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]
  • #91 / Dec 04, 2008 5:29pm

    RS71

    106 posts

    Yep.

    You could take roles_id into its own table so you can have multiple roles and multiple groups but that would be yet another table to access (personally, I don’t think that is needed. most people will probably be good with one role and multiple groups)

    With the groups table, you can build as many tiers of access as you want.

  • #92 / Dec 04, 2008 5:51pm

    tdktank59

    322 posts

    Or you could just run it all off groups lol… and get rid of a table… because you could run it like this

    user
    {
    user_id
    username
    }
    
    user_to_group
    {
    user_id
    group_id
    expires
    }
    
    group
    {
    group_id
    group_name
    group_desc
    }

    then the groups are assigned the permissions

    With the roles and groups you would have the above but with below and two tables for the permissions 1 for roles 1 for groups…

    user
    {
    role_id
    }
    
    roles
    {
    role_id
    role_name
    }

    SO if you think about it just running groups would be easier…
    And when you want to check for permission you just limit to 1 and search for the access where group_id in groups or something like that

    If I can find my working example ill show you what I mean.

  • #93 / Dec 04, 2008 6:12pm

    RS71

    106 posts

    I do understand what you’re talking about, its what I had in mind.

    Heh but yeah you could just do with one table. In my case I’m gonna have to go with the role_id field and the groups table since the majority of my users will just have a general master permission (‘User’). That way I just access one table at login (the users table) and only depending on the users Role will the system check the Groups. And will spare me from making a row for every user (which I probably would have to make 4 mil of =/ )

  • #94 / Dec 04, 2008 6:15pm

    tdktank59

    322 posts

    Well yeah i guess that works!

    The role is there main role and groups just extend their permissions

    Just remember deny access by default and grant access as needed (saves rows in the tables)

  • #95 / Dec 04, 2008 6:25pm

    RS71

    106 posts

    I have yet to look through the actual lib heh but what about these optional features?

    Log after X failed attempts (username tried, time, ip, etc)
    Login time out in case of X login failures

    I’m probably forgetting to mention something else hrmm

  • #96 / Dec 04, 2008 7:12pm

    bugboy

    123 posts

    Ok just installed this and after reading through the thread to get everything working and changing a couple of things to get it running smoothly i think its great.

    I’m going to integrate it in to some modules.

    GREAT WORK 😊

  • #97 / Dec 05, 2008 12:53pm

    Mat-Moo

    350 posts

    I’m looking at upgrading an old php app I have which has already has a database of users/passwords/info. What I’d like to do is somehow bring this info/use this info in DX_Auth, however I don’t have a “Username” per person field (just full name which is not unique). DX_Auth allows me to use email to login with, but register requires a Username? So is there anyway to use this without the Username? or do i just use something randon or abandon the idea?

  • #98 / Dec 05, 2008 1:29pm

    dexcell

    142 posts

    sweet

    cheers

    does it use the new form validation class? I suppose that comes down to the user making the forms though

    Correct. The library have nothing to do with form validation class.

    It’s your choice to use new form class or old form class.
    DX Auth library only give you function for you to be used in your form validation callback function.

    You can see the example in controllers/auth.php

  • #99 / Dec 05, 2008 1:35pm

    dexcell

    142 posts

    I’m looking at upgrading an old php app I have which has already has a database of users/passwords/info. What I’d like to do is somehow bring this info/use this info in DX_Auth, however I don’t have a “Username” per person field (just full name which is not unique). DX_Auth allows me to use email to login with, but register requires a Username? So is there anyway to use this without the Username? or do i just use something randon or abandon the idea?

    The username is important part in DX Auth(for example: it’s used in activate user, forgot pass, etc),
    but in your case, you can do some script to create unique username from their email since i believe that email is unique. for: example, email: .(JavaScript must be enabled to view this email address) become john_doe_mymail.

  • #100 / Dec 05, 2008 1:38pm

    dexcell

    142 posts

    I have yet to look through the actual lib heh but what about these optional features?

    Log after X failed attempts (username tried, time, ip, etc)
    Login time out in case of X login failures

    I’m probably forgetting to mention something else hrmm

    No, this will be up to user to code.

    In the auth.php example, there is a code to show captcha after failed login attempts, so it’s up to user to do what ever they want.

  • #101 / Dec 05, 2008 4:34pm

    dexcell

    142 posts

  • #102 / Dec 05, 2008 6:23pm

    Delete Me Please

    17 posts

    Greetings,

    Getting this error when trying to goto http://domain.com/auth/login:

    A Database Error Occurred
    
    Error Number: 1064
    
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `ip_address` = '127.0.0.1'' at line 2
    
    SELECT 1 WHERE `ip_address` = '127.0.0.1'

    I looked in the log file and the error is in the ./models/dx_auth/login_attempts.php file.

    I used to use CL_Auth but I have removed it and tried to install yours.  I’m pretty sure the old CL_Auth is not interfering, but I could be wrong.  For more information, here is the total output of my log file when trying to access the login page:

    DEBUG - 2008-12-06 09:06:37 --> Config Class Initialized
    DEBUG - 2008-12-06 09:06:37 --> Hooks Class Initialized
    DEBUG - 2008-12-06 09:06:37 --> URI Class Initialized
    DEBUG - 2008-12-06 09:06:37 --> No URI present. Default controller set.
    DEBUG - 2008-12-06 09:06:37 --> Router Class Initialized
    DEBUG - 2008-12-06 09:06:37 --> Output Class Initialized
    DEBUG - 2008-12-06 09:06:37 --> Input Class Initialized
    DEBUG - 2008-12-06 09:06:37 --> XSS Filtering completed
    DEBUG - 2008-12-06 09:06:37 --> XSS Filtering completed
    DEBUG - 2008-12-06 09:06:37 --> XSS Filtering completed
    DEBUG - 2008-12-06 09:06:37 --> XSS Filtering completed
    DEBUG - 2008-12-06 09:06:37 --> Global POST and COOKIE data sanitized
    DEBUG - 2008-12-06 09:06:37 --> Language Class Initialized
    DEBUG - 2008-12-06 09:06:38 --> News Controller Initialized
    DEBUG - 2008-12-06 09:06:38 --> Loader Class Initialized
    DEBUG - 2008-12-06 09:06:38 --> Helper loaded: url_helper
    DEBUG - 2008-12-06 09:06:38 --> Helper loaded: form_helper
    DEBUG - 2008-12-06 09:06:38 --> Helper loaded: html_helper
    DEBUG - 2008-12-06 09:06:38 --> Database Driver Class Initialized
    DEBUG - 2008-12-06 09:06:38 --> Email Class Initialized
    DEBUG - 2008-12-06 09:06:38 --> Validation Class Initialized
    DEBUG - 2008-12-06 09:06:38 --> DX Auth Initialized
    DEBUG - 2008-12-06 09:06:38 --> Session Class Initialized
    DEBUG - 2008-12-06 09:06:38 --> Helper loaded: string_helper
    DEBUG - 2008-12-06 09:06:38 --> Encrypt Class Initialized
    DEBUG - 2008-12-06 09:06:38 --> Session routines successfully run
    DEBUG - 2008-12-06 09:06:38 --> Config file loaded: config/dx_auth.php
    DEBUG - 2008-12-06 09:06:38 --> Language file loaded: language/english/dx_auth_lang.php
    DEBUG - 2008-12-06 09:06:38 --> Config Class Initialized
    DEBUG - 2008-12-06 09:06:38 --> Hooks Class Initialized
    DEBUG - 2008-12-06 09:06:38 --> URI Class Initialized
    DEBUG - 2008-12-06 09:06:38 --> Router Class Initialized
    DEBUG - 2008-12-06 09:06:38 --> Output Class Initialized
    DEBUG - 2008-12-06 09:06:39 --> Input Class Initialized
    DEBUG - 2008-12-06 09:06:39 --> XSS Filtering completed
    DEBUG - 2008-12-06 09:06:39 --> XSS Filtering completed
    DEBUG - 2008-12-06 09:06:39 --> XSS Filtering completed
    DEBUG - 2008-12-06 09:06:39 --> XSS Filtering completed
    DEBUG - 2008-12-06 09:06:39 --> Global POST and COOKIE data sanitized
    DEBUG - 2008-12-06 09:06:39 --> Language Class Initialized
    DEBUG - 2008-12-06 09:06:39 --> Auth Controller Initialized
    DEBUG - 2008-12-06 09:06:39 --> Loader Class Initialized
    DEBUG - 2008-12-06 09:06:39 --> Helper loaded: url_helper
    DEBUG - 2008-12-06 09:06:39 --> Helper loaded: form_helper
    DEBUG - 2008-12-06 09:06:39 --> Helper loaded: html_helper
    DEBUG - 2008-12-06 09:06:39 --> Database Driver Class Initialized
    DEBUG - 2008-12-06 09:06:39 --> Email Class Initialized
    DEBUG - 2008-12-06 09:06:39 --> Validation Class Initialized
    DEBUG - 2008-12-06 09:06:39 --> DX Auth Initialized
    DEBUG - 2008-12-06 09:06:39 --> Session Class Initialized
    DEBUG - 2008-12-06 09:06:39 --> Helper loaded: string_helper
    DEBUG - 2008-12-06 09:06:39 --> Encrypt Class Initialized
    DEBUG - 2008-12-06 09:06:39 --> Session routines successfully run
    DEBUG - 2008-12-06 09:06:39 --> Config file loaded: config/dx_auth.php
    DEBUG - 2008-12-06 09:06:40 --> Language file loaded: language/english/dx_auth_lang.php
    DEBUG - 2008-12-06 09:06:40 --> File loaded: ./models/dx_auth/login_attempts.php
    DEBUG - 2008-12-06 09:06:40 --> Model Class Initialized
    DEBUG - 2008-12-06 09:06:40 --> DB Transaction Failure
    ERROR - 2008-12-06 09:06:40 --> Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `ip_address` = '127.0.0.1'' at line 2
    DEBUG - 2008-12-06 09:06:40 --> Language file loaded: language/english/db_lang.php
  • #103 / Dec 05, 2008 6:28pm

    bugboy

    123 posts

    I think you need to autoload the DX_auth config file for this

  • #104 / Dec 05, 2008 6:34pm

    Delete Me Please

    17 posts

    Fixed it.
    No, it wasn’t because of the autoload thing as described by bugboy.  It was because I had MVC installed and that was messing with DX_Auth.  Uninstalled and fixed 😉.

  • #105 / Dec 05, 2008 6:37pm

    bugboy

    123 posts

    i had that same error and auto loading the config file helped.

    So there are two solutions to the same problem now which is great.

    I’ve got it working with HMVC and Partial.

    Have you got it working with MVC ( is that matchbox)

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

ExpressionEngine News!

#eecms, #events, #releases