@@ -5,16 +5,16 @@ |
||
5 | 5 | $ip = "__IP__"; |
6 | 6 | |
7 | 7 | // This is only useful to cPanel Distributors |
8 | -$status = (array)$cpl->fetchLicenseRiskData(array( |
|
8 | +$status = (array) $cpl->fetchLicenseRiskData(array( |
|
9 | 9 | "ip" => $ip |
10 | 10 | ) |
11 | 11 | ); |
12 | 12 | |
13 | 13 | if ($status["@attributes"]["status"] == 1) { |
14 | 14 | print "Risk Scores for $ip:\n"; |
15 | - print "aggregate : " . $status["@attributes"]["riskscore.aggregate.score"] . "\n"; |
|
16 | - print "directorder : " . $status["@attributes"]["riskscore.directorder.score"] . "\n"; |
|
17 | - print "main : " . $status["@attributes"]["riskscore.main.score"] . "\n"; |
|
15 | + print "aggregate : ".$status["@attributes"]["riskscore.aggregate.score"]."\n"; |
|
16 | + print "directorder : ".$status["@attributes"]["riskscore.directorder.score"]."\n"; |
|
17 | + print "main : ".$status["@attributes"]["riskscore.main.score"]."\n"; |
|
18 | 18 | } else { |
19 | 19 | print "Failed to fetch risk data\n"; |
20 | 20 | } |
@@ -2,14 +2,14 @@ discard block |
||
2 | 2 | |
3 | 3 | include("../cpl.inc.php"); |
4 | 4 | |
5 | -$cpl = new \Detain\Cpanel\Cpanel( $_SERVER['argv'][1], $_SERVER['argv'][2] ); |
|
5 | +$cpl = new \Detain\Cpanel\Cpanel($_SERVER['argv'][1], $_SERVER['argv'][2]); |
|
6 | 6 | |
7 | 7 | $ip = "__IP__"; |
8 | 8 | |
9 | -$groupid = $cpl->findKey("__GROUPNAME__", $cpl->fetchGroups() ); |
|
10 | -$packageid = $cpl->findKey("__PACKAGENAME__", $cpl->fetchPackages() ); |
|
9 | +$groupid = $cpl->findKey("__GROUPNAME__", $cpl->fetchGroups()); |
|
10 | +$packageid = $cpl->findKey("__PACKAGENAME__", $cpl->fetchPackages()); |
|
11 | 11 | |
12 | -$lisc = (array)$cpl->activateLicense(array( |
|
12 | +$lisc = (array) $cpl->activateLicense(array( |
|
13 | 13 | "ip" => $ip, |
14 | 14 | "groupid" => $groupid, |
15 | 15 | "packageid" => $packageid, |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | ); |
22 | 22 | |
23 | 23 | if ($lisc['@attributes']['status'] > 0) { |
24 | - print "license added with id: ". $lisc['@attributes']['licenseid'] . "\n"; |
|
24 | + print "license added with id: ".$lisc['@attributes']['licenseid']."\n"; |
|
25 | 25 | } else { |
26 | - print "License add failed: " . $lisc['@attributes']['reason'] . "\n"; |
|
26 | + print "License add failed: ".$lisc['@attributes']['reason']."\n"; |
|
27 | 27 | } |
28 | 28 |
@@ -27,8 +27,7 @@ discard block |
||
27 | 27 | if ($format != "xml" && $format != "json" && $format != "yaml" && $format != "simplexml") { |
28 | 28 | error_log("set_format requires that the format is xml, json, yaml or simplexml"); |
29 | 29 | return; |
30 | - } |
|
31 | - else { |
|
30 | + } else { |
|
32 | 31 | $this->format = $format; |
33 | 32 | } |
34 | 33 | } |
@@ -59,8 +58,7 @@ discard block |
||
59 | 58 | $result = $result[str_replace('.cgi', '', $function)]; |
60 | 59 | $result = $this->format_result($result); |
61 | 60 | return $result; |
62 | - } |
|
63 | - else { |
|
61 | + } else { |
|
64 | 62 | return $result; |
65 | 63 | } |
66 | 64 | } |
@@ -88,8 +86,7 @@ discard block |
||
88 | 86 | private function validateID($id) { |
89 | 87 | if (preg_match("/^(L|P|G)?\d*$/", $id)) { |
90 | 88 | return 1; |
91 | - } |
|
92 | - else { |
|
89 | + } else { |
|
93 | 90 | return 0; |
94 | 91 | } |
95 | 92 | } |
@@ -273,11 +270,9 @@ discard block |
||
273 | 270 | $xmlObj = (array) $xmlObj; |
274 | 271 | if (array_key_exists("packages", $xmlObj)) { |
275 | 272 | $type = "packages"; |
276 | - } |
|
277 | - else if (array_key_exists("groups", $xmlObj)) { |
|
273 | + } else if (array_key_exists("groups", $xmlObj)) { |
|
278 | 274 | $type = "groups"; |
279 | - } |
|
280 | - else { |
|
275 | + } else { |
|
281 | 276 | error_log("cPanelLicensing::findKey with an object that is not groups or packages"); |
282 | 277 | return; |
283 | 278 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | } |
50 | 50 | $result = curl_exec($this->curl); |
51 | 51 | curl_close($this->curl); |
52 | - if ($result == false) { |
|
52 | + if ($result == FALSE) { |
|
53 | 53 | error_log("cPanelLicensing::get failed: \"".curl_error($this->curl)."\""); |
54 | 54 | return; |
55 | 55 | } |