@@ -22,8 +22,8 @@ |
||
22 | 22 | ); |
23 | 23 | |
24 | 24 | if ($lisc['@attributes']['status'] > 0) { |
25 | - print 'license added with id: ' . $lisc['@attributes']['licenseid'].PHP_EOL; |
|
25 | + print 'license added with id: '.$lisc['@attributes']['licenseid'].PHP_EOL; |
|
26 | 26 | } else { |
27 | - print 'License add failed: ' . $lisc['@attributes']['reason'].PHP_EOL; |
|
27 | + print 'License add failed: '.$lisc['@attributes']['reason'].PHP_EOL; |
|
28 | 28 | } |
29 | 29 |
@@ -13,9 +13,9 @@ |
||
13 | 13 | |
14 | 14 | if ($status['@attributes']['status'] == 1) { |
15 | 15 | print "Risk Scores for $ipAddress:\n"; |
16 | - print 'aggregate : ' . $status['@attributes']['riskscore.aggregate.score'].PHP_EOL; |
|
17 | - print 'directorder : ' . $status['@attributes']['riskscore.directorder.score'].PHP_EOL; |
|
18 | - print 'main : ' . $status['@attributes']['riskscore.main.score'].PHP_EOL; |
|
16 | + print 'aggregate : '.$status['@attributes']['riskscore.aggregate.score'].PHP_EOL; |
|
17 | + print 'directorder : '.$status['@attributes']['riskscore.directorder.score'].PHP_EOL; |
|
18 | + print 'main : '.$status['@attributes']['riskscore.main.score'].PHP_EOL; |
|
19 | 19 | } else { |
20 | 20 | print "Failed to fetch risk data\n"; |
21 | 21 | } |
@@ -9,12 +9,12 @@ |
||
9 | 9 | foreach ($licenses->licenses as $lisc) { |
10 | 10 | $lisc = (array) $lisc; |
11 | 11 | print "\nLicense IP: ".$lisc['@attributes']['ip'].PHP_EOL; |
12 | - print ' ID: ' . $lisc['@attributes']['name'].PHP_EOL; |
|
13 | - print ' groupid: ' . $lisc['@attributes']['groupid'].PHP_EOL; |
|
14 | - print ' packageid: ' . $lisc['@attributes']['packageid'].PHP_EOL; |
|
15 | - print ' adddate: ' . $lisc['@attributes']['adddate'].PHP_EOL; |
|
16 | - print 'expired on: ' . $lisc['@attributes']['expiredon'].PHP_EOL; |
|
17 | - print ' reason: ' . $lisc['@attributes']['expirereason'].PHP_EOL; |
|
12 | + print ' ID: '.$lisc['@attributes']['name'].PHP_EOL; |
|
13 | + print ' groupid: '.$lisc['@attributes']['groupid'].PHP_EOL; |
|
14 | + print ' packageid: '.$lisc['@attributes']['packageid'].PHP_EOL; |
|
15 | + print ' adddate: '.$lisc['@attributes']['adddate'].PHP_EOL; |
|
16 | + print 'expired on: '.$lisc['@attributes']['expiredon'].PHP_EOL; |
|
17 | + print ' reason: '.$lisc['@attributes']['expirereason'].PHP_EOL; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @param $pass |
39 | 39 | */ |
40 | 40 | public function setCredentials($user, $pass) { |
41 | - $this->setopt(CURLOPT_USERPWD, $user. ':' .$pass); |
|
41 | + $this->setopt(CURLOPT_USERPWD, $user.':'.$pass); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | } |
66 | 66 | if ($this->format != 'simplexml') |
67 | 67 | $args['output'] = $this->format; |
68 | - $query = 'https://manage2.cpanel.net/' .$function. '?' .http_build_query($args); |
|
68 | + $query = 'https://manage2.cpanel.net/'.$function.'?'.http_build_query($args); |
|
69 | 69 | $this->setopt(CURLOPT_URL, $query); |
70 | 70 | $this->curl = curl_init(); |
71 | 71 | foreach ($this->opts as $option => $value) |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $result = curl_exec($this->curl); |
74 | 74 | curl_close($this->curl); |
75 | 75 | if ($result == FALSE) { |
76 | - error_log('cPanelLicensing::get failed: "' .curl_error($this->curl). '"'); |
|
76 | + error_log('cPanelLicensing::get failed: "'.curl_error($this->curl).'"'); |
|
77 | 77 | return; |
78 | 78 | } |
79 | 79 | if ($this->format == 'simplexml') { |
@@ -3,11 +3,11 @@ discard block |
||
3 | 3 | $cpl = new \Detain\Cpanel\Cpanel($_SERVER['argv'][1], $_SERVER['argv'][2]); |
4 | 4 | |
5 | 5 | $ipAddress = $_SERVER['argv'][3]; |
6 | -$cpl->format='json'; |
|
6 | +$cpl->format = 'json'; |
|
7 | 7 | $status = json_decode($cpl->fetchLicenseRaw(['ip' => $ipAddress]), true); |
8 | 8 | print_r($status); |
9 | 9 | if (isset($status['@attributes'])) { |
10 | - print 'The license id for the ip is: ' . $status['@attributes']['licenseid'].PHP_EOL; |
|
10 | + print 'The license id for the ip is: '.$status['@attributes']['licenseid'].PHP_EOL; |
|
11 | 11 | print 'The status of the license is: '; |
12 | 12 | if ($status['@attributes']['valid'] > 0) { |
13 | 13 | print 'Active'; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | print 'Inactive'; |
16 | 16 | } |
17 | 17 | print "\n"; |
18 | - print 'The company holding the license is: ' . $status['@attributes']['company']. |
|
18 | + print 'The company holding the license is: '.$status['@attributes']['company']. |
|
19 | 19 | "\n"; |
20 | 20 | } else { |
21 | 21 | print "The status of the license is: Not Licensed\n"; |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | $ipAddress = $_SERVER['argv'][3]; |
6 | 6 | $cpl->format='json'; |
7 | -$status = json_decode($cpl->fetchLicenseRaw(['ip' => $ipAddress]), true); |
|
7 | +$status = json_decode($cpl->fetchLicenseRaw(['ip' => $ipAddress]), TRUE); |
|
8 | 8 | print_r($status); |
9 | 9 | if (isset($status['@attributes'])) { |
10 | 10 | print 'The license id for the ip is: ' . $status['@attributes']['licenseid'].PHP_EOL; |