How can i disable client website ? client database ? client maildomains ? from ispconfig api

Discussion in 'Installation/Configuration' started by Franck Tobihas, Jan 22, 2022.

  1. Franck Tobihas

    Franck Tobihas New Member

    Hi ,

    i created a script (in my wordpress website) using ispconfig api that can created client (website,database,etc ....) after checkout.
    now i don't know how can i disable the client (website,database,etc ....) created.
    How can i disable client website ? client database ? client maildomains ? from ispconfig api

    Thanks
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Many tables have an 'active' column, just read in the old row, set active to 'n' and write it back.
     
  3. Franck Tobihas

    Franck Tobihas New Member

    Hi,
    here is my function:

    $domain_record = $client->sites_web_domain_get($session_id, array('domain' => $domaine.'.'.$CONFIG['webDomain']));

    if (!empty($domain_record[0]['domain_id'])) {

    // desactivation
    $params = array(
    'active' => 'n'
    );

    $client_exist = $client->client_get_by_username($session_id, $user);
    $client_id = $client_exist['client_id'];

    if ($sites_web_id = $client->sites_web_domain_add($session_id, $client_id, $params, $readonly = false)) {
    toLog('Le domaine '.$domaine.'.'.$CONFIG['webDomain'].' est desactivé ('.$sites_web_id.')', 'info');
    } else {
    toLog('Echec à la desactivation du domaine '.$domaine.'.'.$CONFIG['webDomain'], 'error');
    exit();
    }

    } else {
    // N'Existe pas
    toLog('Le domaine '.$domaine.'.'.$CONFIG['webDomain'].' n existe pas', 'warn');
    }

    when I launch the site, there is no error but it crashes the site. when I try to debug, I see that this is the line that crashes the site:

    f ($sites_web_id = $client->sites_web_domain_add($session_id, $client_id, $params, $readonly = false))

    please how to solve it ?

    Thank you for your help.
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

  5. Franck Tobihas

    Franck Tobihas New Member

    Hi,
    is ok now , thanks very much for your help
     

Share This Page