Changeset 540 for trunk/app/app_controller.php
- Timestamp:
- 05/21/08 11:43:42 (7 months ago)
- Files:
-
- 1 modified
-
trunk/app/app_controller.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/app_controller.php
r538 r540 18 18 public function beforeFilter() 19 19 { 20 $this->Auth->fields = array('username' => 'email', 'password' => 'pwd');21 $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');22 $this->Auth->loginRedirect = array('controller' => 'news', 'action' => 'display');23 $this->Auth->logoutRedirect = '/news/display';20 $this->Auth->fields = array('username' => 'email', 'password' => 'pwd'); 21 $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login'); 22 $this->Auth->loginRedirect = array('controller' => 'news', 'action' => 'display'); 23 $this->Auth->logoutRedirect = array('controller' => 'news', 'action' => 'display'); 24 24 $this->Auth->loginError = 'Invalid e-mail / password combination. Please try again'; 25 25 $this->Auth->authorize = 'controller'; … … 28 28 $this->set('cU', $this->Auth->user()); // $cU current user array to use in the views if user logged in 29 29 } 30 31 public function isAuthorized() 32 { 33 if (isset( $this->params[Configure::read('Routing.admin')] )): 34 if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ): // admin and teachers 35 return true; 36 else: 37 return false; 38 endif; 39 endif; 30 40 41 return true; 42 } 43 31 44 public function msgFlash($msg, $to) 32 45 {
