View Single Post
  #3  
Old 11th December 2012, 17:32
AceLine AceLine is offline
Junior Member
 
Join Date: Oct 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

hi Till,

thnx. for your answer. I did the update now but I get a SOAP Error: Could not connect to host error.

what could I check (port 8080, where to check if it is active, etc.) to get closer to the problem?

Hope, you have any help for me...


Best regards from Austria,

AceLine

Quote:
$uid = $_POST['uid'];
$username = strtolower(umlaute(str_replace(" ", ".", $_POST['username'])));
$prefix = $_POST['emailPrefix'];
$email = urldecode($username).$prefix."@"._sitename;

$qry = sql_insert("INSERT INTO email_prefix (email_prefix,uid) VALUES ('".$username.$prefix."',".$uid.")", 2);

$username = 'admin';
$password = 'geheimespasswort';

/*
$soap_location = 'http://localhost:8080/ispconfig3/interface/web/remote/index.php';
$soap_uri = 'http://localhost:8080/ispconfig3/interface/web/remote/';
*/

$soap_location = 'http://localhost:8080/remote/index.php';
$soap_uri = 'http://localhost:8080/remote/';

$client = new SoapClient(null, array('location' => $soap_location,
'uri' => $soap_uri,
'trace' => 1,
'exceptions' => 1));


try {
if($session_id = $client->login($username,$password)) {
echo 'Logged successfull. Session ID:'.$session_id.'<br />';
}

//* Set the function parameters.
$client_id = 1;
$params = array(
'server_id' => 1,
'email' => $email,
'login' => $email,
'password' => $username.$uid,
'name' => $_SESSION['username'],
'uid' => (5000+intval($uid)),
'gid' => (5000+intval($uid)),
'maildir' => '/var/www/'._sitename.'/'.$username.$prefix,
'quota' => 10000000000,
'cc' => '',
'homedir' => '',
'autoresponder' => 'n',
'autoresponder_start_date' => '',
'autoresponder_end_date' => '',
'autoresponder_text' => 'hallo',
'move_junk' => 'n',
'custom_mailfilter' => 'spam',
'postfix' => 'y',
'access' => 'n',
'disableimap' => 'n',
'disablepop3' => 'n',
'disabledeliver' => 'n',
'disablesmtp' => 'n'
);

$affected_rows = $client->mail_user_add($session_id, $client_id, $params);

echo "New user: ".$affected_rows."<br>";

if($client->logout($session_id)) {
echo 'Logged out.<br />';
}


} catch (SoapFault $e) {
echo $client->__getLastResponse();
die('SOAP Error: '.$e->getMessage());
}

echo "ok";

Last edited by AceLine; 11th December 2012 at 20:27.
Reply With Quote