Skip to content

Commit 2eb6fdf

Browse files
committed
updates
1 parent c291530 commit 2eb6fdf

102 files changed

Lines changed: 2338 additions & 2247 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

php/api_add_dns_domain.php

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
$password = $_SERVER['argv'][2];
1313
$domain = $_SERVER['argv'][3];
1414
$ip = $_SERVER['argv'][4];
15-
$show_help = false;
16-
if (in_array('--help', $_SERVER['argv']))
17-
{
18-
$show_help = true;
19-
//break;
20-
}
21-
if ($_SERVER['argc'] < 5)
22-
$show_help = true;
23-
if ($show_help == true)
24-
exit(<<<EOF
15+
$show_help = false;
16+
if (in_array('--help', $_SERVER['argv'])) {
17+
$show_help = true;
18+
//break;
19+
}
20+
if ($_SERVER['argc'] < 5) {
21+
$show_help = true;
22+
}
23+
if ($show_help == true) {
24+
exit(<<<EOF
2525
api_add_dns_domain
2626
2727
Adds a new domain into our system. The status will be "ok" if it added, or
@@ -37,16 +37,17 @@
3737
3838
EOF
3939
);
40+
}
4041
$client = new SoapClient("https://my.interserver.net/api.php?wsdl");
41-
try {
42-
$sid = $client->api_login($username, $password);
43-
if (strlen($sid) == 0)
44-
die("Got A Blank Session");
45-
$res = $client->api_add_dns_domain($sid, $domain, $ip);
46-
echo '$res = '.var_export($res, true)."\n";
47-
} catch (Exception $ex) {
48-
echo "Exception Occurred!\n";
49-
echo "Code:{$ex->faultcode}\n";
50-
echo "String:{$ex->faultstring}\n";
51-
};
52-
?>
42+
try {
43+
$sid = $client->api_login($username, $password);
44+
if (strlen($sid) == 0) {
45+
die("Got A Blank Session");
46+
}
47+
$res = $client->api_add_dns_domain($sid, $domain, $ip);
48+
echo '$res = '.var_export($res, true)."\n";
49+
} catch (Exception $ex) {
50+
echo "Exception Occurred!\n";
51+
echo "Code:{$ex->faultcode}\n";
52+
echo "String:{$ex->faultstring}\n";
53+
};

php/api_add_dns_record.php

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
/** api_add_dns_record - (c)2015 detain@interserver.net InterServer Hosting
33
* Adds a single DNS record
44
* @param sid string the *Session ID* you get from the [login](#login) call
5-
* @param domain_id int
5+
* @param domain_id int
66
* @param name string Specify record name
7-
* @param content string
7+
* @param content string
88
* @param type string Specify TYPE of record
99
* @param ttl int Specify TTL
10-
* @param prio int
10+
* @param prio int
1111
*/
1212
ini_set("soap.wsdl_cache_enabled", "0");
1313
$username = $_SERVER['argv'][1];
@@ -18,16 +18,16 @@
1818
$type = $_SERVER['argv'][6];
1919
$ttl = $_SERVER['argv'][7];
2020
$prio = $_SERVER['argv'][8];
21-
$show_help = false;
22-
if (in_array('--help', $_SERVER['argv']))
23-
{
24-
$show_help = true;
25-
//break;
26-
}
27-
if ($_SERVER['argc'] < 9)
28-
$show_help = true;
29-
if ($show_help == true)
30-
exit(<<<EOF
21+
$show_help = false;
22+
if (in_array('--help', $_SERVER['argv'])) {
23+
$show_help = true;
24+
//break;
25+
}
26+
if ($_SERVER['argc'] < 9) {
27+
$show_help = true;
28+
}
29+
if ($show_help == true) {
30+
exit(<<<EOF
3131
api_add_dns_record
3232
3333
Adds a single DNS record
@@ -45,16 +45,17 @@
4545
4646
EOF
4747
);
48+
}
4849
$client = new SoapClient("https://my.interserver.net/api.php?wsdl");
49-
try {
50-
$sid = $client->api_login($username, $password);
51-
if (strlen($sid) == 0)
52-
die("Got A Blank Session");
53-
$res = $client->api_add_dns_record($sid, $domain_id, $name, $content, $type, $ttl, $prio);
54-
echo '$res = '.var_export($res, true)."\n";
55-
} catch (Exception $ex) {
56-
echo "Exception Occurred!\n";
57-
echo "Code:{$ex->faultcode}\n";
58-
echo "String:{$ex->faultstring}\n";
59-
};
60-
?>
50+
try {
51+
$sid = $client->api_login($username, $password);
52+
if (strlen($sid) == 0) {
53+
die("Got A Blank Session");
54+
}
55+
$res = $client->api_add_dns_record($sid, $domain_id, $name, $content, $type, $ttl, $prio);
56+
echo '$res = '.var_export($res, true)."\n";
57+
} catch (Exception $ex) {
58+
echo "Exception Occurred!\n";
59+
echo "Code:{$ex->faultcode}\n";
60+
echo "String:{$ex->faultstring}\n";
61+
};

php/api_add_prepay.php

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
$module = $_SERVER['argv'][3];
1717
$amount = $_SERVER['argv'][4];
1818
$automatic_use = $_SERVER['argv'][5];
19-
$show_help = false;
20-
if (in_array('--help', $_SERVER['argv']))
21-
{
22-
$show_help = true;
23-
//break;
24-
}
25-
if ($_SERVER['argc'] < 6)
26-
$show_help = true;
27-
if ($show_help == true)
28-
exit(<<<EOF
19+
$show_help = false;
20+
if (in_array('--help', $_SERVER['argv'])) {
21+
$show_help = true;
22+
//break;
23+
}
24+
if ($_SERVER['argc'] < 6) {
25+
$show_help = true;
26+
}
27+
if ($show_help == true) {
28+
exit(<<<EOF
2929
api_add_prepay
3030
3131
Adds a PrePay into the system under the given module. PrePays are a credit on
@@ -44,16 +44,17 @@
4444
4545
EOF
4646
);
47+
}
4748
$client = new SoapClient("https://my.interserver.net/api.php?wsdl");
48-
try {
49-
$sid = $client->api_login($username, $password);
50-
if (strlen($sid) == 0)
51-
die("Got A Blank Session");
52-
$res = $client->api_add_prepay($sid, $module, $amount, $automatic_use);
53-
echo '$res = '.var_export($res, true)."\n";
54-
} catch (Exception $ex) {
55-
echo "Exception Occurred!\n";
56-
echo "Code:{$ex->faultcode}\n";
57-
echo "String:{$ex->faultstring}\n";
58-
};
59-
?>
49+
try {
50+
$sid = $client->api_login($username, $password);
51+
if (strlen($sid) == 0) {
52+
die("Got A Blank Session");
53+
}
54+
$res = $client->api_add_prepay($sid, $module, $amount, $automatic_use);
55+
echo '$res = '.var_export($res, true)."\n";
56+
} catch (Exception $ex) {
57+
echo "Exception Occurred!\n";
58+
echo "Code:{$ex->faultcode}\n";
59+
echo "String:{$ex->faultstring}\n";
60+
};

php/api_api_auto_cpanel_login.php

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/** api_api_auto_cpanel_login - (c)2015 detain@interserver.net InterServer Hosting
3-
* Logs into cpanel for the given website id and returns a unique logged-in url.
3+
* Logs into cpanel for the given website id and returns a unique logged-in url.
44
* The status will be "ok" if successful, or "error" if there was any problems
55
* status_text will contain a description of the problem if any.
66
* @param sid string the *Session ID* you get from the [login](#login) call
@@ -10,16 +10,16 @@
1010
$username = $_SERVER['argv'][1];
1111
$password = $_SERVER['argv'][2];
1212
$id = $_SERVER['argv'][3];
13-
$show_help = false;
14-
if (in_array('--help', $_SERVER['argv']))
15-
{
16-
$show_help = true;
17-
//break;
18-
}
19-
if ($_SERVER['argc'] < 4)
20-
$show_help = true;
21-
if ($show_help == true)
22-
exit(<<<EOF
13+
$show_help = false;
14+
if (in_array('--help', $_SERVER['argv'])) {
15+
$show_help = true;
16+
//break;
17+
}
18+
if ($_SERVER['argc'] < 4) {
19+
$show_help = true;
20+
}
21+
if ($show_help == true) {
22+
exit(<<<EOF
2323
api_api_auto_cpanel_login
2424
2525
Logs into cpanel for the given website id and returns a unique logged-in url.
@@ -34,16 +34,17 @@
3434
3535
EOF
3636
);
37+
}
3738
$client = new SoapClient("https://my.interserver.net/api.php?wsdl");
38-
try {
39-
$sid = $client->api_login($username, $password);
40-
if (strlen($sid) == 0)
41-
die("Got A Blank Session");
42-
$res = $client->api_api_auto_cpanel_login($sid, $id);
43-
echo '$res = '.var_export($res, true)."\n";
44-
} catch (Exception $ex) {
45-
echo "Exception Occurred!\n";
46-
echo "Code:{$ex->faultcode}\n";
47-
echo "String:{$ex->faultstring}\n";
48-
};
49-
?>
39+
try {
40+
$sid = $client->api_login($username, $password);
41+
if (strlen($sid) == 0) {
42+
die("Got A Blank Session");
43+
}
44+
$res = $client->api_api_auto_cpanel_login($sid, $id);
45+
echo '$res = '.var_export($res, true)."\n";
46+
} catch (Exception $ex) {
47+
echo "Exception Occurred!\n";
48+
echo "Code:{$ex->faultcode}\n";
49+
echo "String:{$ex->faultstring}\n";
50+
};

php/api_api_auto_directadmin_login.php

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
$username = $_SERVER['argv'][1];
1111
$password = $_SERVER['argv'][2];
1212
$id = $_SERVER['argv'][3];
13-
$show_help = false;
14-
if (in_array('--help', $_SERVER['argv']))
15-
{
16-
$show_help = true;
17-
//break;
18-
}
19-
if ($_SERVER['argc'] < 4)
20-
$show_help = true;
21-
if ($show_help == true)
22-
exit(<<<EOF
13+
$show_help = false;
14+
if (in_array('--help', $_SERVER['argv'])) {
15+
$show_help = true;
16+
//break;
17+
}
18+
if ($_SERVER['argc'] < 4) {
19+
$show_help = true;
20+
}
21+
if ($show_help == true) {
22+
exit(<<<EOF
2323
api_api_auto_directadmin_login
2424
2525
Logs into DirectAdmin for the given website id and returns a unique logged-in
@@ -34,16 +34,17 @@
3434
3535
EOF
3636
);
37+
}
3738
$client = new SoapClient("https://my.interserver.net/api.php?wsdl");
38-
try {
39-
$sid = $client->api_login($username, $password);
40-
if (strlen($sid) == 0)
41-
die("Got A Blank Session");
42-
$res = $client->api_api_auto_directadmin_login($sid, $id);
43-
echo '$res = '.var_export($res, true)."\n";
44-
} catch (Exception $ex) {
45-
echo "Exception Occurred!\n";
46-
echo "Code:{$ex->faultcode}\n";
47-
echo "String:{$ex->faultstring}\n";
48-
};
49-
?>
39+
try {
40+
$sid = $client->api_login($username, $password);
41+
if (strlen($sid) == 0) {
42+
die("Got A Blank Session");
43+
}
44+
$res = $client->api_api_auto_directadmin_login($sid, $id);
45+
echo '$res = '.var_export($res, true)."\n";
46+
} catch (Exception $ex) {
47+
echo "Exception Occurred!\n";
48+
echo "Code:{$ex->faultcode}\n";
49+
echo "String:{$ex->faultstring}\n";
50+
};

php/api_api_auto_directadmin_storage_login.php

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
* url. The status will be "ok" if successful, or "error" if there was any
55
* problems status_text will contain a description of the problem if any.
66
* @param sid string the *Session ID* you get from the [login](#login) call
7-
* @param id int
7+
* @param id int
88
*/
99
ini_set("soap.wsdl_cache_enabled", "0");
1010
$username = $_SERVER['argv'][1];
1111
$password = $_SERVER['argv'][2];
1212
$id = $_SERVER['argv'][3];
13-
$show_help = false;
14-
if (in_array('--help', $_SERVER['argv']))
15-
{
16-
$show_help = true;
17-
//break;
18-
}
19-
if ($_SERVER['argc'] < 4)
20-
$show_help = true;
21-
if ($show_help == true)
22-
exit(<<<EOF
13+
$show_help = false;
14+
if (in_array('--help', $_SERVER['argv'])) {
15+
$show_help = true;
16+
//break;
17+
}
18+
if ($_SERVER['argc'] < 4) {
19+
$show_help = true;
20+
}
21+
if ($show_help == true) {
22+
exit(<<<EOF
2323
api_api_auto_directadmin_storage_login
2424
2525
Logs into DirectAdmin for the given backup id and returns a unique logged-in
@@ -34,16 +34,17 @@
3434
3535
EOF
3636
);
37+
}
3738
$client = new SoapClient("https://my.interserver.net/api.php?wsdl");
38-
try {
39-
$sid = $client->api_login($username, $password);
40-
if (strlen($sid) == 0)
41-
die("Got A Blank Session");
42-
$res = $client->api_api_auto_directadmin_storage_login($sid, $id);
43-
echo '$res = '.var_export($res, true)."\n";
44-
} catch (Exception $ex) {
45-
echo "Exception Occurred!\n";
46-
echo "Code:{$ex->faultcode}\n";
47-
echo "String:{$ex->faultstring}\n";
48-
};
49-
?>
39+
try {
40+
$sid = $client->api_login($username, $password);
41+
if (strlen($sid) == 0) {
42+
die("Got A Blank Session");
43+
}
44+
$res = $client->api_api_auto_directadmin_storage_login($sid, $id);
45+
echo '$res = '.var_export($res, true)."\n";
46+
} catch (Exception $ex) {
47+
echo "Exception Occurred!\n";
48+
echo "Code:{$ex->faultcode}\n";
49+
echo "String:{$ex->faultstring}\n";
50+
};

0 commit comments

Comments
 (0)