Changeset 480 for trunk/app/controllers/users_controller.php
- Timestamp:
- 05/13/08 00:50:52 (8 months ago)
- Files:
-
- 1 modified
-
trunk/app/controllers/users_controller.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/users_controller.php
r479 r480 19 19 public function beforeFilter() 20 20 { 21 if ( !empty($this->data['User'] ) ): 22 if ( strlen($this->data['User']['pwd']) < 6): 23 unset($this->data['User']['pwd']); 24 endif; 25 endif; 26 21 27 $this->Auth->allow(array('blog', 'entry','portfolio', 'edit', 'about', 'register', 'directory', 'bloggers', 'insert', 'validate', 'logout')); 22 parent::beforeFilter(); 23 24 if ( !empty($this->data['User']['pwd']) ) 25 { 26 if ( strlen($this->data['User']['pwd']) < 5) // only if pwd is big enough 27 { 28 unset($this->data['User']['pwd']); 29 } 30 } 28 29 parent::beforeFilter(); 31 30 } 32 31 33 32 public function isAuthorized() 34 33 { 35 if (isset( $this->params[Configure::read('Routing.admin')] )) 36 { 37 if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ) // admin and teachers 38 { 39 return true; 40 } 41 } 34 if (isset( $this->params[Configure::read('Routing.admin')] )): 35 36 if ($this->Auth->user('group_id') == 1 || $this->Auth->user('group_id') == 2 ): // admin and teachers 37 return true; 38 endif; 39 40 endif; 41 42 42 return false; // go away !! 43 43 } … … 409 409 endif; 410 410 411 $this->User->escapeField('pwd'); 412 411 413 if ( empty($this->data['User']) ): 412 414 … … 415 417 $this->Portal->statics(); // Using Portal components 416 418 417 $this->User->unbindModel($this->User->notNow); 418 419 $this->User->unbindModel($this->User->notNow); 420 419 421 $this->data = $this->User->read(null, $this->Auth->user('id')); 420 422
