Skip to content

Instantly share code, notes, and snippets.

@davialexandre
Created November 5, 2012 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davialexandre/4019273 to your computer and use it in GitHub Desktop.
Save davialexandre/4019273 to your computer and use it in GitHub Desktop.
AdminModule::beforeControllerAction
public function beforeControllerAction($controller, $action)
{
if(parent::beforeControllerAction($controller, $action))
{
if($this->user->isGuest && !($controller->id == 'default' && $action->id == 'login')) {
$this->user->loginRequired();
}
return true;
}
else
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment