Check log-in and permission in Controller/Libarary - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Check log-in and permission in Controller/Libarary (/showthread.php?tid=39668) |
Check log-in and permission in Controller/Libarary - El Forum - 03-17-2011 [eluser]suntrop[/eluser] Hi. I am building my 2nd CI website and want to implement my own auth system. I wasn't happy about Ion-Auth and Tank-Auth. Anyway, I have a MY_Controller and an Admin_Controller, that extends the MY_Controller. All admin pages do need to check if the user is logged-in and if he has the right permission to see the page. So I want to check in the Admin_Controller (that way don't have to repeat it in every Controller) both: log-in status and permission. But how? :-) Lets say the page "/services/support/17-john" is requested. I have to check if the user is logged-in and if he is john, since only the user itself can view his support page. How can I check that in the Admin_Controller? I really hope someone knows what I mean :-) … and of course can help Thanks! |