13
|
1 |
<?php |
47
|
2 |
|
119
|
3 |
/* Poweradmin, a friendly web-based admin tool for PowerDNS. |
47
|
4 |
* See <https://rejo.zenger.nl/poweradmin> for more details. |
|
5 |
* |
|
6 |
* Copyright 2007, 2008 Rejo Zenger <rejo@zenger.nl> |
|
7 |
* |
|
8 |
* This program is free software: you can redistribute it and/or modify |
|
9 |
* it under the terms of the GNU General Public License as published by |
|
10 |
* the Free Software Foundation, either version 3 of the License, or |
|
11 |
* (at your option) any later version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
20 |
*/ |
|
21 |
|
13
|
22 |
require_once("inc/toolkit.inc.php"); |
|
23 |
include_once("inc/header.inc.php"); |
|
24 |
|
126
|
25 |
if (verify_permission('zone_content_view_others')) { $perm_view = "all" ; } |
|
26 |
elseif (verify_permission('zone_content_view_own')) { $perm_view = "own" ; } |
82
|
27 |
else { $perm_view = "none" ;} |
|
28 |
|
126
|
29 |
if (verify_permission('zone_content_edit_others')) { $perm_edit = "all" ; } |
|
30 |
elseif (verify_permission('zone_content_edit_own')) { $perm_edit = "own" ;} |
82
|
31 |
else { $perm_edit = "none" ; } |
|
32 |
|
|
33 |
$count_zones_all = zone_count_ng("all"); |
|
34 |
$count_zones_all_letterstart = zone_count_ng($perm_view,LETTERSTART); |
|
35 |
$count_zones_view = zone_count_ng($perm_view); |
|
36 |
$count_zones_edit = zone_count_ng($perm_edit); |
|
37 |
|
|
38 |
echo " <h2>" . _('List zones') . "</h2>\n"; |
|
39 |
|
|
40 |
if ($perm_view == "none") { |
108
|
41 |
echo " <p>" . _('You do not have the permission to see any zones.') . "</p>\n"; |
143
|
42 |
} elseif (($count_zones_view > $iface_rowamount && $count_zones_all_letterstart == "0") || $count_zones_view == 0) { |
191
|
43 |
if ($count_zones_view > $iface_rowamount) { |
|
44 |
echo "<div class=\"showmax\">"; |
|
45 |
show_letters(LETTERSTART); |
|
46 |
echo "</div>"; |
|
47 |
} |
108
|
48 |
echo " <p>" . _('There are no zones to show in this listing.') . "</p>\n"; |
82
|
49 |
} else { |
|
50 |
echo " <div class=\"showmax\">\n"; |
136
|
51 |
show_pages($count_zones_all_letterstart,$iface_rowamount); |
82
|
52 |
echo " </div>\n"; |
20
|
53 |
|
136
|
54 |
if ($count_zones_view > $iface_rowamount) { |
82
|
55 |
echo "<div class=\"showmax\">"; |
|
56 |
show_letters(LETTERSTART); |
|
57 |
echo "</div>"; |
|
58 |
} |
|
59 |
echo " <table>\n"; |
|
60 |
echo " <tr>\n"; |
|
61 |
echo " <th> </th>\n"; |
|
62 |
echo " <th>" . _('Name') . "</th>\n"; |
|
63 |
echo " <th>" . _('Type') . "</th>\n"; |
|
64 |
echo " <th>" . _('Records') . "</th>\n"; |
|
65 |
echo " <th>" . _('Owner') . "</th>\n"; |
171
|
66 |
if ($iface_zonelist_serial == "1") echo " <th>" . _('Serial') . "</th>\n"; |
82
|
67 |
echo " </tr>\n"; |
13
|
68 |
|
136
|
69 |
if ($count_zones_view <= $iface_rowamount) { |
|
70 |
$zones = get_zones($perm_view,$_SESSION['userid'],"all",ROWSTART,$iface_rowamount); |
82
|
71 |
} else { |
136
|
72 |
$zones = get_zones($perm_view,$_SESSION['userid'],LETTERSTART,ROWSTART,$iface_rowamount); |
82
|
73 |
$count_zones_shown = ($zones == -1) ? 0 : count($zones); |
|
74 |
} |
|
75 |
foreach ($zones as $zone) |
|
76 |
{ |
171
|
77 |
$zone_owners = get_fullnames_owners_from_domainid($zone['id']); |
|
78 |
if ($iface_zonelist_serial == "1") $serial = get_serial_by_zid($zone['id']); |
13
|
79 |
|
82
|
80 |
echo " <tr>\n"; |
|
81 |
echo " <td>\n"; |
|
82 |
echo " <a href=\"edit.php?id=" . $zone['id'] . "\"><img src=\"images/edit.gif\" title=\"" . _('View zone') . " " . $zone['name'] . "\" alt=\"[ " . _('View zone') . " " . $zone['name'] . " ]\"></a>\n"; |
|
83 |
if ( $perm_edit != "all" || $perm_edit != "none") { |
|
84 |
$user_is_zone_owner = verify_user_is_owner_zoneid($zone["id"]); |
|
85 |
} |
|
86 |
if ( $perm_edit == "all" || ( $perm_edit == "own" && $user_is_zone_owner == "1") ) { |
|
87 |
echo " <a href=\"delete_domain.php?id=" . $zone["id"] . "\"><img src=\"images/delete.gif\" title=\"" . _('Delete zone') . " " . $zone['name'] . "\" alt=\"[ ". _('Delete zone') . " " . $zone['name'] . " ]\"></a>\n"; |
|
88 |
} |
|
89 |
echo " </td>\n"; |
|
90 |
echo " <td class=\"y\">" . $zone["name"] . "</td>\n"; |
|
91 |
echo " <td class=\"y\">" . strtolower($zone["type"]) . "</td>\n"; |
|
92 |
echo " <td class=\"y\">" . $zone["count_records"] . "</td>\n"; |
|
93 |
echo " <td class=\"y\">" . $zone_owners . "</td>\n"; |
171
|
94 |
if ($iface_zonelist_serial == "1") { |
|
95 |
if ($serial != "") { |
|
96 |
echo " <td class=\"y\">" . $serial . "</td>\n"; |
|
97 |
} else { |
|
98 |
echo " <td class=\"n\"> </td>\n"; |
|
99 |
} |
|
100 |
} |
163
|
101 |
echo " </tr>\n"; |
82
|
102 |
} |
|
103 |
echo " </table>\n"; |
|
104 |
|
13
|
105 |
} |
|
106 |
|
|
107 |
include_once("inc/footer.inc.php"); |
|
108 |
?> |