Skip to content

Commit 6571c83

Browse files
authored
Merge pull request #71 from iMattPro/fixes
Small fixes
2 parents f68cd30 + 5606b85 commit 6571c83

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

controller/manifest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ public function __construct(config $config, language $language, path_helper $pat
5555
*/
5656
public function handle(): JsonResponse
5757
{
58-
if ($this->user->data['is_bot'] || $this->user->data['user_type'] == USER_INACTIVE)
58+
if ($this->user->data['is_bot'])
5959
{
60-
throw new http_exception(Response::HTTP_FORBIDDEN, 'Forbidden');
60+
throw new http_exception(Response::HTTP_FORBIDDEN, 'NO_AUTH_OPERATION');
6161
}
6262

6363
$board_path = $this->config['force_server_vars'] ? $this->config['script_path'] : $this->path_helper->get_web_root_path();

language/en/webpushnotifications_module_ucp.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
'NOTIFY_WEBPUSH_NOTIFICATIONS' => 'Web push notifications',
4343
'NOTIFY_WEBPUSH_DISABLE' => 'Disable push notifications',
4444
'NOTIFY_WEBPUSH_ENABLE' => 'Enable push notifications',
45+
'NOTIFY_WEBPUSH_ENABLE_SLIDER' => 'Enable push notifications',
4546
'NOTIFY_WEBPUSH_ENABLE_EXPLAIN' => 'Enabling push notifications will activate them on this device only. You can turn off notifications at any time through your browser settings or by clicking the button above. Additionally, if no web push notification types are selected below, you will not receive any web push notifications.',
4647
'NOTIFY_WEBPUSH_SUBSCRIBE' => 'Enable to subscribe',
4748
'NOTIFY_WEBPUSH_UNSUBSCRIBE' => 'Disable to unsubscribe',

language/ru/webpushnotifications_module_ucp.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
'NOTIFY_WEBPUSH_NOTIFICATIONS' => 'Браузерные push—уведомления',
4343
'NOTIFY_WEBPUSH_DISABLE' => 'Отключить',
4444
'NOTIFY_WEBPUSH_ENABLE' => 'Включить',
45+
'NOTIFY_WEBPUSH_ENABLE_SLIDER' => 'Браузерные уведомления',
4546
'NOTIFY_WEBPUSH_ENABLE_EXPLAIN' => 'Включение браузерных push—уведомлений активирует их только на данном устройстве. Вы сможете отключить их в любое время через настройки браузера или с помощью кнопки «Отключить» выше, которая появится после включения браузерных push—уведомлений. Если не выбран ни один из типов уведомлений в категории «Браузерные» ниже, вы также не будете получать браузерные push—уведомления.',
4647
'NOTIFY_WEBPUSH_SUBSCRIBE' => 'Подписаться',
4748
'NOTIFY_WEBPUSH_UNSUBSCRIBE' => 'Отписаться',

styles/all/template/event/notification_dropdown_footer_after.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% if NOTIFICATIONS_WEBPUSH_ENABLE and notification_types is not defined %}
22
<div class="wpn-notification-dropdown-footer" title="{{ lang('NOTIFY_WEBPUSH_DROPDOWN_TITLE') }}">
3-
<span class="ellipsis-text">{{ lang('NOTIFY_WEBPUSH_ENABLE') ~ lang('COLON') }}</span>
3+
<span class="ellipsis-text">{{ lang('NOTIFY_WEBPUSH_ENABLE_SLIDER') ~ lang('COLON') }}</span>
44
<button id="subscribe_webpush" name="subscribe_webpush" data-l-err="{{ lang('INFORMATION') }}" data-l-msg="{{ lang('NOTIFY_WEBPUSH_DENIED') }}">
55
<i class="icon fa-toggle-off fa-fw icon-lightgray" aria-hidden="true" title="{{ lang('NOTIFY_WEBPUSH_SUBSCRIBE') }}"><span class="sr-only">{{ lang('NOTIFY_WEBPUSH_SUBSCRIBE') }}</span></i>
66
</button>

ucp/controller/webpush.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function notification(): JsonResponse
100100
{
101101
if (!$this->request->is_ajax() || $this->user->data['is_bot'] || $this->user->data['user_type'] == USER_INACTIVE)
102102
{
103-
throw new http_exception(Response::HTTP_FORBIDDEN, 'Forbidden');
103+
throw new http_exception(Response::HTTP_FORBIDDEN, 'NO_AUTH_OPERATION');
104104
}
105105

106106
if ($this->user->id() !== ANONYMOUS)
@@ -129,7 +129,7 @@ private function get_user_notifications(): string
129129
// Subscribe should only be available for logged-in "normal" users
130130
if ($this->user->data['user_type'] == USER_IGNORE)
131131
{
132-
throw new http_exception(Response::HTTP_FORBIDDEN, 'Forbidden');
132+
throw new http_exception(Response::HTTP_FORBIDDEN, 'NO_AUTH_OPERATION');
133133
}
134134

135135
$item_id = $this->request->variable('item_id', 0);
@@ -189,7 +189,7 @@ private function get_anonymous_notifications(): string
189189
}
190190
}
191191

192-
throw new http_exception(Response::HTTP_FORBIDDEN, 'Forbidden');
192+
throw new http_exception(Response::HTTP_FORBIDDEN, 'NO_AUTH_OPERATION');
193193
}
194194

195195
/**

0 commit comments

Comments
 (0)