EllisLab text mark
Advanced Search
1 of 8
1
   
The Easiest Authentication Library for CodeIgniter just got easier.
Posted: 25 April 2009 07:12 PM
Avatar
Joined: 2008-05-04
356 posts

Hey guys,

Over the past few days I have been working hard on adding an administration panel to The Authentication Library.

I have added the ability to add, edit and delete users without writing any code. I have also created a helper to reduce the code you need to write for some other tasks.

I have also changed the location of the user guide to my personal domain name. The user guide can be found here and has been updated for this new 1.0.5 release.

You can download the new set of files from Github.

If you have any questions that are not covered in the user guide, please post here.


Thanks.


(Sorry for the brief post, it’s late here.)

 Signature 

[ Adam Griffiths - Freelance Web Applications Developer ]
[ Follow me on Twitter ]

 
Posted: 25 April 2009 07:30 PM   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2008-05-18
2398 posts

Looks really good, have downloaded it, and will dig into it tomorrow smile
It seems to have pretty much what I want, without the additional bloat of the larger libraries

 Signature 

I’m building a Project Management System for my 3rd year Uni project, Sign up to the beta
Track my progress | Post of the day: UI Designs
Get full auto complete support for CodeIgniter in Eclipse

 
Posted: 02 May 2009 01:51 AM   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2009-05-02
3 posts

hallo, Adam, I’ve found this in _generate() function in Auth.php:

$token_source fopen("http://random.org/strings/?num=1&len=20&digits=on&upperalpha=on&loweralpha=on&unique=on&format=plain&rnd=new""r");
$token fread($token_source20); 

may be to use a more simple solution, like

