allow password mails for new accounts
This commit is contained in:
parent
0c4c2c4cf6
commit
630aab2df1
|
@ -989,6 +989,12 @@ function sendPasswordMail($pwd, $user, $recipient = null) {
|
|||
if (!empty($recipient)) {
|
||||
$mailTo = $recipient;
|
||||
}
|
||||
if (empty($mailTo)) {
|
||||
logNewMessage(LOG_ERR, 'Unable to send password mail, no TO address set.');
|
||||
return array(
|
||||
array('ERROR', _('Unable to send mail!'))
|
||||
);
|
||||
}
|
||||
$mailFrom = $_SESSION['config']->getLamProMailFrom();
|
||||
$mailReplyTo = $_SESSION['config']->getLamProMailReplyTo();
|
||||
$mailSubject = $_SESSION['config']->getLamProMailSubject();
|
||||
|
|
|
@ -1056,7 +1056,7 @@ class accountContainer {
|
|||
$container->addElement(new htmlTableExtendedInputCheckbox('lamForcePasswordChange', false, _('Force password change')));
|
||||
$container->addElement(new htmlHelpLink('406'), true);
|
||||
}
|
||||
if (isLAMProVersion() && isset($this->attributes_orig['mail'][0])) {
|
||||
if (isLAMProVersion() && (isset($this->attributes_orig['mail'][0]) || $this->anyModuleManagesMail())) {
|
||||
$pwdMailCheckbox = new htmlTableExtendedInputCheckbox('lamPasswordChangeSendMail', false, _('Send via mail'));
|
||||
$pwdMailCheckbox->setTableRowsToShow(array('lamPasswordChangeSendMailAddress'));
|
||||
$container->addElement($pwdMailCheckbox);
|
||||
|
@ -1171,6 +1171,19 @@ class accountContainer {
|
|||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns if any module manages the mail attribute.
|
||||
*
|
||||
* @return boolean mail is managed
|
||||
*/
|
||||
private function anyModuleManagesMail() {
|
||||
foreach ($this->module as $mod) {
|
||||
if (in_array('mail', $mod->getManagedAttributes())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints common controls like the save button and the ou selection.
|
||||
|
|
Loading…
Reference in New Issue