From: rettenbe Date: Mon, 7 Apr 2008 12:50:36 +0000 (+0000) Subject: Closes #390 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c8313d685546090f5a68b7c1599521f915258b81;p=gosa.git Closes #390 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10239 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index 4ce9ceb4c..a56292bcd 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -961,24 +961,10 @@ sub trigger_logged_in_users_report { @logged_in_user_list = split(/\s/, $result); } -# my @res_lines; -# -# if( defined $result ) { -# chomp($result); -# @res_lines = split("\n", $result); -# } -# -# my @logged_in_user_list; -# foreach my $line (@res_lines) { -# chomp($line); -# my @line_parts = split(/\s+/, $line); -# push(@logged_in_user_list, $line_parts[0]); -# } -# system("echo 'CURRENTLY_LOGGED_IN ".join(" ", @logged_in_user_list)."' > /var/run/gosa-si-client.socket"); $kernel->delay_set('trigger_logged_in_users_report', $trigger_logged_in_users_report_delay); } else { - # try it in 1 sec again + # try it in 10 sec again $kernel->delay_set('trigger_logged_in_users_report', 10); } } diff --git a/gosa-si/server/events/clMessages.pm b/gosa-si/server/events/clMessages.pm index d0ac38072..6cdfd7f7d 100644 --- a/gosa-si/server/events/clMessages.pm +++ b/gosa-si/server/events/clMessages.pm @@ -134,27 +134,16 @@ sub LOGIN { return; } -# TODO umstellen wie bei LOGIN + sub LOGOUT { my ($msg, $msg_hash, $session_id) = @_; my $header = @{$msg_hash->{'header'}}[0]; my $source = @{$msg_hash->{'source'}}[0]; my $login = @{$msg_hash->{$header}}[0]; - - my $sql_statement = "SELECT * FROM known_clients WHERE hostname='$source'"; - my $res = $main::known_clients_db->select_dbentry($sql_statement); - if( 1 != keys(%$res) ) { - &main::daemon_log("DEBUG: clMessages.pm: LOGOUT: no or more hits found in known_clients_db for host '$source'"); - return; - } - - my $act_login = $res->{'1'}->{'login'}; - $act_login =~ s/$login,?//gi; - - if( $act_login eq "" ){ $act_login = "nobody"; } - - $sql_statement = "UPDATE known_clients SET login='$act_login' WHERE hostname='$source'"; - $res = $main::known_clients_db->update_dbentry($sql_statement); + + my $sql_statement = "DELETE FROM $main::login_users_tn WHERE (client='$source' AND user='$login')"; + my $res = $main::login_users_db->del_dbentry($sql_statement); + &main::daemon_log("$session_id INFO: delete user '$login' at client '$source' from login_user_db", 5); return; }