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
82
+ − 25
if ( verify_permission ( zone_content_view_others )) { $perm_view = "all" ; }
+ − 26
elseif ( verify_permission ( zone_content_view_own )) { $perm_view = "own" ; }
+ − 27
else { $perm_view = "none" ;}
+ − 28
+ − 29
if ( verify_permission ( zone_content_edit_others )) { $perm_edit = "all" ; }
+ − 30
elseif ( verify_permission ( zone_content_edit_own )) { $perm_edit = "own" ;}
+ − 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 " ;
+ − 42
} elseif ( $count_zones_view > ROWAMOUNT && $count_zones_all_letterstart == "0" ) {
+ − 43
echo " <p>" . _ ( 'There are no zones to show in this listing.' ) . "</p> \n " ;
82
+ − 44
} else {
+ − 45
echo " <div class= \" showmax \" > \n " ;
+ − 46
show_pages ( $count_zones_all_letterstart , ROWAMOUNT );
+ − 47
echo " </div> \n " ;
20
+ − 48
82
+ − 49
if ( $count_zones_view > ROWAMOUNT ) {
+ − 50
echo "<div class= \" showmax \" >" ;
+ − 51
show_letters ( LETTERSTART );
+ − 52
echo "</div>" ;
+ − 53
}
+ − 54
echo " <table> \n " ;
+ − 55
echo " <tr> \n " ;
+ − 56
echo " <th> </th> \n " ;
+ − 57
echo " <th>" . _ ( 'Name' ) . "</th> \n " ;
+ − 58
echo " <th>" . _ ( 'Type' ) . "</th> \n " ;
+ − 59
echo " <th>" . _ ( 'Records' ) . "</th> \n " ;
+ − 60
echo " <th>" . _ ( 'Owner' ) . "</th> \n " ;
+ − 61
echo " </tr> \n " ;
+ − 62
echo " <tr> \n " ;
13
+ − 63
82
+ − 64
if ( $count_zones_view < ROWAMOUNT ) {
+ − 65
$zones = get_zones ( $perm_view , $_SESSION [ 'userid' ], "all" , ROWSTART , ROWAMOUNT );
+ − 66
} else {
+ − 67
$zones = get_zones ( $perm_view , $_SESSION [ 'userid' ], LETTERSTART , ROWSTART , ROWAMOUNT );
+ − 68
$count_zones_shown = ( $zones == - 1 ) ? 0 : count ( $zones );
+ − 69
}
+ − 70
foreach ( $zones as $zone )
+ − 71
{
+ − 72
$zone_owners = get_fullnames_owners_from_domainid ( $zone [ "id" ]);
13
+ − 73
82
+ − 74
echo " <tr> \n " ;
+ − 75
echo " <td> \n " ;
+ − 76
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 " ;
+ − 77
if ( $perm_edit != "all" || $perm_edit != "none" ) {
+ − 78
$user_is_zone_owner = verify_user_is_owner_zoneid ( $zone [ "id" ]);
+ − 79
}
+ − 80
if ( $perm_edit == "all" || ( $perm_edit == "own" && $user_is_zone_owner == "1" ) ) {
+ − 81
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 " ;
+ − 82
}
+ − 83
echo " </td> \n " ;
+ − 84
echo " <td class= \" y \" >" . $zone [ "name" ] . "</td> \n " ;
+ − 85
echo " <td class= \" y \" >" . strtolower ( $zone [ "type" ]) . "</td> \n " ;
+ − 86
echo " <td class= \" y \" >" . $zone [ "count_records" ] . "</td> \n " ;
+ − 87
echo " <td class= \" y \" >" . $zone_owners . "</td> \n " ;
+ − 88
}
+ − 89
echo " </tr> \n " ;
+ − 90
echo " </table> \n " ;
+ − 91
13
+ − 92
}
+ − 93
+ − 94
include_once ( "inc/footer.inc.php" );
+ − 95
?>