diff --git a/phpBB/phpbb/ucp/controller/webpush.php b/phpBB/phpbb/ucp/controller/webpush.php index 15e54956fb..cac2f10291 100644 --- a/phpBB/phpbb/ucp/controller/webpush.php +++ b/phpBB/phpbb/ucp/controller/webpush.php @@ -103,7 +103,7 @@ class webpush { if (!$this->request->is_ajax() || $this->user->data['is_bot'] || $this->user->data['user_type'] == USER_INACTIVE) { - throw new http_exception(Response::HTTP_FORBIDDEN, 'Forbidden'); + throw new http_exception(Response::HTTP_FORBIDDEN, 'NO_AUTH_OPERATION'); } if ($this->user->id() !== ANONYMOUS) @@ -132,7 +132,7 @@ class webpush // Subscribe should only be available for logged-in "normal" users if ($this->user->data['user_type'] == USER_IGNORE) { - throw new http_exception(Response::HTTP_FORBIDDEN, 'Forbidden'); + throw new http_exception(Response::HTTP_FORBIDDEN, 'NO_AUTH_OPERATION'); } $item_id = $this->request->variable('item_id', 0); @@ -192,7 +192,7 @@ class webpush } } - throw new http_exception(Response::HTTP_FORBIDDEN, 'Forbidden'); + throw new http_exception(Response::HTTP_FORBIDDEN, 'NO_AUTH_OPERATION'); } /** @@ -251,7 +251,7 @@ class webpush } // Subscribe should only be available for logged-in "normal" users - if (!$this->request->is_ajax() || $this->user->id() == ANONYMOUS || $this->user->data['is_bot'] + if (!$this->request->is_ajax() || $this->user->id() === ANONYMOUS || $this->user->data['is_bot'] || $this->user->data['user_type'] == USER_IGNORE || $this->user->data['user_type'] == USER_INACTIVE) { throw new http_exception(Response::HTTP_FORBIDDEN, 'NO_AUTH_OPERATION');