emreakay / CodeIgniter-Aauth

Authorization, Authentication and User Management library for Codeigniter 2.x and 3.x to make easy user management and permission operations
http://emreakay.com
GNU Lesser General Public License v3.0
393 stars 235 forks source link

Create account with set_user_var not saving #266

Closed iemchuu closed 8 months ago

iemchuu commented 8 months ago

public function create_account() { $this->form_validation->set_rules('firstname', 'first name', 'trim|required'); $this->form_validation->set_rules('lastname', 'last name', 'trim|required'); $this->form_validation->set_rules('email', 'email-address', 'trim|required|valid_email|is_unique[aauth_users.email]'); $this->form_validation->set_rules('password', 'password', 'trim|required|min_length[8]'); $this->form_validation->set_rules('confpassword', 'repeat-password', 'required|matches[password]'); if ($this->form_validation->run()) { $firstname = $this->input->post('firstname'); $lastname = $this->input->post('lastname'); $email = $this->input->post('email'); $password = $this->input->post('password'); if ($this->aauth->create_user($email, $password, $firstname)) { $this->aauth->set_user_var("first_name", $firstname); $this->aauth->set_user_var("last_name", $lastname); $this->session->set_flashdata('register-success', 'New user has been added successfuly!'); } else { $this->session->set_flashdata('register-failed', 'Failed to register the user'); } } $this->load->view('template/auth/header'); $this->load->view('auth/register'); $this->load->view('template/auth/footer'); }

create user works fine and being inserted to database, but user variables are not being inserted.