#1  
Old 30th November 2011, 11:49
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default Client_Add Method

Hi guys,

I am writing the interface communication between our ISP software and ISPConfig and I have a little difficulty to understand the client_add method declaration.

At the moment I am developing the creation of the client in the ISPConfig but I am trying to understand how have I to add it just the first time and then update it using the client_id parameter.

The problem is the declaration not so clear for me.

Code:
//* Set the function parameters.
	$random_rs_id = 1;
	$params = array(
			'company_name' => 'awesomecompany',
			'contact_name' => 'name',
			'customer_no' => '1',
			'vat_id' => '1',
			'street' => 'fleetstreet',
			'zip' => '21337',
			'city' => 'london',
			'state' => 'bavaria',
			'country' => 'UK',
			'telephone' => '123456789',
			'mobile' => '987654321',
			'fax' => '546718293',
			'email' => 'e@mail.int',
			'internet' => '',
			'icq' => '111111111',
			'notes' => 'awesome',
			'dafault_mailserver' => 1,
			'limit_maildomain' => -1,
			'limit_mailbox' => -1,
			'limit_mailalias' => -1,
			'limit_mailaliasdomain' => -1,
			'limit_mailforward' => -1,
			'limit_mailcatchall' => -1,
			'limit_mailrouting' => 0,
			'limit_mailfilter' => -1,
			'limit_fetchmail' => -1,
			'limit_mailquota' => -1,
			'limit_spamfilter_wblist' => 0,
			'limit_spamfilter_user' => 0,
			'limit_spamfilter_policy' => 1,
			'default_webserver' => 1,
			'limit_web_ip' => '',
			'limit_web_domain' => -1,
			'limit_web_quota' => -1,
			'web_php_options' => 'no,fast-cgi,cgi,mod,suphp',
			'limit_web_subdomain' => -1,
			'limit_web_aliasdomain' => -1,
			'limit_ftp_user' => -1,
			'limit_shell_user' => 0,
			'ssh_chroot' => 'no,jailkit,ssh-chroot',
			'limit_webdav_user' => 0,
			'default_dnsserver' => 1,
			'limit_dns_zone' => -1,
			'limit_dns_slave_zone' => -1,
			'limit_dns_record' => -1,
			'default_dbserver' => 1,
			'limit_database' => -1,
			'limit_cron' => 0,
			'limit_cron_type' => 'url',
			'limit_cron_frequency' => 5,
			'limit_traffic_quota' => -1,
			'limit_client' => 0,
			'parent_client_id' => 0,
			'username' => 'guy',
			'password' => 'brush',
			'language' => 'en',
			'usertheme' => 'default',
			'template_master' => 0,
			'template_additional' => '',
			'created_at' => 0
			);
	
	$affected_rows = $client->client_add($session_id, $random_rs_id, $params);
What is $random_rs_id means?! The first time I have no identifier for the client so what is it?

Thanks
Reply With Quote
Sponsored Links
  #2  
Old 30th November 2011, 14:14
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,495
Thanks: 835
Thanked 5,534 Times in 4,352 Posts
Default

Thats the client where the client belongs to or in other words, its the client_id of the reseller user where this clinet belongs to. Normally the value shall be 0 which means that the clinet does not belong to a reseller.

Quote:
The first time I have no identifier for the client so what is it?
Set the value to 0
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 30th November 2011, 14:19
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

Code:
$client->client_update($this->getSession (), $clientId, 1, $record);
In the update task what have I to set where there is the number 1?

thanks
Reply With Quote
  #4  
Old 30th November 2011, 14:38
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,495
Thanks: 835
Thanked 5,534 Times in 4,352 Posts
Default

The $client->client_add function retuns the ID of the newly created client, so.

$client_id = $client->client_add(.......)
$client->client_update($this->getSession (), $client_id, $record);
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 30th November 2011, 14:40
vaio1 vaio1 is offline
Senior Member
 
Join Date: Jul 2007
Location: Italy
Posts: 664
Thanks: 77
Thanked 12 Times in 7 Posts
Default

In the client_update.php example downloaded with the ispconfig (latest version) I can see:

Code:
$affected_rows = $client->client_update($session_id, $c_id, $reseller_id, $client_record);
Four parameters not three parameters. Can you check it ?
Reply With Quote
  #6  
Old 1st December 2011, 10:31
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,495
Thanks: 835
Thanked 5,534 Times in 4,352 Posts
 
Default

Yes, you are right. Please see API docs in the remoting_client/API-docs folder of the current ispconfig tar.gz for API Documentation of all functions:

client_update($session_id, $client_id, $reseller_id, $params);

If you dont have a reseller, then the reseller_id is 0.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CRYPT Password method japanfred Developers' Forum 4 22nd December 2011 15:18
ISPConfig 3.0.3.3 Autoresponder, adding subdomain problem BlackHat Installation/Configuration 4 18th October 2011 15:24
Debootstrap method fails to get release file http://ftp.us.debian.org/debian/ vtapas HOWTO-Related Questions 12 11th September 2010 04:59
Draft data loss mitigation method for spanned LVM (would like suggestions) ACiD GRiM Technical 0 18th September 2009 08:57
Spamassassin not working hairydog2 General 7 12th July 2008 22:15


All times are GMT +2. The time now is 20:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.