diff --git a/README.md b/README.md index 75a6828..5428c36 100644 --- a/README.md +++ b/README.md @@ -156,11 +156,24 @@ To send emails you'll need to use an existing SMTP server. Email sending will b * `EMAIL_FROM_NAME` (default: *`SITE_NAME`*): The FROM name used when sending out emails. The default name is taken from `SITE_NAME` under **Organisation settings**. +* `MAIL_SUBJECT` (default: Your $ORGANISATION_NAME account has been created.): The mail subject + +* `MAIL_BODY` (default: ): The mail body. You can use the following substring in the body which will be replaced by user info: + + - `#username#`: the user username + - `#first_name#`: the user first name + - `#last_name#`: the user last name + - `#password#`: the user password + +**Account requests** + #### Account request settings -* `ACCOUNT_REQUESTS_ENABLED` (default: *FALSE*): Set to TRUE in order to enable a form that people can fill in to request an account. This will send an email to `ACCOUNT_REQUESTS_EMAIL` with their details and a link to the account creation page where the details will be filled in automatically. You'll need to set up email sending (see **Email sending**, above) for this to work. If this is enabled but email sending isn't then requests will be disabled and an error message sent to the logs. - -* `ACCOUNT_REQUESTS_EMAIL` (default: *`EMAIL_FROM_ADDRESS`*): This is the email address that any requests for a new account are sent to. +* `ACCOUNT_REQUESTS_ENABLED` (default: *FALSE*): Set to TRUE in order to enable a form that people can fill in to request an account. This will send an email to `ACCOUNT_REQUESTS_EMAIL` with their details and a link to the account creation page where the details will be filled in automatically. You'll need to set up email sending (see **Email sending**, above) for this to work. If this is enabled but email sending isn't then requests will be disabled and an error message sent to the logs. + +* `ACCOUNT_REQUESTS_EMAIL` (default: *{EMAIL_FROM_ADDRESS}*): This is the email address that any requests for a new account are sent to. + +**Site security settings** #### Website security diff --git a/www/account_manager/index.php b/www/account_manager/index.php index d6a3fcb..e81a8f2 100644 --- a/www/account_manager/index.php +++ b/www/account_manager/index.php @@ -51,6 +51,10 @@ $people = ldap_get_user_list($ldap_connection); ?>
+
+

accounts

+
+
diff --git a/www/account_manager/new_user.php b/www/account_manager/new_user.php index b9694d9..30b446d 100644 --- a/www/account_manager/new_user.php +++ b/www/account_manager/new_user.php @@ -121,9 +121,9 @@ if (isset($_POST['create_account'])) { if (isset($send_user_email) and $send_user_email == TRUE) { - $mail_subject = "Your $ORGANISATION_NAME account has been created."; + $mail_subject = getenv('MAIL_SUBJECT') ?: "Your $ORGANISATION_NAME account has been created."; -$mail_body = <<CharSet = 'UTF-8'; $mail->isSMTP(); $mail->SMTPDebug = $SMTP['debug_level']; @@ -29,6 +30,7 @@ function send_email($recipient_email,$recipient_name,$subject,$body) { $mail->addAddress($recipient_email, $recipient_name); $mail->Subject = $subject; $mail->Body = $body; + $mail->IsHTML(true); if (!$mail->Send()) { error_log("$log_prefix SMTP: Unable to send email: " . $mail->ErrorInfo);