diff --git a/lam/help/help.inc b/lam/help/help.inc
index aaf2db72..88b5b834 100644
--- a/lam/help/help.inc
+++ b/lam/help/help.inc
@@ -192,6 +192,8 @@ $helpArray = array (
'
' . _('Format') . ':
' .
'- ' . _('You can use wildcards for LDAP attributes in the form @@attribute@@ (e.g. @@uid@@ for the user name).') . '
' .
'- ' . _('The wildcard for the new password is @@newPassword@@.') . '
'),
+ "553" => array ("Headline" => _("HTML format"),
+ "Text" => _('Specifies if the mail should be sent as text or HTML.')),
// 600 - 699
// OU-editor, domain page
"601" => array ("Headline" => _("OU-Editor") . " - " . _("New organizational unit"),
diff --git a/lam/lib/config.inc b/lam/lib/config.inc
index 476ff255..9a0d1225 100644
--- a/lam/lib/config.inc
+++ b/lam/lib/config.inc
@@ -260,6 +260,9 @@ class LAMConfig {
/** subject for password reset mails */
private $lamProMailSubject = '';
+ /** treat password reset mail body as HTML */
+ private $lamProMailIsHTML = 'false';
+
/** mail body for password reset mails */
private $lamProMailText = '';
@@ -267,7 +270,8 @@ class LAMConfig {
private $settings = array("ServerURL", "useTLS", "Passwd", "Admins", "treesuffix",
"defaultLanguage", "scriptPath", "scriptServer", "scriptRights", "cachetimeout",
"modules", "activeTypes", "types", "accessLevel", 'loginMethod', 'loginSearchSuffix',
- 'loginSearchFilter', 'searchLimit', 'lamProMailFrom', 'lamProMailSubject', 'lamProMailText');
+ 'loginSearchFilter', 'searchLimit', 'lamProMailFrom', 'lamProMailSubject',
+ 'lamProMailText', 'lamProMailIsHTML');
/**
@@ -420,6 +424,7 @@ class LAMConfig {
if (!in_array("loginSearchFilter", $saved)) array_push($file_array, "\n\n# Search filter for LAM login.\n" . "loginSearchFilter: " . $this->loginSearchFilter . "\n");
if (!in_array("lamProMailFrom", $saved)) array_push($file_array, "\n\n# Password mail from\n" . "lamProMailFrom: " . $this->lamProMailFrom . "\n");
if (!in_array("lamProMailSubject", $saved)) array_push($file_array, "\n\n# Password mail subject\n" . "lamProMailSubject: " . $this->lamProMailSubject . "\n");
+ if (!in_array("lamProMailIsHTML", $saved)) array_push($file_array, "\n\n# Password mail is HTML\n" . "lamProMailIsHTML: " . $this->lamProMailIsHTML . "\n");
if (!in_array("lamProMailText", $saved)) array_push($file_array, "\n\n# Password mail text\n" . "lamProMailText: " . $this->lamProMailText . "\n");
// check if all module settings were added
$m_settings = array_keys($this->moduleSettings);
@@ -1071,6 +1076,24 @@ class LAMConfig {
public function setLamProMailSubject($lamProMailSubject) {
$this->lamProMailSubject = $lamProMailSubject;
}
+
+ /**
+ * Returns if the password reset mail content should be treated as HTML.
+ *
+ * @return boolean HTML or text
+ */
+ public function getLamProMailIsHTML() {
+ return $this->lamProMailIsHTML;
+ }
+
+ /**
+ * Sets if the password reset mail content should be treated as HTML.
+ *
+ * @param boolean $lamProMailIsHTML
+ */
+ public function setLamProMailIsHTML($lamProMailIsHTML) {
+ $this->lamProMailIsHTML = $lamProMailIsHTML;
+ }
/**
* Returns the mail body for password reset mails.
diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php
index 84edb37f..85e6b402 100644
--- a/lam/templates/config/confmain.php
+++ b/lam/templates/config/confmain.php
@@ -317,6 +317,12 @@ if (isLAMProVersion()) {
$pwdMailSubject = new htmlTableExtendedInputField(_('Subject'), 'pwdResetMail_subject', $conf->getLamProMailSubject(), '551');
$pwdMailContent->addElement($pwdMailSubject, true);
+ $pwdMailIsHTML = false;
+ if ($conf->getLamProMailIsHTML() == 'true') {
+ $pwdMailIsHTML = true;
+ }
+ $pwdMailContent->addElement(new htmlTableExtendedInputCheckbox('pwdResetMail_isHTML',$pwdMailIsHTML , _('HTML format'), '553'), true);
+
$pwdMailBody = new htmlTableExtendedInputTextarea('pwdResetMail_body', $conf->getLamProMailText(), 50, 4, _('Text'), '552');
$pwdMailContent->addElement($pwdMailBody, true);
@@ -413,6 +419,12 @@ function checkInput() {
$errors[] = array("ERROR", _("From address for password mails is invalid."), $_POST['pwdResetMail_from']);
}
$conf->setLamProMailSubject($_POST['pwdResetMail_subject']);
+ if (isset($_POST['pwdResetMail_isHTML']) && ($_POST['pwdResetMail_isHTML'] == 'on')) {
+ $conf->setLamProMailIsHTML('true');
+ }
+ else {
+ $conf->setLamProMailIsHTML('false');
+ }
$conf->setLamProMailText($_POST['pwdResetMail_body']);
}
$adminText = $_POST['admins'];