added client through remote api can't add database

Discussion in 'Developers' Forum' started by paddox, Feb 25, 2012.

  1. paddox

    paddox New Member

    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!
     
    Last edited: Feb 26, 2012
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    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.
     
  3. paddox

    paddox New Member

    thx alot till! We will try it out!
     

Share This Page