Community auth for full password protected website |
I need some support on this.
I have a full password protected website on several controllers. All I need is being able to check if there someone is logged in and if yes display the views or login form. PHP Code: if( if( $this->require_min_level(0) ) Is there a possiblity to make the check in the __construct() ? For now it's working in the same controller (not in the construct but in each function) but if I want to go to another controller after login it give me again the login form like the user is not logged in correctly. Should I make a if( $this->require_min_level(0) ) on the main controller and a if( $this->verify_min_level(0) ) in the other controllers ? I'm lost here. Thanks again
If all you are doing is verifying that somebody is logged in, and the page is accessible to anyone (even if they are not logged in), then see this:
http://community-auth.com/documentation/...rification Basically, you would do this: PHP Code: $this->is_logged_in(); But if all you want to do is show the login form because the page content should only be available to logged in users, do this: PHP Code: if( $this->require_min_level(1) ) That code is shown at the bottom of this page: http://community-auth.com/documentation/...entication As for your last question, yes you protect routable methods. Those methods may be available to different users, levels, etc. PHP Code: <?php
Unfortunatelly I still have an issue. Let me try to explain. I have 2 controllers:
1. it takes me to http://mywebsite/login?redirect=person (correct!) 2. I enter my login informations Then If I've on my Person controller this PHP Code: public function index() or PHP Code: public function index() It still shows me the login page with no error at all. If I have this: PHP Code: public function index() It shows me the right content. Why ? I can't understand this..
It sounds like your session is not working correctly. Are you using database sessions, or filesystem sessions?
After logging in, do you have a cookie and a session in the database/filesystem?
I'm using filesystem sessions and yes I can see (strangely several files per session). Regarding Cookie I'll check
Here is my logs also if this can helps (I don't know why I get this openssl as I'm not using it. PHP Code: DEBUG - 2016-10-29 06:39:01 --> UTF-8 Support Enabled
I don't see anything in your logs that would help. I would probably go through the install step by step to confirm everything is right. If everything is right, it's probably your CI sessions config. Post your sessions config code. You might also strip out the comments and post your Community Auth configs.
Would you available in skype for a few minutes ? I can't find anything that can help.
I would pay you for this service. I can see sessions files, I can see cookies, but still not working.. Thanks in advance for your answer
Community Auth has 3 new commits in its repository. This should fix your problem.
(11-04-2016, 12:06 AM)appc Wrote: Unfortunatelly doesn't fix anything..Thanks for trying to help me, I'm switching to Ion Auth That's unfortunate for you, since Community Auth is fully working with the commits from this evening. It's probably just your code, and I'm sorry but just don't have the time to skype and help you out. Good luck with Ion Auth. |
Welcome Guest, Not a member yet? Register Sign In |