LSformElement::password : Added mail headers parameters
authorBenjamin Renard <brenard@easter-eggs.com>
Tue, 17 Apr 2012 14:03:14 +0000 (16:03 +0200)
committerBenjamin Renard <brenard@easter-eggs.com>
Tue, 17 Apr 2012 14:03:14 +0000 (16:03 +0200)
doc/conf/LSattribute/LSattr_html/LSattr_html_password.docbook
public_html/includes/class/class.LSformElement_password.php

index 07627ed..c990441 100644 (file)
           l'attribut.</simpara>
         </listitem>
       </varlistentry>
+
+      <varlistentry>
+        <term>headers</term>
+        <listitem>
+          <simpara>Un tableau de type clé/valeur ou la clé est le nom d'un header
+          à ajouter au mail et la valeur est la valeur de l'header en question.
+          </simpara>
+        </listitem>
+      </varlistentry>
       
     </variablelist>
     
index c74d2ed..30d6eb5 100644 (file)
@@ -210,10 +210,17 @@ class LSformElement_password extends LSformElement {
       if (checkEmail($mail,NULL,true)) {
         $this -> attr_html -> attribute -> ldapObject -> registerOtherValue('password',$this -> sendMail['pwd']);
         $msg = $this -> attr_html -> attribute -> ldapObject -> getFData($this -> sendMail['msg']);
+        if (isset($this -> params['html_options']['mail']['headers'])) {
+          $headers = $this -> params['html_options']['mail']['headers'];
+        }
+        else {
+          $headers = array();
+        }
         if (sendMail(
           $mail,
           $this -> sendMail['subject'],
-          $msg
+          $msg,
+          $headers
         )) {
           LSsession :: addInfo(_('Notice mail sent.'));
         }