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

Untitled

By: a guest on Aug 12th, 2012  |  syntax: None  |  size: 0.72 KB  |  hits: 10  |  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. class UsersController extends AppController {
  3.  
  4.         var $name ='users';
  5.         var $components = array('Auth','Session');
  6.         var $view = 'Theme';
  7.         var $theme = 'intellimedia';
  8.         var $layout = 'admin';
  9.        
  10.         function login() {
  11.        
  12.         }
  13.        
  14.         function logout() {
  15.                 $this->redirect($this->Auth->logout());
  16.         }
  17.        
  18.         function beforeFilter() {
  19.  
  20.                 $this->Auth->fields = array('username' => 'username', 'password' => 'password');
  21.                 $this->Auth->loginAction = array('admin' => false, 'controller' => 'users', 'action' => 'login');
  22.                 $this->Auth->loginRedirect = array('controller' => 'admin', 'action' => 'index');
  23.                 $this->Auth->loginError = 'Incorrect username / password.';
  24.                 $this->Auth->logoutRedirect = '/';
  25.                
  26.         }
  27.        
  28. }
  29. ?>