Changeset 788 for trunk/app/controllers

Show
Ignore:
Timestamp:
10/01/08 20:21:44 (7 weeks ago)
Author:
aarkerio
Message:

Update unit testing

Location:
trunk/app/controllers
Files:
2 modified

Legend:

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

    r785 r788  
    3535      
    3636     if ($this->User->save($this->data) && $this->Confirm->delete($data['Confirm']['id'])): 
    37                  $this->flash(__('Your account has been activated', true), '/users/login', 1); 
     37                 $this->flash(__('Your account has been activated', true), '/', 2); 
    3838     endif; 
    3939   else: 
    40              $this->flash('There is not such account', '/users/login', 2); 
     40             $this->flash('There is not such account', '/', 2); 
    4141   endif; 
    4242 } 
  • trunk/app/controllers/users_controller.php

    r785 r788  
    268268  $this->Sanitize = new Sanitize; 
    269269   
    270   $this->Sanitize->html($this->data["User"]["name"]); 
    271    
    272   $this->Sanitize->html($this->data["User"]["username"]); 
    273    
    274   $this->Sanitize->html($this->data["User"]["description"]); 
    275    
    276   $this->Sanitize->html($this->data["User"]["email"]); 
     270  $this->Sanitize->html($this->data['User']['name']); 
     271   
     272  $this->Sanitize->html($this->data['User']['username']); 
     273   
     274  $this->Sanitize->html($this->data['User']['cv']); 
     275   
     276  $this->Sanitize->html($this->data['User']['email']); 
    277277   
    278278  // adds new classroom to database 
    279279  if (!empty($this->data['User'])) 
    280280  { 
    281    $message     = array("oops"=>"Oooppps!"); 
     281   $message     = array('oops'=>'Oooppps!'); 
    282282    
    283283   /** Check Passwd **/ 
     
    292292   /** username check **/ 
    293293   if (strlen($this->data['User']['username']) < 5): 
    294        $message['pwd_username'] = "The username has less than 5 characters "; 
     294       $message['pwd_username'] = 'The username has less than 5 characters '; 
    295295   endif; 
    296296     
    297297   /** name check **/ 
    298298   if (strlen($this->data['User']['name']) < 5): 
    299        $message['pwd_username'] = "The name is too short"; 
     299       $message['pwd_username'] = 'The name is too short'; 
    300300   endif; 
    301301     
    302302    if (strpos($this->data['User']['pwd'], ' ')):  // pwd no spaces 
    303        $message['username_spaces'] = "Your password should not contain spaces"; 
     303       $message['username_spaces'] = 'Your password should not contain spaces'; 
    304304    endif; 
    305305     
    306306    /** description check **/ 
    307     if (strlen($this->data['User']['description']) < 5): 
    308        $message['description_too_short'] = "C'mon pal, talk us about you!"; 
     307    if (strlen($this->data['User']['cv']) < 5): 
     308       $message['description_too_short'] = 'C\'mon pal, talk us about you!'; 
    309309    endif; 
    310310     
    311311    /** email check **/ 
    312312    if ($this->Adds->validEmail($this->data['User']['email']) === false): 
    313        $message['pwd_username'] = "Typed email is invalid"; 
     313       $message['pwd_username'] = 'Email is invalid'; 
    314314    endif; 
    315315     
     
    332332     
    333333    if ( $this->data['User']['code'] != $code ): 
    334         $message['wrong_code'] = "The code is incorrect, please put in contact with your school webmaster."; 
     334        $message['wrong_code'] = 'The code is incorrect, please put in contact with your school webmaster.'; 
    335335    endif; 
    336336     
     
    345345        $this->data['Confirm']['user_id']  = $this->User->getLastInsertID();   // the user id 
    346346        $this->data['Confirm']['secret']   = $this->Adds->genPassword(14);     // secret confirm ID 
    347      
    348     $this->User->Confirm->create(); 
    349347         
    350348         // put the user in confirm model, this is, waiting for user confirmation trough email