diff -r c72d6d51f3d3 -r c255196bc447 edit_record.php --- a/edit_record.php Wed Mar 12 20:45:56 2008 +0000 +++ b/edit_record.php Tue Mar 25 22:45:31 2008 +0000 @@ -20,135 +20,94 @@ */ require_once("inc/toolkit.inc.php"); +include_once("inc/header.inc.php"); -if (isset($_GET["delid"]) && isset($_GET['delid']) && isset($_GET['id'])) { - delete_record_owner($_GET["domain"],$_GET["delid"],$_GET["id"]); -} +if (verify_permission(zone_content_view_others)) { $perm_view = "all" ; } +elseif (verify_permission(zone_content_view_own)) { $perm_view = "own" ; } +else { $perm_view = "none" ; } + +if (verify_permission(zone_content_edit_others)) { $perm_content_edit = "all" ; } +elseif (verify_permission(zone_content_edit_own)) { $perm_content_edit = "own" ; } +else { $perm_content_edit = "none" ; } + +if (verify_permission(zone_meta_edit_others)) { $perm_meta_edit = "all" ; } +elseif (verify_permission(zone_meta_edit_own)) { $perm_meta_edit = "own" ; } +else { $perm_meta_edit = "none" ; } -$xsid = (isset($_GET['id'])) ? $_GET['id'] : $_POST['recordid']; +$user_is_zone_owner = verify_user_is_owner_zoneid($_GET["domain"]); +$zone_type = get_domain_type($_GET["domain"]); +$zone_name = get_domain_name_from_id($_GET["domain"]); -if(!xs(recid_to_domid($xsid))) -{ - error(ERR_RECORD_ACCESS_DENIED); +if ($_POST["commit"]) { + if ( $zone_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0" ) { + error(ERR_PERM_EDIT_RECORD); + } else { + $ret_val = edit_record($_POST["recordid"], $_POST["domainid"], $_POST["name"], $_POST["type"], $_POST["content"], $_POST["ttl"], $_POST["prio"]); + if ( $ret_val == "1" ) { + success(SUC_RECORD_UPD); + } else { + echo "