08-08-2010, 08:27 PM
[eluser]Vheissu[/eluser]
The way I go about this is to first log them in and then set all of their relevant information in a session, usually called user_role and then put if they're an admin or user in there. Then I redirect them to the index function of my Auth controller and inside of that Auth controller index function I am checking if they're an admin or user.
The way I go about this is to first log them in and then set all of their relevant information in a session, usually called user_role and then put if they're an admin or user in there. Then I redirect them to the index function of my Auth controller and inside of that Auth controller index function I am checking if they're an admin or user.
Code:
class Auth extends Controller {
function Auth()
{
parent:Controller();
// Load libraries here etc
}
function index()
{
// Check if they're an admin or user and use redirect() to send them to their respective places
}
}