$sym '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$token ='';
for (
$a 0$a 20$a++) {
    $token 
.= $sym[mt_rand(019)];

or I do not understand something?

 
Posted: 02 May 2009 06:47 AM   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2008-05-04
356 posts
boxfrommars - 02 May 2009 05:51 AM

hallo, Adam, I’ve found this in _generate() function in Auth.php:

$token_source fopen("http://random.org/strings/?num=1&len=20&digits=on&upperalpha=on&loweralpha=on&unique=on&format=plain&rnd=new""r");
$token fread($token_source20)

may be to use a more simple solution, like

$sym '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$token ='';
for (
$a 0$a 20$a++) {
    $token 
.= $sym[mt_rand(019)];

or I do not understand something?

I have taken many of the “rewuirements” of an authentication library “done right” from here. This includes random salt generation from random.org.

I now understand that if a user is using this locally and there is no internet access, an error occurs. I will create a config value that will let you choose whether or not to use random.org for the salts.

Thanks.

 Signature 

[ Adam Griffiths - Freelance Web Applications Developer ]
[ Follow me on Twitter ]

 
Posted: 02 May 2009 08:09 AM   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2009-05-02
3 posts

Thank you for your reply and for a good library grin

 
Posted: 02 May 2009 01:44 PM   [ # 5 ]   [ Rating: 0 ]
Joined: 2009-03-15
25 posts

I’m getting the following error on a fresh install of CI:

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: email

Filename: pages/register.php

Line Number: 20

When I try and access ‘admin/register’. However, looking at register.php I see that $email is being defined correctly. Any ideas?

 
Posted: 02 May 2009 01:56 PM   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2008-05-04
356 posts
Otaku Coder - 02 May 2009 05:44 PM

I’m getting the following error on a fresh install of CI:

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: email

Filename: pages/register.php

Line Number: 20

When I try and access ‘admin/register’. However, looking at register.php I see that $email is being defined correctly. Any ideas?

Thanks for letting me know about this. The error was in the file views/auth/pages/register.php - I have now fixed the error and the changes are in the latest commit in the github repo.

Thanks.

 Signature 

[ Adam Griffiths - Freelance Web Applications Developer ]
[ Follow me on Twitter ]

 
Posted: 02 May 2009 02:32 PM   [ # 7 ]   [ Rating: 0 ]
Joined: 2009-03-15
25 posts
Adam Griffiths - 02 May 2009 05:56 PM
Otaku Coder - 02 May 2009 05:44 PM

I’m getting the following error on a fresh install of CI:

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: email

Filename: pages/register.php

Line Number: 20

When I try and access ‘admin/register’. However, looking at register.php I see that $email is being defined correctly. Any ideas?

Thanks for letting me know about this. The error was in the file views/auth/pages/register.php - I have now fixed the error and the changes are in the latest commit in the github repo.

Thanks.

Just installed the fix and it’s working fine now. Thanks!!

 
Posted: 02 May 2009 02:34 PM   [ # 8 ]   [ Rating: 0 ]
Joined: 2009-03-15
25 posts

I already have a ‘groups’ table in an app I’ve been developing, so I had to rename it in your dump.sql. However, I can’t find any references to that table in the auth code. Is it actually being used or have I just missed it?

 
Posted: 02 May 2009 02:40 PM   [ # 9 ]   [ Rating: 0 ]
Joined: 2009-03-15
25 posts

I seem to be on a Bug Hunt today!!! Here’s another one for you Adam:

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: msg

Filename: pages/reg_success.php

Line Number: 5

I get that error after I’ve hit ‘Submit’ on the register view. It says ‘Success’ and the record is inserted correctly in the DB so everything else appears to work fine.

 
Posted: 02 May 2009 02:46 PM   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2008-05-04
356 posts
Otaku Coder - 02 May 2009 06:34 PM

I already have a ‘groups’ table in an app I’ve been developing, so I had to rename it in your dump.sql. However, I can’t find any references to that table in the auth code. Is it actually being used or have I just missed it?

Yes it’s in there so it can be used in your application, but it’s not directly used in the Library. Although this will change in future versions.

Otaku Coder - 02 May 2009 06:40 PM

I seem to be on a Bug Hunt today!!! Here’s another one for you Adam:

A PHP Error was encountered

Severity: Notice

Message: Undefined variable: msg

Filename: pages/reg_success.php

Line Number: 5

I get that error after I’ve hit ‘Submit’ on the register view. It says ‘Success’ and the record is inserted correctly in the DB so everything else appears to work fine.

Thanks, I think I’ve fixed the problem now. Can you download the new Auth.php library file from github and test it on your machine just to be sure?

Thanks.

 Signature 

[ Adam Griffiths - Freelance Web Applications Developer ]
[ Follow me on Twitter ]

 
Posted: 02 May 2009 02:55 PM   [ # 11 ]   [ Rating: 0 ]
Joined: 2009-03-15
25 posts

Installed the new Auth.php and I can’t see any other errors for now. Thanks!!! Another question, is the Dashboard view supposed to be empty? All I see is ‘This is the admin section.’.

 
Posted: 02 May 2009 03:00 PM   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2008-05-04
356 posts
Otaku Coder - 02 May 2009 06:55 PM

Installed the new Auth.php and I can’t see any other errors for now. Thanks!!! Another question, is the Dashboard view supposed to be empty? All I see is ‘This is the admin section.’.

No worries.

The dashboard should say “welcome $username” where $username is the username of the user. “This is the admin section” was in the old admin controller, have you updated to the new admin controller? There are 2 now, in a directory controllers/admin/.

Thanks.

 Signature 

[ Adam Griffiths - Freelance Web Applications Developer ]
[ Follow me on Twitter ]

 
Posted: 02 May 2009 03:19 PM   [ # 13 ]   [ Rating: 0 ]
Joined: 2009-03-15
25 posts
Adam Griffiths - 02 May 2009 07:00 PM

The dashboard should say “welcome $username” where $username is the username of the user. “This is the admin section” was in the old admin controller, have you updated to the new admin controller? There are 2 now, in a directory controllers/admin/.

Thanks.

I have updated to the new admin controller and I can’t see anything other than ‘This is the admin section’.

 
Posted: 03 May 2009 02:40 PM   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2009-01-09
73 posts

I’m getting the same thing: “This is the admin section”

 
Posted: 03 May 2009 02:56 PM   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2008-05-04
356 posts

I found the problem. I deleted these files locally but they were still in the github repo, even after several commits. I have removed the older files from the repo.

I removed:

controllers/admin.php (path changed)
views/auth/login.php (path changed)
views/auth/logout.php (path changed)
views/auth/reg_success.php (path changed)
views/auth/register.php (path changed)

all .sql files except dump.sql.

So you can either delete the files you don’t need locally or grab them from the repo again.


Thanks.

 Signature 

[ Adam Griffiths - Freelance Web Applications Developer ]
[ Follow me on Twitter ]

 
1 of 8
1