commit | author | age
|
413d3b
|
1 |
<?php |
T |
2 |
|
7fe908
|
3 |
require 'soap_config.php'; |
413d3b
|
4 |
|
T |
5 |
|
|
6 |
$client = new SoapClient(null, array('location' => $soap_location, |
7fe908
|
7 |
'uri' => $soap_uri, |
MC |
8 |
'trace' => 1, |
|
9 |
'exceptions' => 1)); |
413d3b
|
10 |
|
T |
11 |
|
|
12 |
try { |
7fe908
|
13 |
if($session_id = $client->login($username, $password)) { |
413d3b
|
14 |
echo 'Logged successfull. Session ID:'.$session_id.'<br />'; |
T |
15 |
} |
7fe908
|
16 |
|
413d3b
|
17 |
//* Set the function parameters. |
T |
18 |
$client_id = 1; |
7fe908
|
19 |
|
413d3b
|
20 |
$params = array( |
7fe908
|
21 |
'server_id' => 1, |
MC |
22 |
'ip_address' => '*', |
|
23 |
'domain' => 'test2.int', |
|
24 |
'type' => 'vhost', |
|
25 |
'parent_domain_id' => 0, |
|
26 |
'vhost_type' => 'name', |
|
27 |
'hd_quota' => 100000, |
|
28 |
'traffic_quota' => -1, |
|
29 |
'cgi' => 'y', |
|
30 |
'ssi' => 'y', |
|
31 |
'suexec' => 'y', |
|
32 |
'errordocs' => 1, |
|
33 |
'is_subdomainwww' => 1, |
|
34 |
'subdomain' => '', |
|
35 |
'php' => 'y', |
|
36 |
'ruby' => 'n', |
|
37 |
'redirect_type' => '', |
|
38 |
'redirect_path' => '', |
|
39 |
'ssl' => 'n', |
|
40 |
'ssl_state' => '', |
|
41 |
'ssl_locality' => '', |
|
42 |
'ssl_organisation' => '', |
|
43 |
'ssl_organisation_unit' => '', |
|
44 |
'ssl_country' => '', |
|
45 |
'ssl_domain' => '', |
|
46 |
'ssl_request' => '', |
3788b1
|
47 |
'ssl_key' => '', |
7fe908
|
48 |
'ssl_cert' => '', |
MC |
49 |
'ssl_bundle' => '', |
|
50 |
'ssl_action' => '', |
|
51 |
'stats_password' => '', |
|
52 |
'stats_type' => 'webalizer', |
|
53 |
'allow_override' => 'All', |
|
54 |
'apache_directives' => '', |
|
55 |
'php_open_basedir' => '/', |
c1f688
|
56 |
'pm_max_requests' => 0, |
TB |
57 |
'pm_process_idle_timeout' => 10, |
7fe908
|
58 |
'custom_php_ini' => '', |
MC |
59 |
'backup_interval' => '', |
|
60 |
'backup_copies' => 1, |
|
61 |
'active' => 'y', |
|
62 |
'traffic_quota_lock' => 'n' |
|
63 |
); |
|
64 |
|
413d3b
|
65 |
$affected_rows = $client->sites_web_domain_add($session_id, $client_id, $params, $readonly = false); |
7fe908
|
66 |
|
413d3b
|
67 |
echo "Web Domain ID: ".$affected_rows."<br>"; |
T |
68 |
|
7fe908
|
69 |
|
413d3b
|
70 |
if($client->logout($session_id)) { |
T |
71 |
echo 'Logged out.<br />'; |
|
72 |
} |
7fe908
|
73 |
|
MC |
74 |
|
413d3b
|
75 |
} catch (SoapFault $e) { |
T |
76 |
echo $client->__getLastResponse(); |
|
77 |
die('SOAP Error: '.$e->getMessage()); |
|
78 |
} |
|
79 |
|
|
80 |
?> |