detain /
cpanel-licensing
| 1 | <?php |
||
| 2 | include '../src/Cpanel.php'; |
||
| 3 | $cpl = new \Detain\Cpanel\Cpanel($_SERVER['argv'][1], $_SERVER['argv'][2]); |
||
| 4 | |||
| 5 | $ipAddress = '__IP__'; |
||
| 6 | |||
| 7 | $lisc = (array) $cpl->fetchLicenseId(['ip' => $ipAddress]); |
||
| 8 | |||
| 9 | $id = $lisc['@attributes']['licenseid']; |
||
| 10 | |||
| 11 | if ($id > 0) { |
||
| 12 | $result = (array) $cpl->reactivateLicense(['liscid' => $id, reactivateok => 1]); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 13 | } else { |
||
| 14 | print "no expired license exists for $ipAddress\n"; |
||
| 15 | } |
||
| 16 | |||
| 17 | if ($result['@attributes']['status']) { |
||
| 18 | print "the liscense for $ipAddress has been reactivated\n"; |
||
| 19 | } else { |
||
| 20 | print "Failed to reactivate license!\n"; |
||
| 21 | } |
||
| 22 |