summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 93dd6ed)
raw | patch | inline | side by side (parent: 93dd6ed)
author | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 May 2009 12:36:26 +0000 (12:36 +0000) | ||
committer | rettenbe <rettenbe@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 29 May 2009 12:36:26 +0000 (12:36 +0000) |
* bugfixing functions get_login_usr_for_client and get_client_for_login_usr
-- Diese und die folgenden Zeilen werde --
M server/events/gosaTriggered.pm
M gosa-si-server
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13680 594d385d-05f5-0310-b6e9-bd551577e9d8
-- Diese und die folgenden Zeilen werde --
M server/events/gosaTriggered.pm
M gosa-si-server
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13680 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/server/events/gosaTriggered.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 2f50b6a52f87d2aa44259dd55a1511f56b526944..e1fa9767f4b3863c7bdd6a3f318230464c7720c6 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
our ($ldap_uri, $ldap_base, $ldap_admin_dn, $ldap_admin_password, $ldap_server_dn, $ldap_version);
our ($mysql_username, $mysql_password, $mysql_database, $mysql_host);
our $known_modules;
+our $known_functions;
our $root_uid;
our $adm_gid;
}
}
} else {
- &daemon_log("$session_id DEBUG: cannot update job status, msg has no jobdb_id-tag: $answer", 7);
+ &daemon_log("$session_id DEBUG: cannot update job status, msg has no jobdb_id-tag.", 7);
}
}
}
}
- # target ist own address with forward_to_gosa-tag not pointing to myself -> process here
+ # target is own address with forward_to_gosa-tag not pointing to myself -> process here
if (not $done) {
my $forward_to_gosa = @{$msg_hash->{'forward_to_gosa'}}[0];
my $gosa_at;
}
}
+ # Target is a client address and there is a processing function within a plugin -> process loaclly
+ if (not $done)
+ {
+ # Check if target is a client address
+ $sql = "SELECT * FROM $known_clients_tn WHERE (hostname='$target' OR macaddress LIKE '$target')";
+ $res = $known_clients_db->select_dbentry($sql);
+ if ((keys(%$res) > 0) )
+ {
+ my $hostname = $res->{1}->{'hostname'};
+ my $reduced_header = $header;
+ $reduced_header =~ s/gosa_//;
+ # Check if there is a processing function within a plugin
+ if (exists $known_functions->{$reduced_header})
+ {
+ $msg =~ s/<target>\S*<\/target>/<target>$hostname<\/target>/;
+ $done = 1;
+ &daemon_log("$session_id DEBUG: Target is client address with processing function within a plugin -> process here", 7);
+ }
+ }
+ }
+
# If header has a 'job_' prefix, do always process message locally
# which means put it into job queue
if ((not $done) && ($header =~ /job_/))
if (not $done) {
$sql = "SELECT * FROM $known_clients_tn WHERE (hostname='$target' OR macaddress LIKE '$target')";
$res = $known_clients_db->select_dbentry($sql);
- if (keys(%$res) > 0) {
- &daemon_log("$session_id DEBUG: target is a client address in known_clients -> forward to client", 7);
+ if (keys(%$res) > 0)
+ {
$done = 1;
+ &daemon_log("$session_id DEBUG: target is a client address in known_clients -> forward to client", 7);
my $hostkey = $res->{1}->{'hostkey'};
my $hostname = $res->{1}->{'hostname'};
$msg =~ s/<target>\S*<\/target>/<target>$hostname<\/target>/;
if ($error) {
&daemon_log("$session_id ERROR: Some problems occurred while trying to send msg to client '$hostkey': $msg", 1);
}
- } else {
+ }
+ else
+ {
$not_found_in_known_clients_db = 1;
}
}
# Check wether all modules are gosa-si valid passwd check
&password_check;
+# Create functions hash
+#print STDERR Dumper $known_modules;
+while (my ($module, @mod_info) = each %$known_modules)
+{
+#print STDERR Dumper $module;
+ while (my ($plugin, $functions) = each %{$mod_info[0][2]})
+ {
+#print STDERR Dumper $functions;
+ while (my ($function, $nothing) = each %$functions )
+ {
+ $known_functions->{$function} = $nothing;
+ }
+ }
+}
+
# Prepare for using Opsi
if ($opsi_enabled eq "true") {
use JSON::RPC::Client;
index 2377762218170180e1fdb5e8a24b3f854254f39d..5b645e85950e79bf8599a1bcdc9a230f26a4c2a1 100644 (file)
"set_activated_for_installation",
"new_key_for_client",
"detect_hardware",
- "get_login_usr",
- "get_login_client",
"trigger_action_localboot",
"trigger_action_faireboot",
"trigger_action_reboot",
my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
if( defined $jobdb_id) {
my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id";
- &main::daemon_log("$session_id DEBUG: $sql_statement", 7);
+ &main::daemon_log("$session_id DEBUG: $sql_statement", 7);
my $res = $main::job_db->exec_statement($sql_statement);
}
- # If $client is a mac address
- if ($client =~ /^\w\w:\w\w:\w\w:\w\w:\w\w:\w\w$/i)
+ # If $client is a mac address
+ if ($client =~ /^\w\w:\w\w:\w\w:\w\w:\w\w:\w\w$/i)
{
# Search for hostname of $client within known_clients_db
my $sql = "SELECT * FROM $main::known_clients_tn WHERE macaddress LIKE '$client'";
my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0];
if( defined $jobdb_id) {
my $sql_statement = "UPDATE $main::job_queue_tn SET status='processed' WHERE id=$jobdb_id";
- &main::daemon_log("$session_id DEBUG: $sql_statement", 7);
+ &main::daemon_log("$session_id DEBUG: $sql_statement", 7);
my $res = $main::job_db->exec_statement($sql_statement);
}
$out_msg .= "</xml>";
return ( $out_msg );
-
}