LSformElement::password : Added mail headers parameters

This commit is contained in:
Benjamin Renard 2012-04-17 16:03:14 +02:00
parent a516c5be74
commit d74b6a6200
2 changed files with 17 additions and 1 deletions

View file

@ -165,6 +165,15 @@
</listitem> </listitem>
</varlistentry> </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> </variablelist>
</para> </para>

View file

@ -210,10 +210,17 @@ class LSformElement_password extends LSformElement {
if (checkEmail($mail,NULL,true)) { if (checkEmail($mail,NULL,true)) {
$this -> attr_html -> attribute -> ldapObject -> registerOtherValue('password',$this -> sendMail['pwd']); $this -> attr_html -> attribute -> ldapObject -> registerOtherValue('password',$this -> sendMail['pwd']);
$msg = $this -> attr_html -> attribute -> ldapObject -> getFData($this -> sendMail['msg']); $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( if (sendMail(
$mail, $mail,
$this -> sendMail['subject'], $this -> sendMail['subject'],
$msg $msg,
$headers
)) { )) {
LSsession :: addInfo(_('Notice mail sent.')); LSsession :: addInfo(_('Notice mail sent.'));
} }