From 1fffa429f1d20bba8aad2b4d1d6e4e0f7aac70fe Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 2 May 2007 13:22:50 +0000 Subject: [PATCH] Added retype password field git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6232 594d385d-05f5-0310-b6e9-bd551577e9d8 --- setup/class_setupStep_Migrate.inc | 29 ++++++++++++++++++++--------- setup/setup_migrate.tpl | 8 ++++++++ 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/setup/class_setupStep_Migrate.inc b/setup/class_setupStep_Migrate.inc index 42288d6aa..57fc5efdc 100644 --- a/setup/class_setupStep_Migrate.inc +++ b/setup/class_setupStep_Migrate.inc @@ -819,13 +819,20 @@ class Step_Migrate extends setup_step function create_admin_user() { - if(isset($_POST['new_user_password']) && !empty($_POST['new_user_password'])){ - $pwd = $_POST['new_user_password']; - }else{ - print_red(_("Please specify a valid password for the new GOsa admin user.")); - return(FALSE); + $pw1 = $pw2 = ""; + + if(isset($_POST['new_user_password'])){ + $pw1 = $_POST['new_user_password']; } - + if(isset($_POST['new_user_password2'])){ + $pw2 = $_POST['new_user_password2']; + } + + if(empty($pw1) || empty($pw2) | ($pw1 != $pw2)){ + print_red(_("Specified passwords are empty or not equal.")); + return false; + } + /* Establish ldap connection */ $cv = $this->parent->captured_values; $ldap = new LDAP($cv['admin'], @@ -846,7 +853,7 @@ class Step_Migrate extends setup_step $methods = @passwordMethod::get_available_methods_if_not_loaded(); $p_m = $methods[$cv['encryption']]; $p_c = new $p_m(array()); - $hash = $p_c->generate_hash($pwd); + $hash = $p_c->generate_hash($pw2); $new_user=array(); $new_user['objectClass']= array("top","person","gosaAccount","organizationalPerson","inetOrgPerson"); @@ -865,10 +872,12 @@ class Step_Migrate extends setup_step if(!$res){ print_red($ldap->get_error()); + return(FALSE); } $this->acl_create_dialog=FALSE; $this->check_administrativeAccount(); + return(TRUE); } @@ -1155,13 +1164,15 @@ class Step_Migrate extends setup_step } if(isset($_POST['create_admin_user'])){ - $this->create_admin_user(); - $this->dialog = FALSE; + if($this->create_admin_user()){ + $this->dialog = FALSE; + } } if($this->acl_create_dialog){ $smarty = get_smarty(); $smarty->assign("new_user_password",@$_POST['new_user_password']); + $smarty->assign("new_user_password2",@$_POST['new_user_password2']); $smarty->assign("users" ,$this->get_user_list()); $smarty->assign("users_cnt" ,count($this->get_user_list())); $smarty->assign("groups",$this->get_group_list()); diff --git a/setup/setup_migrate.tpl b/setup/setup_migrate.tpl index 51139288a..0d11494e7 100644 --- a/setup/setup_migrate.tpl +++ b/setup/setup_migrate.tpl @@ -213,6 +213,14 @@
+ + + {t}Retype password{/t}:  + + +
+ +

-- 2.30.2