@@ -19,8 +19,7 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @access public |
21 | 21 | */ |
22 | -class Parallels |
|
23 | -{ |
|
22 | +class Parallels { |
|
24 | 23 | public $licenseType = 'billing'; // billing or purchase |
25 | 24 | private $xmlOptions = ['sslverify' => false]; |
26 | 25 | private $defaultUrl = 'https://ka.parallels.com:7050/'; |
@@ -39,8 +38,7 @@ discard block |
||
39 | 38 | * @param bool $demo defaults to FALSE, whether or not to use the demo interface instae dof the normal one |
40 | 39 | * @param NULL|array $xmlOptions array of optoins ot pass to xmlrpc2 client |
41 | 40 | */ |
42 | - public function __construct($login = null, $password = null, $client = null, $demo = false, $xmlOptions = null) |
|
43 | - { |
|
41 | + public function __construct($login = null, $password = null, $client = null, $demo = false, $xmlOptions = null) { |
|
44 | 42 | if (null === $login && defined('PARALLELS_KA_LOGIN')) { |
45 | 43 | $this->login = constant('PARALLELS_KA_LOGIN'); |
46 | 44 | } else { |
@@ -73,8 +71,7 @@ discard block |
||
73 | 71 | /** |
74 | 72 | * @return array |
75 | 73 | */ |
76 | - public function authInfo() |
|
77 | - { |
|
74 | + public function authInfo() { |
|
78 | 75 | return ['login' => $this->login, 'password' => $this->password]; |
79 | 76 | } |
80 | 77 | |
@@ -83,8 +80,7 @@ discard block |
||
83 | 80 | * @param array $macs |
84 | 81 | * @return array |
85 | 82 | */ |
86 | - public function serverAddress($ips = [], $macs = []) |
|
87 | - { |
|
83 | + public function serverAddress($ips = [], $macs = []) { |
|
88 | 84 | if (!is_array($ips) && $ips != '') { |
89 | 85 | $ips = [$ips]; |
90 | 86 | } |
@@ -101,8 +97,7 @@ discard block |
||
101 | 97 | * @param $key |
102 | 98 | * @return mixed |
103 | 99 | */ |
104 | - public function terminateKey($key) |
|
105 | - { |
|
100 | + public function terminateKey($key) { |
|
106 | 101 | $this->response = $this->xml->__call('partner10.terminateKey', [$this->authInfo(), $key]); |
107 | 102 | return $this->response; |
108 | 103 | } |
@@ -111,8 +106,7 @@ discard block |
||
111 | 106 | * @param $key |
112 | 107 | * @return mixed |
113 | 108 | */ |
114 | - public function resetKey($key) |
|
115 | - { |
|
109 | + public function resetKey($key) { |
|
116 | 110 | $this->response = $this->xml->__call('partner10.resetKey', [$this->authInfo(), $key]); |
117 | 111 | return $this->response; |
118 | 112 | } |
@@ -121,8 +115,7 @@ discard block |
||
121 | 115 | * @param $key |
122 | 116 | * @return mixed |
123 | 117 | */ |
124 | - public function activateKey($key) |
|
125 | - { |
|
118 | + public function activateKey($key) { |
|
126 | 119 | $this->response = $this->xml->__call('partner10.activateKey', [$this->authInfo(), $key]); |
127 | 120 | return $this->response; |
128 | 121 | } |
@@ -132,8 +125,7 @@ discard block |
||
132 | 125 | * @param $note |
133 | 126 | * @return mixed |
134 | 127 | */ |
135 | - public function addNoteToKey($key, $note) |
|
136 | - { |
|
128 | + public function addNoteToKey($key, $note) { |
|
137 | 129 | $this->response = $this->xml->__call('partner10.addNoteToKey', [$this->authInfo(), $key, $note]); |
138 | 130 | return $this->response; |
139 | 131 | } |
@@ -143,8 +135,7 @@ discard block |
||
143 | 135 | * @param bool $email |
144 | 136 | * @return mixed |
145 | 137 | */ |
146 | - public function sendKeyByEmail($key, $email = false) |
|
147 | - { |
|
138 | + public function sendKeyByEmail($key, $email = false) { |
|
148 | 139 | if ($email === false) { |
149 | 140 | $this->response = $this->xml->__call('partner10.sendKeyByEmail', [$this->authInfo(), $key]); |
150 | 141 | } else { |
@@ -162,8 +153,7 @@ discard block |
||
162 | 153 | * @param bool $client |
163 | 154 | * @return mixed |
164 | 155 | */ |
165 | - public function createKey($keyType, $upgradePlans = [], $ips = [], $macs = [], $licenseType = false, $client = false) |
|
166 | - { |
|
156 | + public function createKey($keyType, $upgradePlans = [], $ips = [], $macs = [], $licenseType = false, $client = false) { |
|
167 | 157 | if (!is_array($ips) && $ips != '') { |
168 | 158 | $ips = [$ips]; |
169 | 159 | } |
@@ -208,8 +198,7 @@ discard block |
||
208 | 198 | * @param $key |
209 | 199 | * @return mixed |
210 | 200 | */ |
211 | - public function retrieveKey($key) |
|
212 | - { |
|
201 | + public function retrieveKey($key) { |
|
213 | 202 | $this->response = $this->xml->__call('partner10.retrieveKey', [$this->authInfo(), $key]); |
214 | 203 | return $this->response; |
215 | 204 | /* Success |
@@ -370,8 +359,7 @@ discard block |
||
370 | 359 | * @param $key |
371 | 360 | * @return mixed |
372 | 361 | */ |
373 | - public function getAvailableUpgrades($key) |
|
374 | - { |
|
362 | + public function getAvailableUpgrades($key) { |
|
375 | 363 | $this->response = $this->xml->__call('partner10.getAvailableUpgrades', [$this->authInfo(), $key]); |
376 | 364 | return $this->response; |
377 | 365 | } |
@@ -540,8 +528,7 @@ discard block |
||
540 | 528 | * @param $key |
541 | 529 | * @return mixed |
542 | 530 | */ |
543 | - public function getKeyInfo($key) |
|
544 | - { |
|
531 | + public function getKeyInfo($key) { |
|
545 | 532 | $this->response = $this->xml->__call('partner10.getKeyInfo', [$this->authInfo(), $key]); |
546 | 533 | return $this->response; |
547 | 534 | } |
@@ -550,8 +537,7 @@ discard block |
||
550 | 537 | * @param string $ipAddress the ip address |
551 | 538 | * @return false|string false if no key , or a string w/ the key |
552 | 539 | */ |
553 | - public function getMainKeyFromIp($ipAddress) |
|
554 | - { |
|
540 | + public function getMainKeyFromIp($ipAddress) { |
|
555 | 541 | $response = $this->getKeyNumbers($ipAddress); |
556 | 542 | //$response = $this->getKeysInfoByIP($ipAddress); |
557 | 543 | $return = false; |
@@ -575,8 +561,7 @@ discard block |
||
575 | 561 | * @param $ipAddress |
576 | 562 | * @return mixed |
577 | 563 | */ |
578 | - public function getKeysInfoByIP($ipAddress) |
|
579 | - { |
|
564 | + public function getKeysInfoByIP($ipAddress) { |
|
580 | 565 | $this->response = $this->xml->__call('partner10.getKeysInfoByIP', [$this->authInfo(), $ipAddress]); |
581 | 566 | return $this->response; |
582 | 567 | } |
@@ -586,8 +571,7 @@ discard block |
||
586 | 571 | * @param array $macs |
587 | 572 | * @return mixed |
588 | 573 | */ |
589 | - public function getKeyNumbers($ips = [], $macs = []) |
|
590 | - { |
|
574 | + public function getKeyNumbers($ips = [], $macs = []) { |
|
591 | 575 | myadmin_log('licenses', 'info', json_encode($this->serverAddress($ips, $macs)), __LINE__, __FILE__); |
592 | 576 | $this->response = $this->xml->__call('partner10.getKeyNumbers', [$this->authInfo(), $this->serverAddress($ips, $macs)]); |
593 | 577 | return $this->response; |
@@ -716,8 +700,7 @@ discard block |
||
716 | 700 | * @param bool $client |
717 | 701 | * @return mixed |
718 | 702 | */ |
719 | - public function getAvailableKeyTypesAndFeatures($client = false) |
|
720 | - { |
|
703 | + public function getAvailableKeyTypesAndFeatures($client = false) { |
|
721 | 704 | $this->response = $this->xml->__call('partner10.getAvailableKeyTypesAndFeatures', [$this->authInfo(), $client === false ? $this->client : $client]); |
722 | 705 | return $this->response; |
723 | 706 | /* My Output: |