Check user "role" upon Login |
[eluser]elektra[/eluser]
I have implemented this user login http://ellislab.com/forums/viewthread/214754/ and would just want to add one simple thing that is checking the "role" of the user upon login, if its "admin" redirect to admin page, if its "normal" redirect to user page. I just need this one simple thing and have done a so much for registration and login that is why I don't really want to use any auth libraries. Really appreciate all of your help. Thank you
[eluser]Samus[/eluser]
[quote author="elektra" date="1333857535"]I have implemented this user login http://ellislab.com/forums/viewthread/214754/ and would just want to add one simple thing that is checking the "role" of the user upon login, if its "admin" redirect to admin page, if its "normal" redirect to user page. I just need this one simple thing and have done a so much for registration and login that is why I don't really want to use any auth libraries. Really appreciate all of your help. Thank you[/quote] Code: ($this->session->userdata('role') == 'admin') ? redirect('admin/') : redirect('user')); |
Welcome Guest, Not a member yet? Register Sign In |