Welcome Guest, Not a member yet? Register   Sign In
Best coding practice for an admin login
#7

[eluser]Bramme[/eluser]
little double post to bring this to attention (don't feel like starting up a new topic for every quirck).

Atm I got this in my master view file:

Code:
<?php
$this->load->view('global/adminHeader');
if($this->auth->loggedIn()) {
    $this->load->view($page); // page could be for example admin/guestbook/
} else {
    redirect('/admin/');
}
$this->load->view('global/footer');
?>
but this creates an infinite loop. Is there a way to send the page back to my login form (which is my index function) without creating this infinite loop?
Because if I simply load the login view, I get all sorts of errors because my login form uses validation etc that's not being set in the guestbook function.


Messages In This Thread
Best coding practice for an admin login - by El Forum - 06-06-2008, 02:40 AM
Best coding practice for an admin login - by El Forum - 06-06-2008, 03:56 AM
Best coding practice for an admin login - by El Forum - 06-06-2008, 04:24 AM
Best coding practice for an admin login - by El Forum - 06-06-2008, 04:26 AM
Best coding practice for an admin login - by El Forum - 06-06-2008, 05:16 AM
Best coding practice for an admin login - by El Forum - 06-06-2008, 05:24 AM
Best coding practice for an admin login - by El Forum - 06-06-2008, 07:17 AM
Best coding practice for an admin login - by El Forum - 06-06-2008, 07:34 AM
Best coding practice for an admin login - by El Forum - 06-06-2008, 07:52 AM
Best coding practice for an admin login - by El Forum - 06-06-2008, 08:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB