Code

Updated user class && password handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Nov 2008 07:21:32 +0000 (07:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Nov 2008 07:21:32 +0000 (07:21 +0000)
-Try to initialize password method with defaults.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12858 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/personal/generic/class_user.inc

index 66464197e96cd0c115b9d11019107f7079f5136e..2cbe1f0038e5613e2599c5a5f1c009b4b1860eb8 100644 (file)
@@ -816,6 +816,20 @@ class user extends plugin
         }
       }
 
+      if($this->pw_storage != $this->last_pw_storage && isset($_POST['pw_storage'])){
+        if ($this->acl_is_writeable("userPassword")){
+          $temp= passwordMethod::get_available_methods();
+          if (!is_object($this->pwObject) || !($this->pwObject instanceOf $temp[$this->pw_storage])){
+            foreach($temp as $id => $data){
+              if(isset($data['name']) && $data['name'] == $this->pw_storage && $data['is_configurable']){
+                $this->pwObject= new $temp[$this->pw_storage]($this->config,$this->dn);
+                break;
+              }
+            }
+          }
+        }
+      }
+
       /* Save current cn
        */
       $this->cn = $this->givenName." ".$this->sn;