mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-12 12:46:38 +02:00
[ticket/17010] Remove no longer used route & handler
PHPBB3-17010
This commit is contained in:
@ -21,7 +21,3 @@ phpbb_ucp_push_subscribe_controller:
|
|||||||
phpbb_ucp_push_unsubscribe_controller:
|
phpbb_ucp_push_unsubscribe_controller:
|
||||||
path: /push/unsubscribe
|
path: /push/unsubscribe
|
||||||
defaults: { _controller: phpbb.ucp.controller.webpush:unsubscribe }
|
defaults: { _controller: phpbb.ucp.controller.webpush:unsubscribe }
|
||||||
|
|
||||||
phpbb_ucp_push_js_controller:
|
|
||||||
path: /push/js
|
|
||||||
defaults: { _controller: phpbb.ucp.controller.webpush:js }
|
|
||||||
|
@ -187,39 +187,6 @@ class webpush
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle request to web push javascript
|
|
||||||
*
|
|
||||||
* @return Response
|
|
||||||
* @throws LoaderError
|
|
||||||
* @throws RuntimeError
|
|
||||||
* @throws SyntaxError
|
|
||||||
*/
|
|
||||||
public function js(): Response
|
|
||||||
{
|
|
||||||
// @todo: return forbidden for guest & bot
|
|
||||||
|
|
||||||
$template_data = $this->get_subscribe_vars();
|
|
||||||
$template_data += [
|
|
||||||
'VAPID_PUBLIC_KEY' => $this->config['webpush_vapid_public'],
|
|
||||||
'U_WEBPUSH_WORKER_URL' => $this->controller_helper->route('phpbb_ucp_push_worker_controller'),
|
|
||||||
'SUBSCRIPTIONS' => $this->get_subscriptions(),
|
|
||||||
];
|
|
||||||
|
|
||||||
$content = $this->template->render('webpush.js.twig', $template_data);
|
|
||||||
|
|
||||||
$response = new Response($content);
|
|
||||||
$response->headers->set('Content-Type', 'text/javascript; charset=UTF-8');
|
|
||||||
|
|
||||||
if (!empty($this->user->data['is_bot']))
|
|
||||||
{
|
|
||||||
// Let reverse proxies know we detected a bot.
|
|
||||||
$response->headers->set('X-PHPBB-IS-BOT', 'yes');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $response;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle subscribe requests
|
* Handle subscribe requests
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user