commit | author | age
|
413d3b
|
1 |
<?php |
T |
2 |
|
b1a6a5
|
3 |
require 'soap_config.php'; |
413d3b
|
4 |
|
T |
5 |
|
|
6 |
$client = new SoapClient(null, array('location' => $soap_location, |
b1a6a5
|
7 |
'uri' => $soap_uri, |
MC |
8 |
'trace' => 1, |
|
9 |
'exceptions' => 1)); |
413d3b
|
10 |
|
T |
11 |
|
|
12 |
try { |
b1a6a5
|
13 |
if($session_id = $client->login($username, $password)) { |
413d3b
|
14 |
echo 'Logged successfull. Session ID:'.$session_id.'<br />'; |
T |
15 |
} |
b1a6a5
|
16 |
|
413d3b
|
17 |
//* Set the function parameters. |
bfcdef
|
18 |
$reseller_id = 0; // this id has to be 0 if the client shall not be assigned to admin or if the client is a reseller |
413d3b
|
19 |
$params = array( |
b1a6a5
|
20 |
'company_name' => 'awesomecompany', |
MC |
21 |
'contact_name' => 'name', |
|
22 |
'customer_no' => '1', |
|
23 |
'vat_id' => '1', |
|
24 |
'street' => 'fleetstreet', |
|
25 |
'zip' => '21337', |
|
26 |
'city' => 'london', |
|
27 |
'state' => 'bavaria', |
|
28 |
'country' => 'GB', |
|
29 |
'telephone' => '123456789', |
|
30 |
'mobile' => '987654321', |
|
31 |
'fax' => '546718293', |
|
32 |
'email' => 'e@mail.int', |
|
33 |
'internet' => '', |
|
34 |
'icq' => '111111111', |
|
35 |
'notes' => 'awesome', |
|
36 |
'default_mailserver' => 1, |
|
37 |
'limit_maildomain' => -1, |
|
38 |
'limit_mailbox' => -1, |
|
39 |
'limit_mailalias' => -1, |
|
40 |
'limit_mailaliasdomain' => -1, |
|
41 |
'limit_mailforward' => -1, |
|
42 |
'limit_mailcatchall' => -1, |
|
43 |
'limit_mailrouting' => 0, |
|
44 |
'limit_mailfilter' => -1, |
|
45 |
'limit_fetchmail' => -1, |
|
46 |
'limit_mailquota' => -1, |
|
47 |
'limit_spamfilter_wblist' => 0, |
|
48 |
'limit_spamfilter_user' => 0, |
|
49 |
'limit_spamfilter_policy' => 1, |
|
50 |
'default_webserver' => 1, |
|
51 |
'limit_web_ip' => '', |
|
52 |
'limit_web_domain' => -1, |
|
53 |
'limit_web_quota' => -1, |
|
54 |
'web_php_options' => 'no,fast-cgi,cgi,mod,suphp', |
|
55 |
'limit_web_subdomain' => -1, |
|
56 |
'limit_web_aliasdomain' => -1, |
|
57 |
'limit_ftp_user' => -1, |
|
58 |
'limit_shell_user' => 0, |
|
59 |
'ssh_chroot' => 'no,jailkit,ssh-chroot', |
|
60 |
'limit_webdav_user' => 0, |
|
61 |
'default_dnsserver' => 1, |
|
62 |
'limit_dns_zone' => -1, |
|
63 |
'limit_dns_slave_zone' => -1, |
|
64 |
'limit_dns_record' => -1, |
|
65 |
'default_dbserver' => 1, |
|
66 |
'limit_database' => -1, |
|
67 |
'limit_cron' => 0, |
|
68 |
'limit_cron_type' => 'url', |
|
69 |
'limit_cron_frequency' => 5, |
|
70 |
'limit_traffic_quota' => -1, |
|
71 |
'limit_client' => 0, // If this value is > 0, then the client is a reseller |
|
72 |
'parent_client_id' => 0, |
|
73 |
'username' => 'guy3', |
|
74 |
'password' => 'brush', |
|
75 |
'language' => 'en', |
|
76 |
'usertheme' => 'default', |
|
77 |
'template_master' => 0, |
|
78 |
'template_additional' => '', |
|
79 |
'created_at' => 0 |
|
80 |
); |
|
81 |
|
bfcdef
|
82 |
$affected_rows = $client->client_add($session_id, $reseller_id, $params); |
b1a6a5
|
83 |
|
413d3b
|
84 |
echo "Client: ".$affected_rows."<br>"; |
T |
85 |
|
b1a6a5
|
86 |
|
413d3b
|
87 |
if($client->logout($session_id)) { |
T |
88 |
echo 'Logged out.<br />'; |
|
89 |
} |
b1a6a5
|
90 |
|
MC |
91 |
|
413d3b
|
92 |
} catch (SoapFault $e) { |
T |
93 |
echo $client->__getLastResponse(); |
|
94 |
die('SOAP Error: '.$e->getMessage()); |
|
95 |
} |
|
96 |
|
|
97 |
?> |