13
|
1 |
<?php |
47
|
2 |
|
|
3 |
/* PowerAdmin, a friendly web-based admin tool for PowerDNS. |
|
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 |
|
29
|
25 |
$num_all_domains = zone_count(0); |
|
26 |
$doms = zone_count(0, LETTERSTART); |
13
|
27 |
?> |
71
|
28 |
<h2><?php echo _('List all zones'); ?></h2> |
|
29 |
<?php |
29
|
30 |
echo "<div class=\"showmax\">"; |
75
|
31 |
show_pages($doms,$rowamount); |
29
|
32 |
echo "</div>"; |
20
|
33 |
|
75
|
34 |
if ($num_all_domains > $rowamount) |
13
|
35 |
{ |
29
|
36 |
echo "<div class=\"showmax\">"; |
|
37 |
show_letters(LETTERSTART); |
|
38 |
echo "</div>"; |
13
|
39 |
} |
|
40 |
?> |
|
41 |
<table> |
|
42 |
<tr> |
|
43 |
<th> </th> |
71
|
44 |
<th><?php echo _('Name'); ?></th> |
|
45 |
<th><?php echo _('Type'); ?></th> |
|
46 |
<th><?php echo _('Records'); ?></th> |
|
47 |
<th><?php echo _('Owner'); ?></th> |
13
|
48 |
</tr> |
|
49 |
<tr> |
|
50 |
|
71
|
51 |
<?php |
75
|
52 |
if ($num_all_domains < $rowamount) { |
|
53 |
$doms = get_domains(0,"all",ROWSTART,$rowamount); |
13
|
54 |
} else { |
75
|
55 |
$doms = get_domains(0,LETTERSTART,ROWSTART,$rowamount); |
34
|
56 |
$num_show_domains = ($doms == -1) ? 0 : count($doms); |
13
|
57 |
} |
|
58 |
|
|
59 |
// If the user doesnt have any domains print a message saying so |
|
60 |
if ($doms < 0) |
|
61 |
{ |
|
62 |
?> |
|
63 |
<tr> |
|
64 |
<td> </td> |
71
|
65 |
<td colspan="4"><?php echo _('There are no zones.'); ?></td> |
13
|
66 |
</tr> |
71
|
67 |
<?php |
13
|
68 |
} |
|
69 |
|
|
70 |
// If he has domains, dump them (duh) |
|
71 |
else |
|
72 |
{ |
|
73 |
foreach ($doms as $c) |
|
74 |
{ |
|
75 |
?> |
|
76 |
|
|
77 |
<tr> |
37
|
78 |
<td> |
71
|
79 |
<a href="edit.php?id=<?php echo $c["id"] ?>"><img src="images/edit.gif" title="<?php echo _('Edit zone') . " " . $c['name']; ?>" alt="[ <?php echo _('Edit zone') . " " . $c['name']; ?> ]"></a> |
|
80 |
<?php |
36
|
81 |
if (level(5)) |
|
82 |
{ |
13
|
83 |
?> |
71
|
84 |
<a href="delete_domain.php?id=<?php echo $c["id"] ?>"><img src="images/delete.gif" title="<?php print _('Delete zone') . " " . $c['name']; ?>" alt="[<?php echo _('Delete zone') . " " . $c['name']; ?>]"></a> |
|
85 |
<?php |
36
|
86 |
} |
13
|
87 |
?> |
37
|
88 |
</td> |
71
|
89 |
<td class="y"><?php echo $c["name"] ?></td> |
|
90 |
<td class="y"><?php echo strtolower(get_domain_type($c["id"])) ?></td> |
|
91 |
<td class="y"><?php echo $c["numrec"] ?></td> |
36
|
92 |
|
71
|
93 |
<?php |
36
|
94 |
$zone_owners = get_owners_from_domainid($c["id"]); |
|
95 |
if ($zone_owners == "") |
|
96 |
{ |
|
97 |
echo "<td class=\"n\"></td>"; |
|
98 |
} |
|
99 |
else |
|
100 |
{ |
|
101 |
print "<td class=\"y\">".$zone_owners."</td>"; |
|
102 |
} |
68
|
103 |
print "</tr>\n"; |
13
|
104 |
} |
|
105 |
} |
|
106 |
|
|
107 |
?> |
|
108 |
</table> |
|
109 |
|
71
|
110 |
<?php |
75
|
111 |
if ($num_all_domains < $rowamount) { |
13
|
112 |
?> |
71
|
113 |
<p><?php printf(_('This lists shows all %s zones(s) you have access to.'), $num_all_domains); ?></p> |
|
114 |
<?php |
13
|
115 |
} |
|
116 |
else |
|
117 |
{ |
|
118 |
?> |
71
|
119 |
<p><?php printf(_('This lists shows %s out of %s zones you have access to.'), $num_show_domains, $num_all_domains); ?></p> |
|
120 |
<?php |
13
|
121 |
} |
|
122 |
?> |
|
123 |
|
|
124 |
|
71
|
125 |
<?php // RZ TODO Check next, does it work? |
13
|
126 |
// <small> echo _('You only administer some records of domains marked with an (*).'); </small> |
|
127 |
?> |
|
128 |
|
71
|
129 |
<?php |
13
|
130 |
include_once("inc/footer.inc.php"); |
|
131 |
?> |