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
?>
44
+ − 28
<h2> <? echo _ ( 'List all zones' ); ?> </h2>
13
+ − 29
<?
29
+ − 30
echo "<div class= \" showmax \" >" ;
+ − 31
show_pages ( $doms , ROWAMOUNT );
+ − 32
echo "</div>" ;
20
+ − 33
29
+ − 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>
+ − 44
<th> <? echo _ ( 'Name' ); ?> </th>
+ − 45
<th> <? echo _ ( 'Type' ); ?> </th>
+ − 46
<th> <? echo _ ( 'Records' ); ?> </th>
+ − 47
<th> <? echo _ ( 'Owner' ); ?> </th>
+ − 48
</tr>
+ − 49
<tr>
+ − 50
+ − 51
<?
+ − 52
if ( $num_all_domains < ROWAMOUNT ) {
+ − 53
$doms = get_domains ( 0 , "all" , ROWSTART , ROWAMOUNT );
+ − 54
} else {
+ − 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>
+ − 65
<td colspan="4"> <? echo _ ( 'There are no zones.' ); ?> </td>
+ − 66
</tr>
+ − 67
<?
+ − 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>
+ − 79
<a href="edit.php?id= <? echo $c [ "id" ] ?> "><img src="images/edit.gif" title=" <? echo _ ( 'Edit zone' ) . " " . $c [ 'name' ]; ?> " alt="[ <? echo _ ( 'Edit zone' ) . " " . $c [ 'name' ]; ?> ]"></a>
13
+ − 80
<?
36
+ − 81
if ( level ( 5 ))
+ − 82
{
13
+ − 83
?>
+ − 84
<a href="delete_domain.php?id= <? echo $c [ "id" ] ?> "><img src="images/delete.gif" title=" <? print _ ( 'Delete zone' ) . " " . $c [ 'name' ]; ?> " alt="[ <? echo _ ( 'Delete zone' ) . " " . $c [ 'name' ]; ?> ]"></a>
+ − 85
<?
36
+ − 86
}
13
+ − 87
?>
37
+ − 88
</td>
13
+ − 89
<td class="y"> <? echo $c [ "name" ] ?> </td>
26
+ − 90
<td class="y"> <? echo strtolower ( get_domain_type ( $c [ "id" ])) ?> </td>
13
+ − 91
<td class="y"> <? echo $c [ "numrec" ] ?> </td>
36
+ − 92
+ − 93
<?
+ − 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
}
+ − 103
print "<tr> \n " ;
13
+ − 104
}
+ − 105
}
+ − 106
+ − 107
?>
+ − 108
</table>
+ − 109
+ − 110
<?
+ − 111
if ( $num_all_domains < ROWAMOUNT ) {
+ − 112
?>
+ − 113
<p> <? printf ( _ ( 'This lists shows all %s zones(s) you have access to.' ), $num_all_domains ); ?> </p>
+ − 114
<?
+ − 115
}
+ − 116
else
+ − 117
{
+ − 118
?>
+ − 119
<p> <? printf ( _ ( 'This lists shows %s out of %s zones you have access to.' ), $num_show_domains , $num_all_domains ); ?> </p>
+ − 120
<?
+ − 121
}
+ − 122
?>
+ − 123
+ − 124
+ − 125
<? // RZ TODO Check next, does it work?
+ − 126
// <small> echo _('You only administer some records of domains marked with an (*).'); </small>
+ − 127
?>
+ − 128
+ − 129
<?
+ − 130
include_once ( "inc/footer.inc.php" );
+ − 131
?>