Explorar o código

rename editswitches to editdevice.
bugfix: fixed edit user_acl field for device

Dmitriev Roman %!s(int64=5) %!d(string=hai) anos
pai
achega
f54eb41e63

+ 1 - 1
html/admin/devices/deleted.php

@@ -26,7 +26,7 @@ foreach ($switches as $row) {
     	    }
 	}
     print "<td class=\"$cl\"><input type=hidden name=\"id\" value=".$row['id'].">".$row['id']."</td>\n";
-    print "<td class=\"$cl\" align=left><a href=editswitches.php?id=".$row['id'].">" . $row['device_name'] . "</a></td>\n";
+    print "<td class=\"$cl\" align=left><a href=editdevice.php?id=".$row['id'].">" . $row['device_name'] . "</a></td>\n";
     print "<td class=\"$cl\">".$row['ip']."</td>\n";
     print "<td class=\"$cl\">" . get_vendor_name($db_link, $row['vendor_id']) . " " . $row['device_model'] . "</td>\n";
     print "<td class=\"$cl\">" . get_building($db_link, $row['building_id']) . "(" . $row['comment'] . ")</td>\n";

+ 1 - 1
html/admin/devices/edit_l3int.php

@@ -52,7 +52,7 @@ require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
 <div id="cont">
 <br>
 <form name="def" action="edit_l3int.php" method="post">
-<b>Список L3 интерфейсов <?php print_url($device_info['device_name'],"/admin/devices/editswitches.php?id=$id"); ?></b> <br>
+<b>Список L3 интерфейсов <?php print_url($device_info['device_name'],"/admin/devices/editdevice.php?id=$id"); ?></b> <br>
 <table class="data">
 <tr align="center">
 	<td></td>

+ 4 - 4
html/admin/devices/editswitches.php → html/admin/devices/editdevice.php

@@ -3,7 +3,7 @@ require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . $language . ".php");
 require_once ($_SERVER['DOCUMENT_ROOT']."/inc/idfilter.php");
 
