From ef2a636ee407633fa658e22603c8feedb534eeea Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 14 Dec 2009 10:11:47 +0000 Subject: [PATCH] Fixed problem with password hash modifications and missing password change request git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14896 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/users/class_userManagement.inc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 1b14c0a5a..50029c1c2 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -33,6 +33,7 @@ class userManagement extends management var $edit_uid = ""; var $pwd_change_queue = array(); + var $force_hash_type = array(); // Tab definition protected $tabClass = "usertabs"; @@ -256,8 +257,14 @@ class userManagement extends management } // Change cassword - if(!change_password ($this->dn, $_POST['new_password'])){ - return($smarty->fetch(get_template_path('password.tpl', TRUE))); + if(isset($this->force_hash_type[$this->dn])){ + if(!change_password ($this->dn, $_POST['new_password'],0,$this->force_hash_type[$this->dn])){ + return($smarty->fetch(get_template_path('password.tpl', TRUE))); + } + }else{ + if(!change_password ($this->dn, $_POST['new_password'])){ + return($smarty->fetch(get_template_path('password.tpl', TRUE))); + } } if ($this->config->get_cfg_value("passwordHook") != ""){ exec($this->config->get_cfg_value("passwordHook")." ".$username." ".$_POST['new_password'], $resarr); @@ -287,7 +294,12 @@ class userManagement extends management function saveChanges() { management::saveChanges(); - if($this->last_dn == "new"){ + + if(isset($this->last_tabObject->by_object['user']) && $this->last_tabObject->by_object['user']->password_change_needed()){ + $this->force_hash_type[$this->last_tabObject->dn] = $this->last_tabObject->by_object['user']->pw_storage; + $this->pwd_change_queue[] = $this->last_tabObject->dn; + return($this->handlePasswordQueue()); + }elseif($this->last_dn == "new"){ $this->pwd_change_queue[] = $this->last_tabObject->dn; return($this->handlePasswordQueue()); } -- 2.30.2