diff options
-rw-r--r-- | ldap_wizard/Ldap.pm | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ldap_wizard/Ldap.pm b/ldap_wizard/Ldap.pm index c43e2b46..806d9d84 100644 --- a/ldap_wizard/Ldap.pm +++ b/ldap_wizard/Ldap.pm @@ -90,12 +90,23 @@ $o->{pages} = { ! -f $conf_file and $::in->ask_warn(N("Error"), N("You must setup a LDAP server first.")) and return 'set_srv'; return 'add_userposix'; } + + if ($o->{var}{wiz_level} == 1) { + ! -f $conf_file and $::in->ask_yesorno(N("Information "), N("wold you like save an existing OpenLDAP configuration ?")) and return 'sav_old_conf'; + return 'set_srv'; + } }, data => [ { label => N("Your choice:") . "\n\n", val => \$o->{var}{wiz_level}, type => 'list', list => [ keys %level ], format => sub { $level{$_[0]} } }, ], next => 'set_srv', }, + + sav_old_conf => { + name => N("Save an existing configuration"), + next => 'set_srv' + }, + add_userposix => { name => N("LDAP User Add") . "\n\n" . N("User Create in: ") . $o->{var}{defou} . ", " . $o->{var}{suffix}, data => [ @@ -130,7 +141,7 @@ $o->{pages} = { $::in->ask_warn(N("Error"), N("You must enter a password for LDAP.")); return 1; } - if (!($o->{var}{uidpass} eq $o->{var}{uidpass2})) { + if ($o->{var}{uidpass} ne $o->{var}{uidpass2}) { $::in->ask_warn(N("Error"), N("The passwords do not match")); return 1; } @@ -147,7 +158,7 @@ $o->{pages} = { ], complete => sub { - if (!$o->{var}{suffix}) { + if (!$o->{var}{suffix} || $o->{var}{suffix} !~ /dc/ ) { $::in->ask_warn(N("Error"), N("You must enter a suffix for LDAP.")); return 1; } @@ -155,7 +166,7 @@ $o->{pages} = { $::in->ask_warn(N("Error"), N("You must enter a password for LDAP.")); return 1; } - if (!($o->{var}{rootpass} eq $o->{var}{rootpass2})) { + if ($o->{var}{rootpass} ne $o->{var}{rootpass2}) { $::in->ask_warn(N("Error"), N("The passwords do not match")); return 1; } |