Explorar o código

create netdevice with last work ip

Roman Dmitriev %!s(int64=2) %!d(string=hai) anos
pai
achega
ed61261de0
Modificáronse 2 ficheiros con 12 adicións e 12 borrados
  1. 11 11
      html/admin/devices/index-passive.php
  2. 1 1
      html/utils/user_apply.php

+ 11 - 11
html/admin/devices/index-passive.php

@@ -123,19 +123,19 @@ print_navigation($page_url,$page,$displayed,$count_records[0],$total);
 ?>
 <br>
 
-<form name="def">
+<form id="def" name="def">
 
 <table class="data">
-        <tr>
-                <td align=Center><input type="checkbox" onClick="checkAll(this.checked);"></td>
-                <td align=Center><?php print $sort_url . "&sort=login&order=$new_order>" . WEB_cell_login . "</a>"; ?></td>
-                <td align=Center><?php print $sort_url . "&sort=ip_int&order=$new_order>" . WEB_cell_ip . "</a>"; ?></td>
-                <td align=Center><?php print $sort_url . "&sort=mac&order=$new_order>" . WEB_cell_mac . "</a>"; ?></td>
-                <td align=Center><?php print $sort_url . "&sort=model_name&order=$new_order>".WEB_cell_host_model; ?></td>
-                <td align=Center><?php print WEB_cell_comment; ?></td>
-                <td align=Center><?php print WEB_cell_connection; ?></td>
-                <td align=Center><?php print $sort_url . "&sort=last_found&order=$new_order>".WEB_cell_last_found."</a>"; ?></td>
-        </tr>
+    <tr>
+        <td align=Center><input type="checkbox" onClick="checkAll(this.checked);"></td>
+        <td align=Center><?php print $sort_url . "&sort=login&order=$new_order>" . WEB_cell_login . "</a>"; ?></td>
+        <td align=Center><?php print $sort_url . "&sort=ip_int&order=$new_order>" . WEB_cell_ip . "</a>"; ?></td>
+        <td align=Center><?php print $sort_url . "&sort=mac&order=$new_order>" . WEB_cell_mac . "</a>"; ?></td>
+        <td align=Center><?php print $sort_url . "&sort=model_name&order=$new_order>".WEB_cell_host_model; ?></td>
+        <td align=Center><?php print WEB_cell_comment; ?></td>
+        <td align=Center><?php print WEB_cell_connection; ?></td>
+        <td align=Center><?php print $sort_url . "&sort=last_found&order=$new_order>".WEB_cell_last_found."</a>"; ?></td>
+    </tr>
 <?php
 
 $sSQL = "SELECT A.id, D.id as dev_id, D.device_type, A.ip, A.mac, A.user_id, L.login, D.comment, A.last_found, V.name, M.model_name

+ 1 - 1
html/utils/user_apply.php

@@ -171,7 +171,7 @@ if (isset($_POST["ApplyForAll"])) {
                 if ($a_create_netdev) {
                     if (!empty($b_ip)) {
                         $device = get_record_sql($db_link,"SELECT * FROM devices WHERE user_id=".$val);
-                        $auth = get_record_sql($db_link,"SELECT * FROM User_auth WHERE user_id=".$val);
+                        $auth = get_record_sql($db_link,"SELECT * FROM User_auth WHERE user_id=".$val." ORDER BY last_found DESC");
                         if (empty($device) and !empty($auth)) {
                             $new['user_id']=$val;
                             $new['device_name'] = $login['login'];