Show
Ignore:
Timestamp:
05/13/08 00:50:52 (8 months ago)
Author:
aarkerio
Message:

Messages to all class

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/controllers/users_controller.php

    r479 r480  
    1919 public function beforeFilter()  
    2020 { 
     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 
    2127    $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(); 
    3130 } 
    3231   
    3332 public function isAuthorized()  
    3433 {       
    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 
    4242    return false;  // go away !! 
    4343 } 
     
    409409  endif; 
    410410 
     411  $this->User->escapeField('pwd'); 
     412   
    411413  if ( empty($this->data['User']) ): 
    412414 
     
    415417      $this->Portal->statics(); // Using Portal components 
    416418         
    417       $this->User->unbindModel($this->User->notNow); 
    418              
     419      $this->User->unbindModel($this->User->notNow);         
     420       
    419421      $this->data = $this->User->read(null, $this->Auth->user('id')); 
    420422