Welcome Guest, Not a member yet? Register   Sign In
User Authentication
#11

[eluser]cahva[/eluser]
Well I have done it this way:
- Create the auth library Smile It offcourse consists of login, logout, logged_in etc. methods
- add the auth library to autoload.
- Create the controller for the login and logout which has the login form etc.
- Now in every controller's construct you would have this:
Code:
function __construct()
{
    parent::Controller();
    if(!$this->auth->logged_in()) {
        redirect('login');
    }
    ...

I dont think 2 lines of code in every construct is asking too much Wink


Messages In This Thread
User Authentication - by El Forum - 09-25-2008, 07:15 AM
User Authentication - by El Forum - 09-25-2008, 07:51 AM
User Authentication - by El Forum - 09-25-2008, 08:02 AM
User Authentication - by El Forum - 09-25-2008, 08:26 AM
User Authentication - by El Forum - 09-25-2008, 09:05 AM
User Authentication - by El Forum - 09-25-2008, 02:23 PM
User Authentication - by El Forum - 09-26-2008, 05:35 AM
User Authentication - by El Forum - 09-26-2008, 06:52 AM
User Authentication - by El Forum - 09-26-2008, 07:41 AM
User Authentication - by El Forum - 09-26-2008, 10:35 AM
User Authentication - by El Forum - 09-26-2008, 12:31 PM
User Authentication - by El Forum - 09-26-2008, 12:41 PM
User Authentication - by El Forum - 09-26-2008, 01:26 PM
User Authentication - by El Forum - 09-26-2008, 01:36 PM
User Authentication - by El Forum - 09-26-2008, 02:01 PM
User Authentication - by El Forum - 09-27-2008, 01:18 PM
User Authentication - by El Forum - 09-27-2008, 06:18 PM
User Authentication - by El Forum - 09-28-2008, 01:38 AM
User Authentication - by El Forum - 09-28-2008, 06:52 AM
User Authentication - by El Forum - 09-28-2008, 09:18 AM
User Authentication - by El Forum - 09-28-2008, 09:25 AM
User Authentication - by El Forum - 11-13-2008, 01:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB