Welcome Guest, Not a member yet? Register   Sign In
what is the best way to use login module ?
#8

[eluser]überfuzz[/eluser]
[quote author="Buso" date="1273580591"]...
Inside Users controller I have my login method, which runs the needed validations...[/quote]

Code:
//The main idea of my login controller, use or make your own functions to run it smoothly on your system...
    function log_in()
    {
        if ($this->_validate_form_fields() === FALSE)
        {
            $this->index();
        }
        else
        {
            redirect('/*link to wonderland*/');
        }
    }

    function _process_login()
    {
        //use your profile model and check credentials.
        
    }

    //extend CI_Form_Validation with _process_login
    function _validate_form_fields()
    {
        //Setup default rules.
        //Use your custom rule.
        $this->form_validation->set_message('_process_login',"You're kidding right!?");
        //if process_login === FALSE -> error message is thrown.
        return $this->form_validation->run();
    }

Like I said, this login controller is used because of how the form_validation works. If I could run it outside the controller handling the login I'd do that.


Messages In This Thread
what is the best way to use login module ? - by El Forum - 05-10-2010, 01:18 PM
what is the best way to use login module ? - by El Forum - 05-10-2010, 01:32 PM
what is the best way to use login module ? - by El Forum - 05-10-2010, 01:37 PM
what is the best way to use login module ? - by El Forum - 05-10-2010, 01:41 PM
what is the best way to use login module ? - by El Forum - 05-10-2010, 09:08 PM
what is the best way to use login module ? - by El Forum - 05-11-2010, 12:51 AM
what is the best way to use login module ? - by El Forum - 05-11-2010, 01:23 AM
what is the best way to use login module ? - by El Forum - 05-11-2010, 01:45 AM
what is the best way to use login module ? - by El Forum - 05-11-2010, 06:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB