Welcome Guest, Not a member yet? Register   Sign In
The Auth Library 1.0.3 - The Easiest Auth Library for CodeIgniter


Minor item: In your signature's link ( http://www.programmersvoice.com/user_guide/ ), when I click "Installation Instructions", gives a 404.

Otherwise, thanks for the library, trying it out now.

Thanks Adam!

Adam, I have another question..
I am trying to integrate the login page in to my home page, and when I do it, the form field seems to disable all my styling and and the form doesn't even show up!

What should I do?

[eluser]Adam Griffiths[/eluser]
That might be because there is styles included in the login.php view, have you taken the styles out of the login view to leave just the form?

If you can post your code to give me a better understanding of how you worked with it that'd be great.


Thanks Adam, so much, for taking a look!

It's a little hard to describe and would take up a lot of space as a comment, so I created a topic:


Please, if you could help, that'd be great!

[eluser]Andrew Mc[/eluser]
Hi Adam,

First of all thanks for this, has made my life easier. I am only new to CodeIgniter but I have a couple of suggestions for your Library.
1. a method in /libraries/Auth.php to return the users username if logged in
2. as above but returning the user_id.

Do you plan on extending the library to include permission based access to resources?

[eluser]Adam Griffiths[/eluser]
Hey Andrew,

If you want to return the username or user id of the currently logged in user, you can do so using the session library...




Any function I do make would just be a wrapper of that anyway.

I haven't made any plans to include permission based access other than groups and the restrict function.


[eluser]Andrew Mc[/eluser]
Hi Adam,

Just looking through some more of your code. /libraries/Auth.php gets a random string from random.org every time you update the users token. This seems a little slow and could cause problems if random.org went down for any reason. I have added a function _generate_token() to generate a random 20 char string while trying to even the odds as best I can.
function _generate_token($length = 20)
        $output = "";
                case 0:
                    $output .= mt_rand(0,9);
                case 1:
                case 2:
                    $output .= chr(mt_rand(0,25) + ord('a'));
            case 3:
                case 4:
                    $output .= chr(mt_rand(0,25) + ord('A'));
        return $output;    

Hi Adam and everyone who can give me an answer. First of al, thanks for this work. I made a simple application to try the Auth library, and when I submit the login form, I get this error message :

A PHP Error was encountered
Severity: Notice
Message: Undefined property: Admin::$db
Filename: libraries/MY_Controller.php
Line Number: 33

Fatal error: Call to a member function query() on a non-object in C:\wamp\www\vacation_0.1\application\libraries\MY_Controller.php on line 33

Is there something wrong I did or has someone else got the same error ?



Try adding 'database' to the libraries array in your autoload.php in your config folder or add
to your controller before calling the library function.

Theme © iAndrew 2016 - Forum software by © MyBB