示例#1
0
 if ($_GET['action'] == 'add_domain') {
     if (!empty($_GET['domain'])) {
         if ($PowerDNS->isValidDomain($_GET['domain']) && count(explode(".", $_GET['domain'])) > 1) {
             $response = $PowerDNS->addDomain($_GET['domain'], $_GET['solusvm_cid']);
             $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 add_domain."));
     }
 }
 // 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 {