diff -r e68c3d6094d1 -r 1ede5203910d edit.php --- a/edit.php Thu Apr 24 21:07:27 2008 +0000 +++ b/edit.php Thu Apr 24 22:33:28 2008 +0000 @@ -69,164 +69,138 @@ delete_owner_from_zone($zone_id, $_POST["delete_owner"]); } -$domain_type=get_domain_type($zone_id); -$record_count=count_zone_records($zone_id); - -echo "

" . _('Edit zone') . " \"" . get_zone_name_from_id($zone_id) . "\"

\n"; - if ( $perm_view == "none" || $perm_view == "own" && $user_is_zone_owner == "0" ) { error(ERR_PERM_VIEW_ZONE); } else { - echo "
\n"; - show_pages($record_count,$iface_rowamount,$zone_id); - echo "
\n"; + + if (zone_id_exists($zone_id) == "0") { + error(ERR_ZONE_NOT_EXIST); + } else { + $domain_type=get_domain_type($zone_id); + $record_count=count_zone_records($zone_id); + + echo "

" . _('Edit zone') . " \"" . get_zone_name_from_id($zone_id) . "\"

\n"; + + echo "
\n"; + show_pages($record_count,$iface_rowamount,$zone_id); + echo "
\n"; - $records = get_records_from_domain_id($zone_id,ROWSTART,$iface_rowamount); - if ( $records == "-1" ) { - echo "

" . _("This zone does not have any records. Weird.") . "

\n"; - } else { - echo "
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - foreach ($records as $r) { - echo " \n"; - echo " \n"; + $records = get_records_from_domain_id($zone_id,ROWSTART,$iface_rowamount); + if ( $records == "-1" ) { + echo "

" . _("This zone does not have any records. Weird.") . "

\n"; + } else { + echo " \n"; + echo "
 " . _('Name') . "" . _('Type') . "" . _('Content') . "" . _('Priority') . "" . _('TTL') . "
\n"; echo " \n"; - if ( $domain_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0" ) { - echo " \n"; - } else { - echo " \n"; - } - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + foreach ($records as $r) { + echo " \n"; + echo " \n"; + echo " \n"; + if ( $domain_type == "SLAVE" || $perm_content_edit == "none" || $perm_content_edit == "own" && $user_is_zone_owner == "0" ) { + echo " \n"; } else { - $add = ""; + echo " \n"; } - echo " " . $type_available . "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + if ($r['type'] == "MX") { + echo " \n"; + } else { + echo " \n"; + } + echo " \n"; + echo " \n"; } - echo " \n"; - echo " \n"; - echo " \n"; - if ($r['type'] == "MX") { - echo " \n"; - } else { - echo " \n"; - } - echo " \n"; - echo " \n"; - } - echo "
 \n"; - echo " - \"[\n"; - echo " - \"[\n"; - echo " \n"; - echo "  " . _('Name') . "" . _('Type') . "" . _('Content') . "" . _('Priority') . "" . _('TTL') . "
 \n"; + echo " + \"[\n"; + echo " + \"[\n"; + echo " \n"; + echo " \n"; + echo "  
 
\n"; - echo " \n"; - echo "
"; - } - - if ( $perm_content_edit == "all" || $perm_content_edit == "own" && $user_is_zone_owner == "1" ) { - if ( $domain_type != "SLAVE") { - echo "   \n"; + echo " \n"; + echo " \n"; + echo " "; } - echo " \n"; - } - - echo "
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - - $owners = get_users_from_domain_id($zone_id); - - if ($owners == "-1") { - echo " "; - } else { - if ($meta_edit) { - foreach ($owners as $owner) { - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + + if ( $perm_content_edit == "all" || $perm_content_edit == "own" && $user_is_zone_owner == "1" ) { + if ( $domain_type != "SLAVE") { + echo "   \n"; } - } else { - foreach ($owners as $owner) { - echo " "; - } + echo " \n"; } - } - if ($meta_edit) { - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - } - echo " \n"; - echo " \n"; - echo " \n"; + echo "
\n"; + echo "
" . _('Owner of zone') . "
" . _('No owner set for this zone.') . "
" . $owner["fullname"] . "\n"; - echo " \n"; - echo " \n"; - echo "
" . $owner["fullname"] . " 
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
" . _('Type') . "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + + $owners = get_users_from_domain_id($zone_id); - if ($meta_edit) { - echo " \n"; - echo " \n"; - echo " \n"; - echo " "; + } else { + if ($meta_edit) { + foreach ($owners as $owner) { + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + } + } else { + foreach ($owners as $owner) { + echo " "; + } } - echo " " . strtolower($type) . "\n"; + } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - } else { - echo " \n"; - } - - if ($domain_type == "SLAVE" ) { - $slave_master=get_domain_slave_master($zone_id); + if ($meta_edit) { + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + } echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; if ($meta_edit) { @@ -234,19 +208,50 @@ echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; } else { - echo " \n"; + echo " \n"; } + + if ($domain_type == "SLAVE" ) { + $slave_master=get_domain_slave_master($zone_id); + echo " \n"; + echo " \n"; + echo " \n"; + + if ($meta_edit) { + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + } else { + echo " \n"; + } + } + echo "
" . _('Owner of zone') . "
\n"; - echo "
" . _('No owner set for this zone.') . "
" . $owner["fullname"] . "\n"; + echo " \n"; + echo " \n"; + echo "
" . $owner["fullname"] . " 
\n"; - echo " \n"; - echo "
" . strtolower($domain_type) . " 
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
" . _('IP address of master NS') . "" . _('Type') . "
\n"; - echo " \n"; + echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
" . $slave_master . " 
" . strtolower($domain_type) . " 
" . _('IP address of master NS') . "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
" . $slave_master . " 
\n"; + echo "
\n"; // eo div meta } - echo " \n"; - echo " \n"; // eo div meta } include_once("inc/footer.inc.php");