From 27e9282aa47d8181a19f1d3df233bb7cf3c27147 Mon Sep 17 00:00:00 2001 From: "Misty (Bot)" Date: Wed, 8 Sep 2021 16:27:01 +0000 Subject: [PATCH 01/65] chore: update changelog for v1.18.2 --- CHANGELOG.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 466a49bd4a..2331add3ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,46 @@ +#### v1.18.2 (2021-09-08) + +##### Chores + +* **deps:** update commitlint monorepo to v13 (87ba768f) +* incrementing version number - v1.18.1 (f8f80e4f) +* update changelog for v1.18.1 (0713475d) + +##### New Features + +* a slightly less ugly rewards panel (bf0c02a7) + +##### Bug Fixes + +* dashboard graph controls (a7855c4c) +* #9767 ACP change group icon fix (580a016b) +* #9781 (#9782) (0ce4b87d) +* replace logic in isPrivilegedOrSelfAndPasswordMatch to use privileges.users.canEdit (856ba78a) +* handle missing uid in deprecated socket call (cdaea611) +* use privileges.users.canEdit for image upload priv check (e33e046f) +* errors from registerComplete (a48bbdbf) +* simplify logic for fullname and email blanking in user retrieval (getUserDataByUserSlug) (60de0844) +* lint (1e2bda13) +* manifest error (488f0978) +* #9772, regression from https://github.com/NodeBB/NodeBB/commit/70a04bc10577e90e28d66a647d38cafc3307a285 (72710b80) +* push back some deprecations, remove deprecated stuff scheduled for v1.18.0 (dd4e66e2) +* deprecate userData.showHidden as it is functionally equivalent to userData.canEdit (4ac701d7) +* focus on save button on plugin activation (46e5e17d) +* #9773, fire hooks properly for priv changes (#9774) (6869920e) +* **deps:** + * update dependency sharp to v0.29.1 (ac6cd02f) + * update dependency nodebb-plugin-dbsearch to v5.0.3 (338f90fc) + * update dependency nodebb-theme-vanilla to v12.1.3 (0b3ea5ad) + * update dependency nodebb-theme-persona to v11.2.5 (57e54d55) + +##### Refactors + +* deprecate picture update socket call, new API routes for picture update (0a41741b) + +##### Tests + +* added test for external image via new change picture API (8cbad61e) + #### v1.18.1 (2021-09-03) ##### Chores From 0a56158bb42659b069aa7323f4944f7950f7915e Mon Sep 17 00:00:00 2001 From: "Misty (Bot)" Date: Wed, 8 Sep 2021 16:27:00 +0000 Subject: [PATCH 02/65] chore: incrementing version number - v1.18.2 (cherry picked from commit 854c078b7385ce9f84850e09c8a6d8cd654aaca2) Signed-off-by: Misty (Bot) --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index 1cb2211274..3f2f772b16 100644 --- a/install/package.json +++ b/install/package.json @@ -2,7 +2,7 @@ "name": "nodebb", "license": "GPL-3.0", "description": "NodeBB Forum", - "version": "1.18.1", + "version": "1.18.2", "homepage": "http://www.nodebb.org", "repository": { "type": "git", From 34afb7476254eee2d94e55e04f5a5f74c2db2f67 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 8 Sep 2021 14:05:51 -0400 Subject: [PATCH 03/65] fix: browsers autocompleting smtp fields when they should not --- src/views/admin/settings/email.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/admin/settings/email.tpl b/src/views/admin/settings/email.tpl index 1a8e98177e..76286d117e 100644 --- a/src/views/admin/settings/email.tpl +++ b/src/views/admin/settings/email.tpl @@ -122,14 +122,14 @@
- +

[[admin/settings/email:smtp-transport.username-help]]

- +
From 006fc700ddc6b9a17e87e9210c8a5eadf127e233 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 8 Sep 2021 14:18:20 -0400 Subject: [PATCH 04/65] feat: add ACP option to require email address on new registration --- public/language/en-GB/admin/settings/email.json | 2 ++ src/user/interstitials.js | 12 +++++++++--- src/views/admin/settings/email.tpl | 8 ++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/public/language/en-GB/admin/settings/email.json b/public/language/en-GB/admin/settings/email.json index 9bdbde26a6..af4e100eb6 100644 --- a/public/language/en-GB/admin/settings/email.json +++ b/public/language/en-GB/admin/settings/email.json @@ -37,6 +37,8 @@ "subscriptions.hour": "Digest Hour", "subscriptions.hour-help": "Please enter a number representing the hour to send scheduled email digests (e.g. 0 for midnight, 17 for 5:00pm). Keep in mind that this is the hour according to the server itself, and may not exactly match your system clock.
The approximate server time is:
The next daily digest is scheduled to be sent ", "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. It does not ensure user will enter a real email address, nor even an address they own.", "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). Enable this setting at your own risk – sending emails to unverified addresses may be a violation of regional anti-spam laws." } \ No newline at end of file diff --git a/src/user/interstitials.js b/src/user/interstitials.js index 5467711503..3a98b12373 100644 --- a/src/user/interstitials.js +++ b/src/user/interstitials.js @@ -57,9 +57,15 @@ Interstitials.email = async (data) => { // User attempting to edit another user's email -- not allowed throw new Error('[[error:no-privileges]]'); } - } else if (current) { - // User explicitly clearing their email - await user.email.remove(userData.uid, data.req.session.id); + } else { + if (meta.config.requireEmailAddress) { + throw new Error('[[error:invalid-email]]'); + } + + if (current) { + // User explicitly clearing their email + await user.email.remove(userData.uid, data.req.session.id); + } } } else { // New registrants have the confirm email sent from user.create() diff --git a/src/views/admin/settings/email.tpl b/src/views/admin/settings/email.tpl index 76286d117e..9d33950d7a 100644 --- a/src/views/admin/settings/email.tpl +++ b/src/views/admin/settings/email.tpl @@ -27,6 +27,14 @@ +
+ +
+

[[admin/settings/email:require-email-address-warning]]

+