@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | public $opts; |
17 | 17 | |
18 | 18 | /** |
19 | - * Cpanel constructor. |
|
20 | - * |
|
21 | - * @param $user |
|
22 | - * @param $pass |
|
23 | - */ |
|
19 | + * Cpanel constructor. |
|
20 | + * |
|
21 | + * @param $user |
|
22 | + * @param $pass |
|
23 | + */ |
|
24 | 24 | public function __construct($user, $pass) |
25 | 25 | { |
26 | 26 | $this->opts = []; |
@@ -31,29 +31,29 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | - * @param $option |
|
35 | - * @param $value |
|
36 | - */ |
|
34 | + * @param $option |
|
35 | + * @param $value |
|
36 | + */ |
|
37 | 37 | public function setopt($option, $value) |
38 | 38 | { |
39 | 39 | $this->opts[$option] = $value; |
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * sets the login credentials |
|
44 | - * @param string $user the username |
|
45 | - * @param string $pass the password |
|
46 | - */ |
|
43 | + * sets the login credentials |
|
44 | + * @param string $user the username |
|
45 | + * @param string $pass the password |
|
46 | + */ |
|
47 | 47 | public function setCredentials($user, $pass) |
48 | 48 | { |
49 | 49 | $this->setopt(CURLOPT_USERPWD, $user.':'.$pass); |
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | - * sets the output format |
|
54 | - * |
|
55 | - * @param string $format can be any of xml,json,yaml,simplexml |
|
56 | - */ |
|
53 | + * sets the output format |
|
54 | + * |
|
55 | + * @param string $format can be any of xml,json,yaml,simplexml |
|
56 | + */ |
|
57 | 57 | public function setFormat($format) |
58 | 58 | { |
59 | 59 | if ($format != 'xml' && $format != 'json' && $format != 'yaml' && $format != 'simplexml') { |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
68 | - * @param string $function |
|
69 | - * @param array $args |
|
70 | - * @return array|mixed|void |
|
71 | - */ |
|
68 | + * @param string $function |
|
69 | + * @param array $args |
|
70 | + * @return array|mixed|void |
|
71 | + */ |
|
72 | 72 | private function get($function, $args = []) |
73 | 73 | { |
74 | 74 | if (!$function) { |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
113 | - * formats the response |
|
114 | - * @param array $result the result array to format |
|
115 | - * @return array the rormatted arrray |
|
116 | - */ |
|
113 | + * formats the response |
|
114 | + * @param array $result the result array to format |
|
115 | + * @return array the rormatted arrray |
|
116 | + */ |
|
117 | 117 | private function formatResult($result) |
118 | 118 | { |
119 | 119 | if (is_array($result)) { |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
134 | - * @param $id |
|
135 | - * @return int |
|
136 | - */ |
|
134 | + * @param $id |
|
135 | + * @return int |
|
136 | + */ |
|
137 | 137 | private function validateID($id) |
138 | 138 | { |
139 | 139 | if (preg_match("/^(L|P|G)?\d*$/", $id)) { |
@@ -144,18 +144,18 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
147 | - * @param $ipAddress |
|
148 | - * @return int |
|
149 | - */ |
|
147 | + * @param $ipAddress |
|
148 | + * @return int |
|
149 | + */ |
|
150 | 150 | private function validateIP($ipAddress) |
151 | 151 | { |
152 | 152 | return preg_match("/^\d*\.\d*\.\d*\.\d*$/", $ipAddress); |
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
156 | - * @param $args |
|
157 | - * @return array|mixed|void |
|
158 | - */ |
|
156 | + * @param $args |
|
157 | + * @return array|mixed|void |
|
158 | + */ |
|
159 | 159 | public function reactivateLicense($args) |
160 | 160 | { |
161 | 161 | if (!array_key_exists('liscid', $args)) { |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
173 | - * @param $args |
|
174 | - * @return array|mixed|void |
|
175 | - */ |
|
173 | + * @param $args |
|
174 | + * @return array|mixed|void |
|
175 | + */ |
|
176 | 176 | public function expireLicense($args) |
177 | 177 | { |
178 | 178 | if (!array_key_exists('liscid', $args)) { |
@@ -187,9 +187,9 @@ discard block |
||
187 | 187 | } |
188 | 188 | |
189 | 189 | /** |
190 | - * @param $args |
|
191 | - * @return array|mixed|void |
|
192 | - */ |
|
190 | + * @param $args |
|
191 | + * @return array|mixed|void |
|
192 | + */ |
|
193 | 193 | public function extendOnetimeUpdates($args) |
194 | 194 | { |
195 | 195 | if (!array_key_exists('ip', $args)) { |
@@ -204,9 +204,9 @@ discard block |
||
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
207 | - * @param $args |
|
208 | - * @return array|mixed|void |
|
209 | - */ |
|
207 | + * @param $args |
|
208 | + * @return array|mixed|void |
|
209 | + */ |
|
210 | 210 | public function changeip($args) |
211 | 211 | { |
212 | 212 | if (!array_key_exists('oldip', $args) || !array_key_exists('newip', $args)) { |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
224 | - * @param $args |
|
225 | - * @return array|mixed|void |
|
226 | - */ |
|
224 | + * @param $args |
|
225 | + * @return array|mixed|void |
|
226 | + */ |
|
227 | 227 | public function requestTransfer($args) |
228 | 228 | { |
229 | 229 | if (!array_key_exists('ip', $args) || !array_key_exists('groupid', $args) || !array_key_exists('packagegroup', $args)) { |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | } |
247 | 247 | |
248 | 248 | /** |
249 | - * @param $args |
|
250 | - * @return array|mixed|void |
|
251 | - */ |
|
249 | + * @param $args |
|
250 | + * @return array|mixed|void |
|
251 | + */ |
|
252 | 252 | public function activateLicense($args) |
253 | 253 | { |
254 | 254 | if (!array_key_exists('ip', $args) || !array_key_exists('groupid', $args) || !array_key_exists('packageid', $args)) { |
@@ -272,9 +272,9 @@ discard block |
||
272 | 272 | } |
273 | 273 | |
274 | 274 | /** |
275 | - * @param $args |
|
276 | - * @return array|mixed|void |
|
277 | - */ |
|
275 | + * @param $args |
|
276 | + * @return array|mixed|void |
|
277 | + */ |
|
278 | 278 | public function addPickupPass($args) |
279 | 279 | { |
280 | 280 | if (!array_key_exists('pickup', $args)) { |
@@ -285,9 +285,9 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | /** |
288 | - * @param $args |
|
289 | - * @return array|mixed|void |
|
290 | - */ |
|
288 | + * @param $args |
|
289 | + * @return array|mixed|void |
|
290 | + */ |
|
291 | 291 | public function registerAuth($args) |
292 | 292 | { |
293 | 293 | if (!array_key_exists('user', $args)) { |
@@ -310,21 +310,21 @@ discard block |
||
310 | 310 | } |
311 | 311 | |
312 | 312 | /** |
313 | - * return s a list of groups |
|
314 | - * |
|
315 | - * @return array|mixed|void |
|
316 | - */ |
|
313 | + * return s a list of groups |
|
314 | + * |
|
315 | + * @return array|mixed|void |
|
316 | + */ |
|
317 | 317 | public function fetchGroups() |
318 | 318 | { |
319 | 319 | return $this->get('XMLgroupInfo.cgi'); |
320 | 320 | } |
321 | 321 | |
322 | 322 | /** |
323 | - * fetches license risk data |
|
324 | - * |
|
325 | - * @param array $args |
|
326 | - * @return array|mixed|void |
|
327 | - */ |
|
323 | + * fetches license risk data |
|
324 | + * |
|
325 | + * @param array $args |
|
326 | + * @return array|mixed|void |
|
327 | + */ |
|
328 | 328 | public function fetchLicenseRiskData($args = []) |
329 | 329 | { |
330 | 330 | if (!array_key_exists('ip', $args)) { |
@@ -339,11 +339,11 @@ discard block |
||
339 | 339 | } |
340 | 340 | |
341 | 341 | /** |
342 | - * gets raw license information |
|
343 | - * |
|
344 | - * @param array $args optional array of arguments |
|
345 | - * @return array|mixed|void |
|
346 | - */ |
|
342 | + * gets raw license information |
|
343 | + * |
|
344 | + * @param array $args optional array of arguments |
|
345 | + * @return array|mixed|void |
|
346 | + */ |
|
347 | 347 | public function fetchLicenseRaw($args = []) |
348 | 348 | { |
349 | 349 | $args = array_merge(['all' => 1], $args); |
@@ -359,11 +359,11 @@ discard block |
||
359 | 359 | } |
360 | 360 | |
361 | 361 | /** |
362 | - * gets license information |
|
363 | - * |
|
364 | - * @param array $args optional array of arguments |
|
365 | - * @return array|mixed|void |
|
366 | - */ |
|
362 | + * gets license information |
|
363 | + * |
|
364 | + * @param array $args optional array of arguments |
|
365 | + * @return array|mixed|void |
|
366 | + */ |
|
367 | 367 | public function fetchLicenseId($args = []) |
368 | 368 | { |
369 | 369 | $args = array_merge(['all' => 1], $args); |
@@ -379,38 +379,38 @@ discard block |
||
379 | 379 | } |
380 | 380 | |
381 | 381 | /** |
382 | - * @return array|mixed|void |
|
383 | - */ |
|
382 | + * @return array|mixed|void |
|
383 | + */ |
|
384 | 384 | public function fetchPackages($expand = false) |
385 | 385 | { |
386 | 386 | return $this->get('XMLpackageInfo.cgi', ($expand === true ? ['expand' => 1] : [])); |
387 | 387 | } |
388 | 388 | |
389 | 389 | /** |
390 | - * gets a list of licenses |
|
391 | - * |
|
392 | - * @param array $args optional arguments |
|
393 | - * @return array|mixed|void |
|
394 | - */ |
|
390 | + * gets a list of licenses |
|
391 | + * |
|
392 | + * @param array $args optional arguments |
|
393 | + * @return array|mixed|void |
|
394 | + */ |
|
395 | 395 | public function fetchLicenses($args = []) |
396 | 396 | { |
397 | 397 | return $this->get('XMLlicenseInfo.cgi'); |
398 | 398 | } |
399 | 399 | |
400 | 400 | /** |
401 | - * return sa list of expired licenses |
|
402 | - * @return array|mixed|void |
|
403 | - */ |
|
401 | + * return sa list of expired licenses |
|
402 | + * @return array|mixed|void |
|
403 | + */ |
|
404 | 404 | public function fetchExpiredLicenses() |
405 | 405 | { |
406 | 406 | return $this->fetchLicenses(['expired' => '1']); |
407 | 407 | } |
408 | 408 | |
409 | 409 | /** |
410 | - * @param $search |
|
411 | - * @param $xmlObj |
|
412 | - * @return string|void |
|
413 | - */ |
|
410 | + * @param $search |
|
411 | + * @param $xmlObj |
|
412 | + * @return string|void |
|
413 | + */ |
|
414 | 414 | public function findKey($search, $xmlObj) |
415 | 415 | { |
416 | 416 | $xmlObj = (array) $xmlObj; |