2 require_once(
"../class/config.php");
3 include_once(
"head.php");
7 "delete_id" => array (
"get",
"integer",
""),
8 "id" => array (
"post",
"integer", 0),
9 "ipsub" => array (
"post",
"string",
""),
10 "infos" => array (
"post",
"string" ,
""),
11 "s_ipsub" => array (
"post",
"integer",
""),
12 "s_protocol" => array (
"post",
"string",
""),
16 if (!empty($delete_id)) {
17 if (!
$authip->ip_delete($delete_id)) {
18 $error=
"Error during deletion";
24 $error=
"Error during recording";
31 <h3><?php
__(
"Access security"); ?></h3>
36 <p
class=
"alert alert-danger"><?php echo
$error ?></p>
39 <p
class=
"alert alert-warning"><?php
__(
"Warning"); echo
"<br/>";
__(
"The IP and subnet you have here are allowed for ALL users and ALL usages"); ?></p>
44 <legend><?php
__(
"Add an IP");?> - <a href=
"javascript:edit_ip('','<?php echo htmlentities(get_remote_ip())."','Home IP
'";?>);" ><?php echo __("Add my current IP"); ?></a></legend>
45 <span id="form_add_ip">
46 <form method="post" action="adm_authip_whitelist.php" name="main" id="main">
47 <p id="reset_edit_ip" style="display:none;"><a href="javascript:reset_edit_ip();"><?php __("Cancel edit")?></a></p>
48 <input type="hidden" name="id" value="" id="edit_id" />
50 <?php __("Enter here the IP address you want. <br/> <i>IPv4, IPv6 and subnet allowed</i>"); ?> <br/>
51 <input type="text" size='20
' maxlength='39
' name="ipsub" id="edit_ip" />
54 <?php __("Add a comment");?><br/>
55 <input type="text" size='25
' maxlength='200
' name="infos" id="edit_infos" />
57 <input type="submit" class="inb" value="<?php __("Save")?>" />
64 <tr><th><?php __("Type"); ?></th><th><?php __("IP"); ?></th><th><?php __("Informations"); ?></th><th colspan='2
' /></tr>
66 foreach($list_ip as $i) {
67 if (checkip($i['ip
'])) {
68 if ($i['subnet
']==32) {
73 } elseif (checkipv6($i['ip
'])) {
74 if ($i['subnet
']==128) {
80 echo "<tr class='lst
'><td>$txt</td><td>{$i['ip_human
']}</td><td>{$i['infos
']}</td>";
82 <td><div class="ina edit"><a href="javascript:edit_ip(<?php echo "'".htmlentities($i['id'])."','".htmlentities($i['ip_human'])."','".htmlentities($i['infos'])."'"; ?>);"><?php __("Edit"); ?></a></div></td>
83 <td><div class="ina delete"><a href="adm_authip_whitelist.php?delete_id=<?php echo urlencode($i["id"]) ?>"><?php __("Delete"); ?></a></div></td>
89 <script type="text/javascript">
90 function reset_edit_ip() {
91 $("#reset_edit_ip").hide();
92 $("#edit_id").val('');
93 $("#edit_ip").val('');
94 $("#edit_infos").val('');
97 function edit_ip(id, iph, infos) {
99 $("#reset_edit_ip").show();
101 $("#edit_id").val(id);
102 $("#edit_infos").val(infos);
103 $("#edit_ip").val(iph);
107 <?php include_once("foot.php"); ?>