Welcome Guest, Not a member yet? Register   Sign In
Howto include Login Site
#1

[eluser]toki[/eluser]
Hi,

I build a login controller, which uses a login model and shows a login view.
Now I have other functions (controllers), which shall be only available for logged in users.
When the other controller recognizes that the user is not logged in, it shall append the login form at the end of the view.

How can i do this without redundancy of code?

Thank you!

toki
#2

[eluser]Abdul Malik Ikhsan[/eluser]
I think you can create your own base controller like MY_Controller. then, you create default "doing" function like showloginform() in constructor. and you can extends in your app using extends MY_Controller simply like parent::MYController();

for detail, you can read user_guide Smile
#3

[eluser]cryogenix[/eluser]
this post of mine might help you: http://ellislab.com/forums/viewreply/773561/

that post example was using ION_Auth as an example but I'm pretty much sure it's very adaptable to your own auth implementation.

cheers,
hope it helps.
my 2 cents worth Wink
#4

[eluser]toki[/eluser]
Thanks a lot for both answers. That helps.




Theme © iAndrew 2016 - Forum software by © MyBB