From: cajus Date: Fri, 30 Nov 2007 10:30:07 +0000 (+0000) Subject: Add more pw functionality X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3bfdc3f0a4caa25759877653c4a968058d0d5b2a;p=gosa.git Add more pw functionality git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7951 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index cb0d10f7f..f67b555fc 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -55,6 +55,7 @@ class user extends plugin var $old_photoData= ""; var $cert_dialog= FALSE; var $picture_dialog= FALSE; + var $pwObject= NULL; var $userPKCS12= ""; var $userSMIMECertificate= ""; @@ -328,6 +329,16 @@ class user extends plugin } } + /* Password configure dialog handling */ + if(is_object($this->pwObject) && is_object($this->dialog)){ + $output= $this->pwObject->configure(); + if ($output != ""){ + return $output; + } + + $this->dialog= false; + } + /* Dialog handling */ if(is_object($this->dialog)){ /* Must be called before save_object */ @@ -348,6 +359,18 @@ class user extends plugin } } + /* Want password method editing? */ + if ($this->acl_is_writeable("userPassword")){ + if (isset($_POST['edit_pw_method'])){ + if (!is_object($this->pwObject) || $this->pw_storage != $this->pwObject->get_hash_name()){ + $temp= passwordMethod::get_available_methods(); + $this->pwObject= new $temp[$this->pw_storage]($this->config); + $this->dialog= &$this->pwObject; + } + return ($this->pwObject->configure()); + } + } + /* Want picture edit dialog? */ if($this->acl_is_writeable("userPicture")) { if (isset($_POST['edit_picture'])){ @@ -1027,6 +1050,11 @@ class user extends plugin } } + /* Maybe the current password method want's to do some changes... */ + if (is_object($this->pwObject)){ + $this->pwObject->save($this->dn); + } + /* Optionally execute a command after we're done */ if ($mode == "add"){ $this->handle_post_events("add", array("uid" => $this->uid));