summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 017b9c3)
raw | patch | inline | side by side (parent: 017b9c3)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 13:22:50 +0000 (13:22 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 2 May 2007 13:22:50 +0000 (13:22 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6232 594d385d-05f5-0310-b6e9-bd551577e9d8
setup/class_setupStep_Migrate.inc | patch | blob | history | |
setup/setup_migrate.tpl | patch | blob | history |
index 42288d6aa9ff7a3105f9318d483e03ddfde3e8f5..57fc5efdcba52fefec994aa229ccb0e15a896a25 100644 (file)
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'],
$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");
if(!$res){
print_red($ldap->get_error());
+ return(FALSE);
}
$this->acl_create_dialog=FALSE;
$this->check_administrativeAccount();
+ return(TRUE);
}
}
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());
index 51139288abcc459b0ab22de77dfee1631af3ae6c..0d11494e7d9144f040d958107f0d1debe3439a82 100644 (file)
--- a/setup/setup_migrate.tpl
+++ b/setup/setup_migrate.tpl
<input type='input' value='{$new_user_password}' name='new_user_password'><br>
</td>
</tr>
+ </tr>
+ <td>
+ {t}Retype password{/t}:
+ </td>
+ <td>
+ <input type='input' value='{$new_user_password2}' name='new_user_password2'><br>
+ </td>
+ </tr>
</table>
<input type='submit' name='create_admin_user' value='{t}Create{/t}'>
</p>