From 79fdf7663505b5886f40bd1127c0d6a1b20d341d Mon Sep 17 00:00:00 2001 From: Vicent Guardiola Date: Fri, 3 Sep 2004 03:48:48 +0000 Subject: Change next step when user already exist Fix more label --- ldap_wizard/Ldap.pm | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'ldap_wizard') diff --git a/ldap_wizard/Ldap.pm b/ldap_wizard/Ldap.pm index 19d7d5f4..0e434b0d 100644 --- a/ldap_wizard/Ldap.pm +++ b/ldap_wizard/Ldap.pm @@ -82,7 +82,7 @@ if (-f $conf_file) { } my %level = ( - 1 => N("Configure Ldap server"), + 1 => N("Show Ldap configuration"), 2 => N("Add user in Ldap server"), 3 => N("Delete Ldap configuration"), ); @@ -147,6 +147,7 @@ $o->{pages} = { if (!$o->{var}{sn}) { $::in->ask_warn(N("Error"), N("You must enter a valid First Name.")); return 1; + } if (!$o->{var}{cn}) { $::in->ask_warn(N("Error"), N("You must enter a valid Name.")); return 1; @@ -155,8 +156,8 @@ $o->{pages} = { $::in->ask_warn(N("Error"), N("You must enter a valid User Name.")); return 1; } - } }, + next => 'password' }, password => { @@ -183,14 +184,15 @@ $o->{pages} = { data => [ { label => N(" ") }, { label => N("LDAP directory tree:"), val => \$o->{var}{suffix}, help => "aide p" }, - { label => N("LDAP Administrator:"), val => \$o->{var}{administrator}, help => "aide p" }, + { label => N("LDAP Administrator:"), val => \$o->{var}{rootdn}, help => "aide p" }, { label => N("LDAP Password:"), hidden => 1, val => \$o->{var}{rootpass}, help => "aide p" }, { label => N("LDAP Password (again):"), hidden => 1, val => \$o->{var}{rootpass2}, help => "aide p" }, ], pre => sub { - $o->{var}{administrator} = "cn=".N("Adrministrator").",".$o->{var}{suffix}; + $o->{var}{rootdn} = "cn=".N("Administrator").",".$o->{var}{suffix}; }, complete => sub { + if (!$o->{var}{suffix} || $o->{var}{suffix} !~ /dc/) { $::in->ask_warn(N("Error"), N("You must enter a valid LDAP directory tree .")); return 1; @@ -246,18 +248,18 @@ $o->{pages} = { { label => N(" ") }, { label => N("\n"),fixed_val => \$o->{var}{error_user_add} } ], - next => 'add_userposix', - end => 1, + no_back => '1', + next => 'ask_menu', }, add_user_nogood => { - name => N("Error for added User"), + name => N("Error when adding user in Ldap datase"), data => [ { label => N(" ") }, { label => N("\n"),fixed_val => \$o->{var}{error_user_add} } ], + no_back => '1', next => 'add_userposix', - end => 1, }, -- cgit v1.2.1