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

Untitled

By: a guest on Apr 26th, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 16  |  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. class AppController extends Controller {
  4.  
  5.         var $components = array('Auth', 'Session');
  6.         var $helpers = array('Html', 'Javascript', 'Form', 'Session');
  7.         function beforeFilter() {
  8.                 parent::beforeFilter();
  9.  
  10.                 $this->Auth->loginRedirect = array(
  11.                         'controller' => 'medias',
  12.                         'action' => 'index'
  13.                 );
  14.                 $this->Auth->fields = array(
  15.                         'username' => 'email',
  16.                         'password' => 'password'
  17.                 );
  18.                 $this->Auth->loginAction = array(
  19.                         'controller' => 'users',
  20.                         'action' => 'login',
  21.                 );
  22.                 $this->Auth->autoRedirect = false;
  23.         }
  24.        
  25. }