From: rettenbe Date: Wed, 26 Mar 2008 15:51:19 +0000 (+0000) Subject: new function to detect logged in users X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bb25f3cc79c2edf131a8eb8d7c7979346363c804;p=gosa.git new function to detect logged in users git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10001 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index a380c3429..afd46fd11 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -954,20 +954,27 @@ sub trigger_logged_in_users_report { # just do if client is registered already if( $REGISTERED ) { - my $result = qx(/usr/bin/w -hs); - 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]); - } + my $result = qx(/usr/bin/users); + my @logged_in_user_list; + if( defined $result ) { + chomp($result); + @logged_in_user_list = split("\n", $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 {