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. |
T |
18 |
$client_id = 1; |
|
19 |
$params = array( |
b1a6a5
|
20 |
'server_id' => 1, |
MC |
21 |
'email' => 'joe@test.int', |
|
22 |
'login' => 'joe@test.int', |
|
23 |
'password' => 'howtoforge', |
|
24 |
'name' => 'joe', |
|
25 |
'uid' => 5000, |
|
26 |
'gid' => 5000, |
|
27 |
'maildir' => '/var/vmail/test.int/joe', |
|
28 |
'quota' => 5242880, |
|
29 |
'cc' => '', |
|
30 |
'homedir' => '/var/vmail', |
|
31 |
'autoresponder' => 'n', |
|
32 |
'autoresponder_start_date' => array('day' => 1, 'month' => 7, 'year' => 2012, 'hour' => 0, 'minute' => 0), |
|
33 |
'autoresponder_end_date' => array('day' => 20, 'month' => 7, 'year' => 2012, 'hour' => 0, 'minute' => 0), |
|
34 |
'autoresponder_text' => 'hallo', |
|
35 |
'move_junk' => 'n', |
|
36 |
'custom_mailfilter' => 'spam', |
|
37 |
'postfix' => 'n', |
|
38 |
'access' => 'n', |
|
39 |
'disableimap' => 'n', |
|
40 |
'disablepop3' => 'n', |
|
41 |
'disabledeliver' => 'n', |
|
42 |
'disablesmtp' => 'n' |
|
43 |
); |
|
44 |
|
413d3b
|
45 |
$affected_rows = $client->mail_user_add($session_id, $client_id, $params); |
T |
46 |
|
|
47 |
echo "New user: ".$affected_rows."<br>"; |
b1a6a5
|
48 |
|
413d3b
|
49 |
if($client->logout($session_id)) { |
T |
50 |
echo 'Logged out.<br />'; |
|
51 |
} |
b1a6a5
|
52 |
|
MC |
53 |
|
413d3b
|
54 |
} catch (SoapFault $e) { |
T |
55 |
echo $client->__getLastResponse(); |
|
56 |
die('SOAP Error: '.$e->getMessage()); |
|
57 |
} |
|
58 |
|
|
59 |
?> |