Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ion Auth - Restrict emails when registering
//MODEL
class users_m()
{
function restrict_email()
{
$emails = array('test@test.com', 'test2@test2.com');
$this->db->where_in($emails);
}
}
//CONTROLLER
function register_user()
{
//set the hook
$this->ion_auth->set_hook('pre_register', 'restrict_emails', $this->users_m, 'restrict_email');
//other stuff...
$user = array(
'email' => $this->input->post('email'),
'password' => $this->input->post('password'),
...
);
//before the user is created the hook will be called automatically
$this->ion_auth->register(...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.