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

[eluser]Buso[/eluser]
This is how I do it:

I have a 'users' controller, an 'auth' library, and a base controller (all of my controllers extends this controller. You can set MY_Controller in /libraries. I do it another way but this is simpler). If I need to restrict access to all my site, inside base controller i put something like
Code:
$this->auth->check('some_resource')

That will check if the user has access to the mentioned resource, eg: 'enter_site'

Inside Users controller I have my login method, which runs the needed validations, and if everything is fine then goes this:
Code:
$this->auth->login()

My auth library will assume 'login' data is at $this->input->post('login'), same for password. That's if you need 'automagic'. Optionally you can set the arguments yoursef ->login($user,$password)

Auth will do everything else but the queries, which are handled by auth_model.

I hope this is helpful.


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