Browse Source

open a user entry from the list of switch ports in the same window

Roman Dmitriev 2 năm trước cách đây
mục cha
commit
7897c5e53a

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

@@ -101,7 +101,7 @@ foreach ($ports as $row) {
         if (isset($row['target_port_id']) and $row['target_port_id'] > 0) {
             print_device_port($db_link, $row['target_port_id']);
         } else {
-            print_auth_port($db_link, $row['id']);
+            print_auth_port($db_link, $row['id'],FALSE);
         }
         print "</td>\n";
         print "<td class='".$cl."'>" . $row['comment'] . "</td>\n";

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

@@ -180,7 +180,7 @@ print_editdevice_submenu($page_url, $id, $device['device_type'], $user_info['log
             if (isset($row['target_port_id']) and $row['target_port_id'] > 0) {
                 print_device_port($db_link, $row['target_port_id']);
             } else {
-                print_auth_port($db_link, $row['id']);
+                print_auth_port($db_link, $row['id'], TRUE);
             }
             print "</td>\n";
             print "<td class='" . $cl . "'>" . $row['comment'] . "</td>\n";

+ 6 - 2
html/inc/common.php

@@ -1405,7 +1405,7 @@ function get_device_by_auth($db, $id)
     return $f_dev['id'];
 }
 
-function print_auth_port($db, $port_id)
+function print_auth_port($db, $port_id, $new_window = FALSE)
 {
     $d_sql = "SELECT A.ip,A.ip_int,A.mac,A.id,A.dns_name FROM User_auth as A, connections as C WHERE C.port_id=$port_id and A.id=C.auth_id and A.deleted=0 order by A.ip_int";
     $t_device = mysqli_query($db, $d_sql);
@@ -1414,7 +1414,11 @@ function print_auth_port($db, $port_id)
         if (isset($f_dns) and $f_dns != '') {
             $name = $f_dns;
         }
-        print "<a href=\"#\" onclick=\"".open_window_url("/admin/users/editauth.php?id=".$f_auth_id)." return false;\">" . $name . " [" . $f_ip . "]</a><br>";
+        if ($new_window) {
+            print "<a href=\"#\" onclick=\"".open_window_url("/admin/users/editauth.php?id=".$f_auth_id)." return false;\">" . $name . " [" . $f_ip . "]</a><br>";
+        } else {
+            print "<a href=/admin/users/editauth.php?id=".$f_auth_id."/>" . $name . " [" . $f_ip . "]</a><br>";
+        }
     }
 }