summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fac8b3d)
raw | patch | inline | side by side (parent: fac8b3d)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 31 Jul 2008 15:15:45 +0000 (15:15 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 31 Jul 2008 15:15:45 +0000 (15:15 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12085 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index f44f5f631b86c6e97528cdf51bbf3df288fc32ca..48260797f45aea8e6fc8e6c5e9a6bfe24ee37791 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
our (%cfg_defaults, $log_file, $pid_file,
$server_ip, $server_port, $ClientPackages_key,
$arp_activ, $gosa_unit_tag,
- $GosaPackages_key, $gosa_ip, $gosa_port, $gosa_timeout,
+ $GosaPackages_key, $gosa_timeout,
$foreign_server_string, $server_domain, $ServerPackages_key, $foreign_servers_register_delay,
$wake_on_lan_passwd, $job_synchronization, $modified_jobs_loop_delay,
$arp_enabled, $arp_interface,
"wol-password" => [\$wake_on_lan_passwd, ""],
},
"GOsaPackages" => {
- "ip" => [\$gosa_ip, "0.0.0.0"],
- "port" => [\$gosa_port, "20082"],
"job-queue" => [\$job_queue_file_name, '/var/lib/gosa-si/jobs.db'],
"job-queue-loop-delay" => [\$job_queue_loop_delay, 3],
"messaging-db-loop-delay" => [\$messaging_db_loop_delay, 3],
index 70da956b5d6a72b08945a84a2a5f55607593f3aa..c5dc787c5267d5cfdb468d17564ec347593eecec 100644 (file)
+## @file
+# @brief Implementation of a GOsa-SI event module.
+# @details A GOsa-SI event module containing all functions to handle incoming messages from clients.
+# @author Andreas Rettenberger <rettenberger@gonicus.de>
+# @date 2008
+# @version 1.0
+
package clMessages;
use Exporter;
@ISA = qw(Exporter);
### Start ######################################################################
-my $ldap_uri;
-my $ldap_base;
-my $ldap_admin_dn;
-my $ldap_admin_password;
-
-my %cfg_defaults = (
-"server" => {
- "ldap-uri" => [\$ldap_uri, ""],
- "ldap-base" => [\$ldap_base, ""],
- "ldap-admin-dn" => [\$ldap_admin_dn, ""],
- "ldap-admin-password" => [\$ldap_admin_password, ""],
- },
-);
-&read_configfile($main::cfg_file, %cfg_defaults);
-
-
+# labled for deleting: rettenbe 20080730
+#my $ldap_uri;
+#my $ldap_base;
+#my $ldap_admin_dn;
+#my $ldap_admin_password;
+#
+#my %cfg_defaults = (
+#"server" => {
+# "ldap-uri" => [\$ldap_uri, ""],
+# "ldap-base" => [\$ldap_base, ""],
+# "ldap-admin-dn" => [\$ldap_admin_dn, ""],
+# "ldap-admin-password" => [\$ldap_admin_password, ""],
+# },
+#);
+#&read_configfile($main::cfg_file, %cfg_defaults);
+#
+
+
+## @method get_events()
+# @details A brief function returning a list of functions which are exported by importing the module.
+# @return List of all provided functions
sub get_events {
return \@events;
}
-sub read_configfile {
- my ($cfg_file, %cfg_defaults) = @_;
- my $cfg;
-
- if( defined( $cfg_file) && ( (-s $cfg_file) > 0 )) {
- if( -r $cfg_file ) {
- $cfg = Config::IniFiles->new( -file => $cfg_file );
- } else {
- &main::daemon_log("ERROR: clMessages.pm couldn't read config file!", 1);
- }
- } else {
- $cfg = Config::IniFiles->new() ;
- }
- foreach my $section (keys %cfg_defaults) {
- foreach my $param (keys %{$cfg_defaults{ $section }}) {
- my $pinfo = $cfg_defaults{ $section }{ $param };
- ${@$pinfo[0]} = $cfg->val( $section, $param, @$pinfo[1] );
- }
- }
-}
+#sub read_configfile {
+# my ($cfg_file, %cfg_defaults) = @_;
+# my $cfg;
+#
+# if( defined( $cfg_file) && ( (-s $cfg_file) > 0 )) {
+# if( -r $cfg_file ) {
+# $cfg = Config::IniFiles->new( -file => $cfg_file );
+# } else {
+# &main::daemon_log("ERROR: clMessages.pm couldn't read config file!", 1);
+# }
+# } else {
+# $cfg = Config::IniFiles->new() ;
+# }
+# foreach my $section (keys %cfg_defaults) {
+# foreach my $param (keys %{$cfg_defaults{ $section }}) {
+# my $pinfo = $cfg_defaults{ $section }{ $param };
+# ${@$pinfo[0]} = $cfg->val( $section, $param, @$pinfo[1] );
+# }
+# }
+#}
sub save_fai_log {
index 99b5ae93d4e82ea34ce1f5988295460bd57068e4..dc18c5ccf891305faaf551f611bd64e2ea738195 100644 (file)
+## @file
+# @details A GOsa-SI event module containing all functions common used by GOsa
+# @brief Implementation of a GOsa-SI event module.
+# @author Andreas Rettenberger <rettenberger@gonicus.de>
+# @date 2008
+# @version 1.0
+
package gosaTriggered;
use Exporter;
@ISA = qw(Exporter);
### Start ######################################################################
-#&main::read_configfile($main::cfg_file, %cfg_defaults);
-
+## @method get_events()
+# A brief function returning a list of functions which are exported by importing the module.
+# @return List of all provided functions
sub get_events {
return \@events;
}
+## @method send_usr_msg($msg, $msg_hash, $session_id)
+# This function accepts usr messages from GOsa, split mulitple target messages to mulitiple single target messages and put all messages into messaging_db
+# @param msg - STRING - xml message
+# @param msg_hash - HASHREF - message information parsed into a hash
+# @param session_id - INTEGER - POE session id of the processing of this message
+# @return (out_msg) - ARRAY - Array containing the answer message from client
sub send_user_msg {
my ($msg, $msg_hash, $session_id) = @_ ;
my $header = @{$msg_hash->{'header'}}[0];
my $source = @{$msg_hash->{'source'}}[0];
my $target = @{$msg_hash->{'target'}}[0];
- #my $subject = &decode_base64(@{$msg_hash->{'subject'}}[0]);
+ #my $subject = &decode_base64(@{$msg_hash->{'subject'}}[0]); # just for debugging
my $subject = @{$msg_hash->{'subject'}}[0];
my $from = @{$msg_hash->{'from'}}[0];
my @users = exists $msg_hash->{'users'} ? @{$msg_hash->{'users'}} : () ;
my @groups = exists $msg_hash->{'groups'} ? @{$msg_hash->{'groups'}} : ();
my $delivery_time = @{$msg_hash->{'delivery_time'}}[0];
- #my $message = &decode_base64(@{$msg_hash->{'message'}}[0]);
+ #my $message = &decode_base64(@{$msg_hash->{'message'}}[0]); # just for debugging
my $message = @{$msg_hash->{'message'}}[0];
# keep job queue uptodate if necessary
return &create_xml_string(&create_xml_hash($header, $target, $source, $error_string));
}
- # add incoming message to messaging_db
+ # determine new message id
my $new_msg_id = 1;
my $new_msg_id_sql = "SELECT MAX(CAST(id AS INTEGER)) FROM $main::messaging_tn";
my $new_msg_id_res = $main::messaging_db->exec_statement($new_msg_id_sql);
@users = map(push(@receiver_l, "u_$_"), @users);
@groups = map(push(@receiver_l, "g_$_"), @groups);
+ # add incoming message to messaging_db
my $func_dic = {table=>$main::messaging_tn,
primkey=>[],
id=>$new_msg_id,
index a253111bd537dbef3ad070b9df217df4214fe68c..b285b96f1bad607f1f9a1b4c0bce9602dd3c9494 100644 (file)
=head1 SYNOPSIS
use GOSA::GosaSupportDaemon;
-
use Time::HiRes qw(usleep);
-
use MIME::Base64;
=head1 DESCRIPTION