From: hickert Date: Mon, 3 Nov 2008 08:47:47 +0000 (+0000) Subject: Allow to select password methods in templates. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d4d10c030a3328873576431c4818e16c74dcd045;p=gosa.git Allow to select password methods in templates. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12863 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc index 2cbe1f003..d07458802 100644 --- a/gosa-core/plugins/personal/generic/class_user.inc +++ b/gosa-core/plugins/personal/generic/class_user.inc @@ -1049,7 +1049,14 @@ class user extends plugin /* Set password to some junk stuff in case of templates */ if ($this->is_template){ - $this->attrs['userPassword']= '{crypt}N0T$3T4N0W'; + $temp= passwordMethod::get_available_methods(); + foreach($temp as $id => $data){ + if(isset($data['name']) && $data['name'] == $this->pw_storage){ + $tmp = new $temp[$this->pw_storage]($this->config,$this->dn); + $this->attrs['userPassword'] = $tmp->create_template_hash($this->attrs); + break; + } + } } @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,