for more details. * * Copyright 2007-2010 Rejo Zenger * Copyright 2010-2014 Poweradmin Development Team * * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * Script that displays zone list * * @package Poweradmin * @copyright 2007-2010 Rejo Zenger * @copyright 2010-2014 Poweradmin Development Team * @license http://opensource.org/licenses/GPL-3.0 GPL */ require_once("inc/toolkit.inc.php"); include_once("inc/header.inc.php"); global $pdnssec_use; 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_edit = "all"; } elseif (verify_permission('zone_content_edit_own')) { $perm_edit = "own"; } else { $perm_edit = "none"; } $count_zones_all = zone_count_ng("all"); $count_zones_all_letterstart = zone_count_ng($perm_view, LETTERSTART); $count_zones_view = zone_count_ng($perm_view); $count_zones_edit = zone_count_ng($perm_edit); # OUCH: Temporary workaround for nasty sorting issue. # The problem is that sorting order is saved as a session variable # and it's used in two different screens - zone list and search results. # Both have different queries for getting data, but same order field # that causes failure. $zone_sort_by = ZONE_SORT_BY; if (!in_array(ZONE_SORT_BY, array('name', 'type', 'count_records'))) { $zone_sort_by = 'name'; } echo "

" . _('List zones') . "

\n"; if ($perm_view == "none") { echo "

" . _('You do not have the permission to see any zones.') . "

\n"; } elseif (($count_zones_view > $iface_rowamount && $count_zones_all_letterstart == "0") || $count_zones_view == 0) { if ($count_zones_view > $iface_rowamount) { echo "
"; show_letters(LETTERSTART); echo "
"; } echo "

" . _('There are no zones to show in this listing.') . "

\n"; } else { if (LETTERSTART != 'all') { echo "
\n"; show_pages($count_zones_all_letterstart, $iface_rowamount); echo "
\n"; } if ($count_zones_view > $iface_rowamount) { echo "
"; show_letters(LETTERSTART); echo "
"; } echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if ($iface_zonelist_serial) { echo " \n"; } if ($pdnssec_use) { echo " \n"; } echo " \n"; if ($count_zones_view <= $iface_rowamount) { $zones = get_zones($perm_view, $_SESSION['userid'], "all", ROWSTART, $iface_rowamount, $zone_sort_by); } elseif (LETTERSTART == 'all') { $zones = get_zones($perm_view, $_SESSION['userid'], "all", ROWSTART, 'all', $zone_sort_by); } else { $zones = get_zones($perm_view, $_SESSION['userid'], LETTERSTART, ROWSTART, $iface_rowamount, $zone_sort_by); $count_zones_shown = ($zones == -1) ? 0 : count($zones); } foreach ($zones as $zone) { if ($zone['count_records'] == NULL) { $zone['count_records'] = 0; } $zone_owners = get_fullnames_owners_from_domainid($zone['id']); if ($iface_zonelist_serial) $serial = get_serial_by_zid($zone['id']); if ($perm_edit != "all" || $perm_edit != "none") { $user_is_zone_owner = verify_user_is_owner_zoneid($zone["id"]); } echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; if ($iface_zonelist_serial) { if ($serial != "") { echo " \n"; } else { echo " \n"; } } if ($pdnssec_use) { echo " \n"; } echo " \n"; } echo "
  " . _('Name') . "" . _('Type') . "" . _('Records') . "" . _('Owner') . "" . _('Serial') . "" . _('DNSSEC') . "
\n"; if ($count_zones_edit > 0 && ($perm_edit == "all" || ( $perm_edit == "own" && $user_is_zone_owner == "1"))) { echo " "; } echo " \n"; echo " \"[\n"; if ($perm_edit == "all" || ( $perm_edit == "own" && $user_is_zone_owner == "1")) { echo " \"[\n"; } echo " " . $zone["name"] . "" . strtolower($zone["type"]) . "" . $zone["count_records"] . "" . $zone_owners . "" . $serial . " 
\n"; echo " \n"; echo "
\n"; } include_once("inc/footer.inc.php");