delete_supermaster.php
changeset 82 c255196bc447
parent 79 0c0aa144356a
child 106 41d05ff53708
equal deleted inserted replaced
81:c72d6d51f3d3 82:c255196bc447
    18  *  You should have received a copy of the GNU General Public License
    18  *  You should have received a copy of the GNU General Public License
    19  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
    19  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
    20  */
    20  */
    21 
    21 
    22 require_once("inc/toolkit.inc.php");
    22 require_once("inc/toolkit.inc.php");
       
    23 include_once("inc/header.inc.php");
    23 
    24 
    24 if (!level(5))
    25 $master_ip = "-1"
    25 {
    26 if (isset($_GET['master_ip']) && (is_valid_ip($_GET['master_ip']) || is_valid_ip6($_GET['master_ip']))) {
    26         error(ERR_LEVEL_5);
    27 	 $master_ip = $_GET['master_ip'];
    27         
       
    28 }
    28 }
    29 
    29 
    30 if (isset($_GET["master_ip"])) {
    30 $confirm = "-1";
    31         if ((isset($_GET['confirm'])) && ($_GET["confirm"] == '0')) {
    31 if ((isset($_GET['confirm']) && v_num($_GET['confirm'])
    32                 clean_page("index.php");
    32         $confirm = $_GET['confirm'];
    33         } elseif ((isset($_GET["confirm"])) && ($_GET['confirm'] == '1')) {
    33 }
    34                 delete_supermaster($_GET["master_ip"]);
    34 
    35                 clean_page("index.php");
    35 if ($master_ip == "-1"){
    36         }
    36 	error(ERR_INV_INPUT);
    37         include_once("inc/header.inc.php");
       
    38 	$info = get_supermaster_info_from_ip($_GET["master_ip"]);
       
    39         ?>
       
    40 	<h2><?php echo _('Delete supermaster'); ?> "<?php echo $_GET["master_ip"] ?>"</h2>
       
    41 	<?php echo _('Hostname in NS record'); ?>: <?php echo $info["ns_name"] ?><br>
       
    42 	<?php echo _('Account'); ?>: <?php echo $info["account"] ?><br><br>
       
    43         <font class="warning"><?php echo _('Are you sure?'); ?></font><br><br>
       
    44         <input type="button" class="button" OnClick="location.href='<?php echo $_SERVER["REQUEST_URI"] ?>&confirm=1'" value="<?php echo _('Yes'); ?>"> 
       
    45 	<input type="button" class="button" OnClick="location.href='<?php echo $_SERVER["REQUEST_URI"] ?>&confirm=0'" value="<?php echo _('No'); ?>">
       
    46         <?php
       
    47 } else {
    37 } else {
    48         include_once("inc/header.inc.php");
    38 	(verify_permission(supermaster_edit)) ? $perm_sm_edit = "1" :  $perm_sm_edit = "0" ;
    49         echo _('Nothing to do!');
    39 	if ($perm_sm_edit == "0") {
       
    40 		error(ERR_PERM_DEL_SM);
       
    41 	} else {
       
    42 		$info = get_supermaster_info_from_ip($master_ip);
       
    43 
       
    44 		echo "     <h2>" . _('Delete supermaster') . " \"" . $master_ip . "\"</h2>\n";
       
    45 
       
    46 		if ($_GET["confirm"] == '1') {
       
    47 			if (delete_supermaster($master_ip)) {
       
    48 				success(SUC_ZONE_DEL);
       
    49 			}
       
    50 		} else {
       
    51 			echo "     <p>\n";
       
    52 			echo "      " . _('Hostname in NS record') . ": " . $info['ns_name'] . "<br>\n";
       
    53 			echo "      " . _('Account') . ": " . $info['account'] . "\n";
       
    54 			echo "     </p>\n";
       
    55 			echo "     <p>" . _('Are you sure?') . "</p>\n";
       
    56 			echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='" . $_SERVER['REQUEST_URI'] . "&confirm=1'\" value=\"" . _('Yes') . "\">\n"; 
       
    57 			echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
       
    58 		}
       
    59 	}
    50 }
    60 }
       
    61 
    51 include_once("inc/footer.inc.php");
    62 include_once("inc/footer.inc.php");