Code

Hard coded ldap-shell.conf. Need to place it somewhere else later.
[gosa.git] / gosa-si / client / events / corefunctions.pm
index 3f534088e4040c5dd8cf144916e784094f934d8c..70d3bff70d5ff16501bdb9ed69baa455d324ebfa 100644 (file)
@@ -20,7 +20,6 @@ use Data::Dumper;
 use Fcntl;
 use GOSA::GosaSupportDaemon;
 use File::Basename;
-use open ':utf8';
 
 my ($ldap_enabled, $ldap_config, $pam_config, $nss_config, $fai_logpath);
 
@@ -112,6 +111,7 @@ sub registered {
     my $opts_file_FH;
     my $hostname= $main::client_dnsname;
     $hostname =~ s/\..*$//;
+    $hostname =~ tr/A-Z/a-z/;
     open($opts_file_FH, ">$main::opts_file");
     print $opts_file_FH "MAC=\"$main::client_mac_address\"\n";
     print $opts_file_FH "IPADDRESS=\"$main::client_ip\"\n";
@@ -236,6 +236,7 @@ sub new_ldap_config {
     my $file1;
     my $file2;
     open(file1, "> $ldap_config");
+#print STDERR Dumper(PerlIO::get_layers(file1, output => 1));
     print file1 "# This file was automatically generated by gosa-si-client. Do not change.\n";
     print file1 "URI";
     foreach $element (@ldap_uris) {
@@ -285,7 +286,7 @@ sub new_ldap_config {
     }
 
     # Write shell based config
-    my $cfg_name= dirname($ldap_config)."/ldap-shell.conf";
+    my $cfg_name= "/etc/ldap/ldap-shell.conf";
 
     # Get first LDAP server
     my $ldap_server= $ldap_uris[0];
@@ -294,6 +295,7 @@ sub new_ldap_config {
     open(file1, "> $cfg_name");
     print file1 "LDAP_BASE=\"$ldap_base\"\n";
     print file1 "LDAP_SERVER=\"$ldap_server\"\n";
+    print file1 "LDAP_URIS=\"@ldap_uris\"\n";
     print file1 "ADMIN_BASE=\"$admin_base\"\n";
     print file1 "DEPARTMENT=\"$department\"\n";
     print file1 "RELEASE=\"$release\"\n";
@@ -312,6 +314,11 @@ sub new_key {
 
     my $out_hash = &create_xml_hash("new_key", $main::client_address, $main::server_address, $new_server_key);    
     my $out_msg = &create_xml_string($out_hash);
+
+    # set global $NEW_KEY_FLAG, gosa-si-client cause a reregistering process if no 'confirm_new_key'-msg 
+    # comes from gosa-si-server within a given time
+    
+
     return $out_msg; 
 }