Esempio n. 1
0
     }
 }
 // Delete Domain
 if ($_GET['action'] == 'delete_domain') {
     if (!empty($_GET['domain_id'])) {
         $response = $PowerDNS->deleteDomain($_GET['domain_id']);
         $output = json_encode($response);
     } else {
         $output = json_encode(array("status" => "error", "msg" => "Missing data for delete_domain."));
     }
 }
 // Get Domain ID
 if ($_GET['action'] == 'get_domain_id') {
     if (!empty($_GET['domain'])) {
         if ($PowerDNS->isValidDomain($_GET['domain'])) {
             $response = $PowerDNS->getDomainID($_GET['domain']);
             $output = json_encode($response);
         } else {
             $output = json_encode(array("status" => "error", "msg" => "Invalid Domain."));
         }
     } else {
         $output = json_encode(array("status" => "error", "msg" => "Missing data for get_domain_id."));
     }
 }
 // Add Record
 if ($_GET['action'] == 'add_record') {
     if (!empty($_GET['domain_id']) && !empty($_GET['name']) && !empty($_GET['type']) && !empty($_GET['content']) && !empty($_GET['ttl'])) {
         $response = $PowerDNS->addRecord($_GET['domain_id'], $_GET['name'], $_GET['type'], $_GET['content'], $_GET['ttl'], $_GET['prio']);
         $output = json_encode($response);
     } else {
         $output = json_encode(array("status" => "error", "msg" => "Missing data for add_record."));