This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

cms:onApplyPageSecurity event

Triggered by Cms_Controller
Author LemonStand eCommerce Inc.

Event handler signature

public void event_onApplyPageSecurity(Cms_Page $page, array $request_parameters)
$page Cms_Page specifies the CMS page object.
$request_parameters array a list of request parameters.
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');
}