@@ -118,6 +118,7 @@ discard block |
||
118 | 118 | * a check to make sure the passed type is valid |
119 | 119 | * |
120 | 120 | * @param mixed the license type your trying to validate |
121 | + * @param integer $type |
|
121 | 122 | * @return bool whether or not its a valid fantastico license type |
122 | 123 | */ |
123 | 124 | public function is_type($type) { |
@@ -146,7 +147,7 @@ discard block |
||
146 | 147 | * [2] => 150.101.195.140 |
147 | 148 | * ) |
148 | 149 | * |
149 | - * @param mixed $type one of the possible fantastico license types, defaults to {@link self::ALL_TYPES} |
|
150 | + * @param integer $type one of the possible fantastico license types, defaults to {@link self::ALL_TYPES} |
|
150 | 151 | * @return false|array returns false on error or an array of license details |
151 | 152 | */ |
152 | 153 | public function getIpList($type = self::ALL_TYPES) { |
@@ -199,7 +200,7 @@ discard block |
||
199 | 200 | * } |
200 | 201 | * ) |
201 | 202 | * |
202 | - * @param mixed $type one of the possible fantastico license types, defaults to {@link self::ALL_TYPES} |
|
203 | + * @param integer $type one of the possible fantastico license types, defaults to {@link self::ALL_TYPES} |
|
203 | 204 | * @return false|array returns false on error or an array of license details |
204 | 205 | */ |
205 | 206 | public function getIpListDetailed($type = self::ALL_TYPES) { |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'trace' => 1, |
99 | 99 | 'exception' => 1)); |
100 | 100 | } catch (\Exception $e) { |
101 | - require_once (INCLUDE_ROOT . '/../vendor/detain/nusoap/lib/nusoap.php'); |
|
101 | + require_once (INCLUDE_ROOT.'/../vendor/detain/nusoap/lib/nusoap.php'); |
|
102 | 102 | $this->soapClient = new \nusoap_client($this->wsdl); |
103 | 103 | } |
104 | 104 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @return string the login hash |
135 | 135 | */ |
136 | 136 | private function getHash() { |
137 | - return md5($this->api_username . $this->api_password); |
|
137 | + return md5($this->api_username.$this->api_password); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -153,16 +153,16 @@ discard block |
||
153 | 153 | * @return false|array returns false on error or an array of license details |
154 | 154 | */ |
155 | 155 | public function getIpList($type = self::ALL_TYPES) { |
156 | - if (isset($this->cache['getIpList_' . $type])) { |
|
157 | - return $this->cache['getIpList_' . $type]; |
|
156 | + if (isset($this->cache['getIpList_'.$type])) { |
|
157 | + return $this->cache['getIpList_'.$type]; |
|
158 | 158 | } |
159 | 159 | if (!$this->is_type($type)) { |
160 | 160 | return false; |
161 | 161 | } |
162 | 162 | $this->connect(); |
163 | - $this->cache['getIpList_' . $type] = json_decode($this->soapClient->getIpList($this->getHash(), $type), true); |
|
163 | + $this->cache['getIpList_'.$type] = json_decode($this->soapClient->getIpList($this->getHash(), $type), true); |
|
164 | 164 | myadmin_log('fantastico', 'debug', json_encode($response), __LINE__, __FILE__); |
165 | - return $this->cache['getIpList_' . $type]; |
|
165 | + return $this->cache['getIpList_'.$type]; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
@@ -210,8 +210,8 @@ discard block |
||
210 | 210 | if (!$this->is_type($type)) { |
211 | 211 | return false; |
212 | 212 | } |
213 | - if (isset($this->cache['getIpListDetailed_' . $type])) { |
|
214 | - return $this->cache['getIpListDetailed_' . $type]; |
|
213 | + if (isset($this->cache['getIpListDetailed_'.$type])) { |
|
214 | + return $this->cache['getIpListDetailed_'.$type]; |
|
215 | 215 | } |
216 | 216 | $this->connect(); |
217 | 217 | //try { |
@@ -219,17 +219,17 @@ discard block |
||
219 | 219 | myadmin_log('fantastico', 'debug', json_encode($response), __LINE__, __FILE__); |
220 | 220 | //echo '<pre>';echo print_r($response, true);echo '</pre>'; |
221 | 221 | //$this->cache['getIpListDetailed_' . $type] = $this->cache['getIpListDetailed_' . $type]->Licenses; |
222 | - $this->cache['getIpListDetailed_' . $type] = array(); |
|
223 | - $this->cache['getIpList_' . $type] = array(); |
|
222 | + $this->cache['getIpListDetailed_'.$type] = array(); |
|
223 | + $this->cache['getIpList_'.$type] = array(); |
|
224 | 224 | foreach ($response['Licenses'] as $idx => $data) { |
225 | 225 | $tdata = array( |
226 | 226 | 'ipAddress' => $data[0], |
227 | 227 | 'addedOn' => $data[1], |
228 | 228 | 'isVPS' => $data[2], |
229 | 229 | 'status' => $data[3]); |
230 | - $this->cache['getIpListDetailed_' . $type][] = $tdata; |
|
231 | - $this->cache['getIpList_' . $type][] = $tdata['ipAddress']; |
|
232 | - $this->cache['getIpDetails_' . $tdata['ipAddress']] = $tdata; |
|
230 | + $this->cache['getIpListDetailed_'.$type][] = $tdata; |
|
231 | + $this->cache['getIpList_'.$type][] = $tdata['ipAddress']; |
|
232 | + $this->cache['getIpDetails_'.$tdata['ipAddress']] = $tdata; |
|
233 | 233 | } |
234 | 234 | //} catch (SoapFault $fault) { |
235 | 235 | //var_dump($fault); |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | //$this->cache['getIpDetails_' . $data['ipAddress']] = $data; |
244 | 244 | //} |
245 | 245 | //echo '<pre>';print_r($this->cache);echo '</pre>'; |
246 | - return $this->cache['getIpListDetailed_' . $type]; |
|
246 | + return $this->cache['getIpListDetailed_'.$type]; |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | /** |
@@ -284,15 +284,15 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public function getIpDetails($ip) { |
286 | 286 | if (!$this->valid_ip($ip)) { |
287 | - return array('faultcode' => 1, 'fault ' => 'Invalid IP Address ' . $ip); |
|
287 | + return array('faultcode' => 1, 'fault ' => 'Invalid IP Address '.$ip); |
|
288 | 288 | } |
289 | - if (isset($this->cache['getIpDetails_' . $ip])) { |
|
290 | - return $this->cache['getIpDetails_' . $ip]; |
|
289 | + if (isset($this->cache['getIpDetails_'.$ip])) { |
|
290 | + return $this->cache['getIpDetails_'.$ip]; |
|
291 | 291 | } |
292 | 292 | $this->connect(); |
293 | - $this->cache['getIpDetails_' . $ip] = json_decode($this->soapClient->getIpDetails($this->getHash(), $ip), true); |
|
293 | + $this->cache['getIpDetails_'.$ip] = json_decode($this->soapClient->getIpDetails($this->getHash(), $ip), true); |
|
294 | 294 | myadmin_log('fantastico', 'debug', json_encode($response), __LINE__, __FILE__); |
295 | - return $this->cache['getIpDetails_' . $ip]; |
|
295 | + return $this->cache['getIpDetails_'.$ip]; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | /** |
@@ -363,9 +363,9 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function editIp($ip, $newip) { |
365 | 365 | if (!$this->valid_ip($ip)) { |
366 | - $response = ['faultcode' => 1, 'fault' => 'Invalid IP Address ' . $ip]; |
|
366 | + $response = ['faultcode' => 1, 'fault' => 'Invalid IP Address '.$ip]; |
|
367 | 367 | } elseif (!$this->valid_ip($newip)) { |
368 | - $response = ['faultcode' => 2, 'fault' => 'Invalid IP Address ' . $newip]; |
|
368 | + $response = ['faultcode' => 2, 'fault' => 'Invalid IP Address '.$newip]; |
|
369 | 369 | } else { |
370 | 370 | $this->connect(); |
371 | 371 | $response = json_decode($this->soapClient->editIp($this->getHash(), $ip, $newip), true); |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | */ |
444 | 444 | public function addIp($ip, $type) { |
445 | 445 | if (!$this->valid_ip($ip)) { |
446 | - $response = ['faultcode' => 1, 'fault' => 'Invalid IP Address ' . $ip]; |
|
446 | + $response = ['faultcode' => 1, 'fault' => 'Invalid IP Address '.$ip]; |
|
447 | 447 | } else { |
448 | 448 | $this->connect(); |
449 | 449 | $response = json_decode($this->soapClient->addIp($this->getHash(), $ip, $type), true); |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | */ |
482 | 482 | public function deactivateIp($ip) { |
483 | 483 | if (!$this->valid_ip($ip)) { |
484 | - return array('faultcode' => 1, 'fault ' => 'Invalid IP Address ' . $ip); |
|
484 | + return array('faultcode' => 1, 'fault ' => 'Invalid IP Address '.$ip); |
|
485 | 485 | } |
486 | 486 | $this->connect(); |
487 | 487 | $response = json_decode($this->soapClient->deactivateIp($this->getHash(), $ip), true); |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | */ |
516 | 516 | public function reactivateIp($ip) { |
517 | 517 | if (!$this->valid_ip($ip)) { |
518 | - return array('faultcode' => 1, 'fault ' => 'Invalid IP Address ' . $ip); |
|
518 | + return array('faultcode' => 1, 'fault ' => 'Invalid IP Address '.$ip); |
|
519 | 519 | } |
520 | 520 | $this->connect(); |
521 | 521 | $response = json_decode($this->soapClient->reactivateIp($this->getHash(), $ip), true); |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | */ |
551 | 551 | public function deleteIp($ip) { |
552 | 552 | if (!$this->valid_ip($ip)) { |
553 | - return array('faultcode' => 1, 'fault ' => 'Invalid IP Address ' . $ip); |
|
553 | + return array('faultcode' => 1, 'fault ' => 'Invalid IP Address '.$ip); |
|
554 | 554 | } |
555 | 555 | $this->connect(); |
556 | 556 | $response = json_decode($this->soapClient->deleteIp($this->getHash(), $ip), true); |