edit_record.php
changeset 127 e2c54e888f7e
parent 126 cb06e3e29ed8
child 140 e68c3d6094d1
equal deleted inserted replaced
126:cb06e3e29ed8 127:e2c54e888f7e
    32 
    32 
    33 if (verify_permission('zone_meta_edit_others')) { $perm_meta_edit = "all" ; }
    33 if (verify_permission('zone_meta_edit_others')) { $perm_meta_edit = "all" ; }
    34 elseif (verify_permission('zone_meta_edit_own')) { $perm_meta_edit = "own" ; }
    34 elseif (verify_permission('zone_meta_edit_own')) { $perm_meta_edit = "own" ; }
    35 else { $perm_meta_edit = "none" ; }
    35 else { $perm_meta_edit = "none" ; }
    36 
    36 
    37 $zid = get_zone_id_from_record_id($_GET["id"]);
    37 $zid = get_zone_id_from_record_id($_GET['id']);
    38 
    38 
    39 $user_is_zone_owner = verify_user_is_owner_zoneid($zid);
    39 $user_is_zone_owner = verify_user_is_owner_zoneid($zid);
    40 $zone_type = get_domain_type($zid);
    40 $zone_type = get_domain_type($zid);
    41 $zone_name = get_domain_name_from_id($zid);
    41 $zone_name = get_domain_name_from_id($zid);
    42 
    42 
    43 if ($_POST["commit"]) {
    43 if ($_POST["commit"]) {
    44 	if ( $zone_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0" ) {
    44 	if ( $zone_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0" ) {
    45 		error(ERR_PERM_EDIT_RECORD);
    45 		error(ERR_PERM_EDIT_RECORD);
    46 	} else {
    46 	} else {
    47 		$ret_val = edit_record($_POST["recordid"], $_POST["domainid"], $_POST["name"], $_POST["type"], $_POST["content"], $_POST["ttl"], $_POST["prio"]);
    47 		$ret_val = edit_record($_POST);
    48 		if ( $ret_val == "1" ) {
    48 		if ( $ret_val == "1" ) {
    49 			success(SUC_RECORD_UPD);
    49 			success(SUC_RECORD_UPD);
    50 		} else {
    50 		} else {
    51 			echo "     <div class=\"error\">" . $ret_val . "</div>\n";  
    51 			echo "     <div class=\"error\">" . $ret_val . "</div>\n";  
    52 		}
    52 		}
    78 		echo "       <td>" . $record["content"] . "</td>\n";
    78 		echo "       <td>" . $record["content"] . "</td>\n";
    79 		echo "       <td>" . $record["prio"] . "</td>\n";
    79 		echo "       <td>" . $record["prio"] . "</td>\n";
    80 		echo "       <td>" . $record["ttl"] . "</td>\n";
    80 		echo "       <td>" . $record["ttl"] . "</td>\n";
    81 		echo "      </tr>\n";
    81 		echo "      </tr>\n";
    82 	} else {
    82 	} else {
    83 		echo "      <input type=\"hidden\" name=\"recordid\" value=\"" . $_GET["id"] . "\">\n";
    83 		echo "      <input type=\"hidden\" name=\"rid\" value=\"" . $_GET["id"] . "\">\n";
    84 		echo "      <input type=\"hidden\" name=\"domainid\" value=\"" . $zid . "\">\n";
    84 		echo "      <input type=\"hidden\" name=\"zid\" value=\"" . $zid . "\">\n";
    85 		echo "      <tr>\n";
    85 		echo "      <tr>\n";
    86 		echo "       <td><input type=\"text\" name=\"name\" value=\"" . trim(str_replace($zone_name, '', $record["name"]), '.') . "\" class=\"input\">." . $zone_name . "</td>\n";
    86 		echo "       <td><input type=\"text\" name=\"name\" value=\"" . trim(str_replace($zone_name, '', $record["name"]), '.') . "\" class=\"input\">." . $zone_name . "</td>\n";
    87 		echo "       <td>IN</td>\n";
    87 		echo "       <td>IN</td>\n";
    88 		echo "       <td>\n";
    88 		echo "       <td>\n";
    89 		echo "        <select name=\"type\">\n";
    89 		echo "        <select name=\"type\">\n";