index 47092086595211b4ea0d87909391e70acf779b3f..3d74d38b62dc57cef885b3aced89b2d9b5cb9f2c 100644 (file)
my $event_hash;
my $network_interface;
my $no_bus;
-my (@ldap_cfg, @pam_cfg, @nss_cfg, $goto_admin, $goto_secret, $gosa_unit_tag);
-
+my (@ldap_cfg, @pam_cfg, @nss_cfg, $goto_admin, $goto_secret);
my %cfg_defaults = (
"bus" => {
"ldap-admin-dn" => [\$ldap_admin_dn, ""],
"ldap-admin-password" => [\$ldap_admin_password, ""],
"max-clients" => [\$max_clients, 100],
- "gosa-unit-tag" => [\$gosa_unit_tag, ""],
},
"SIPackages" => {
"key" => [\$SIPackages_key, ""],
&import_events();
# Unit tag can be defined in config
-if((not defined($gosa_unit_tag)) || length($gosa_unit_tag) == 0) {
+if((not defined($main::gosa_unit_tag)) || length($main::gosa_unit_tag) == 0) {
# Read gosaUnitTag from LDAP
my $tmp_ldap= Net::LDAP->new($ldap_uri);
if(defined($tmp_ldap)) {
my $unit_tag= $entry->get_value("gosaUnitTag");
if(defined($unit_tag) && length($unit_tag) > 0) {
&main::daemon_log("Detected gosaUnitTag $unit_tag for creating entries", 4);
- $gosa_unit_tag= $unit_tag;
+ $main::gosa_unit_tag= $unit_tag;
}
} else {
# Perform another search for Unit Tag
my $hostname= `hostname -f`;
+ chomp($hostname);
&main::daemon_log("Searching for servers gosaUnitTag with hostname $hostname",6);
$mesg = $tmp_ldap->search(
base => $ldap_base,
my $unit_tag= $entry->get_value("gosaUnitTag");
if(defined($unit_tag) && length($unit_tag) > 0) {
&main::daemon_log("Detected gosaUnitTag $unit_tag for creating entries", 4);
- $gosa_unit_tag= $unit_tag;
+ $main::gosa_unit_tag= $unit_tag;
}
} else {
# Perform another search for Unit Tag
$hostname= `hostname -s`;
+ chomp($hostname);
&main::daemon_log("Searching for servers gosaUnitTag with hostname $hostname",6);
$mesg = $tmp_ldap->search(
base => $ldap_base,
my $unit_tag= $entry->get_value("gosaUnitTag");
if(defined($unit_tag) && length($unit_tag) > 0) {
&main::daemon_log("Detected gosaUnitTag $unit_tag for creating entries", 4);
- $gosa_unit_tag= $unit_tag;
+ $main::gosa_unit_tag= $unit_tag;
}
} else {
&main::daemon_log("Not using gosaUnitTag", 6);
}
}
} else {
- &main::daemon_log("Using gosaUnitTag from config-file: $gosa_unit_tag",6);
+ &main::daemon_log("Using gosaUnitTag from config-file: $main::gosa_unit_tag",6);
}
$tmp_ldap->unbind;
}
# $entry->add("gotomode" => "locked");
# $entry->add("gotoSysStatus" => "new-system");
# $entry->add("ipHostNumber" => $ipaddress);
-# if(defined($gosa_unit_tag) && length($gosa_unit_tag) > 0) {
+# if(defined($main::gosa_unit_tag) && length($main::gosa_unit_tag) > 0) {
# $entry->add("objectClass" => "gosaAdministrativeUnit");
-# $entry->add("gosaUnitTag" => $gosa_unit_tag);
+# $entry->add("gosaUnitTag" => $main::gosa_unit_tag);
# }
# my $res=$entry->update($ldap);
# if(defined($res->{'errorMessage'}) &&