Skip to content

Commit c2ff80c

Browse files
committed
formatting update
1 parent 36ddf64 commit c2ff80c

8 files changed

Lines changed: 279 additions & 275 deletions

bin/activate_kcare.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
require_once __DIR__.'/../../../include/functions.inc.php';
34
$url = 'https://cln.cloudlinux.com/clweb/xmlrpc';
45
$license_type = 16;
@@ -12,18 +13,18 @@
1213

1314
$BODY = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <methodCall> <methodName>registration.license</methodName> <params> <param> <value>$auth_token</value> </param> <param> <value>$ipAddress</value> </param> <param> <value><int>$license_type</int></value> </param></params> </methodCall>";
1415
$context = stream_context_create(
15-
[
16-
'http' => [
17-
'method' => 'POST',
18-
'header' => 'Content-Type: application/xml; charset=UTF-8',
19-
'content' => $BODY
20-
]
21-
]
16+
[
17+
'http' => [
18+
'method' => 'POST',
19+
'header' => 'Content-Type: application/xml; charset=UTF-8',
20+
'content' => $BODY
21+
]
22+
]
2223
);
2324

2425
$result = file_get_contents($url, false, $context);
2526
if (mb_strpos($result, '<i4>0</i4>')) {
26-
echo "Success Registering IP\n";
27+
echo "Success Registering IP\n";
2728
} else {
28-
echo "Error Registering IP\n";
29+
echo "Error Registering IP\n";
2930
}

bin/cloudlinux_remove.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
$cl = new Cloudlinux(CLOUDLINUX_LOGIN, CLOUDLINUX_KEY);
88
if (isset($_SERVER['argv'][2])) {
9-
print_r($cl->remove($_SERVER['argv'][1], $_SERVER['argv'][2]));
9+
print_r($cl->remove($_SERVER['argv'][1], $_SERVER['argv'][2]));
1010
} else {
11-
print_r($cl->remove($_SERVER['argv'][1]));
11+
print_r($cl->remove($_SERVER['argv'][1]));
1212
}

bin/deactivate_kcare.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
require_once __DIR__.'/../../../include/functions.inc.php';
34
$url = 'https://cln.cloudlinux.com/clweb/xmlrpc';
45
$license_type = 16;
@@ -12,20 +13,20 @@
1213

1314
$BODY = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <methodCall> <methodName>registration.remove_license</methodName> <params> <param> <value>$auth_token</value> </param> <param> <value>$ipAddress</value> </param> <param> <value><int>$license_type</int></value> </param></params> </methodCall>";
1415
$context = stream_context_create(
15-
[
16-
'http' => [
17-
'method' => 'POST',
18-
'header' => 'Content-Type: application/xml; charset=UTF-8',
19-
'content' => $BODY
20-
]
21-
]
16+
[
17+
'http' => [
18+
'method' => 'POST',
19+
'header' => 'Content-Type: application/xml; charset=UTF-8',
20+
'content' => $BODY
21+
]
22+
]
2223
);
2324

2425
$result = file_get_contents($url, false, $context);
2526
if (mb_strpos($result, '<i4>1</i4>')) {
26-
echo "Success Removing IP\n";
27+
echo "Success Removing IP\n";
2728
} elseif (mb_strpos($result, '<i4>0</i4>')) {
28-
echo "Success Removing IP\n";
29+
echo "Success Removing IP\n";
2930
} else {
30-
echo "Error Removing IP\n";
31+
echo "Error Removing IP\n";
3132
}

bin/lookup_kcare.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
require_once __DIR__.'/../../../include/functions.inc.php';
34
$url = 'https://cln.cloudlinux.com/clweb/xmlrpc';
45
$license_type = 16;
@@ -12,22 +13,22 @@
1213

1314
$BODY = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <methodCall> <methodName>registration.is_licensed</methodName> <params> <param> <value>$auth_token</value> </param> <param> <value>$ipAddress</value> </param> <param><value><boolean>1</boolean></value></param></params> </methodCall>";
1415
$context = stream_context_create(
15-
[
16-
'http' => [
17-
'method' => 'POST',
18-
'header' => 'Content-Type: application/xml; charset=UTF-8',
19-
'content' => $BODY
20-
]
21-
]
16+
[
17+
'http' => [
18+
'method' => 'POST',
19+
'header' => 'Content-Type: application/xml; charset=UTF-8',
20+
'content' => $BODY
21+
]
22+
]
2223
);
2324

2425
$result = file_get_contents($url, false, $context);
2526
if (mb_strpos($result, '<i4>0</i4>')) {
26-
echo "Not Licensed\n";
27+
echo "Not Licensed\n";
2728
} elseif (mb_strpos($result, '<i4>16</i4>')) {
28-
echo "KernelCare License\n";
29+
echo "KernelCare License\n";
2930
} elseif (mb_strpos($result, '<i4>1</i4>')) {
30-
echo "License Type 1\n";
31+
echo "License Type 1\n";
3132
} elseif (mb_strpos($result, '<i4>2</i4>')) {
32-
echo "License Type 2\n";
33+
echo "License Type 2\n";
3334
}

bin/test_cloudlinux_licenses.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
use Detain\Cloudlinux\Cloudlinux;
34

45
ini_set('display_errors', 'on');
@@ -12,14 +13,14 @@
1213
$response = $cl->isLicensed('206.72.198.90', true);
1314
print_r($response);
1415
if (!$response) {
15-
echo "Not Licensed\n";
16-
// $cl->license('66.45.228.100', 1);
17-
echo "License Created of type 1\n";
16+
echo "Not Licensed\n";
17+
// $cl->license('66.45.228.100', 1);
18+
echo "License Created of type 1\n";
1819
} else {
19-
echo "Already Licensed\n";
20+
echo "Already Licensed\n";
2021
}
2122

2223
echo "List of All Licnses:\n";
2324
foreach ($cl->reconcile() as $license) {
24-
echo $license['IP'].' is type '.$license['TYPE'].'. server registered in CLN with license: '.var_export($license['REGISTERED'], true).PHP_EOL;
25+
echo $license['IP'].' is type '.$license['TYPE'].'. server registered in CLN with license: '.var_export($license['REGISTERED'], true).PHP_EOL;
2526
}

0 commit comments

Comments
 (0)