Changeset 458
- Timestamp:
- 05/05/08 22:50:24 (8 months ago)
- Location:
- trunk/app
- Files:
-
- 3 modified
-
controllers/users_controller.php (modified) (2 diffs)
-
controllers/vclassrooms_controller.php (modified) (1 diff)
-
views/elements/poll.ctp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/controllers/users_controller.php
r457 r458 361 361 $this->set('message', $message); 362 362 $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 { 371 373 $this->data['Confirm']['user_id'] = $this->User->getLastInsertID(); // the user id 372 374 $this->data['Confirm']['secret'] = $this->Adds->genPassword(14); // secret confirm ID … … 374 376 $this->User->Confirm->create(); 375 377 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 378 393 { 379 //Send the confirmation email380 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 else391 {392 394 $this->set('message', array("Error"=>"Error, something is wrong in save method")); 393 395 $this->render('validate', 'ajax'); 394 } 396 } 397 } 395 398 } 396 399 } -
trunk/app/controllers/vclassrooms_controller.php
r457 r458 157 157 158 158 $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 160 160 $this->set('data', $this->Vclassroom->find($conditions)); 161 161 } -
trunk/app/views/elements/poll.ctp
r291 r458 58 58 echo '<br />'; 59 59 60 echo $ajax->submit('Vot ar', array("url" => "/pollrows/vote",60 echo $ajax->submit('Vote', array("url" => "/pollrows/vote", 61 61 "update"=>"add_pollrow", 62 62 "loading" => "Element.hide('add_pollrow');Element.show('loading')",
