Я пытаюсь зарегистрировать пользователя с Ion Auth, но функция register () не сообщает об ошибках. Как зарегистрироваться в Ion Auth? Я уже читал различные учебники, подобные этой и этой (и документации ), но они, похоже, не работают.
function register() { // do not allow registration if logged in if ($this->ion_auth->logged_in()) { redirect('/'); } $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); $this->form_validation->set_rules('name', 'Name', 'trim|required|xss_clean'); $this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email|callback_email_check'); $this->form_validation->set_rules('email2', 'Email Confirmation', 'trim|required|valid_email|matches[email]'); $this->form_validation->set_rules('password', 'Password', 'trim|required|md5'); if ($this->form_validation->run() == FALSE) { $this->data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message'); $this->load->view('header'); $this->load->view('register', $this->data); $this->load->view('footer'); } else { $username = $this->input->post('email'); $password = $this->input->post('password'); $email = $username; $additional_data = array( 'first_name' => $this->input->post('name'), 'last_name' => '', ); if (!$this->ion_auth->email_check($email)) { $group_name = 'users'; $uId = $this->ion_auth->register($username, $password, $email, $additional_data, $group_name); if ($uId == FALSE) { $this->session->set_flashdata('message', $this->ion_auth->errors()); redirect("home/register", 'refresh'); } else { redirect('/'); // registration success } } } } function email_check($str) { if ($this->ion_auth->email_check($str)) { $this->form_validation->set_message('email_check', 'This email is already registered.'); return FALSE; } return TRUE; }