Allows to perform security checks before a page is displayed.
In the event handler you can perform additional security checks
and redirect the browser to another page if it is needed.
The event handler accepts the page object and the request parameters array. Usage example:
public function subscribeEvents()
{
Backend::$events->addEvent('cms:onApplyPageSecurity', $this, 'apply_security');
}
public function apply_security($page, $params)
{
if ($page->url !== 'my-secure-page')
return;
// Redirect to another page if the
// customer is not logged in, or if the
// customer name is not John
$customer = Cms_Controller::get_customer();
if (!$customer || $customer->first_name != 'John')
Phpr::$response->redirect('/login');
}