Setting site to client in API

Discussion in 'Plugins/Modules/Addons' started by ginner159, Aug 16, 2013.

  1. ginner159

    ginner159 New Member

    Hello all,

    Ive been making an signup page with the api but im having trouble assigning the newly created site to the client who signed up. By that i mean i set it up so everyone gets a subdomain with a hosting package.

    what i want to know is how to define/set the site owner in the api so that in the ISPCONFIG panel it shows its owned by the client.

    Ive attached the script i have (made in dreamweaver)
     

    Attached Files:

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You pass the ID of the new client that you added as $client_id to the sites_web_domain_add function.
     
  3. ginner159

    ginner159 New Member

    I thought i was doing that on line 483 ?? this is what happens in the client panel after using the form (see attached) Capture 2 is in the sites section, which makes me then have to add it manually.

    have i got something coded wrong?
     

    Attached Files:

  4. till

    till Super Moderator Staff Member ISPConfig Developer

    No, you dont assign it to the client there. You add a client and then add a website without assignng it to the newly created client.

    Try this code:

    Code:
    $client_id = $client->client_add($session_id, 0, $paramsA);
    	$site_id = $client->sites_web_domain_add($session_id, $client_id, $paramsB, $readonly = false);
     
  5. ginner159

    ginner159 New Member

    so i would need to upload the sites_web_domain_add php as a separate file?? as i copied it into the one file thinking it could be done that way
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    I've not talked about uploading any separate files, i just corrected your sourcecode error.
     
  7. ginner159

    ginner159 New Member

    Thanks so much till!

    what was the difference between what i had and you had that was making it fail? as all i can tell is just renaming $affectedrows to another name.
     
  8. ginner159

    ginner159 New Member

    just a quick thought how would i now get my form to auto increment customer number? or set the same as client id
     

Share This Page