delete_record.php
changeset 98 9c10fd623368
parent 82 c255196bc447
child 119 f74e4f88b680
equal deleted inserted replaced
97:090be08858db 98:9c10fd623368
    25 $record_id = "-1";
    25 $record_id = "-1";
    26 if (isset($_GET['id']) && v_num($_GET['id'])) {
    26 if (isset($_GET['id']) && v_num($_GET['id'])) {
    27 	$record_id = $_GET['id'];
    27 	$record_id = $_GET['id'];
    28 }
    28 }
    29 
    29 
    30 
       
    31 $confirm = "-1";
    30 $confirm = "-1";
    32 if ((isset($_GET['confirm']) && v_num($_GET['confirm'])
    31 if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
    33         $confirm = $_GET['confirm'];
    32         $confirm = $_GET['confirm'];
    34 }
    33 }
    35 
    34 
    36 if (verify_permission(zone_content_edit_others)) { $perm_content_edit = "all" ; }
    35 if (verify_permission(zone_content_edit_others)) { $perm_content_edit = "all" ; }
    37 elseif (verify_permission(zone_content_edit_own)) { $perm_content_edit = "own" ; }
    36 elseif (verify_permission(zone_content_edit_own)) { $perm_content_edit = "own" ; }
    38 else { $perm_content_edit = "none" ; }
    37 else { $perm_content_edit = "none" ; }
    39 
    38 
    40 $user_is_zone_owner = verify_user_is_owner_zoneid($_GET["domain"]);
    39 $user_is_zone_owner = verify_user_is_owner_zoneid($_GET["domain"]);
    41 
    40 
    42 if ($record_id == "-1" ) {
    41 if ($record_id == "-1" ) {
       
    42 	error(ERR_INV_INPUT);
       
    43 } else {
    43 	if ($confirm == '1') {
    44 	if ($confirm == '1') {
    44 		if ( delete_record($record_id) ) {
    45 		if ( delete_record($record_id) ) {
    45 			success(SUC_RECORD_DEL);
    46 			success(SUC_RECORD_DEL);
    46 		}
    47 		}
    47 	} else {
    48 	} else {
    77 			echo "     <p>" . _('Are you sure?') . "</p>\n";
    78 			echo "     <p>" . _('Are you sure?') . "</p>\n";
    78 			echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='" . $_SERVER["REQUEST_URI"] . "&confirm=1'\" value=\"" . _('Yes') . "\">\n";
    79 			echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='" . $_SERVER["REQUEST_URI"] . "&confirm=1'\" value=\"" . _('Yes') . "\">\n";
    79 			echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
    80 			echo "     <input type=\"button\" class=\"button\" OnClick=\"location.href='index.php'\" value=\"" . _('No') . "\">\n";
    80 		}
    81 		}
    81         }
    82         }
    82 } else {
       
    83 	error(ERR_INV_INPUT);
       
    84 }
    83 }
    85 include_once("inc/footer.inc.php");
    84 include_once("inc/footer.inc.php");