From 05ecd64b2cbcf614be340ff3ddb656c7df836ba0 Mon Sep 17 00:00:00 2001 From: Daniel Aleksandersen Date: Fri, 3 Dec 2021 00:48:31 +0100 Subject: [PATCH 1/2] Fix admin-only email setting --- admin/settings/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/settings/index.php b/admin/settings/index.php index 3402e343..8c2ecb42 100644 --- a/admin/settings/index.php +++ b/admin/settings/index.php @@ -148,7 +148,7 @@ function ui_array (Setup $setup, Locale $locale) 'options' => array ( 'to-everyone' => 'Everyone, admin and users', 'to-users' => 'Users only, when they reply to each other', - 'no-admin' => 'Admin only', + 'to-admin' => 'Admin only', 'to-nobody' => 'Nobody' ) ), From 5814a4531d328fa9b91cc2d6e6acee8abdf9c2d0 Mon Sep 17 00:00:00 2001 From: Daniel Aleksandersen Date: Fri, 3 Dec 2021 01:09:47 +0100 Subject: [PATCH 2/2] Hide notification button when emailer disabled --- backend/classes/commentsui.php | 4 ++-- backend/classes/formui.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/classes/commentsui.php b/backend/classes/commentsui.php index 817abe7e..845ac4db 100644 --- a/backend/classes/commentsui.php +++ b/backend/classes/commentsui.php @@ -382,7 +382,7 @@ public function replyForm ($permalink = '{permalink}', $url = '{url}', $thread = )); // Add checkbox label element to reply form footer element - if ($this->setup->emailField !== 'off') { + if ($this->setup->emailField !== 'off' && in_array($this->setup->sendsNotifications, ['to-everyone', 'to-users'])) { if ($this->login->userIsLoggedIn === false or !empty ($this->login->email)) { $subscribe_label = $this->subscribeLabel ($permalink, 'reply', $subscribed); $reply_form_links_wrapper->appendChild ($subscribe_label); @@ -573,7 +573,7 @@ public function editForm ($permalink = '{permalink}', $url = '{url}', $thread = )); // Add checkbox label element to edit form buttons wrapper element - if ($this->setup->emailField !== 'off') { + if ($this->setup->emailField !== 'off' && in_array($this->setup->sendsNotifications, ['to-everyone', 'to-users'])) { $subscribe_label = $this->subscribeLabel ($permalink, 'edit', $subscribed); $edit_form_links_wrapper->appendChild ($subscribe_label); } diff --git a/backend/classes/formui.php b/backend/classes/formui.php index a0a58de3..2b17de0c 100644 --- a/backend/classes/formui.php +++ b/backend/classes/formui.php @@ -838,7 +838,7 @@ public function initialHTML ($hashover_wrapper = true) )); // Add checkbox label element to main form buttons wrapper element - if ($this->setup->emailField !== 'off') { + if ($this->setup->emailField !== 'off' && in_array($this->setup->sendsNotifications, ['to-everyone', 'to-users'])) { if ($this->login->userIsLoggedIn === false or !empty ($this->login->email)) { $subscribed = ($this->setup->subscribesUser === true); $subscribe_label = $this->subscribeLabel ('', 'main', $subscribed);