CodeIgniter Forums
Using Hooks for login prompt - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Using Hooks for login prompt (/showthread.php?tid=17611)



Using Hooks for login prompt - El Forum - 04-09-2009

[eluser]macleodjb[/eluser]
I was reading up on hooks. I was curious how can i have it so i can force the user to login under certain controllers? For instance i only want them to login if they are under the control panel or view controller?


Using Hooks for login prompt - El Forum - 04-09-2009

[eluser]TheFuzzy0ne[/eluser]
I wouldn't use hooks for that. I would probably just create a library which extends the controller class, and have my controllers extend that.


Using Hooks for login prompt - El Forum - 04-09-2009

[eluser]jedd[/eluser]
[quote author="macleodjb" date="1239336673"]I was reading up on hooks. I was curious how can i have it so i can force the user to login under certain controllers? For instance i only want them to login if they are under the control panel or view controller?[/quote]

I just read your [url="http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html"]recent thread[/url] on converting an existing site .. and feel I should really clarify what you're trying to do in this instance.

Is there a particular reason you must use hooks?

What precisely are you wanting to achieve, and what other limitations do you have about the answer you're looking for?