• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The Auth Library 1.0.3 - The Easiest Auth Library for CodeIgniter

#31
[eluser]2think[/eluser]
Adam,

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.

#32
[eluser]heavener[/eluser]
Thanks Adam!

#33
[eluser]heavener[/eluser]
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?

#34
[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.

#35
[eluser]heavener[/eluser]
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:

http://ellislab.com/forums/viewthread/108507/

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

#36
[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?

#37
[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...

Code:
$this->session->userdata('username');

or

Code:
$this->session->userdata('user_id');

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.


Thanks.

#38
[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.
Code:
function _generate_token($length = 20)
    {
        $output = "";
        for($i=0;$i<$length;$i++)
        {
            switch(mt_rand(0,4)){
                case 0:
                    $output .= mt_rand(0,9);
                    break;
                case 1:
                case 2:
                    $output .= chr(mt_rand(0,25) + ord('a'));
                    break;
            case 3:
                case 4:
                    $output .= chr(mt_rand(0,25) + ord('A'));
                    break;
            }
        }
        return $output;    
    }

#39
[eluser]Christophe-France[/eluser]
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 ?

Merci.

Christophe

#40
[eluser]davidbehler[/eluser]
Try adding 'database' to the libraries array in your autoload.php in your config folder or add
Code:
$this->load->library('database');
to your controller before calling the library function.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.