[eluser]JamesTaylor[/eluser]
I'm using DX Auth for the first time and attempting to setup a mini example for myself to get to grips with it. I have it installed and working with CI2 now and am wanting to implement permissions for the 1st time.
I have created 2 new accounts, the 1st is an admin acc. and the 2nd is a user acc. I have also created 2 additional controllers called 'allow' and 'deny'.
Using the admin acc. i have set the the URI Permissions for the 'user' accounts to include the controller 'allow' by adding \allow\ and saving the update.
my 2 controllers are identical except for their names, here is what i have in them:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Allow extends CI_Controller {
function __construct()
{
parent::__construct();
$this->dx_auth->check_uri_permissions();
}
function index()
{
$this->load->view('welcome_message');
}
}
I was expecting that when i logged in with the user account i would be able to view the 'allow page' but not the 'deny page' however i am currently getting the following error message when i view either...
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined property: Allow::$dx_auth
Filename: controllers/allow.php
Line Number: 9
Fatal error: Call to a member function check_uri_permissions() on a non-object in C:\wamp\www\DXAuth-CI2\application\controllers\allow.php on line 9
Line 9 is the '$this->dx_auth->check_uri_permissions();' statement.
Can someone please offer me some help as to what i am doing wrong, i have had a few issues initially with getting DX Auth working with CI2 so i'm not sure if this is just another compatibility issue or I am making a mistake!
Thanks
James