Community Auth - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: External Resources (https://forum.codeigniter.com/forumdisplay.php?fid=7) +--- Forum: Addins (https://forum.codeigniter.com/forumdisplay.php?fid=13) +--- Thread: Community Auth (/showthread.php?tid=69620) |
Community Auth - filipirie - 12-25-2017 Hey Guys, I'm using Community Auth and for each action in my app i'm redirected to the login page. Here is the MY_Controller code ; PHP Code: require_once APPPATH . 'third_party/community_auth/core/Auth_Controller.php'; PHP Code: class Dashboard extends Back_Controller and here the dahboard view Code: <?php Each time a connected user clicks on a link he gets redirection to the login page before. Also when i remove the require_min_level condition, the authentication are not loaded and i get the undefined variable errors. I get thess issues with all of my pages. Please can anyone help me on these issues ? Thanks in advance !!! RE: Community Auth - skunkbad - 12-25-2017 First thing I notice is that you are trying to load the session library in your Front_Controller, but this is taken care of in Auth_Controller, and Front_Controller is extending Auth_Controller, so you can remove that. Next, for testing I changed my Auth_Controller.php to this: PHP Code: require_once APPPATH . 'third_party/community_auth/core/Auth_Controller.php'; I also made a basic controller for testing: PHP Code: class Back extends Back_Controller { And this all worked as expected. One thing you should know is that this is the wrong way to load helpers: PHP Code: require_once APPPATH . 'third_party/community_auth/helpers/auth_helper.php'; See the documentation for helpers to see the right way. If this doesn't help the problem is most likely in your code, as you seem to not fully grasp the documentation for CodeIgniter. Really, it could be something as simple as a botched installation of Community Auth, but could be anything based on your code that you've provided. RE: Community Auth - filipirie - 12-26-2017 Hi Skunkbad, Please both enforcing and simple verification load auth_data? If yes, why when i use only simple verification method i get undefined variables errors? RE: Community Auth - skunkbad - 12-26-2017 (12-26-2017, 02:22 AM)filipirie Wrote: Hi Skunkbad, Auth variables won't be available if the request is done without current or previous authentication. RE: Community Auth - filipirie - 12-26-2017 Okay SB. Thanks! |