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

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.50 KB  |  hits: 14  |  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. How can I use different model for Auth component in CakePHP 2.0.4?
  2. public $components = array(
  3.     'Session',
  4.     'Auth' => array(
  5.         'authenticate' => array('all' => array('userModel' => 'Player'))
  6.      )
  7. );
  8.        
  9. function beforeFilter() {
  10.     $this->Auth->authenticate = array('all' => array('userModel' => 'Player'));
  11. }
  12.        
  13. 'loginAction' => array('controller' => 'players', 'action' => 'login')
  14.        
  15. $this->Auth->authenticate = array(
  16.     'all' => array('userModel' => 'Member'),
  17.     'Form',
  18.     'Basic'
  19. );