diff options
author | Vicent Guardiola <vguardiola@mandriva.com> | 2004-08-12 10:01:19 +0000 |
---|---|---|
committer | Vicent Guardiola <vguardiola@mandriva.com> | 2004-08-12 10:01:19 +0000 |
commit | be4f3bb753db35906af2820b5b58f1aa52e8c1c6 (patch) | |
tree | 149a34746c896cf08a5aa4b9ac90b8a1446173ca /ldap_wizard/Ldap.pm | |
parent | 809c813923affdcc48ec1de308f41dbeecbebf5a (diff) | |
download | drakwizard-be4f3bb753db35906af2820b5b58f1aa52e8c1c6.tar drakwizard-be4f3bb753db35906af2820b5b58f1aa52e8c1c6.tar.gz drakwizard-be4f3bb753db35906af2820b5b58f1aa52e8c1c6.tar.bz2 drakwizard-be4f3bb753db35906af2820b5b58f1aa52e8c1c6.tar.xz drakwizard-be4f3bb753db35906af2820b5b58f1aa52e8c1c6.zip |
Clean source
Add test if conf_file exist
Diffstat (limited to 'ldap_wizard/Ldap.pm')
-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; } |