DX Auth - Using Permissions - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: DX Auth - Using Permissions (/showthread.php?tid=38210) |
DX Auth - Using Permissions - El Forum - 02-02-2011 [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'); 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 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 DX Auth - Using Permissions - El Forum - 02-02-2011 [eluser]predat0r[/eluser] Did you autoload the lib like 'DX_Auth' and not like 'dx_auth'? The first one works only. DX Auth - Using Permissions - El Forum - 02-02-2011 [eluser]JamesTaylor[/eluser] Thanks predat0r, that was my problem... but i'm straight into another! when i attempt to access the 'deny' controller as expect i am denied access to hit and am redirected to the url ...index.php/auth/deny - however this brings up a 404 page not found error?? DX Auth - Using Permissions - El Forum - 02-02-2011 [eluser]predat0r[/eluser] I'm just guessing, 404 error means - in my opinion - your view isn't there or misspelled or stg, did you do a view for deny? DX Auth - Using Permissions - El Forum - 02-02-2011 [eluser]JamesTaylor[/eluser] Yeah i agree predat0r! It appears that there is no function 'deny' in the controller 'auth' which comes with DX Auth... seems a bit strange to me, but maybe its an oversight in the library?? If I add the function to the controller I no longer get the 404 page - instead i'm echoing out 'denied' via the function which is working. Am I missing something here, perhaps in the config of DX Auth or has the deny function just been ommitted by accident from DX Auth?? Surely I can't be the 1st to come across this problem?!! James DX Auth - Using Permissions - El Forum - 02-02-2011 [eluser]predat0r[/eluser] First, you have to set controller(s) and view(s) that can be see the user. Then set the permissions. In the lib DX_Auth is the code where redirects users if they try to go to denied uri Code: function deny_access($uri = 'deny') you can modify in the config file these settings, or if its good, you have to write the cont/view. For example take the DX_banned_uri config item. Its equal to /auth/banned/. You have to create controller/view for that. |