Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 8th, 2012  |  syntax: None  |  size: 0.36 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. public function beforeFilter() {
  4.         $this->Auth->authenticate = array('Form' => array(
  5.                 'userModel' => 'Usuario',
  6.                 'fields' => array(
  7.                         'username' => 'usuario'
  8.                         'password' => 'senha')));
  9.  
  10.         $this->Auth->loginAction = array(
  11.                 'controller' => 'usuarios',
  12.                 'action' => 'login',
  13.                 'admin' => true);
  14.  
  15.         if (!$this->isPrefix('admin'))
  16.                 $this->Auth->allow();
  17. }