Просмотр исходного кода

add connected device to export

Roman Dmitriev 2 лет назад
Родитель
Сommit
6edfe3ac5e
1 измененных файлов с 4 добавлено и 4 удалено
  1. 4 4
      html/utils/auth_export.php

+ 4 - 4
html/utils/auth_export.php

@@ -5,7 +5,7 @@ require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/languages/" . HTML_LANG . ".php")
 if (!defined("CONFIG")) die("Not defined");
 if (!defined("CONFIG")) die("Not defined");
 
 
 if (isset($_POST["ExportAuth"])) {
 if (isset($_POST["ExportAuth"])) {
-    print "login;ip;mac;comment;dns name;last_found\n";
+    print "login;ip;mac;comment;dns name;last_found;connected\n";
     if (isset($_POST["a_selected"]) and $_POST["a_selected"] * 1) {
     if (isset($_POST["a_selected"]) and $_POST["a_selected"] * 1) {
         //export selected only
         //export selected only
         $auth_id = $_POST["fid"];
         $auth_id = $_POST["fid"];
@@ -13,15 +13,15 @@ if (isset($_POST["ExportAuth"])) {
             if ($val) {
             if ($val) {
                 $sSQL = "SELECT User_list.login, User_auth.ip, User_auth.mac, User_auth.comments, User_auth.dns_name, User_auth.last_found FROM User_auth, User_list WHERE User_auth.user_id = User_list.id AND User_auth.id = " . $val;
                 $sSQL = "SELECT User_list.login, User_auth.ip, User_auth.mac, User_auth.comments, User_auth.dns_name, User_auth.last_found FROM User_auth, User_list WHERE User_auth.user_id = User_list.id AND User_auth.id = " . $val;
                 $record = get_record_sql($db_link, $sSQL);
                 $record = get_record_sql($db_link, $sSQL);
-                print $record['login'] . ';' . $record['ip'] . ';' . $record['mac'] . ';' . $record['comments'] . ';' . $record['dns_name'] . ';' . $record['last_found'] . "\n";
+                print $record['login'] . ';' . $record['ip'] . ';' . $record['mac'] . ';' . $record['comments'] . ';' . $record['dns_name'] . ';' . $record['last_found'] . ';' . get_connection($db_link, $val)."\n";
             }
             }
         }
         }
     } else {
     } else {
         //export all
         //export all
-        $sSQL = "SELECT User_list.login, User_auth.ip, User_auth.mac, User_auth.comments, User_auth.dns_name, User_auth.last_found FROM User_auth, User_list WHERE User_auth.user_id = User_list.id AND User_auth.deleted = 0 ORDER BY User_auth.ip_int";
+        $sSQL = "SELECT User_list.login, User_auth.id, User_User_auth.ip, User_auth.mac, User_auth.comments, User_auth.dns_name, User_auth.last_found FROM User_auth, User_list WHERE User_auth.user_id = User_list.id AND User_auth.deleted = 0 ORDER BY User_auth.ip_int";
         $auth_table = mysqli_query($db_link, $sSQL);
         $auth_table = mysqli_query($db_link, $sSQL);
         while ($record = mysqli_fetch_array($auth_table)) {
         while ($record = mysqli_fetch_array($auth_table)) {
-            print $record['login'] . ';' . $record['ip'] . ';' . $record['mac'] . ';' . $record['comments'] . ';' . $record['dns_name'] . ';' . $record['last_found'] . "\n";
+            print $record['login'] . ';' . $record['ip'] . ';' . $record['mac'] . ';' . $record['comments'] . ';' . $record['dns_name'] . ';' . $record['last_found'] .';' . get_connection($db_link, $record['id']). "\n";
         }
         }
     }
     }
 }
 }