EllisLab text mark
Advanced Search
1 of 42
1
   
DX Auth 1.0.6 (Authentication library)
Posted: 01 December 2008 06:14 AM
Avatar
Joined: 2008-10-22
145 posts

Introduction
DX Auth is an authentication library for Code Igniter. It’s goal to enable you to easily include secure and easy to use authentication library to your project, while giving you the flexibility to choose from simple authentication system to full fledged authentication system.

DX Auth is also build with internationalization in mind, so every string is available in language file. (Except the examples because that is your code, not the library).

It’s based on CL Auth 0.2.5 beta developed by Jason Ashdown.

What is the feature of DX Auth?

  * Basic auth (Login, logout, register, change password).
  * Remember me.
  * Login using username or email address or both (depend on config settings).
  * Forgot password.
  * Ban user.
  * Last login IP address and time (optional).
  * Email activation (optional).
  * User Profile (optional).
  * Role based (admin, user, moderator, etc). Inheritance also supported (optional)
  * Restrict page based on URI and role (optional).
  * Custom permission for each role (optional).
  * Login attempt (optional). You can use this to display catpcha after specified try to login to prevent bot.
  * Event feature (For example: You can put your own code like PM welcome message after user activated, etc).
  * Captcha (optional, native and reCAPTCHA is available).
  * Simple admin panel (So you can customize it, include it into your own admin panel, or delete if you don’t need it).
  * Most of the feature is optional, means you can turn it off in config file, delete it, or just don’t use it.


What is changed since CL Auth 0.2.5

If you are ever using CL Auth before, you might want to know what’s changed since CL Auth 0.2.5

  * Bug fixes.
  * Add and change function.
  * Changed code structure.
  * Group changed to role.
  * Compatible with CI bundled session without hacking it.
  * Added language file for internationalization.
  * All function named lower_case instead of camelCase.
  * Source code writing following CI User guide.
  * Commented source code so you can follow along.
  * Code Igniter style user guide with detailed explanation.
  * And other that i don’t remember smile.

DX Auth is tested in CI 1.7.0, but should be working for above version.

DX Auth is licensed under MIT license.

Here is the link:

Documentation (Very well documented)

Download link

Simple example on how to use DX Auth (See how easy to use it)

Version 1.0.6 (See how to upgrade below)

Release Date: January 3, 2009

It’s recommended to download the latest version.

 Signature 

DX Auth library - User guide

 
Posted: 01 December 2008 06:16 AM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-22
145 posts

Change log:

http://dexcell.shinsengumiteam.com/dx_auth/changelog.html

Upgrade

http://dexcell.shinsengumiteam.com/dx_auth/upgrade.html

User guide download

http://dexcell.shinsengumiteam.com/dx_auth/user_guide.zip

If user guide is updated, you may need to clear your browser cache to see the all the changes in user guide.

Note:

Even tough user guide is saying DX Auth User Guide Version 1.0,
it was the last version of user guide since i don’t have time to change it.

User guide version always updated according to DX Auth version in download page.

 Signature 

