|
@@ 359-361 (lines=3) @@
|
356 |
|
|
357 |
|
$result = $this->client->sendRequest("/json-api/createacct", "GET", $params); |
358 |
|
|
359 |
|
if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ |
360 |
|
throw new ClientExceptions($result['metadata']['reason']); |
361 |
|
} |
362 |
|
|
363 |
|
if ( ! empty($result) && ! empty($result['result'][0]) && $result['result'][0]['status'] === 0) { |
364 |
|
throw new ClientExceptions($result['result'][0]['statusmsg']); |
|
@@ 480-482 (lines=3) @@
|
477 |
|
$params['users_json'] = json_encode($usersJson); |
478 |
|
|
479 |
|
$result = $this->client->sendRequest("/json-api/forcepasswordchange", "GET", $params); |
480 |
|
if ($result['metadata']['result'] === 0) { |
481 |
|
throw new ClientExceptions($result['metadata']['reason']); |
482 |
|
} |
483 |
|
|
484 |
|
if ( ! empty($result['data'])) { |
485 |
|
return $result['updated']; |
|
@@ 603-605 (lines=3) @@
|
600 |
|
{ |
601 |
|
$params = ['user' => $user, 'bwlimit' => intval($bwlimit)]; |
602 |
|
$result = $this->client->sendRequest("/json-api/limitbw", "GET", $params); |
603 |
|
if ( ! empty($result['metadata']) && $result['metadata']['result'] === 1) { |
604 |
|
return $result['data']['bwlimits'][0]; |
605 |
|
} |
606 |
|
|
607 |
|
return null; |
608 |
|
} |
|
@@ 805-807 (lines=3) @@
|
802 |
|
return true; |
803 |
|
} |
804 |
|
|
805 |
|
if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ |
806 |
|
throw new ClientExceptions($result['metadata']['reason']); |
807 |
|
} |
808 |
|
|
809 |
|
return false; |
810 |
|
} |
|
@@ 842-844 (lines=3) @@
|
839 |
|
|
840 |
|
$result = $this->client->sendRequest("/json-api/passwd", "GET", $params); |
841 |
|
|
842 |
|
if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ |
843 |
|
throw new ClientExceptions($result['metadata']['reason']); |
844 |
|
} |
845 |
|
|
846 |
|
if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ |
847 |
|
return $result['data']['app']; |
|
@@ 846-848 (lines=3) @@
|
843 |
|
throw new ClientExceptions($result['metadata']['reason']); |
844 |
|
} |
845 |
|
|
846 |
|
if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ |
847 |
|
return $result['data']['app']; |
848 |
|
} |
849 |
|
|
850 |
|
return null; |
851 |
|
} |
|
@@ 870-872 (lines=3) @@
|
867 |
|
$params = ['user' => $username, 'keepdns' => (int) $keepDNS]; |
868 |
|
$result = $this->client->sendRequest("/json-api/removeacct", "GET", $params); |
869 |
|
|
870 |
|
if(!empty($result['metadata']) && $result['metadata']['result'] === 0){ |
871 |
|
throw new ClientExceptions($result['metadata']['reason']); |
872 |
|
} |
873 |
|
|
874 |
|
if(!empty($result['metadata']) && $result['metadata']['result'] === 1){ |
875 |
|
return true; |