[eluser]Andy78[/eluser]
I'm also a little confused about $this->data as opposed to $data. Where is the $this->data array set? Can somebody explain it to me?
For example its used in the login() and in the create_user() functions but in order for me to pass additional $formdate data and data for a country selectbox to my create_user view I had to do
$additional_data = array('name' => $this->input->post('name'),
'gender' => $this->input->post('gender'),
'country' => $this->input->post('country'),
'dateofbirth' => $this->input->post('year') .'-'. $this->input->post('month') .'-'. $this->input->post('day'),
);
}
if ($this->form_validation->run() == true && $this->ion_auth->register($username,$password,$email,$additional_data)) { //check to see if we are creating the user
//redirect them back to the admin page
$this->session->set_flashdata('message', "User Created");
redirect("auth", 'refresh');
}
else { //display the create user form
//set the flash data error message if there is one
$data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));