From c9b2341dbfe82f4a5d7dde0450168ffa7c35f24b Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 21 Oct 2021 20:25:58 +0200 Subject: [PATCH] LSformElement::password: fix sendind email in create form --- src/includes/class/class.LSformElement_password.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/includes/class/class.LSformElement_password.php b/src/includes/class/class.LSformElement_password.php index b8f9f518..5fba5b6f 100644 --- a/src/includes/class/class.LSformElement_password.php +++ b/src/includes/class/class.LSformElement_password.php @@ -152,7 +152,10 @@ class LSformElement_password extends LSformElement { 'mail' => $mail, 'pwd' => $return[$this -> name][0] ); - $this -> attr_html -> attribute -> addObjectEvent('after_modify', $this, 'send'); + if ($this -> form -> idForm == 'create') + $this -> attr_html -> attribute -> addObjectEvent('after_create', $this, 'send'); + else + $this -> attr_html -> attribute -> addObjectEvent('after_modify', $this, 'send'); } } return $retval;