rendered paste body<?php/** * @property CI_Loader $load * @property CI_Form_validation $form_validation * @property CI_Input $input * @property CI_Email $email * @property CI_DB_active_record $db * @property CI_DB_forge $dbforge */class User extends Controller { function User() { parent::Controller(); } function login() { if ($this->input->post('email')) { $this->output->enable_profiler(TRUE); switch ($this->redux_auth->login($this->input->post('email'), $this->input->post('password'))) { case 'NOT_ACTIVATED': # code... break; case 'BANNED': break; case true: print 'Welcome'; break; default: # code... break; } } else { $this->load->view('user/login'); } } function register() { $this->load->helper('form'); $this->load->library('form_validation'); if ($this->form_validation->run() == FALSE) { echo 'invalid validation'; } else { echo 'it works'; } if (!empty($_POST)) { $this->output->enable_profiler(TRUE); // Generate extra_data $extra_data = array( 'first_name'=> $this->input->post('first_name'), 'last_name' => $this->input->post('last_name'), 'about' => $this->input->post('about'), 'location' => $this->input->post('location'), ); switch ($this->redux_auth->register( $this->input->post('username'), $this->input->post('password'), $this->input->post('email'), $extra_data)) { case 'REGISTRATION_SUCCESS': echo 'success'; break; case 'REGISTRATION_SUCCESS_EMAIL': echo 'success email'; break; default: echo 'error'; break; } } $this->load->view('partials/header'); $this->load->view('user/register'); $this->load->view('partials/footer'); } function check_username($username) { $this->form_validation->set_message('check_username', 'The %s field can not be the word "test"'); return false; //return $this->redux_auth->check_username($username); } function _check_email($email) { return $this->redux_auth->check_email($email); } function username_check($str) { if ($str == 'test') { $this->form_validation->set_message('username_check', 'The %s field can not be the word "test"'); return FALSE; } else { return TRUE; } }}/* End of file user.php *//* Location: ./system/application/controllers/user.php */