Displaying page according to user role

Hey,
Im trying to create a login page (Done using Lightbox), and want to add another filter to it.
I have 3 types of members roles Teacher, Student and Admin.

Whenever a user log’s in, I want to redirect them to a specific page according to the role.

E.g: If the teacher log’s in, then they should be redirected to a page name “teacher-Home”
similarly
if students log’s in, it should turn to “Student-Home”

I’m not sure you can actually do it. While I am sure you could redirect from within a lightbox, I am thinking that would keep the lightbox open.

When the lightbox closes, it should return you back to the point where you initially called the lightbox to open, in your code.

Once the lightbox closes, you could then definitely jump to a specific page. You would need to pass data from the lightbox back to the calling function, so you would have your information from the lightbox. You would probably need this in order to figure out what page to jump to.

You can create your own custom login form. Use that form to retrieve the user roles once he is logged in. You can then redirect the user according to its role.

Another solution is to user router pages . You can use the router to return different page according to the current user role.

“router/home” will return a different pages depending on the user role. This is a more complex solution but I believe that’s the cleanest one because it automatically dispatch the user to the correct page and only use 1 URL (router/home) instead of 3