reply-to for password reset mails
This commit is contained in:
parent
c33e212295
commit
14901fa203
|
@ -194,6 +194,8 @@ $helpArray = array (
|
||||||
'<li>' . _('The wildcard for the new password is @@newPassword@@.') . '</li>'),
|
'<li>' . _('The wildcard for the new password is @@newPassword@@.') . '</li>'),
|
||||||
"553" => array ("Headline" => _("HTML format"),
|
"553" => array ("Headline" => _("HTML format"),
|
||||||
"Text" => _('Specifies if the mail should be sent as text or HTML.')),
|
"Text" => _('Specifies if the mail should be sent as text or HTML.')),
|
||||||
|
"554" => array ("Headline" => _("Reply-to address"),
|
||||||
|
"Text" => _("This email address will be set as reply-to address of all password mails.")),
|
||||||
// 600 - 699
|
// 600 - 699
|
||||||
// OU-editor, domain page
|
// OU-editor, domain page
|
||||||
"601" => array ("Headline" => _("OU-Editor") . " - " . _("New organisational unit"),
|
"601" => array ("Headline" => _("OU-Editor") . " - " . _("New organisational unit"),
|
||||||
|
|
|
@ -257,6 +257,9 @@ class LAMConfig {
|
||||||
/** email address for sender of password reset mails */
|
/** email address for sender of password reset mails */
|
||||||
private $lamProMailFrom = '';
|
private $lamProMailFrom = '';
|
||||||
|
|
||||||
|
/** reply-to email address for password reset mails */
|
||||||
|
private $lamProMailReplyTo = '';
|
||||||
|
|
||||||
/** subject for password reset mails */
|
/** subject for password reset mails */
|
||||||
private $lamProMailSubject = '';
|
private $lamProMailSubject = '';
|
||||||
|
|
||||||
|
@ -270,7 +273,7 @@ class LAMConfig {
|
||||||
private $settings = array("ServerURL", "useTLS", "Passwd", "Admins", "treesuffix",
|
private $settings = array("ServerURL", "useTLS", "Passwd", "Admins", "treesuffix",
|
||||||
"defaultLanguage", "scriptPath", "scriptServer", "scriptRights", "cachetimeout",
|
"defaultLanguage", "scriptPath", "scriptServer", "scriptRights", "cachetimeout",
|
||||||
"modules", "activeTypes", "types", "accessLevel", 'loginMethod', 'loginSearchSuffix',
|
"modules", "activeTypes", "types", "accessLevel", 'loginMethod', 'loginSearchSuffix',
|
||||||
'loginSearchFilter', 'searchLimit', 'lamProMailFrom', 'lamProMailSubject',
|
'loginSearchFilter', 'searchLimit', 'lamProMailFrom', 'lamProMailReplyTo', 'lamProMailSubject',
|
||||||
'lamProMailText', 'lamProMailIsHTML');
|
'lamProMailText', 'lamProMailIsHTML');
|
||||||
|
|
||||||
|
|
||||||
|
@ -423,6 +426,7 @@ class LAMConfig {
|
||||||
if (!in_array("loginSearchSuffix", $saved)) array_push($file_array, "\n\n# Search suffix for LAM login.\n" . "loginSearchSuffix: " . $this->loginSearchSuffix . "\n");
|
if (!in_array("loginSearchSuffix", $saved)) array_push($file_array, "\n\n# Search suffix for LAM login.\n" . "loginSearchSuffix: " . $this->loginSearchSuffix . "\n");
|
||||||
if (!in_array("loginSearchFilter", $saved)) array_push($file_array, "\n\n# Search filter for LAM login.\n" . "loginSearchFilter: " . $this->loginSearchFilter . "\n");
|
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("lamProMailFrom", $saved)) array_push($file_array, "\n\n# Password mail from\n" . "lamProMailFrom: " . $this->lamProMailFrom . "\n");
|
||||||
|
if (!in_array("lamProMailReplyTo", $saved)) array_push($file_array, "\n\n# Password mail reply-to\n" . "lamProMailReplyTo: " . $this->lamProMailReplyTo . "\n");
|
||||||
if (!in_array("lamProMailSubject", $saved)) array_push($file_array, "\n\n# Password mail subject\n" . "lamProMailSubject: " . $this->lamProMailSubject . "\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("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");
|
if (!in_array("lamProMailText", $saved)) array_push($file_array, "\n\n# Password mail text\n" . "lamProMailText: " . $this->lamProMailText . "\n");
|
||||||
|
@ -1059,6 +1063,29 @@ class LAMConfig {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the reply-to address for password reset mails.
|
||||||
|
*
|
||||||
|
* @return String mail address
|
||||||
|
*/
|
||||||
|
public function getLamProMailReplyTo() {
|
||||||
|
return $this->lamProMailReplyTo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the reply-to address for password reset mails.
|
||||||
|
*
|
||||||
|
* @param String $lamProMailReplyTo mail address
|
||||||
|
* @return boolean true if address is valid
|
||||||
|
*/
|
||||||
|
public function setLamProMailReplyTo($lamProMailReplyTo) {
|
||||||
|
$this->lamProMailReplyTo = $lamProMailReplyTo;
|
||||||
|
if (($lamProMailReplyTo != '') && !get_preg($lamProMailReplyTo, 'email') && !get_preg($lamProMailReplyTo, 'emailWithName')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the subject for password reset mails.
|
* Returns the subject for password reset mails.
|
||||||
*
|
*
|
||||||
|
|
|
@ -314,6 +314,9 @@ if (isLAMProVersion()) {
|
||||||
$pwdMailFrom = new htmlTableExtendedInputField(_('From address'), 'pwdResetMail_from', $conf->getLamProMailFrom(), '550');
|
$pwdMailFrom = new htmlTableExtendedInputField(_('From address'), 'pwdResetMail_from', $conf->getLamProMailFrom(), '550');
|
||||||
$pwdMailContent->addElement($pwdMailFrom, true);
|
$pwdMailContent->addElement($pwdMailFrom, true);
|
||||||
|
|
||||||
|
$pwdMailReplyTo = new htmlTableExtendedInputField(_('Reply-to address'), 'pwdResetMail_replyTo', $conf->getLamProMailReplyTo(), '554');
|
||||||
|
$pwdMailContent->addElement($pwdMailReplyTo, true);
|
||||||
|
|
||||||
$pwdMailSubject = new htmlTableExtendedInputField(_('Subject'), 'pwdResetMail_subject', $conf->getLamProMailSubject(), '551');
|
$pwdMailSubject = new htmlTableExtendedInputField(_('Subject'), 'pwdResetMail_subject', $conf->getLamProMailSubject(), '551');
|
||||||
$pwdMailContent->addElement($pwdMailSubject, true);
|
$pwdMailContent->addElement($pwdMailSubject, true);
|
||||||
|
|
||||||
|
@ -418,6 +421,9 @@ function checkInput() {
|
||||||
if (!$conf->setLamProMailFrom($_POST['pwdResetMail_from'])) {
|
if (!$conf->setLamProMailFrom($_POST['pwdResetMail_from'])) {
|
||||||
$errors[] = array("ERROR", _("From address for password mails is invalid."), $_POST['pwdResetMail_from']);
|
$errors[] = array("ERROR", _("From address for password mails is invalid."), $_POST['pwdResetMail_from']);
|
||||||
}
|
}
|
||||||
|
if (!$conf->setLamProMailReplyTo($_POST['pwdResetMail_replyTo'])) {
|
||||||
|
$errors[] = array("ERROR", _("Reply-to address for password mails is invalid."), $_POST['pwdResetMail_replyTo']);
|
||||||
|
}
|
||||||
$conf->setLamProMailSubject($_POST['pwdResetMail_subject']);
|
$conf->setLamProMailSubject($_POST['pwdResetMail_subject']);
|
||||||
if (isset($_POST['pwdResetMail_isHTML']) && ($_POST['pwdResetMail_isHTML'] == 'on')) {
|
if (isset($_POST['pwdResetMail_isHTML']) && ($_POST['pwdResetMail_isHTML'] == 'on')) {
|
||||||
$conf->setLamProMailIsHTML('true');
|
$conf->setLamProMailIsHTML('true');
|
||||||
|
|
Loading…
Reference in New Issue