|
|
@@ -3,6 +3,16 @@ $default_displayed=50;
|
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
|
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . $language . ".php");
|
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
|
|
|
+
|
|
|
+if (isset($_POST["removeRule"])) {
|
|
|
+ $r_id = $_POST["f_id"];
|
|
|
+ foreach ($r_id as $key => $val) {
|
|
|
+ if ($val) { delete_record($db_link, "auth_rules", "id=".$val); }
|
|
|
+ }
|
|
|
+ header("Location: " . $_SERVER["REQUEST_URI"]);
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+
|
|
|
print_ip_submenu($page_url);
|
|
|
?>
|
|
|
<div id="cont">
|
|
|
@@ -11,7 +21,6 @@ print_ip_submenu($page_url);
|
|
|
<table class="data">
|
|
|
<tr><td><b>Отображать:<?php print_row_at_pages('rows',$displayed); ?> <input type="submit" value="Показать"> </td></tr>
|
|
|
</table>
|
|
|
-</form>
|
|
|
<?php
|
|
|
fix_auth_rules($db_link);
|
|
|
$countSQL="SELECT Count(*) FROM auth_rules";
|
|
|
@@ -25,21 +34,24 @@ print_navigation($page_url,$page,$displayed,$count_records[0],$total);
|
|
|
?>
|
|
|
<table class="data">
|
|
|
<tr align="center">
|
|
|
+<td><input type="checkbox" onClick="checkAll(this.checked);"></td>
|
|
|
<td><b>Тип</b></td>
|
|
|
<td><b>Правило</b></td>
|
|
|
<td><b>Юзер/Группа</b></td>
|
|
|
+<td align=right><input type="submit" onclick="return confirm('Удалить выделенных?')" name="removeRule" value="Удалить"></td>
|
|
|
</tr>
|
|
|
<?php
|
|
|
$t_auth_rules = get_records_sql($db_link,"SELECT * FROM auth_rules ORDER BY id LIMIT $start,$displayed");
|
|
|
foreach ( $t_auth_rules as $row ) {
|
|
|
print "<tr align=center>\n";
|
|
|
- print "<td class=\"data\">";
|
|
|
+ print "<td class=\"data\" style='padding:0'><input type=checkbox name=f_id[] value=".$row["id"]." ></td>\n";
|
|
|
+ print "<td class=\"data\">";
|
|
|
if ($row['type'] == 1) { print "Subnet"; }
|
|
|
if ($row['type'] == 2) { print "Mac"; }
|
|
|
if ($row['type'] == 3) { print "Hostname"; }
|
|
|
print "</td>\n";
|
|
|
print "<td class=\"data\">".$row['rule']."</td>\n";
|
|
|
- print "<td class=\"data\" align=left>";
|
|
|
+ print "<td colspan=2 class=\"data\" align=left>";
|
|
|
if (!empty($row['user_id'])) {
|
|
|
$user_info=get_record_sql($db_link,"SELECT * FROM User_list WHERE id=".$row['user_id']);
|
|
|
if (!empty($user_info)) { print "User:  "; print_url($user_info['login'],'/admin/users/edituser.php?id='.$user_info['id']); }
|
|
|
@@ -53,6 +65,7 @@ foreach ( $t_auth_rules as $row ) {
|
|
|
}
|
|
|
?>
|
|
|
</table>
|
|
|
+</form>
|
|
|
<?php
|
|
|
print_navigation($page_url,$page,$displayed,$count_records[0],$total);
|
|
|
require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php");
|