/lib/wasRemoteAdmin.php |
@@ -35,12 +35,12 @@ |
class wasRemoteAdmin { |
|
var $url; |
var $raPassword; |
var $pwd; |
var $options; |
|
function wasRemoteAdmin($url,$raPassword) { |
function wasRemoteAdmin($url,$pwd) { |
$this->url = $url; |
$this->raPassword = $raPassword; |
$this->pwd = $pwd; |
$this->options = |
array ( |
"indent" => " ", |
@@ -68,7 +68,7 @@ |
array( |
"name" => 'password', |
"value" => array( |
"string" => htmlspecialchars($this->raPassword) |
"string" => htmlspecialchars($this->pwd) |
), |
), |
array( |
@@ -104,7 +104,7 @@ |
array( |
"name" => 'password', |
"value" => array( |
"string" => htmlspecialchars($this->raPassword) |
"string" => htmlspecialchars($this->pwd) |
), |
), |
array( |
@@ -134,55 +134,5 @@ |
$request->setBody($xml_load); |
return $request->send()->getBody(); |
} |
|
function admin_create_user($firstname, $lastname, $password, $region_x, $region_y) { |
$request = new HTTP_Request2($this->url, HTTP_Request2::METHOD_POST); |
|
$serializer = new XML_Serializer($this->options); |
$xml = array( |
"methodName" => htmlspecialchars('admin_create_user'), |
"params" => |
array( "param" => |
array( "value" => |
array("struct" => |
array( |
"member" => |
array( |
"name" => 'password', |
"value" => array( |
"string" => htmlspecialchars($this->raPassword) |
), |
), |
array( |
"name" => 'user_firstname', |
"value" => htmlspecialchars($firstname) |
), |
array( |
"name" => 'user_lastname', |
"value" => htmlspecialchars($lastname) |
), |
array( |
"name" => 'user_password', |
"value" => htmlspecialchars($password) |
), |
array( |
"name" => 'start_region_x', |
"value" => htmlspecialchars($region_x) |
), |
array( |
"name" => 'start_region_y', |
"value" => htmlspecialchars($region_y) |
), |
), |
), |
), |
), |
); |
|
$serializer->serialize($xml); |
$xml_load = $serializer->getSerializedData(); |
$request->setBody($xml_load); |
return $request->send()->getBody(); |
} |
} |
|