Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix admin-only email setting #319

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin/settings/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
),
Expand Down
4 changes: 2 additions & 2 deletions backend/classes/commentsui.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion backend/classes/formui.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down