Skip to content

Instantly share code, notes, and snippets.

@waltergalvao
Created June 18, 2012 02:23
Show Gist options
  • Select an option

  • Save waltergalvao/2946463 to your computer and use it in GitHub Desktop.

Select an option

Save waltergalvao/2946463 to your computer and use it in GitHub Desktop.
<?php
App::uses('Controller', 'Controller');
class AppController extends Controller {
public $components = array(
'Session',
'Auth' => array(
'authError' => 'Area Restrita',
'loginRedirect' => array('controller' => 'users', 'action' => 'registrar'),
'logoutRedirect' => array('controller' => 'users', 'action' => 'registrar'),
'authenticate' => array('Form' => array( 'fields' => array( 'username' => 'userid', 'password' => 'user_pass'))))
);
public function beforeRender() {
$this->loadModel('Ranking');
$this->set('toppvp',$this->Ranking->find('all', array('limit' => 10, 'order' => array('ratio' => 'DESC'))));
}
public function beforeFilter() {
$this->Auth->allow('logout','login','index','registrar','home');
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment