Thread: User creating
View Single Post
  #5  
Old 23rd July 2010, 23:55
shoevring shoevring is offline
Member
 
Join Date: Feb 2010
Posts: 71
Thanks: 1
Thanked 2 Times in 2 Posts
Default

Quote:
Originally Posted by till View Post
Sure, why not? Thats the purpose of this function.

First, take a look at the client table in the database to get all available fields:

Code:
`company_name` varchar(64) default NULL,
  `contact_name` varchar(64) default NULL,
  `street` varchar(255) default NULL,
  `zip` varchar(32) default NULL,
  `city` varchar(64) default NULL,
  `state` varchar(32) default NULL,
  `country` char(2) default NULL,
  `telephone` varchar(32) default NULL,
  `mobile` varchar(32) default NULL,
  `fax` varchar(32) default NULL,
  `email` varchar(255) default NULL,
  `internet` varchar(255) NOT NULL,
  `icq` varchar(16) default NULL,
  `notes` text,
  `default_mailserver` int(11) unsigned NOT NULL default '1',
  `limit_maildomain` int(11) NOT NULL default '-1',
  `limit_mailbox` int(11) NOT NULL default '-1',
  `limit_mailalias` int(11) NOT NULL default '-1',
  `limit_mailaliasdomain` int(11) NOT NULL default '-1',
  `limit_mailforward` int(11) NOT NULL default '-1',
  `limit_mailcatchall` int(11) NOT NULL default '-1',
  `limit_mailrouting` int(11) NOT NULL default '0',
  `limit_mailfilter` int(11) NOT NULL default '-1',
  `limit_fetchmail` int(11) NOT NULL default '-1',
  `limit_mailquota` int(11) NOT NULL default '-1',
  `limit_spamfilter_wblist` int(11) NOT NULL default '0',
  `limit_spamfilter_user` int(11) NOT NULL default '0',
  `limit_spamfilter_policy` int(11) NOT NULL default '0',
  `default_webserver` int(11) unsigned NOT NULL default '1',
  `limit_web_ip` text,
  `limit_web_domain` int(11) NOT NULL default '-1',
  `limit_web_quota` int(11) NOT NULL default '-1',
  `web_php_options` varchar(255) NOT NULL default 'no,fast-cgi,cgi,mod,suphp',
  `limit_web_subdomain` int(11) NOT NULL default '-1',
  `limit_web_aliasdomain` int(11) NOT NULL default '-1',
  `limit_ftp_user` int(11) NOT NULL default '-1',
  `limit_shell_user` int(11) NOT NULL default '0',
  `ssh_chroot` varchar(255) NOT NULL DEFAULT 'no,jailkit,ssh-chroot',
  `limit_webdav_user` int(11) NOT NULL default '0',
  `default_dnsserver` int(11) unsigned NOT NULL default '1',
  `limit_dns_zone` int(11) NOT NULL default '-1',
  `limit_dns_slave_zone` int(11) NOT NULL default '-1',
  `limit_dns_record` int(11) NOT NULL default '-1',
  `default_dbserver` int(11) NOT NULL default '1',
  `limit_database` int(11) NOT NULL default '-1',
  `limit_cron` int(11) NOT NULL default '0',
  `limit_cron_type` enum('url','chrooted','full') NOT NULL default 'url',
  `limit_cron_frequency` int(11) NOT NULL default '5',
  `limit_traffic_quota` int(11) NOT NULL default '-1',
  `limit_client` int(11) NOT NULL default '0',
  `parent_client_id` int(11) unsigned NOT NULL default '0',
  `username` varchar(64) default NULL,
  `password` varchar(64) default NULL,
  `language` char(2) NOT NULL default 'en',
  `usertheme` varchar(32) NOT NULL default 'default',
Then create your params array:

Code:
$params = array('contact_name' => $firstname.' '.$lastname, 'username' => $username, 'password' => $password, .................);
and so on.

and then call the remote function:

Code:
$client->client_add($session_id, 0, $params);

So, something like this(How should the default server be in the variable? With the id of the server?):


<?php

[my variables]

include "/usr/local/ispconfig/interface/lib/classes/remoting.inc.php";

$params = array('contact_name' => $firstname.' '.$lastname,'username' => $username,'password' => $password,'street' => $street.' '.$streetnumber,'zip' => $zipcode,'email' => $email,'default_mailserver' => $mailserver,'default_webserver' => $webserver,'default_dbserver' => $dbserver,'limit_maildomain' => $limit_maildomain,'limit_mailbox' => $limit_mailbox,'limit_mailalias' => $limit_mailalias,'limit_mailaliasdomain' => $limit_mailaliasdomain,'limit_mailforward' => $limit_mailforward,'limit_mailcatchall' => $limit_mailcatchall,'limit_mailrouting' => $limit_mailrouting,'limit_mailfilter' => $limit_mailfilter,'limit_fetchmail' => $limit_fetchmail,'limit_mailquota' => $limit_mailquota,'limit_spamfilter_wblist' => $limit_spamfilter_wblist,'limit_spamfilter_user' => $limit_spamfilter_user,'limit_spamfilter_policy' => $limit_spamfilter_policy,'limit_web_domain' => $limit_web_domain,'limit_web_quota' => $limit_web_quota,'limit_web_subdomain' => $limit_web_subdomain,'limit_web_aliasdomain' => $limit_web_aliasdomain,'limit_ftp_user' => $limit_ftp_user,'limit_shell_user' => $limit_shell_user,'limit_webdav_user' => $limit_webdav_user,'limit_database' => $limit_database,'limit_cron' => $limit_cron,'limit_cron_type' => $limit_cron_type,'limit_cron_frequency' => $limit_cron_frequency,'limit_traffic_quota' => $limit_traffic_quota,'language' => $defaultlanguage');


$client->client_add($session_id, 0, $params);

?>

??? is this right?
Reply With Quote