Welcome Guest, Not a member yet? Register   Sign In
Ion Auth - Lightweight Auth System based on Redux Auth 2

[eluser]Ben Edmunds[/eluser]
goldpelican,

The controller code is just a basic example. The library won't allow you to have duplicate identities but the best way to check and notify the user of this is with form_validation callbacks.

Below are the two callbacks I usually use:

Code:
/**
     * Username check
     *
     * @return bool
     * @author Ben Edmunds
     **/
    public function username_check($username)
    {
        if ($this->ion_auth->username_check($username))
        {
            $this->form_validation->set_message('username_check', 'The username "'.$username.'" already exists.');
            return FALSE;
        }
        else
        {
            return TRUE;
        }
    }
    
    /**
     * Email check
     *
     * @return bool
     * @author Ben Edmunds
     **/
    public function email_check($email)
    {
        if ($this->ion_auth->email_check($email))
        {
            $this->form_validation->set_message('email_check', 'The email "'.$email.'" already exists.');
            return FALSE;
        }
        else
        {
            return TRUE;
        }
    }


Messages In This Thread
Ion Auth - Lightweight Auth System based on Redux Auth 2 - by El Forum - 05-02-2010, 12:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB