26 require_once(
"../class/config.php");
27 include_once(
"head.php");
31 "delete_id" => array (
"get",
"integer",
""),
32 "id" => array (
"post",
"integer", 0),
33 "ipsub" => array (
"post",
"string",
""),
34 "infos" => array (
"post",
"string" ,
""),
35 "s_ipsub" => array (
"post",
"integer",
""),
36 "s_protocol" => array (
"post",
"string",
""),
40 if (!empty($delete_id)) {
41 if (!
$authip->ip_delete($delete_id)) {
42 $msg->raise(
"ERROR",
"admin", _(
"Error during deletion"));
48 $msg->raise(
"ERROR",
"admin", _(
"Error during recording"));
55 <h3><?php
__(
"Access security"); ?></h3>
59 <?php echo
$msg->msg_html_all(); ?>
62 <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>
67 <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>
68 <span id="form_add_ip">
69 <form method="post" action="adm_authip_whitelist.php" name="main" id="main">
71 <p id="reset_edit_ip" style="display:none;"><a href="javascript:reset_edit_ip();"><?php __("Cancel edit")?></a></p>
72 <input type="hidden" name="id" value="" id="edit_id" />
74 <?php __("Enter here the IP address you want. <br/> <i>IPv4, IPv6 and subnet allowed</i>"); ?> <br/>
75 <input type="text" size="20" maxlength="39" name="ipsub" id="edit_ip" />
78 <?php __("Add a comment");?><br/>
79 <input type="text" size="25" maxlength="200" name="infos" id="edit_infos" />
81 <input type="submit" class="inb" value="<?php __("Save")?>" />
88 <tr><th><?php __("Type"); ?></th><th><?php __("IP"); ?></th><th><?php __("Informations"); ?></th><th colspan="2" /></tr>
90 foreach($list_ip as $i) {
91 if (checkip($i['ip
'])) {
92 if ($i['subnet
']==32) {
97 } elseif (checkipv6($i['ip
'])) {
98 if ($i['subnet
']==128) {
106 echo "<tr class=\"lst\"><td>$txt</td><td>{$i['ip_human
']}</td><td>{$i['infos
']}</td>";
108 <td><div class="ina edit"><a href="javascript:edit_ip(<?php echo "'".urlencode($i['id'])."','".urlencode($i['ip_human'])."','".urlencode($i['infos'])."'"; ?>);"><?php __("Edit"); ?></a></div></td>
109 <td><div class="ina delete"><a href="adm_authip_whitelist.php?delete_id=<?php eue($i["id"]); ?>"><?php __("Delete"); ?></a></div></td>
115 <script type="text/javascript">
116 function reset_edit_ip() {
117 $("#reset_edit_ip").hide();
118 $("#edit_id").val('');
119 $("#edit_ip").val('');
120 $("#edit_infos").val('');
123 function edit_ip(id, iph, infos) {
125 $("#reset_edit_ip").show();
127 $("#edit_id").val(id);
128 $("#edit_infos").val(infos);
129 $("#edit_ip").val(iph);
133 <?php include_once("foot.php"); ?>
if(!empty($delete_id)) if(!empty($ipsub)) $list_ip
$fields
Manages Whitelists in IP auth module.
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
if(!isset($is_include)) if(! $key &&! $crt) $id
if(in_array($action, array('start', 'stop', 'monit'))) switch($action) if($lxc->error &&! $script) $infos