Browse Source

Permanent cleaning of empty users is disabled

Dmitriev Roman 3 tháng trước cách đây
mục cha
commit
e19c4edf1f
1 tập tin đã thay đổi với 9 bổ sung9 xóa
  1. 9 9
      scripts/fetch_new_arp.pl

+ 9 - 9
scripts/fetch_new_arp.pl

@@ -54,15 +54,15 @@ foreach my $row (@u_ref) {
 }
 
 # Clean up empty non-permanent user accounts that have no authentications or auth rules
-if ($config_ref{clean_empty_user}) {
-    log_info($dbh, 'Clearing empty non-permanent user accounts and associated devices');
-    my $u_sql = "SELECT * FROM User_list AS U WHERE U.permanent = 0 AND (SELECT COUNT(*) FROM User_auth WHERE User_auth.deleted = 0 AND User_auth.user_id = U.id) = 0 AND (SELECT COUNT(*) FROM auth_rules WHERE auth_rules.user_id = U.id) = 0;";
-    my @u_ref = get_records_sql($dbh, $u_sql);
-    foreach my $row (@u_ref) {
-        db_log_info($dbh, "Remove empty user with id: $row->{id} login: $row->{login}");
-        delete_user($dbh, $row->{id});
-    }
-}
+#if ($config_ref{clean_empty_user}) {
+#    log_info($dbh, 'Clearing empty non-permanent user accounts and associated devices');
+#    my $u_sql = "SELECT * FROM User_list AS U WHERE U.permanent = 0 AND (SELECT COUNT(*) FROM User_auth WHERE User_auth.deleted = 0 AND User_auth.user_id = U.id) = 0 AND (SELECT COUNT(*) FROM auth_rules WHERE auth_rules.user_id = U.id) = 0;";
+#    my @u_ref = get_records_sql($dbh, $u_sql);
+#    foreach my $row (@u_ref) {
+#        db_log_info($dbh, "Remove empty user with id: $row->{id} login: $row->{login}");
+#        delete_user($dbh, $row->{id});
+#    }
+#}
 
 # Clean temporary (dynamic) user authentication records that have expired
 my $now = DateTime->now(time_zone => 'local');