summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 86c64eb)
raw | patch | inline | side by side (parent: 86c64eb)
author | wolffc <wolffc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 24 Jun 2011 14:13:22 +0000 (14:13 +0000) | ||
committer | wolffc <wolffc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 24 Jun 2011 14:13:22 +0000 (14:13 +0000) |
servers immediately when handling the CURRENTLY_LOGGED_IN message.
Instead, introduce a new option (report-logged-in-users), task
(watch_for_logged_in_users) and time period (logged_in_users_delay) so
that all known users are reported every logged_in_users_delay seconds
(10 minutes by default).
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@20917 594d385d-05f5-0310-b6e9-bd551577e9d8
Instead, introduce a new option (report-logged-in-users), task
(watch_for_logged_in_users) and time period (logged_in_users_delay) so
that all known users are reported every logged_in_users_delay seconds
(10 minutes by default).
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@20917 594d385d-05f5-0310-b6e9-bd551577e9d8
trunk/gosa-si/gosa-si-server | patch | blob | history | |
trunk/gosa-si/server/events/clMessages.pm | patch | blob | history |
index b3c88c1d8f32cf13cfe9164aab04b9a9d12fe0f0..f36994356db4ad487c94a6294449ed79a29e35e2 100755 (executable)
$wake_on_lan_passwd, $job_synchronization, $modified_jobs_loop_delay,
$arp_enabled, $arp_interface,
$opsi_enabled, $opsi_server, $opsi_admin, $opsi_password,
- $new_systems_ou,
+ $new_systems_ou, $logged_in_users_delay,
);
# additional variable which should be globaly accessable
"key-lifetime" => [\$foreign_servers_register_delay, 120],
"job-synchronization-enabled" => [\$job_synchronization, "true"],
"synchronization-loop" => [\$modified_jobs_loop_delay, 5],
+ "report-logged-in-users" => [\$logged_in_users_delay, 600],
},
"ArpHandler" => {
"enabled" => [\$arp_enabled, "true"],
$kernel->delay_set('watch_for_delivery_messages', $messaging_db_loop_delay);
$kernel->delay_set('watch_for_done_messages', $messaging_db_loop_delay);
$kernel->delay_set('watch_for_old_known_clients', $job_queue_loop_delay);
+ $kernel->delay_set('watch_for_logged_in_users', $logged_in_users_delay);
# Start opsi check
if ($opsi_enabled eq "true") {
$kernel->delay_set('watch_for_next_tasks', 1);
}
+sub watch_for_logged_in_users {
+ my ($kernel,$heap) = @_[KERNEL, HEAP];
+
+ # Get list of currently logged in users
+ my $sql = "SELECT * FROM $login_users_tn WHERE regserver='localhost'";
+ my $res = $main::login_users_db->select_dbentry($sql);
+ my $msg_hash = &create_xml_hash("information_sharing", $server_address, "KNOWN_SERVER");
+ while (my ($hit_id, $hit) = each(%$res)) {
+ &add_content2xml_hash($msg_hash, 'user_db', $hit->{'client'}.";".$hit->{'user'});
+ }
+ my $msg = &create_xml_string($msg_hash);
+
+ # Inform all other server which users are logged in at clients registered at local server
+ my $sql_statement= "SELECT * FROM $known_server_tn";
+ my $query_res = $known_server_db->select_dbentry( $sql_statement );
+ while( my ($hit_num, $hit) = each %{ $query_res } ) {
+ my $host_name = $hit->{hostname};
+ my $host_key = $hit->{hostkey};
+ $msg =~ s/<target>\S+<\/target>/<target>$host_name<\/target>/g;
+ # TODO: get session_id
+ my $error = &send_msg_to_target($msg, $host_name, $host_key, "information_sharing", 0);
+ }
+
+ $kernel->delay_set('watch_for_logged_in_users', $logged_in_users_delay);
+}
sub get_ldap_handle {
my ($session_id) = @_;
watch_for_done_jobs => \&watch_for_done_jobs,
watch_for_opsi_jobs => \&watch_for_opsi_jobs,
watch_for_old_known_clients => \&watch_for_old_known_clients,
+ watch_for_logged_in_users => \&watch_for_logged_in_users,
create_packages_list_db => \&run_create_packages_list_db,
create_fai_server_db => \&run_create_fai_server_db,
create_fai_release_db => \&run_create_fai_release_db,
index 9960a59d3155e1576d9d9c9a725335a913e8e989..24e9d2978f7e4af4df00832b8a3cb0ac5c417d92 100644 (file)
&main::daemon_log("$session_id INFO: delete user '".$hit->{'user'}."' at client '".$hit->{'client'}."' from login_user_db", 5);
}
- # Inform all other server which users are logged in at clients registered at local server
- my $info_sql = "SELECT * FROM $main::login_users_tn WHERE regserver='localhost'";
- my $info_res = $main::login_users_db->select_dbentry($info_sql);
- my $info_msg_hash = &create_xml_hash("information_sharing", $main::server_address, "KNOWN_SERVER");
- while (my ($hit_id, $hit) = each(%$info_res)) {
- &add_content2xml_hash($info_msg_hash, 'user_db', $hit->{'client'}.";".$hit->{'user'});
- }
- my $info_msg = &create_xml_string($info_msg_hash);
-
- return ($info_msg);
+ return;
}