list_supermasters.php
author peter
Mon, 11 Feb 2008 18:42:04 +0000
changeset 73 8a239565e9b3
parent 71 e1b918eaf69a
child 82 c255196bc447
permissions -rw-r--r--
[feladat @ 120] Fixed a bug reported by Techwolf. When editing or deleting an user the user was redirected to a non existing page. This probably happened when BASE_URL and/or BASE_PATH was set wrong in the config.inc.php.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
     1
<?php
47
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
     2
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
     3
/*  PowerAdmin, a friendly web-based admin tool for PowerDNS.
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
     4
 *  See <https://rejo.zenger.nl/poweradmin> for more details.
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
     5
 *
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
     6
 *  Copyright 2007, 2008  Rejo Zenger <rejo@zenger.nl>
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
     7
 *
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
     8
 *  This program is free software: you can redistribute it and/or modify
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
     9
 *  it under the terms of the GNU General Public License as published by
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    10
 *  the Free Software Foundation, either version 3 of the License, or
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    11
 *  (at your option) any later version.
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    12
 *
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    13
 *  This program is distributed in the hope that it will be useful,
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    16
 *  GNU General Public License for more details.
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    17
 *
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    18
 *  You should have received a copy of the GNU General Public License
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    19
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    20
 */
ae140472d97c [feladat @ 94]
rejo
parents: 15
diff changeset
    21
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    22
require_once("inc/toolkit.inc.php");
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    23
include_once("inc/header.inc.php");
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    24
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    25
if (!level(5))
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    26
{
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    27
?>
71
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    28
     <h3><?php echo _('Oops!'); ?></h3>
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    29
     <p><?php echo _('You are not allowed to add supermasters with your current access level!'); ?></p>
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    30
<?php
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    31
} 
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    32
else
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    33
{
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    34
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    35
	$supermasters = get_supermasters(0);
15
305cee3b388d [feladat @ 62]
rejo
parents: 13
diff changeset
    36
	$num_supermasters = ($supermasters == -1) ? 0 : count($supermasters);
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    37
	?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    38
71
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    39
	   <h3><?php printf(_('List all %s supermasters'), $num_supermasters); ?></h3>
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    40
	   <table>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    41
	    <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    42
	     <th>&nbsp;</td>
71
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    43
	     <th><?php echo _('IP address of supermaster'); ?></td>
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    44
	     <th><?php echo _('Hostname in NS record'); ?></td>
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    45
	     <th><?php echo _('Account'); ?></td>
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    46
	    </tr>
71
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    47
	<?php
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    48
	   if ($num_supermasters == 0)
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    49
	   {
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    50
	?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    51
	    <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    52
	     <td class="n">&nbsp;</td>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    53
	     <td class="n" colspan="3">
71
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    54
	      <?php echo _('No supermasters in this listing, sorry.'); ?>
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    55
	     </td>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    56
	    </tr>
71
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    57
	<?php
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    58
	   }
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    59
	   else
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    60
	   {
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    61
		   foreach ($supermasters as $c)
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    62
		   {
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    63
	?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    64
	    <tr>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    65
	     <td class="n">
71
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    66
	      <a href="delete_supermaster.php?master_ip=<?php echo $c["master_ip"] ?>"><img src="images/delete.gif" title="<?php print _('Delete supermaster') . ' ' . $c["master_ip"]; ?>" alt="[ <?php echo _('Delete supermaster'); ?> ]"></a>
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    67
	     </td>
71
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    68
	     <td class="y"><?php echo $c["master_ip"] ?></td>
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    69
	     <td class="y"><?php echo $c["ns_name"] ?></td>
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    70
	     <td class="y"><?php echo $c["account"] ?></td>
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    71
	    </tr>
71
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    72
	<?php
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    73
		   }
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    74
	   }
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    75
	?>
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    76
	   </table>
71
e1b918eaf69a [feladat @ 118]
peter
parents: 50
diff changeset
    77
<?php
13
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    78
}
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    79
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    80
include_once("inc/footer.inc.php");
2ff220cfde13 [feladat @ 60]
rejo
parents:
diff changeset
    81
?>