Răsfoiți Sursa

changed log level for some events

Roman Dmitriev 1 an în urmă
părinte
comite
be9990f52e
2 a modificat fișierele cu 7 adăugiri și 7 ștergeri
  1. 2 2
      html/admin/users/editauth.php
  2. 5 5
      html/admin/users/edituser.php

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

@@ -104,7 +104,7 @@ if (isset($_POST["editauth"]) and !$old_auth_info['deleted']) {
         if (!$user_enabled) { $new['enabled']=0; }
         $changes = get_diff_rec($db_link, "User_auth", "id='$id'", $new, 0);
         if (!empty($changes)) {
-            LOG_WARNING($db_link, "Changed record for $ip! Log: " . $changes, $id);
+            LOG_INFO($db_link, "Changed record for $ip! Log: " . $changes, $id);
             }
         if (is_auth_bind_changed($db_link, $id, $ip, $mac)) {
             $new_id = copy_auth($db_link, $id, $new);
@@ -130,7 +130,7 @@ if (isset($_POST["moveauth"]) and !$old_auth_info['deleted']) {
     $moved_auth = get_record_sql($db_link,"SELECT comments FROM User_auth WHERE id=".$id);
     $changes = apply_auth_rule($db_link, $moved_auth, $new_parent_id);
     update_record($db_link, "User_auth", "id='$id'", $changes);
-    LOG_WARNING($db_link, "IP-address moved to another user! Applyed: " . get_rec_str($changes), $id);
+    LOG_INFO($db_link, "IP-address moved to another user! Applyed: " . get_rec_str($changes), $id);
     run_sql($db_link,"DELETE FROM auth_rules WHERE user_id=".$old_auth_info["user_id"]." AND rule='".$old_auth_info["mac"]."' AND type=2");
     run_sql($db_link,"DELETE FROM auth_rules WHERE user_id=".$old_auth_info["user_id"]." AND rule='".$old_auth_info["ip"]."' AND type=1");
     LOG_INFO($db_link,"Autorules removed for user_id: ".$old_auth_info["user_id"]." login: ".$user_info["login"]." by mac and ip");

+ 5 - 5
html/admin/users/edituser.php

@@ -35,7 +35,7 @@ if (isset($_POST["edituser"])) {
         $new["month_quota"] = get_int(trim($_POST["f_permonth"]));
     }
     $changes = get_diff_rec($db_link,"User_list","id='$id'", $new, 0);
-    if (!empty($changes)) { LOG_WARNING($db_link,"Changed user id: $id login: ".$new["login"].". \r\nApply: $changes"); }
+    if (!empty($changes)) { LOG_INFO($db_link,"Changed user id: $id login: ".$new["login"].". \r\nApply: $changes"); }
     update_record($db_link, "User_list", "id='$id'", $new);
     if (!$new["enabled"]) {
         run_sql($db_link, "UPDATE User_auth SET enabled=0, changed=1 WHERE user_id=".$id);
@@ -50,7 +50,7 @@ if (isset($_POST["addMacRule"])) {
     unset($new);
     $first_auth = get_record_sql($db_link,"SELECT mac FROM User_auth WHERE user_id=".$id." AND deleted=0 AND LENGTH(mac)>0 ORDER BY id");
     if (!empty($first_auth) and !empty($first_auth['mac'])) {
-	add_auth_rule($db_link,$first_auth['mac'],2,$id);
+	    add_auth_rule($db_link,$first_auth['mac'],2,$id);
         }
     header("Location: " . $_SERVER["REQUEST_URI"]);
     exit;
@@ -67,7 +67,7 @@ if (isset($_POST["addIPRule"])) {
     unset($new);
     $first_auth = get_record_sql($db_link,"SELECT ip FROM User_auth WHERE user_id=".$id." AND deleted=0 AND LENGTH(ip)>0 ORDER BY id");
     if (!empty($first_auth) and !empty($first_auth['ip'])) {
-	add_auth_rule($db_link,$first_auth['ip'],1,$id);
+	    add_auth_rule($db_link,$first_auth['ip'],1,$id);
         }
     header("Location: " . $_SERVER["REQUEST_URI"]);
     exit;
@@ -150,7 +150,7 @@ if (isset($_POST["addauth"])) {
                 $new['dhcp']=$f_dhcp;
                 $new["dhcp_action"]='manual';
                 update_record($db_link,"User_auth","id=".$fid,$new);
-                LOG_WARNING($db_link,"Add ip for login: ".$user_info["login"].": ip => $fip, mac => $fmac",$fid);
+                LOG_INFO($db_link,"Add ip for login: ".$user_info["login"].": ip => $fip, mac => $fmac",$fid);
                 header("Location: /admin/users/editauth.php?id=".$fid);
                 exit;
                 }
@@ -172,7 +172,7 @@ if (isset($_POST["removeauth"])) {
             run_sql($db_link, 'DELETE FROM connections WHERE auth_id='.$val);
             run_sql($db_link, 'DELETE FROM User_auth_alias WHERE auth_id='.$val);
             $changes=delete_record($db_link, "User_auth", "id=" . $val);
-            if (!empty($changes)) { LOG_WARNING($db_link,"Remove user ".$user_info["login"]." ip: \r\n ".$changes); }
+            if (!empty($changes)) { LOG_INFO($db_link,"Remove user ".$user_info["login"]." ip: \r\n ".$changes); }
         }
     }
     header("Location: " . $_SERVER["REQUEST_URI"]);