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 = $_SERVER['argv'][3]; |
||
| 6 | $cpl->format = 'json'; |
||
| 7 | $lisc = json_decode($cpl->fetchLicenseId(['ip' => $ipAddress]), true); |
||
| 8 | print_r($lisc); |
||
| 9 | $liscid = $lisc['licenseid'][0]; |
||
| 10 | |||
| 11 | if ($liscid > 0) { |
||
| 12 | $expire = json_decode($cpl->expireLicense( |
||
| 13 | [ |
||
| 14 | liscid => $liscid, |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 15 | reason => 'Automagic Expiration', |
||
|
0 ignored issues
–
show
|
|||
| 16 | expcode => 'normal' |
||
|
0 ignored issues
–
show
|
|||
| 17 | ] |
||
| 18 | ), true); |
||
| 19 | print $expire['result'].PHP_EOL; |
||
| 20 | } else { |
||
| 21 | print "There is no valid license for $ipAddress\n"; |
||
| 22 | } |
||
| 23 |