HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   added client through remote api can't add database (http://www.howtoforge.com/forums/showthread.php?t=56318)

paddox 25th February 2012 19:30

mistake in API add_client.php???
 
Hi, i'm trying to use the remote api so i can link my webhosting website to ispconfig and automatically add clients

this works, but when i log in with this newly created account with no user limits (quota = unlimited) the user can't add a database, website, maildomain, mailbox

when i add a client through ispconfig's panel and then log in with this user I can create a website, mailbox, maildomain, database.

So I went on a search and when I look in the clients tabel of de ispconfig database I can see a difference in the parent_client_id.

client added through remote api,parent_client_id = 1
client added through ispconfig panel, parent_client_id = 0

when I Changed de parent_client_id of the user made with the remote api to 0, suddenly he could add a website,database,...

So the next step was to edit the client_add function, the parameter parent_client_id was changed to 0.

But when I add this client and check it through the database it still gives a 1

so then i tried to comment out the paramater parent_client_id in the add_client function because in the table structure of clients the default value is zero, but still it is set to 1

I use the latest stable version of ispconfig 3 and Debian 6.0 (sqeeuze) and I followed the perfect setup for ispconfig 3 for Debian 6.0

thx for any advice in advance!

till 27th February 2012 10:16

If you set the parent_client_id with your script, then this means that you attach this client to a reseller. If this reseller does not exist or has reached its limits, then you can not add any new items as the reseller limit has been recahed.

The solution is to fix your script and set $reseller_id = 0 (its the second parameter) of the client_add function.

There is no need to change any code of the remote API.

paddox 27th February 2012 12:59

thx alot till! We will try it out!


All times are GMT +2. The time now is 18:51.

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