Guest User

Untitled

a guest
Jul 20th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. public function register()
  2. {
  3. if(!Auth::instance()->logged_in())
  4. {
  5. $captcha = new Captcha();
  6.  
  7. if ($_POST)
  8. {
  9. /* @var $user_model User_Model */
  10. $user_model = ORM::factory('user');
  11. $captcha_result = Validation::factory($_POST)->add_rules('captcha_response', 'required', 'Captcha::valid')->validate();
  12.  
  13.  
  14. $user_model->load_values($_POST);
  15. $user_model->username = $_POST['email'];
  16.  
  17. $user_result = $user_model->validate();
  18.  
  19. echo $user_model->_valid;
  20. die;
  21. }
  22.  
  23. $this->template->subtitle = __('New User');
  24. $this->template->content = new View('user/register_view');
  25. $this->template->content->form_data = $this->get_form_data();
  26. $this->template->content->captcha = $captcha;
  27. }
  28. else
  29. {
  30. url::redirect('user/home');
  31. }
  32. }
Add Comment
Please, Sign In to add comment