mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: add ACP option to require email address on new registration
This commit is contained in:
@@ -37,6 +37,8 @@
|
|||||||
"subscriptions.hour": "Digest Hour",
|
"subscriptions.hour": "Digest Hour",
|
||||||
"subscriptions.hour-help": "Please enter a number representing the hour to send scheduled email digests (e.g. <code>0</code> for midnight, <code>17</code> for 5:00pm). Keep in mind that this is the hour according to the server itself, and may not exactly match your system clock.<br /> The approximate server time is: <span id=\"serverTime\"></span><br /> The next daily digest is scheduled to be sent <span id=\"nextDigestTime\"></span>",
|
"subscriptions.hour-help": "Please enter a number representing the hour to send scheduled email digests (e.g. <code>0</code> for midnight, <code>17</code> for 5:00pm). Keep in mind that this is the hour according to the server itself, and may not exactly match your system clock.<br /> The approximate server time is: <span id=\"serverTime\"></span><br /> The next daily digest is scheduled to be sent <span id=\"nextDigestTime\"></span>",
|
||||||
"notifications.remove-images": "Remove images from email notifications",
|
"notifications.remove-images": "Remove images from email notifications",
|
||||||
|
"require-email-address": "Require new users to specify an email address",
|
||||||
|
"require-email-address-warning": "By default, users can opt-out of entering an email address. Enabling this option means they have to enter an email address in order to proceed with registration. <strong>It does not ensure user will enter a real email address, nor even an address they own.</strong>",
|
||||||
"include-unverified-emails": "Send emails to recipients who have not explicitly confirmed their emails",
|
"include-unverified-emails": "Send emails to recipients who have not explicitly confirmed their emails",
|
||||||
"include-unverified-warning": "By default, users with emails associated with their account have already been verified, but there are situations where this is not the case (e.g. SSO logins, grandfathered users, etc). <strong>Enable this setting at your own risk</strong> – sending emails to unverified addresses may be a violation of regional anti-spam laws."
|
"include-unverified-warning": "By default, users with emails associated with their account have already been verified, but there are situations where this is not the case (e.g. SSO logins, grandfathered users, etc). <strong>Enable this setting at your own risk</strong> – sending emails to unverified addresses may be a violation of regional anti-spam laws."
|
||||||
}
|
}
|
||||||
@@ -57,9 +57,15 @@ Interstitials.email = async (data) => {
|
|||||||
// User attempting to edit another user's email -- not allowed
|
// User attempting to edit another user's email -- not allowed
|
||||||
throw new Error('[[error:no-privileges]]');
|
throw new Error('[[error:no-privileges]]');
|
||||||
}
|
}
|
||||||
} else if (current) {
|
} else {
|
||||||
// User explicitly clearing their email
|
if (meta.config.requireEmailAddress) {
|
||||||
await user.email.remove(userData.uid, data.req.session.id);
|
throw new Error('[[error:invalid-email]]');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (current) {
|
||||||
|
// User explicitly clearing their email
|
||||||
|
await user.email.remove(userData.uid, data.req.session.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// New registrants have the confirm email sent from user.create()
|
// New registrants have the confirm email sent from user.create()
|
||||||
|
|||||||
@@ -27,6 +27,14 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="checkbox">
|
||||||
|
<label for="requireEmailAddress" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
|
<input class="mdl-switch__input" type="checkbox" id="requireEmailAddress" data-field="requireEmailAddress" name="requireEmailAddress" />
|
||||||
|
<span class="mdl-switch__label">[[admin/settings/email:require-email-address]]</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<p class="help-block">[[admin/settings/email:require-email-address-warning]]</p>
|
||||||
|
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label for="includeUnverifiedEmails" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
<label for="includeUnverifiedEmails" class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
<input class="mdl-switch__input" type="checkbox" id="includeUnverifiedEmails" data-field="includeUnverifiedEmails" name="includeUnverifiedEmails" />
|
<input class="mdl-switch__input" type="checkbox" id="includeUnverifiedEmails" data-field="includeUnverifiedEmails" name="includeUnverifiedEmails" />
|
||||||
|
|||||||
Reference in New Issue
Block a user