From d4d10c030a3328873576431c4818e16c74dcd045 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 3 Nov 2008 08:47:47 +0000 Subject: [PATCH] Allow to select password methods in templates. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12863 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/plugins/personal/generic/class_user.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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__, -- 2.30.2