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]
  • #106 / Dec 07, 2008 3:02pm

    Johan André

    412 posts

    Hey!

    Thanks for a great library!
    I have a question before using it in a current project though.

    Is there any way to set URI permissions based on users instead of based on roles?

    I have a situation where I got alot of sections (with separate admins and roles) and alot of bands assigned to each section. The bands will need access to their profile (but of course not the other bandprofiles).

    Is this possible without making a group for each band?

  • #107 / Dec 08, 2008 5:54pm

    tdktank59

    322 posts

    Hey!

    Thanks for a great library!
    I have a question before using it in a current project though.

    Is there any way to set URI permissions based on users instead of based on roles?

    I have a situation where I got alot of sections (with separate admins and roles) and alot of bands assigned to each section. The bands will need access to their profile (but of course not the other bandprofiles).

    Is this possible without making a group for each band?

    Some minor modifications sure…

    Add another table and a few other small things you could do it based on user_id instead of group/role_id

  • #108 / Dec 08, 2008 6:00pm

    uptown

    12 posts

    I’ve installed the code, and I’m trying to load up one of the examples.
    When I do, all I get is a partial login form.  The last form element I see is the “Remember Me” label.  In my server logs, I see an error:

    [Mon Dec 08 16:50:35 2008] [error] [client 127.0.0.1] PHP Fatal error:  Call to undefined function anchor() in C:\\server\\apache\\htdocs\\frameworks\\ci\\application\\views\\auth\\login_form.php on line 66

    I’ve also attached a screenshot.  Any ideas?  This is running on my local installation of Apache on a Windows machine.

  • #109 / Dec 08, 2008 6:02pm

    tdktank59

    322 posts

    need to include url helpers….

  • #110 / Dec 08, 2008 6:09pm

    uptown

    12 posts

    need to include url helpers….

    Yup ... that was it?  Just curious ... why wouldn’t that have been in the constructor of the controller already?

  • #111 / Dec 08, 2008 6:14pm

    tdktank59

    322 posts

    HTML and URL helpers

  • #112 / Dec 08, 2008 6:43pm

    tdktank59

    322 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

     


    Tracked this down its in the check_attempts under login_attempts file in the models folder

  • #113 / Dec 09, 2008 6:03am

    dexcell

    142 posts

    Thanks tdktank59 for answering.

  • #114 / Dec 09, 2008 6:15am

    dexcell

    142 posts

    Hey!

    Thanks for a great library!
    I have a question before using it in a current project though.

    Is there any way to set URI permissions based on users instead of based on roles?

    I have a situation where I got alot of sections (with separate admins and roles) and alot of bands assigned to each section. The bands will need access to their profile (but of course not the other bandprofiles).

    Is this possible without making a group for each band?

    Unfortunately, URI permissions is based on roles only.

    I don’t know if this work for your situation.
    You can create each band in roles, inherit user URI

    for example in roles:

    User
    {
    'home'
    'etc'
    }

    Band A: User
    {
    'band_a'
    }

    Band B: User
    {
    'band_b'
    }

    If it’s not work for your situation,
    then you may need some minor modification like tdktank59 said.

    DX Auth event might be helpful, you have to check it if you want add your own code.

  • #115 / Dec 09, 2008 6:19am

    dexcell

    142 posts

    Btw, i’m planning to add 3 more event in DX_Auth_Event, to enable more flexibility for people adding their code in the event to fit their needs.

  • #116 / Dec 09, 2008 10:45am

    tdktank59

    322 posts

    It would be sweet if you can figure out whats wrong with login_attempts so we can use this with HMVC!!!

    BTW I am looking for the solution as well…

  • #117 / Dec 09, 2008 1:22pm

    Ryan Pharis

    4 posts

    dexcell,

    Thanks for this authentication library. I have got it working just fine, but have one problem.
    When I register a user, I get a php warning:

    A PHP Error was encountered
    
    Severity: Warning
    
    Message: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
    
    Filename: libraries/Email.php
    
    Line Number: 1444

    I’m using the latest version of CI and your code.
    I set up an email.php config file for my app, and set the protocol to ‘mail’ but that didn’t help.
    Any ideas why that’s happening?

  • #118 / Dec 09, 2008 2:07pm

    dallen33

    88 posts

    This is absolutely the best Auth library I have used. This is the first time I’ve ever had an auth up and running in seconds. Great job!

  • #119 / Dec 09, 2008 2:48pm

    tdktank59

    322 posts

    For those of you just looking you also need to

    include the url, and html helpers

    Ill keep posting this until its in the documentation…

  • #120 / Dec 09, 2008 3:43pm

    tdktank59

    322 posts

    All right so the HMVC problem has something to do with the config loading…

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

ExpressionEngine News!

#eecms, #events, #releases