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 |
'parent_domain_id' => 1, |
e23c47
|
23 |
'username' => 'tom', |
TB |
24 |
'password' => 'secret', |
7fe908
|
25 |
'quota_size' => 10000, |
MC |
26 |
'active' => 'y', |
|
27 |
'uid' => '5000', |
|
28 |
'gid' => '5000', |
e23c47
|
29 |
'dir' => '/var/www/clients/client0/web1', |
7fe908
|
30 |
'quota_files' => -1, |
MC |
31 |
'ul_ratio' => -1, |
|
32 |
'dl_ratio' => -1, |
|
33 |
'ul_bandwidth' => -1, |
|
34 |
'dl_bandwidth' => -1 |
|
35 |
); |
|
36 |
|
413d3b
|
37 |
$affected_rows = $client->sites_ftp_user_add($session_id, $client_id, $params); |
7fe908
|
38 |
|
413d3b
|
39 |
echo "FTP User ID: ".$affected_rows."<br>"; |
T |
40 |
|
7fe908
|
41 |
|
413d3b
|
42 |
if($client->logout($session_id)) { |
T |
43 |
echo 'Logged out.<br />'; |
|
44 |
} |
7fe908
|
45 |
|
MC |
46 |
|
413d3b
|
47 |
} catch (SoapFault $e) { |
T |
48 |
echo $client->__getLastResponse(); |
|
49 |
die('SOAP Error: '.$e->getMessage()); |
|
50 |
} |
|
51 |
|
|
52 |
?> |