Welcome Guest, Not a member yet? Register   Sign In
The Easiest Authentication Library for CodeIgniter just got easier.
#97

[eluser]Adam Griffiths[/eluser]
[quote author="Nexus Rex" date="1246463123"]1. Is there a way to send a user who is logging in to a different login page (view), instead of the Admin login page? I would like a user login page that fits my own site's template.

2. I would also like help figuring out how to create a "pass-through" feature: say you land on the URI /member/account/ and you are not logged in. I would like the login form to display, and upon successful login, you are just passed-through to the current URI. If you are already logged in, you just get passed right through as well.

Thank you.[/quote]

The first point you made is somewhat difficult. But then again depending on your needs it could be fairly simple. If you want to have the login page on your website rather than in the admin section, then you should open up libraries/Auth.php — find the login() function and change the call to the login view so the function $this->view(); is not used and $this->load->view() is used instead.

If you want to have both the login on your website and in the admin panel. You'll need to copy the login() function — rename it and then do the above so you load a different view file. Hopefully I am clear enough for you on this one.

With your second point, if you have the following code in your member controller.

Code:
function account()
{
    if(logged_in())
    {
        // show the logged in view stuff
    }
    else
    {
        $this->auth->login('member/account/');
    }
}

This would then redirect the user back to that page.


Thanks.


Messages In This Thread
The Easiest Authentication Library for CodeIgniter just got easier. - by El Forum - 07-01-2009, 11:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB