Skip to content

Instantly share code, notes, and snippets.

@mojaie
Created May 19, 2012 06:48
Show Gist options
  • Save mojaie/2729768 to your computer and use it in GitHub Desktop.
Save mojaie/2729768 to your computer and use it in GitHub Desktop.
CakePHP:test002_0
<?php
class AppController extends Controller {
public $components = array('Auth');
public function beforeFilter(){
$this->Auth->authorize = 'Controller';
$this->Auth->loginRedirect = '/';
$this->Auth->logoutRedirect = '/';
if ($this->Auth->loggedIn()) {
$this->set('authUser', $this->Auth->user());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment