Created
July 23, 2015 13:35
-
-
Save lorenzo/81609897c1f3a7cb4e95 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Configures authentication and the basic fields to show on each screen | |
* | |
* @param Event $event The given event | |
* @return void | |
*/ | |
public function beforeFilter(Event $event) | |
{ | |
if ($this->request->public) { | |
$this->Auth->allow(); | |
} | |
parent::beforeFilter($event); | |
// Attach an event listener to the main model | |
$this->loadModel() | |
->eventManager() | |
->on(new RequestMetadata($this->request, $this->Auth->user('username'))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment