ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

DX Auth 1.0.6 (Authentication library)

December 01, 2008 6:14am

Subscribe [160]
  • #61 / Dec 03, 2008 10:26am

    dexcell

    142 posts

    Please fix:

    $this->ci->load->library('dx_auth_event');

    ->

    $this->ci->load->library('DX_Auth_Event');

    And also please review your naming conventions, because it cause an error on lower/upper case depended OS. If you want to use loading like that “$this->ci->load->library(‘dx_auth_event’)”, you need to rename DX_Auth_Event.

    to tdktank59
    If you put ‘dx_auth’ in autoload, fix it to ‘DX_Auth’.

    Thanks, i forgot in linux file name is case sensitive.
    I’m gonna change it.

  • #62 / Dec 03, 2008 10:39am

    dexcell

    142 posts

    If you haven’t checked out KhACL yet I’ll just suggest one more time that you take a peak.  I just wonder if you’re reinventing the wheel here and doing it inefficiently (a wobbly wheel).

    The KhACL approach has roots from phpGACL.  Here’s a link to an admin panel:
    http://opensourceemr.com:2089/phpgacl/admin/acl_admin.php

    There’s a link to the manual there as well to describe the concept.

    This doesn’t mean your library is a total scrub.  The ACL is just one facet of the library.  All the user admin stuff is still useful.  I haven’t looked at your library at all, but if you keep the parts loosely coupled then it offers the ability to swap in other ACL libraries as well (zend acl, etc.).

    Backend Pro (in these forums) has an example implementation of KhACL and it’s decoupled from the auth management class (should you want to compare notes).

    Thank you for letting me know about this. I didn’t know about ACL thing before.
    Backend Pro seems very good (I didn’t realize there is this library when i search before).

    Actually this library is for my coming project, and this library is good enough to fulfill my needs, so i’m gonna stick for this library, while i’m gonna look at ACL in the future.

    I release it to public, because looks like many people searching for a auth library and compatible with latest CI (Including me in the past). So i think it may helpful for someone.

    EDIT: i realized the power of ACL now, those who need the more advanced multi user and permission than this library, i suggest you to look at php gacl website.

  • #63 / Dec 03, 2008 11:41am

    Very well looking library! Lots of useful features, thanks. 😉

  • #64 / Dec 03, 2008 12:52pm

    dexcell

    142 posts

    Just to telling you i’m gonna change role_uri table into
    permissions table

    and the field will be designed as below (apparently) to enable you adding custom permissions

    Permissions table
    {
    id
    role_id
    data (text) = will be inputed and retreived as array
    }

    Just think the data as user_data in CI sessions table.

  • #65 / Dec 03, 2008 3:12pm

    anonymous42223

    38 posts

    This looks great, but what platform did you develop this on?

    I had to rename everything with “DX_Auth” (note capitalization) to “dx_auth” otherwise it wouldn’t work. Names are case sensitive on most linux-based servers…

  • #66 / Dec 03, 2008 3:49pm

    tdktank59

    322 posts

    Just wanted to let you know you also need to include the url helper in the auto load or the files that require it…

    Otherwise it throws this to the error logs

    [03-Dec-2008 14:42:26] PHP Fatal error:  Call to undefined function anchor() in /home/fourtwo1/public_html/offroadwars/system/application/views/auth/login_form.php on line 66
    [03-Dec-2008 14:42:32] PHP Fatal error:  Call to undefined function redirect() in /home/fourtwo1/public_html/offroadwars/system/application/libraries/DX_Auth.php on line 398

    Also need the html helper

    [03-Dec-2008 14:52:34] PHP Fatal error:  Call to undefined function nbs() in /home/fourtwo1/public_html/offroadwars/system/application/views/cpanel/roles.php on line 19

  • #67 / Dec 03, 2008 5:35pm

    Colin Williams

    2601 posts

    Now I know for a fact I’m not “releasing” my User/Auth library. Enough out in the fray already!

  • #68 / Dec 03, 2008 5:57pm

    tdktank59

    322 posts

    LOL i said the same thing plus this one had almost 100% of the features I was planning on building into it lol…

    All besides the many to many with roles


    ========

    So im looking at how your config works and its static… and kinda annoying how you have some config values in other files… Why not just put them all in the config file and stuff

  • #69 / Dec 03, 2008 6:32pm

    anonymous42223

    38 posts

    Yeah, I gave up. I just went ahead and bought EE & EE Forums for the simplicity… that and it can do all that my application needs.

    I know not the cheapest route but I’m not gonna waste my time learning 10 auth systems when I don’t know if they’ll work for me…. especially when I don’t have the time to spend learning on them in the first place 😛

  • #70 / Dec 03, 2008 6:42pm

    Colin Williams

    2601 posts

    I don’t have any intrinsic knowledge on any of the available ones because I’ve spent the time fostering my own, but I’d imagine there are enough available that one could be picky and choose the heaviest (this or FreakAuth) or lightest (Redux, Fresh Auth) to suit their needs.

  • #71 / Dec 03, 2008 6:57pm

    freshface

    131 posts

    great lib, will check it out.
    ps: not everything is in the language file.

  • #72 / Dec 04, 2008 12:22am

    dexcell

    142 posts

    ^
    Everything is in language file, except the examples in controller and views because that’s your code application.

  • #73 / Dec 04, 2008 12:48am

    dexcell

    142 posts

    Just wanted to let you know you also need to include the url helper in the auto load or the files that require it…

    Otherwise it throws this to the error logs

    [03-Dec-2008 14:42:26] PHP Fatal error:  Call to undefined function anchor() in /home/fourtwo1/public_html/offroadwars/system/application/views/auth/login_form.php on line 66
    [03-Dec-2008 14:42:32] PHP Fatal error:  Call to undefined function redirect() in /home/fourtwo1/public_html/offroadwars/system/application/libraries/DX_Auth.php on line 398

    Also need the html helper

    [03-Dec-2008 14:52:34] PHP Fatal error:  Call to undefined function nbs() in /home/fourtwo1/public_html/offroadwars/system/application/views/cpanel/roles.php on line 19

    Thanks

  • #74 / Dec 04, 2008 2:33am

    tdktank59

    322 posts

    No problem that’s what’s testing is for.
    BTW you should update the link with a new version with the fixed loads

    If I recall right it’s in the library and one in each example
    It’s kinda bad when the example dosnt work right away LOL

  • #75 / Dec 04, 2008 8:23am

    Paul Apostol

    43 posts

    Hello,
    Nice library and is good that CL Auth has a successor.
    I prefer that the tables follows the DataMapper model cos will help me to code faster the control panel.
    As for the “check_role_uri” the only problem of mine is that it checks the table each time is accessed. Maybe caching the results is consuming too much memory.
    Like other users here I’ve tried to develop a similar library but you were so good and fast that I abandoned the idea. The only thing I propose is to develop add-ins for this library.
    The library can contain in a way or another groups and roles. The add-ins can offer functions to treat those groups and/or roles.
    As ex. I’m trying to implement an approach to RBAC library in manner closer to CI, but with flexibility for other ideas. Using DX Auth as a authentication library we can develop different styles of authorization: unique group, multiple groups, unique role, multiple roles, combination of previous, etc (have any other ideas?).
    What I want to make is a more flexible way to set the “role_uri” keeping all the structure in the database (I need to keep there another record of the level of the user: owner, manager, supervisor - can see or change data accordingly). That renders a very easy to use control panel but a lot of pain in getting the rules for the roles in the case I’ll try to describe below.
    I wrote here to have some “consultancy” on making multiple roles for one users and role inheritance.
    As ex a user could have 2 roles (or more) and at least one of the roles inherits from another (or maybe from the one the user has already). Some restrictions could be set when we are allocating the roles (the user can have only one role from the main and inherited list). Also, for some roles (with no relation between them) we can have different levels of access.
    Yes, I know, complicated.

    Paul

    PS: i don’t like “is_admin” cos what I want to try is that when rule is not set will inherit the right from the superior one (like in “role_uri”) and for the role “Admin” I can set only a simple rule “/”. The access to the page could be managed by the authentication.


    EDIT: Maybe we can consider no inheritance between roles and add a feature to clone a certain role in CP?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases