Code

new function to detect logged in users
authorrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 26 Mar 2008 15:51:19 +0000 (15:51 +0000)
committerrettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 26 Mar 2008 15:51:19 +0000 (15:51 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10001 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-client

index a380c342986f8ffbe3ad895ba9ccd10d5b339d38..afd46fd11f8bf1a5729901d8450c69035eec45ed 100755 (executable)
@@ -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 {