diff options
Diffstat (limited to 'ldap_wizard')
-rw-r--r-- | ldap_wizard/Ldap.pm | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/ldap_wizard/Ldap.pm b/ldap_wizard/Ldap.pm index d3604ebd..c3871d6e 100644 --- a/ldap_wizard/Ldap.pm +++ b/ldap_wizard/Ldap.pm @@ -48,13 +48,14 @@ my $o = { nom => '', prenom => '', }, + needed_rpm => [ 'openldap-server','openldap-client' ], }; my $ldap_suffix=join(',dc=', split(/\./, chomp_(`hostname -f`))); $ldap_suffix =~ s/[^,]*,//; -my $conf_file = "/etc/sysconfig/ldapconf"; +my $conf_file = "/etc/sysconfig/ldapwiz"; my $LDAPCONF = "/etc/openldap/slapd.conf"; #my $rootdn_cn = "Admin"; ##### Read conf file is exist @@ -92,11 +93,11 @@ $o->{pages} = { return 'add_userposix'; } - if ($o->{var}{wiz_level} == 1) { - ! -f $conf_file and $::in->ask_yesorno(N("Information "), N("Would you like save an existing OpenLDAP configuration ?")) and return 'sav_old_conf'; - return 'set_srv'; - } - }, + + if ($o->{var}{wiz_level} == 1) { + -f $conf_file and return 'resume'; + } + }, data => [ { label => N("Your choice:") . "\n\n", val => \$o->{var}{wiz_level}, type => 'list', list => [ keys %level ], format => sub { $level{$_[0]} } }, @@ -154,7 +155,7 @@ $o->{pages} = { name => N("Configuring LDAP Server"), data => [ { label => N("LDAP Suffix:\n ex: dc=example,dc=com\n"), val => \$o->{var}{suffix}, help => N("aide p") }, - { label => N("LDAP Administrator:\n "), val => \$o->{var}{rootdn}, help => N("aide p") }, + { label => N("LDAP Administrator:\n ex: cn=admin,dc=example,dc=com\n"), val => \$o->{var}{rootdn}, help => N("aide p") }, { label => N("LDAP Password:"), hidden => 1, val => \$o->{var}{rootpass}, help => N("aide p") }, { label => N("LDAP Password (again):"), hidden => 1, val => \$o->{var}{rootpass2}, help => N("aide p") }, ], @@ -191,8 +192,8 @@ $o->{pages} = { data => [ { label => N("Organisation LDAP:"), type => 'field', fixed_val => \$o->{var}{suffix} }, { label => N("Administrator LDAP:"), type => 'field', fixed_val => \$o->{var}{rootdn} }, -# { label => N("Arbo LDAP:"), type => 'field', fixed_val => " " }, { label => "", type => 'field', fixed_val => \$o->{var}{suffix} }, + { label => N("Users Container :"), type => 'field', fixed_val => \$o->{var}{defou} }, ], post => \&do_it_setldap, next => 'end' @@ -211,6 +212,20 @@ $o->{pages} = { end => 1, next => 0, }, + resume => { + name => N("Server already configured"), + post => sub { + my $container_ou = $o->{var}{wiz_level}.",".$o->{var}{suffix}; + }, + data => [ { label => N("You have already configure your OpenLDAP Server with drakwizard\n") } , + { label => N("Organisation LDAP:"), type => 'field', fixed_val => \$o->{var}{suffix} }, + { label => N("Administrator LDAP:"), type => 'field', fixed_val => \$o->{var}{rootdn} }, + { label => N("Users Container :"), type => 'field', fixed_val => \$o->{var}{defou} }, + ], + no_back => 1, + end => 1, + next => 0, + }, }; sub do_it_setldap { |