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

removed the option to put an empty username

root 11 месяцев назад
Родитель
Сommit
d2b00082a1
3 измененных файлов с 6 добавлено и 2 удалено
  1. 2 1
      html/admin/iplist/index.php
  2. 2 0
      html/admin/users/editauth.php
  3. 2 1
      html/admin/users/edituser.php

+ 2 - 1
html/admin/iplist/index.php

@@ -231,7 +231,8 @@ foreach ($users as $user) {
     if (!$user['UEnabled'] or $user['UBlocked']) { $cl = "off"; }
     if (!$user['UEnabled'] or $user['UBlocked']) { $cl = "off"; }
     print "<td class=\"$cl\" style='padding:0'><input type=checkbox name=fid[] value=".$user['id']."></td>\n";
     print "<td class=\"$cl\" style='padding:0'><input type=checkbox name=fid[] value=".$user['id']."></td>\n";
     print "<td class=\"$cl\" >".$user['ou_name']."</td>\n";
     print "<td class=\"$cl\" >".$user['ou_name']."</td>\n";
-    print "<td class=\"$cl\" ><a href=/admin/users/edituser.php?id=".$user['user_id'].">" . $user['login'] . "</a></td>\n";
+    if (empty($user['login'])) { $user_name = $user['user_id']; } else { $user_name = $user['login']; }
+    print "<td class=\"$cl\" ><a href=/admin/users/edituser.php?id=".$user['user_id'].">" . $user_name . "</a></td>\n";
     print "<td class=\"$cl\" ><a href=/admin/users/editauth.php?id=".$user['id'].">" . $user['ip'] . "</a></td>\n";
     print "<td class=\"$cl\" ><a href=/admin/users/editauth.php?id=".$user['id'].">" . $user['ip'] . "</a></td>\n";
     print "<td class=\"$cl\" >" . expand_mac($db_link,$user['mac']) . "</td>\n";
     print "<td class=\"$cl\" >" . expand_mac($db_link,$user['mac']) . "</td>\n";
     if (isset($user['dhcp_hostname']) and strlen($user['dhcp_hostname']) > 0) {
     if (isset($user['dhcp_hostname']) and strlen($user['dhcp_hostname']) > 0) {

+ 2 - 0
html/admin/users/editauth.php

@@ -278,6 +278,8 @@ $auth_info = get_record_sql($db_link, $sSQL);
 $device = get_record_sql($db_link, "SELECT * FROM devices WHERE user_id=" . $auth_info['user_id']);
 $device = get_record_sql($db_link, "SELECT * FROM devices WHERE user_id=" . $auth_info['user_id']);
 
 
 $parent_name = get_login($db_link, $auth_info['user_id']);
 $parent_name = get_login($db_link, $auth_info['user_id']);
+if (empty($parent_name)) { $parent_name=$auth_info['user_id']; }
+
 if ($auth_info['dhcp_time'] == '0000-00-00 00:00:00') {
 if ($auth_info['dhcp_time'] == '0000-00-00 00:00:00') {
     $dhcp_str = '';
     $dhcp_str = '';
 } else {
 } else {

+ 2 - 1
html/admin/users/edituser.php

@@ -21,7 +21,8 @@ if (isset($_POST["edituser"])) {
     $new["ou_id"] = $_POST["f_ou"] * 1;
     $new["ou_id"] = $_POST["f_ou"] * 1;
     $new["filter_group_id"] = $_POST["f_filter"] * 1;
     $new["filter_group_id"] = $_POST["f_filter"] * 1;
     $new["queue_id"] = $_POST["f_queue"] * 1;
     $new["queue_id"] = $_POST["f_queue"] * 1;
-    $new["login"] = trim($_POST["f_login"]);
+    $user_name = trim($_POST["f_login"]);
+    if (!empty($user_name)) { $new["login"] = $user_name; }
     $new["fio"] = trim($_POST["f_fio"]);
     $new["fio"] = trim($_POST["f_fio"]);
     if (get_const('default_user_ou_id') == $new["ou_id"] or get_const('default_hotspot_ou_id') == $new["ou_id"]) {
     if (get_const('default_user_ou_id') == $new["ou_id"] or get_const('default_hotspot_ou_id') == $new["ou_id"]) {
         $new["enabled"] = 0;
         $new["enabled"] = 0;