edit_record.php
changeset 120 982f722376b4
parent 119 f74e4f88b680
child 126 cb06e3e29ed8
equal deleted inserted replaced
119:f74e4f88b680 120:982f722376b4
    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 $user_is_zone_owner = verify_user_is_owner_zoneid($_GET["domain"]);
    37 $zid = get_zone_id_from_record_id($_GET["id"]);
    38 $zone_type = get_domain_type($_GET["domain"]);
    38 
    39 $zone_name = get_domain_name_from_id($_GET["domain"]);
    39 $user_is_zone_owner = verify_user_is_owner_zoneid($zid);
       
    40 $zone_type = get_domain_type($zid);
       
    41 $zone_name = get_domain_name_from_id($zid);
    40 
    42 
    41 if ($_POST["commit"]) {
    43 if ($_POST["commit"]) {
    42 	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" ) {
    43 		error(ERR_PERM_EDIT_RECORD);
    45 		error(ERR_PERM_EDIT_RECORD);
    44 	} else {
    46 	} else {
    55 
    57 
    56 if ( $perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0" ) {
    58 if ( $perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0" ) {
    57 	error(ERR_PERM_VIEW_RECORD);
    59 	error(ERR_PERM_VIEW_RECORD);
    58 } else {
    60 } else {
    59 	$record = get_record_from_id($_GET["id"]);
    61 	$record = get_record_from_id($_GET["id"]);
    60 	echo "     <form method=\"post\" action=\"edit_record.php?domain=" . $_GET["domain"] . "&id=" . $_GET["id"] . "\">\n";
    62 	echo "     <form method=\"post\" action=\"edit_record.php?domain=" . $zid . "&id=" . $_GET["id"] . "\">\n";
    61 	echo "      <table>\n";
    63 	echo "      <table>\n";
    62 	echo "       <tr>\n";
    64 	echo "       <tr>\n";
    63 	echo "        <th>" . _('Name') . "</td>\n";
    65 	echo "        <th>" . _('Name') . "</td>\n";
    64 	echo "        <th>&nbsp;</td>\n";
    66 	echo "        <th>&nbsp;</td>\n";
    65 	echo "        <th>" . _('Type') . "</td>\n";
    67 	echo "        <th>" . _('Type') . "</td>\n";
    77 		echo "       <td>" . $record["prio"] . "</td>\n";
    79 		echo "       <td>" . $record["prio"] . "</td>\n";
    78 		echo "       <td>" . $record["ttl"] . "</td>\n";
    80 		echo "       <td>" . $record["ttl"] . "</td>\n";
    79 		echo "      </tr>\n";
    81 		echo "      </tr>\n";
    80 	} else {
    82 	} else {
    81 		echo "      <input type=\"hidden\" name=\"recordid\" value=\"" . $_GET["id"] . "\">\n";
    83 		echo "      <input type=\"hidden\" name=\"recordid\" value=\"" . $_GET["id"] . "\">\n";
    82 		echo "      <input type=\"hidden\" name=\"domainid\" value=\"" . $_GET["domain"] . "\">\n";
    84 		echo "      <input type=\"hidden\" name=\"domainid\" value=\"" . $zid . "\">\n";
    83 		echo "      <tr>\n";
    85 		echo "      <tr>\n";
    84 		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";
    85 		echo "       <td>IN</td>\n";
    87 		echo "       <td>IN</td>\n";
    86 		echo "       <td>\n";
    88 		echo "       <td>\n";
    87 		echo "        <select name=\"type\">\n";
    89 		echo "        <select name=\"type\">\n";