Create/Delete Secondary DNS with remote API

Discussion in 'Developers' Forum' started by holykim, Oct 3, 2016.

  1. holykim

    holykim Member

    Hi,
    This was requested by Maumar last 2012 and Till advised that this will be added in 3.0.5. However, this function is still missing in 3.1. You can find the original post written by Maumar at the following link https://www.howtoforge.com/community/threads/creating-secondary-zone-with-remote-cli.58180/

    ISPConfig 3.1 has little changes on directory structures so now we need to add these functions in the file below. Hope this helps to someone who wants to create a secondary zone automatically when primary zone is created by remote API.

    /usr/local/ispconfig/interface/lib/classes/remote.d/dns.inc.php


    //* Add a slave zone
    public function dns_slave_add($session_id, $client_id, $params)
    {
    if(!$this->checkPerm($session_id, 'dns_zone_add')) {
    throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
    return false;
    }
    return $this->insertQuery('../dns/form/dns_slave.tform.php',$client_id,$params);
    }

    //* Delete a slave zone
    public function dns_slave_delete($session_id, $primary_id)
    {
    if(!$this->checkPerm($session_id, 'dns_zone_delete')) {
    throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
    return false;
    }
    return $this->deleteQuery('../dns/form/dns_slave.tform.php',$primary_id);
    }
     
    till likes this.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I've added it to the bugtracker so we can add it in 3.1.1. If code gets submitted to the forum instead as merge request to the GIT server, then things get lost sometimes.
     

Share This Page