Welcome Guest, Not a member yet? Register   Sign In
Community Auth
#2

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';

class 
MY_Controller extends Auth_Controller
{
    
/**
     * Class constructor
     */
    
public function __construct()
    {
        
parent::__construct();
    }
}

class 
Back_Controller extends MY_Controller
{
 
   /**
     * Class constructor
     */
 
   public function __construct()
 
   {
 
       parent::__construct();

 
       $this->require_min_level(1);
 
   }




I also made a basic controller for testing:


PHP Code:
class Back extends Back_Controller {
    
    public function 
__construct()
    {
        
parent::__construct();
    }

    
// -----------------------------------------------------------------------

    /**
     * Test by going to /back/dash in your browser
     */
    
public function dash()
    {
        echo 
'authenticated content ...';
    }
    
    
// -----------------------------------------------------------------------


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.
Reply


Messages In This Thread
Community Auth - by filipirie - 12-25-2017, 02:07 AM
RE: Community Auth - by skunkbad - 12-25-2017, 10:59 AM
RE: Community Auth - by filipirie - 12-26-2017, 02:22 AM
RE: Community Auth - by skunkbad - 12-26-2017, 09:04 AM
RE: Community Auth - by filipirie - 12-26-2017, 09:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB