Update changelog; change name of new setting to email_verify_addresses setting

This commit is contained in:
Starbeamrainbowlabs 2020-01-05 23:10:19 +00:00
parent 344b7daa70
commit 5fdd91ce4c
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
3 changed files with 5 additions and 4 deletions

View File

@ -9,6 +9,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
- Email address verification
- Enabled by default. In order to receive emails users now need to verify their email address
- This is done via a verification email that's sent when you change your email address (even if your email address is the same when you change your preferences and you haven't yet verified it)
- A new `email_verify_addresses` setting has been added to control the functionality
## Fixed
- Fixed weighted word support on search query analysis debug page

View File

@ -66,7 +66,7 @@ register_module([
$content .= " <label for='email-address'>Email Address:</label>\n";
$content .= " <input type='email' id='email-address' name='email-address' placeholder='e.g. bob@bobsrockets.com' value='{$env->user_data->emailAddress}' />\n";
$content .= " <p><small>Used to send you notifications etc. Never shared with anyone except $settings->admindetails_name, $settings->sitename's administrator.</small></p>\n";
if($settings->email_user_verify) {
if($settings->email_verify_addresses) {
$content .= " <p>Email verification status: <strong>".(empty($env->user_data->emailAddressVerified) ? "not " : "")."verified</strong> <small><em>(Email address verification is required in order to receive emails (other than the verification email itself, of course). Click the link in the verification email sent to you to verify your address, or change it here to get another verification email - changing it to the same email address is ok)</em></small></p>";
}
$content .= " <input type='submit' value='Save Preferences' />\n";
@ -121,11 +121,11 @@ register_module([
// If email address verification is required and the email
// address has changed, send a verification email now
if($settings->email_user_verify) {
if($settings->email_verify_addresses) {
if(empty($env->user_data->emailAddressVerified) && $old_address !== $_POST["email-address"])
$env->user_data->emailAddressVerified = false;
if(empty($env->user_data->emailAddressVerified) && !email_user_verify($env->user)) {
if(empty($env->user_data->emailAddressVerified) && !email_verify_addresses($env->user)) {
http_response_code(503);
exit(page_renderer::render_main("Server error sending verification code - $settings->sitename", "<p>$settings->sitename tried to send you an email to verify your email address, but was unable to do so. The changes to your settings have not been saved. Please contact $settings->admindetails_name, whose email address can be found at the bottom of this page.</p>"));
}

View File

@ -231,7 +231,7 @@
"email_debug_dontsend": { "type": "checkbox", "description": "If set to true, emails are logged to the standard error instead of being actually sent.", "default": false },
"email_subject_utf8": { "type": "checkbox", "description": "Whether to encode the subject of emails sent to allow them to contain unicode characters. Without this, email subjects will be transliterated to ASCII. If utf-8 email subjects are disabled, page names may not be represented properly.", "default": true },
"email_body_utf8": { "type": "checkbox", "description": "Whether to send emails with utf-8 bodies. If set to false, email bodies will be transliterated to ASCII. If utf-8 email bodies are disabled, page names may not be represented properly.", "default": true },
"email_user_verify": { "type": "checkbox", "description": "Whether user email addresses must be verified in order to send emails to them.", "default": true },
"email_verify_addresses": { "type": "checkbox", "description": "Whether user email addresses must be verified in order to send emails to them.", "default": true },
"updateurl": { "type": "url", "description": "The url from which to fetch updates. Defaults to the master (development) branch. MAKE SURE THAT THIS POINTS TO A *HTTPS* URL, OTHERWISE SOMEONE COULD INJECT A VIRUS INTO YOUR WIKI!", "default": "https://raw.githubusercontent.com/sbrl/pepperminty-wiki/master/index.php" },
"optimize_pages": { "type": "checkbox", "description": "Whether to optimise all webpages generated.", "default": true },
"minify_pageindex": { "type": "checkbox", "description": "Whether to minify the page index when saving it. Improves performance slightly (especially on larger wikis), but can make debugging and quick ninja-edits more awkward. Note that this only takes effect when the page index is next saved.", "default": true },