From 68362ba14079f7bca663b83de013d3ab1fa9157d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come.chilliet@fusiondirectory.org>
Date: Wed, 16 Oct 2019 15:16:19 +0200
Subject: [PATCH] :ambulance: fix(6035) Set userPassword to %askme% by default
 in templates

This makes more sense since it means asking for password at creation,
 and not changing password when applying.

issue #6035
---
 plugins/personal/generic/class_user.inc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc
index a45f134b1..4a55f638c 100644
--- a/plugins/personal/generic/class_user.inc
+++ b/plugins/personal/generic/class_user.inc
@@ -256,6 +256,10 @@ class user extends simplePlugin
   {
     parent::__construct($dn, $object, $parent, $mainTab);
 
+    if ($this->is_template && !$this->initially_was_account) {
+      $this->attributesAccess['userPassword']->setValue('%askme%');
+    }
+
     $this->attributesAccess['uid']->setUnique('whole');
     $this->attributesAccess['uid']->setAutocomplete(FALSE);
     $this->attributesAccess['uid']->setDisabled($this->initially_was_account && !$this->is_template);
-- 
GitLab