View Single Post
  #2  
Old 26th February 2010, 21:10
ivomendonca ivomendonca is offline
Banned
 
Join Date: Sep 2009
Posts: 132
Thanks: 10
Thanked 14 Times in 8 Posts
Default

Quote:
Originally Posted by detot View Post
Im looking for remote framework using scripts for ISPconfig.
I have ISPConfig 3.
But in core there are only mail_ functions.
Im understanding, that its not hard to write new function, but if you have examples for ISPconfig3, Ill be very happy... =)))

And another one problem:
Im trying to add mail_domain,
After running this function from remote script, i see domain, but without any name, client_id and activity.

That im doing not right?

$params = array ( 'sid' => $session_id,
'module' => 'mail',
'function' => 'mail_domain',
'params' => array ( "domain" => 'test1.com',
"active" => 'y',
"server_id" => '1'
));
$domain_id = $soap_client->call('mail_domain_add', $params);
if($err = $soap_client->getError()){
die("Error: ".$err);
}else{
print_r($domain_id);
}

You only have to know the client_id for adding or 0 for admin owner.
hope to help





//* Add a mail domain
public function mail_domain_add($session_id, $client_id, $params)
{
if(!$this->checkPerm($session_id, 'mail_domain_add')) {
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
$domain_id = $this->insertQuery('../mail/form/mail_domain.tform.php',$client_id,$params);
return $domain_id;
}

Last edited by ivomendonca; 26th February 2010 at 21:21.
Reply With Quote