-if (isset($_POST["editswitches"]) and isset($id)) {
+if (isset($_POST["editdevice"]) and isset($id)) {
     if (isset($_POST["f_port_count"])) {
         $sw_ports = $_POST["f_port_count"] * 1;
     } else {
@@ -56,7 +56,7 @@ if (isset($_POST["editswitches"]) and isset($id)) {
     if (isset($_POST["f_fdb_snmp"])) { $new['fdb_snmp_index'] = $_POST["f_fdb_snmp"]; }
     if (isset($_POST["f_discovery"])) { $new['discovery'] = $_POST["f_discovery"]; }
     if (isset($_POST["f_dhcp"])) { $new['dhcp'] = $_POST["f_dhcp"] * 1; }
-    if (isset($_POST["f_user_acl"])) { $new['user_acl'] = $_POST["user_acl"] * 1; }
+    if (isset($_POST["f_user_acl"])) { $new['user_acl'] = $_POST["f_user_acl"] * 1; }
     if (isset($_POST["f_wan"])) { $new['wan_int'] = $_POST["f_wan"]; }
     if (isset($_POST["f_lan"])) { $new['lan_int'] = $_POST["f_lan"]; }
     if (isset($_POST["f_building_id"])) { $new['building_id'] = $_POST["f_building_id"] * 1; }
@@ -86,7 +86,7 @@ print_editdevice_submenu($page_url,$id);
 
 ?>
 <div id="cont">
-<form name="def" action="editswitches.php?id=<? echo $id; ?>" method="post">
+<form name="def" action="editdevice.php?id=<? echo $id; ?>" method="post">
 <table class="data">
 <tr>
 <td>Название</td>
@@ -175,7 +175,7 @@ print "<td><button name=\"port_walk\" onclick=\"window.open('mactable.php?id=" .
 print "<button name=\"port_walk\" onclick=\"window.open('snmpwalk.php?id=" . $id . "')\">Port Walk</button>";
 print "<td align=right>";
 if ($device['deleted']) { print "<input type=\"submit\" name=\"undelete\" value=\"Воскресить\">"; }
-print "<input type=\"submit\" name=\"editswitches\" value=\"Сохранить\"></td>\n";
+print "<input type=\"submit\" name=\"editdevice\" value=\"Сохранить\"></td>\n";
 print "</tr>\n";
 print "</table>\n";
 ?>

+ 1 - 1
html/admin/devices/editport.php

@@ -16,7 +16,7 @@ if (isset($_POST["editport"])) {
 
     // redirect to device
     $device_id = get_record_field($db_link,'device_ports','device_id',"id=".$id);
-    header("location: editswitches.php?id=$device_id");
+    header("location: editdevice.php?id=$device_id");
 }
 
 unset($_POST);

+ 2 - 2
html/admin/devices/index.php

@@ -17,7 +17,7 @@ if (isset($_POST["create"])) {
         $new_id=insert_record($db_link, "devices", $new);
         LOG_INFO($db_link, "Created new device device_name=$fname");
         unset($_POST);
-        header("location: editswitches.php?id=$new_id");
+        header("location: editdevice.php?id=$new_id");
     }
 }
 
@@ -83,7 +83,7 @@ foreach ($switches as $row) {
     print "<td class=\"$cl\" style='padding:0'><input type=checkbox name=fid[] value=".$row['id']."></td>\n";
     print "<td class=\"$cl\"><input type=hidden name=\"id\" value=".$row['id'].">".$row['id']."</td>\n";
     print "<td class=\"$cl\">".get_devtype_name($db_link,$row['device_type'])."</td>\n";
-    print "<td class=\"$cl\" align=left><a href=editswitches.php?id=".$row['id'].">" . $row['device_name'] . "</a></td>\n";
+    print "<td class=\"$cl\" align=left><a href=editdevice.php?id=".$row['id'].">" . $row['device_name'] . "</a></td>\n";
     if (isset($row['user_id']) and $row['user_id']>0) {
         print "<td class=\"$cl\"><a href=/admin/users/edituser.php?id=".$row['user_id'].">".$row['ip']."</a></td>\n";
         } else {

+ 1 - 1
html/admin/devices/portsbyvlan.php

@@ -36,7 +36,7 @@ $sSQL = "SELECT DP.id, DP.port, D.id, D.device_name FROM `device_ports` AS DP, d
 $ports_info = mysqli_query($db_link, $sSQL);
 while (list ($f_port_id,$f_port,$f_switch_id,$f_switch) = mysqli_fetch_array($ports_info)) {
     print "<tr>";
-    print "<td class=\"data\"><a href=\"/admin/devices/editswitches.php?id=$f_switch_id\">" . $f_switch . "</a></td>\n";
+    print "<td class=\"data\"><a href=\"/admin/devices/editdevice.php?id=$f_switch_id\">" . $f_switch . "</a></td>\n";
     print "<td class=\"data\"><a href=\"/admin/devices/editport.php?id=$f_port_id\">" . $f_port . "</a></td>\n";
     print "</tr>";
 }

+ 4 - 4
html/inc/common.php

@@ -525,7 +525,7 @@ function print_editdevice_submenu ($current_page,$id) {
 print "<div id='submenu'>\n";
 $dev_id='';
 if (isset($id)) { $dev_id='?id='.$id; }
-print_submenu_url('Параметры','/admin/devices/editswitches.php'.$dev_id,$current_page,0);
+print_submenu_url('Параметры','/admin/devices/editdevice.php'.$dev_id,$current_page,0);
 print_submenu_url('Порты','/admin/devices/switchport.php'.$dev_id,$current_page,0);
 print_submenu_url('Состояние','/admin/devices/switchstatus.php'.$dev_id,$current_page,0);
 print_submenu_url('Соединения','/admin/devices/switchport-conn.php'.$dev_id,$current_page,1);
@@ -2466,7 +2466,7 @@ function expand_device_name($db, $name)
     $device_id = get_device_id($db, $name);
     $result = $name;
     if (isset($device_id) and $device_id > 0) {
-        $result = '<a href=/admin/devices/editswitches.php?id=' . $device_id . '>' . $name . '</a>';
+        $result = '<a href=/admin/devices/editdevice.php?id=' . $device_id . '>' . $name . '</a>';
     }
     return $result;
 }
@@ -2522,13 +2522,13 @@ function expand_log_str($db, $msg)
         $device_name = $matches[1];
         $device_id = get_device_id($db, $device_name);
         if (isset($device_id) and $device_id > 0) {
-            $device_replace = 'at device <a href=/admin/devices/editswitches.php?id=' . $device_id . '>${1}</a>';
+            $device_replace = 'at device <a href=/admin/devices/editdevice.php?id=' . $device_id . '>${1}</a>';
             $result = preg_replace($device_pattern, $device_replace, $result);
         }
     }
 
     $device_pattern = '/(device_id:|device id:|device id|device_id)\s+(\d+)\s+/i';
-    $device_replace = 'device_id: <a href=/admin/devices/editswitches.php?id=${2}>${2}</a> ';
+    $device_replace = 'device_id: <a href=/admin/devices/editdevice.php?id=${2}>${2}</a> ';
     $result = preg_replace($device_pattern, $device_replace, $result);
 
     $ip_pattern = '/\s+ip\:\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+/i';