Changeset 458

Show
Ignore:
Timestamp:
05/05/08 22:50:24 (8 months ago)
Author:
aarkerio
Message:

Users improved

Location:
trunk/app
Files:
3 modified

Legend:

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

    r457 r458  
    361361       $this->set('message', $message); 
    362362       $this->render('validate', 'ajax'); //if error exist, stop here 
    363     } 
    364      
    365     $this->data['User']['active']     = 0; 
    366     $this->data['User']['name_blog']  = $this->data['User']['username'].'\'s corner';  
    367     $this->User->create(); 
    368     //exit(var_dump($this->data["User"])); 
    369     if ($this->User->save($this->data['User'])) 
    370     {   
     363       
     364    } 
     365    else 
     366    { 
     367       $this->data['User']['active']     = 0; 
     368       $this->data['User']['name_blog']  = $this->data['User']['username'].'\'s corner';  
     369       $this->User->create(); 
     370       //exit(var_dump($this->data["User"])); 
     371       if ($this->User->save($this->data['User'])) 
     372       {   
    371373        $this->data['Confirm']['user_id']  = $this->User->getLastInsertID();   // the user id 
    372374        $this->data['Confirm']['secret']   = $this->Adds->genPassword(14);     // secret confirm ID 
     
    374376    $this->User->Confirm->create(); 
    375377         
    376         // put the user in confirm model, this is, waiting for user confirmation trough email 
    377         if ($this->User->Confirm->save($this->data["Confirm"]))   
     378         // put the user in confirm model, this is, waiting for user confirmation trough email 
     379         if ($this->User->Confirm->save($this->data["Confirm"]))   
     380         { 
     381            //Send the confirmation email 
     382            if ( $this-> _sendNewUserPwd($this->data['User']['email'], $this->data['Confirm']['secret']) )  
     383            {  
     384              $msg  = "<h2>You have been registered!</h2> <p>A confirmation email has been sent to: ".$this->data['User']['email']; 
     385          $msg .= " In order to complete the registration process, please click on the link contained on the email.</p>"; 
     386              $this->set('message', array("Suceess"=>$msg));  
     387              $this->set('ok', true); 
     388              $this->render('validate', 'ajax'); 
     389            } 
     390         } 
     391        } 
     392        else  
    378393        { 
    379           //Send the confirmation email 
    380           if ( $this-> _sendNewUserPwd($this->data['User']['email'], $this->data['Confirm']['secret']) )  
    381           {  
    382             $msg  = "<h2>You have been registered!</h2> <p>A confirmation email has been sent to: ".$this->data['User']['email']; 
    383         $msg .= "In order to complete the registration process, please click on the link contained on the email.</p>"; 
    384             $this->set('message', array("Suceess"=>$msg));  
    385             $this->set('ok', true); 
    386             $this->render('validate', 'ajax'); 
    387           } 
    388        } 
    389     } 
    390     else  
    391     { 
    392394            $this->set('message', array("Error"=>"Error, something is wrong in save method")); 
    393395            $this->render('validate', 'ajax'); 
    394     } 
     396        } 
     397     } 
    395398   } 
    396399  } 
  • trunk/app/controllers/vclassrooms_controller.php

    r457 r458  
    157157 
    158158      $this->set('users',$this->Vclassroom->UsersVclassroom->findAll(array('UsersVclassroom.vclassroom_id' => $vclassroom_id))); 
    159       //die(debug($this->Vclassroom->UsersVclassroom->findAll(array('UsersVclassroom.vclassroom_id' => $vclassroom_id)))); 
     159       
    160160      $this->set('data', $this->Vclassroom->find($conditions)); 
    161161 } 
  • trunk/app/views/elements/poll.ctp

    r291 r458  
    5858    echo '<br />'; 
    5959     
    60     echo $ajax->submit('Votar', array("url" => "/pollrows/vote",  
     60    echo $ajax->submit('Vote', array("url" => "/pollrows/vote",  
    6161                                     "update"=>"add_pollrow", 
    6262                                     "loading" => "Element.hide('add_pollrow');Element.show('loading')",