DX Auth library - User guide

 
Posted: 01 December 2008 06:56 AM   [ # 2 ]   [ Rating: 0 ]
Joined: 2007-10-07
14 posts

Very nice and well documented, will try this library in my current project.

First remarks:
1. You need to move out to language file all strings like ‘Remember me’,‘Username’,‘Confirmation Code’,‘You are already logged in.’,‘You have successfully registered.’ etc. Without that your library is not “build with internationalization in mind”.
Example:

$val->set_rules('username''lang:auth_login_username''trim|required|xss_clean'); 

2. I have all my user related tables in separeted database. So construction like

// Load Database
$this->ci->load->database(); 

is not good for me. Maybe you should make something like:

$this->ci->load->database($this->ci->config->item('DX_database')); 

3. Check this:

$this->ci->load->plugin('DX_captcha'); 

There is no such plugin in installation.

4. I did not found any line where

$this->captcha_login 

is used to switch on/off captcha in login page.

At first glance library is too crude for everyday use.

 
Posted: 01 December 2008 07:09 AM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2008-07-16
11 posts

dexcell auth plugin sounds interesting, almost covers everything i need for my current project.. i will try and let you know.

 Signature 

Do Something.Prioritize & Focus.

Have you checked out my blog today?.... No, do it now http://www.amiworks.co.in/talk

My Company : http://amiworks.com

 
Posted: 01 December 2008 09:30 AM   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-22
145 posts
RHAngel - 01 December 2008 11:56 AM

Very nice and well documented, will try this library in my current project.

First remarks:
1. You need to move out to language file all strings like ‘Remember me’,‘Username’,‘Confirmation Code’,‘You are already logged in.’,‘You have successfully registered.’ etc. Without that your library is not “build with internationalization in mind”.
Example:

$val->set_rules('username''lang:auth_login_username''trim|required|xss_clean'); 

2. I have all my tables related to users in separeted database. So construction like

// Load Database
$this->ci->load->database(); 

is not good for me. Maybe you you should make something like:

$this->ci->load->database($this->ci->config->item('DX_database')); 

3. Check this:

$this->ci->load->plugin('DX_captcha'); 

There is no such plugin in installation.

4. I did not found any line where

$this->captcha_login 

is used to switch on/off captcha in login page.

At first glance library is too crude for everyday use.

1. Auth.php is an example, meaning it’s not the library, so it’s your code, you need to create your application language file.

2. Good idea. I’m gonna add it later.

3. Sorry i’ve forgot adding it into zip download. Anyways i add it now, you can try to download it again. please let me know if something going wrong because in here, all it’s going fine smile thanks.

4. Do you mean in DX_Auth.php. Yes, see dx_config.php in the Helper configuration part. there is an explanataion there

At first glance library is too crude for everyday use

Well, that’s why in DX Auth most of them can be turn off as option. so you can only use basic auth. Then you have scalability if you want to have more feature just go to config and turn the feature on.

 Signature 

DX Auth library - User guide

 
Posted: 01 December 2008 09:34 AM   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-22
145 posts
thecancerus - 01 December 2008 12:09 PM

dexcell auth plugin sounds interesting, almost covers everything i need for my current project.. i will try and let you know.

Thanks, please download from link once again as before i forgot to add some file,
If the example doesn’t work please let me know because it’s working fine here.

 Signature 

DX Auth library - User guide

 
Posted: 01 December 2008 09:34 AM   [ # 6 ]   [ Rating: 0 ]
Joined: 2007-10-07
14 posts

Oh, I’m understand with Auth.php now, will dig only DX_Auth and models then. smileI try to use your library with PostgreSQL, if you don’t mind. smile

 
Posted: 01 December 2008 09:45 AM   [ # 7 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-22
145 posts
RHAngel - 01 December 2008 02:34 PM

Oh, I’m understand with Auth.php now, will dig only DX_Auth and models then. smileI try to use your library with PostgreSQL, if you don’t mind. smile

See here to know which part is the DX Auth library, and which is not

http://dexcell.shinsengumiteam.com/dx_auth/installation/index.html

I just updated it, you might need to press F5 in your browser.

I don’t mind and thanks for digging the code, maybe you can give advise or find bugs.

 Signature 

DX Auth library - User guide

 
Posted: 01 December 2008 09:59 AM   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2007-01-10
63 posts

Thanks for your contribution—I’ll give it a try.

Could anyone put up a comparison matrix for all the auth system we have now? —I’ve lost track long time ago.  cheese

—trice

 Signature 

http://www.polarblau.com

 
Posted: 01 December 2008 10:00 AM   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-22
145 posts

Updated the download file because there is typos and updated thing in user guide.

Added to readme.txt

After you download an extract the zip file DX Auth library file included in these folder:
-captcha folder
-system\plugins\ folder
-application\config\ folder
-application\helpers\ folder
-application\language\ folder
-application\libraries\ folder
-application\models\ folder

Except files above, everything is only examples, or can be deleted.

 Signature 

DX Auth library - User guide

 
Posted: 01 December 2008 10:08 AM   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-22
145 posts
trice22 - 01 December 2008 02:59 PM

Thanks for your contribution—I’ll give it a try.

Could anyone put up a comparison matrix for all the auth system we have now? —I’ve lost track long time ago.  cheese

—trice

Thanks, before when i was searching for a auth system, CL Auth was the best in my opinion in feature, but unfortunately the author become very busy and don’t have time to fix the bug and maintain the library to make it compatible with CI latest library.

When i dig the code, i think CL Auth has already a very good code base, that’s why i choose to take CL Auth to the next level and the result is DX Auth.

 Signature 

DX Auth library - User guide

 
Posted: 01 December 2008 10:23 AM   [ # 11 ]   [ Rating: 0 ]
Joined: 2007-10-07
14 posts

I think you need to rewrite

$this->ci->lang->load('dx_auth''english'); 

to

$this->ci->lang->load('dx_auth'); 

Or move language to config file, only ‘english’ is a bad choice. If I use other language I need to rewrite it by myself every time you update the library to the next version.

 
Posted: 01 December 2008 10:53 AM   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-22
145 posts
RHAngel - 01 December 2008 03:23 PM

I think you need to rewrite

$this->ci->lang->load('dx_auth''english'); 

to

$this->ci->lang->load('dx_auth'); 

Or move language to config file, only ‘english’ is a bad choice. If I use other language I need to rewrite it by myself every time you update the library to the next version.

Thank you, i totally forgot about that, will remove that english string so it will use language specified by CI config.

 Signature 

DX Auth library - User guide

 
Posted: 01 December 2008 11:35 AM   [ # 13 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-29
108 posts

Sounds interesting..I’ll try that library maybe next week or the week after next hehe, I will create a web portal after my current project, so I might use that DX Auth library of yours..Hope that all problems that RHAngel posted are fixed, when I downloaded the library next week.

Good day.

 Signature 

Rey Philip Regis
Contact Center Support/Developer
Northern Telcoworks Inc.
Cebu City, Philippines

 
Posted: 01 December 2008 12:36 PM   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-22
145 posts

@RHAngel
Just little question to you, before i add it to the source code.

Because i always put my all my tables in the same database, so i don’t know the answer.

About this code (i change the variable a bit)

$this->ci->load->database($this->ci->config->item('DX_database_group_name')); 

Does using code like this wouldn’t having some ‘collision’ with other code that using default active group/default database ?

I mean, Will CI take care of the rest in the background even if we load 2 database at once and return the correct one when i call it in the model?

I have read CI user guide about using multiple database, and if i should follow that, then looks like i have to change all the model just for one line raspberry (even tough looks like just renaming and testing).

But if that’s the case, i will consider adding it in the future, but not in these current day because i have my project to do.

And of course if you willing to help me by writing and testing it, i’m gonna add it to DX Auth source code smile

 Signature 

DX Auth library - User guide

 
Posted: 01 December 2008 12:41 PM   [ # 15 ]   [ Rating: 0 ]
Joined: 2007-10-07
14 posts

Oh, it is my fault. To use separate database we need to return connection in separate object. Like in example:

$DB1 $this->load->database('group_one'TRUE); 

So, I’m sorry. smile

By the way. Library is not compatible with PostgreSQL when you use quotes in table names or fields, because of plain SQL in models. To use this library with PostgreSQL you guys need to rewrite all plain SQL in models like:

$sql "SELECT $u_table.*, 
            
$r_table.name AS role_name
            FROM 
$u_table 
            JOIN 
$r_table ON $r_table.role_id = $u_table.role_id
            ORDER BY 
$u_table.user_id ASC"

to

$sql "SELECT \"$u_table\".*, 
            \"
$r_table\".\"name\" AS \"role_name\"
            FROM \"
$u_table\
            JOIN \"
$r_table\" ON \"$r_table\".\"role_id\" = \"$u_table\".\"role_id\"
            ORDER BY \"
$u_table\".\"user_id\" ASC"

 

dexcell maybe you can rewrite all queries to active record? 8) Or may be I can help you.

 
1 of 42
1