@@ -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 | } |
@@ -8,10 +8,10 @@ |
||
| 8 | 8 | $package = $cpl->findKey("__PACKAGE_NAME__", $cpl->fetchPackages()); |
| 9 | 9 | |
| 10 | 10 | $result = (array) $cpl->requestTransfer(array( |
| 11 | - "ip" => $ip, |
|
| 12 | - "groupid" => $group, |
|
| 13 | - "packageid" => $package |
|
| 14 | - ) |
|
| 11 | + "ip" => $ip, |
|
| 12 | + "groupid" => $group, |
|
| 13 | + "packageid" => $package |
|
| 14 | + ) |
|
| 15 | 15 | ); |
| 16 | 16 | |
| 17 | 17 | print $result["@attributes"]['reason']."\n"; |
@@ -9,15 +9,15 @@ |
||
| 9 | 9 | $id = $lisc['@attributes']['licenseid']; |
| 10 | 10 | |
| 11 | 11 | if ($id > 0) { |
| 12 | - $result = (array) $cpl->reactivateLicense(array('liscid' => $id, reactivateok => 1)); |
|
| 12 | + $result = (array) $cpl->reactivateLicense(array('liscid' => $id, reactivateok => 1)); |
|
| 13 | 13 | } else { |
| 14 | - print "no expired license exists for $ip\n"; |
|
| 14 | + print "no expired license exists for $ip\n"; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | if ($result['@attributes']['status']) { |
| 18 | - print "the liscense for $ip has been reactivated\n"; |
|
| 18 | + print "the liscense for $ip has been reactivated\n"; |
|
| 19 | 19 | } else { |
| 20 | - print "Failed to reactivate license!\n"; |
|
| 20 | + print "Failed to reactivate license!\n"; |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | |
@@ -7,8 +7,8 @@ |
||
| 7 | 7 | $newip = "__DESTINATIONIP__"; |
| 8 | 8 | |
| 9 | 9 | $response = (array) $cpl->changeip(array( |
| 10 | - "oldip" => $oldip, |
|
| 11 | - "newip" => $newip |
|
| 10 | + "oldip" => $oldip, |
|
| 11 | + "newip" => $newip |
|
| 12 | 12 | )); |
| 13 | 13 | |
| 14 | 14 | print_r($response)."\n"; |
@@ -7,17 +7,17 @@ |
||
| 7 | 7 | $status = $cpl->fetchLicenseRaw(array("ip" => $ip)); |
| 8 | 8 | print_r($status); |
| 9 | 9 | if (isset($status['@attributes'])) { |
| 10 | - print "The license id for the ip is: ".$status["@attributes"]["licenseid"]."\n"; |
|
| 11 | - print "The status of the license is: "; |
|
| 12 | - if ($status["@attributes"]["valid"] > 0) { |
|
| 13 | - print "Active"; |
|
| 14 | - } else { |
|
| 15 | - print "Inactive"; |
|
| 16 | - } |
|
| 17 | - print "\n"; |
|
| 18 | - print "The company holding the license is: ".$status["@attributes"]["company"]. |
|
| 19 | - "\n"; |
|
| 10 | + print "The license id for the ip is: ".$status["@attributes"]["licenseid"]."\n"; |
|
| 11 | + print "The status of the license is: "; |
|
| 12 | + if ($status["@attributes"]["valid"] > 0) { |
|
| 13 | + print "Active"; |
|
| 14 | + } else { |
|
| 15 | + print "Inactive"; |
|
| 16 | + } |
|
| 17 | + print "\n"; |
|
| 18 | + print "The company holding the license is: ".$status["@attributes"]["company"]. |
|
| 19 | + "\n"; |
|
| 20 | 20 | } else { |
| 21 | - print "The status of the license is: Not Licensed\n"; |
|
| 21 | + print "The status of the license is: Not Licensed\n"; |
|
| 22 | 22 | } |
| 23 | 23 | |
@@ -7,14 +7,14 @@ |
||
| 7 | 7 | $licenses = $cpl->fetchExpiredLicenses(); |
| 8 | 8 | |
| 9 | 9 | foreach ($licenses->licenses as $lisc) { |
| 10 | - $lisc = (array) $lisc; |
|
| 11 | - print "\nLicense IP: ".$lisc['@attributes']['ip']."\n"; |
|
| 12 | - print " ID: ".$lisc['@attributes']['name']."\n"; |
|
| 13 | - print " groupid: ".$lisc['@attributes']['groupid']."\n"; |
|
| 14 | - print " packageid: ".$lisc['@attributes']['packageid']."\n"; |
|
| 15 | - print " adddate: ".$lisc['@attributes']['adddate']."\n"; |
|
| 16 | - print "expired on: ".$lisc['@attributes']['expiredon']."\n"; |
|
| 17 | - print " reason: ".$lisc['@attributes']['expirereason']."\n"; |
|
| 10 | + $lisc = (array) $lisc; |
|
| 11 | + print "\nLicense IP: ".$lisc['@attributes']['ip']."\n"; |
|
| 12 | + print " ID: ".$lisc['@attributes']['name']."\n"; |
|
| 13 | + print " groupid: ".$lisc['@attributes']['groupid']."\n"; |
|
| 14 | + print " packageid: ".$lisc['@attributes']['packageid']."\n"; |
|
| 15 | + print " adddate: ".$lisc['@attributes']['adddate']."\n"; |
|
| 16 | + print "expired on: ".$lisc['@attributes']['expiredon']."\n"; |
|
| 17 | + print " reason: ".$lisc['@attributes']['expirereason']."\n"; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | |
@@ -8,15 +8,15 @@ |
||
| 8 | 8 | $liscid = $lisc["@attributes"]["licenseid"]; |
| 9 | 9 | |
| 10 | 10 | if ($liscid > 0) { |
| 11 | - $expire = (array) $cpl->expireLicense(array( |
|
| 12 | - liscid => $liscid, |
|
| 13 | - reason => "Automagic Expiration", |
|
| 14 | - expcode => "normal" |
|
| 15 | - ) |
|
| 16 | - ); |
|
| 17 | - print $expire["@attributes"]["result"]."\n"; |
|
| 11 | + $expire = (array) $cpl->expireLicense(array( |
|
| 12 | + liscid => $liscid, |
|
| 13 | + reason => "Automagic Expiration", |
|
| 14 | + expcode => "normal" |
|
| 15 | + ) |
|
| 16 | + ); |
|
| 17 | + print $expire["@attributes"]["result"]."\n"; |
|
| 18 | 18 | } else { |
| 19 | - print "There is no valid license for $ip\n"; |
|
| 19 | + print "There is no valid license for $ip\n"; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |