root/alternc/trunk/bureau/admin/adm_slaveip.php

Revision 340, 3.7 kB (checked in by anarcat, 3 years ago)

[project @ alternc: changeset 2004-06-02 13:03:13 by anonymous]
ajout de la gestion des comptes d'esclaves DNS correction sql : ajout
de if exists

Original author: anonymous
Date: 2004-06-02 13:03:13

Line 
1 <?php
2 /*
3  $Id: adm_slaveip.php,v 1.2 2004/06/02 13:03:13 anonymous Exp $
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2002 by the AlternC Development Team.
7  http://alternc.org/
8  ----------------------------------------------------------------------
9  Based on:
10  Valentin Lacambre's web hosting softwares: http://altern.org/
11  ----------------------------------------------------------------------
12  LICENSE
13
14  This program is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License (GPL)
16  as published by the Free Software Foundation; either version 2
17  of the License, or (at your option) any later version.
18
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  GNU General Public License for more details.
23
24  To read the license please visit http://www.gnu.org/copyleft/gpl.html
25  ----------------------------------------------------------------------
26  Original Author of file: Benjamin Sonntag
27  Purpose of file: Manage list of allowed ip for zone transfers
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31
32 if (!$admin->enabled) {
33     __("This page is restricted to authorized staff");
34     exit();
35 }
36
37 if ($delip) {
38     // Delete an ip address/class
39     if ($dom->del_slave_ip($delip)) {
40         $error=_("The requested ip address has been deleted. It will be denied in one hour.");
41     }
42 }
43 if ($newip) {
44     // Add an ip address/class
45     if ($dom->add_slave_ip($newip,$newclass)) {
46         $error=_("The requested ip address has been added to the list. It will be allowed in one hour.");
47         unset($newip); unset($newclass);
48     }
49 }
50
51 if (!$newclass) $newclass=32;
52
53 include("head.php");
54 ?>
55 </head>
56 <body>
57 <h3><?php __("Manage allowed ip for slave zone transfers"); ?></h3>
58 <?php
59     if ($error) {
60       echo "<p class=\"error\">$error</p>";
61     }
62
63 $c=$dom->enum_slave_ip();
64
65 if (is_array($c)) {
66
67 ?>
68 <p>
69 <?php __("Here is the list of the allowed ip or ip class for slave dns zone transfer requests (AXFR). You must add the ip address of all the slave DNS you have so that those slaves will be allowed to transfer the zone files. There is also some defaults ip from DNS checks made by some third-party technical offices such as afnic (for .fr domains)"); ?>
70 </p>
71
72 <table border="0" cellpadding="4" cellspacing="0">
73 <tr><th><?php __("Action"); ?></th><th><?php __("IP Address"); ?></th></tr>
74 <?php
75 $col=1;
76 for($i=0;$i<count($c);$i++) {
77  $col=3-$col;
78 ?>
79
80 <tr class="lst<?php echo $col; ?>">
81 <td><a href="adm_slaveip.php?delip=<?php echo urlencode($c[$i][ip]); ?>"><?php __("Delete"); ?></a></td>
82 <td><?php echo $c[$i]["ip"]."/".$c[$i]["class"]; ?></td>
83 </tr>
84 <?php
85 }
86 ?>
87 </table>
88     <?php } ?>
89 <p><?php __("If you want to allow an ip address or class to connect to your dns server, enter it here. Choose 32 as a prefix for single ip address."); ?></p>
90 <form method="post" action="adm_slaveip.php">
91 <table border="0" cellpadding="4" cellspacing="0">
92 <tr><th><label for="newip"><?php __("IP Address"); ?></label></th><th><label for="newclass"><?php __("Prefix"); ?></label></th></tr>
93 <tr>
94     <td style="text-align: right"><input type="text" class="int" value="<?php echo urlencode($newip); ?>" id="newip" name="newip" maxlength="15" size="20" style="text-align:right" /> / </td>
95     <td><input type="text" class="int" value="<?php echo urlencode($newclass); ?>" id="newclass" name="newclass" maxlength="2" size="3" /></td>
96 </tr>
97 <tr><td colspan="2">
98     <input type="submit" value="<?php __("Add this ip to the slave list"); ?>" class="inb" />
99 </table>
100
101 </form>
102 </body>
103 </html>
104
Note: See TracBrowser for help on using the browser.