find all domains for a specific client

Discussion in 'ISPConfig 3 Priority Support' started by saco721, Jun 20, 2017.

  1. saco721

    saco721 Member HowtoForge Supporter

    Hi,
    I have installed ISPConfig 3.1.2 on debian jessie multiserver setup. I was wondering how I could go about finding what domains belong to a specific client, for example, domain1.com, domain2.com for client user, domain3.com, domain4.com for client user2 etc. I have looked at domains_get_all_by_user.php, but it always returns :
    Any help is greatly appreciated, thanks.
     
    Last edited: Jun 20, 2017
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I would use the function, e.g.:

    $remoteclient->sites_web_domain_get($session_id, array('sys_groupid' => 1));

    where 1 is the group id of the client group. And if you don't have the groupid of a client, then you can get it like this:

    $remoteclient->client_get_groupid($session_id, $client_id);

    sys_group
     
  3. saco721

    saco721 Member HowtoForge Supporter

    Hi Till,
    Thanks for your time. sites_web_domain_get works as it should but i'm getting the domain with a prefix, ie, site1.domain1.com instead of just domain1.com. I presume this is because subdomain site1.domain1.com is setup as a website instead of subdomain for website. But how do get just the domain?. I tried using :

    where 1 is the group id of name: admin, client_id: 0.
    but it doesn't return anything, apart from :
    I have attached the script.
     

    Attached Files:

    Last edited: Jun 20, 2017
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    When you setup a website and enter 'site1.domain1.com' into the domain field of this website, then the domain name of this website is 'site1.domain1.com' and not 'domain1.com'. The api returns what you entered in ISPConfig.

    If you want to query the database for other alias domains that you might have added to a site, then use the alias and subdomain query functions.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    And if you entered domains with a site1 prefix in ISPConfig instead of the domain, then you can e.g. split the domain name you got from the api by dots and remove the first part.
     
  6. saco721

    saco721 Member HowtoForge Supporter

    Thanks very much Till.
     

Share This Page