Welcome Guest, Not a member yet? Register   Sign In
The Authentication Library 1.0.6
#19

[eluser]rdjs[/eluser]
Thanks for your hard work in creating this auth system.

I had two small problems getting everything set up.

1. When a user tries to logout there is a call to sess_destroy() but I had to change this to destroy(). The problem is not a fault with The Authentication Library but that I made some changes to the way sessions are handled in order to get SWFUpload working with the codeigniter upload class as per this thread
http://ellislab.com/forums/viewthread/97399/

2. When registering a user I got the following errors:

Code:
A PHP Error was encountered

Severity: Warning

Message: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known

Filename: libraries/Auth.php

Line Number: 348
A PHP Error was encountered

Severity: Warning

Message: fopen(http://random.org/strings/?num=1&len=20&digits=on&upperalpha=on&loweralpha=on&unique=on&format=plain&rnd=new) [function.fopen]: failed to open stream: No such file or directory

Filename: libraries/Auth.php

Line Number: 348
A PHP Error was encountered

Severity: Warning

Message: fread(): supplied argument is not a valid stream resource

Filename: libraries/Auth.php

Line Number: 349

This could be caused by some kind of infrastructure or server problem. I am testing this app from work and they have very strict I.T. policies, firewalls etc. It could also be some kind of server setting.

Here is the code from libraries/Auth.php around line 348:

Code:
if (ini_get('allow_url_fopen')) {
          // Grab the random string using the easy version if we can
          $token_source = fopen($rand_url, "r");
          $token = fread($token_source, 20);
        }

My hunch is that the server restrictions and php.ini settings are not aligned. As the code checks the ini to see if it can use fopen(), as it is told there are no problems it gives it a try.

Either way the registration seems to work as expected so I have just suppressed the warnings like so...

Code:
if (ini_get('allow_url_fopen')) {
          // Grab the random string using the easy version if we can
          $token_source = @ fopen($rand_url, "r");
          $token = @ fread($token_source, 20);
        }

Which works OK as $token contains a value like UnUmfDzdu7CQshCYqcD. I wonder however if it would be easier to generate the unique string a more like this:

Code:
$token = sha1(mt_rand(10000,99999).time().$username);

And then the whole if / ifelse / else section in the _genrate() function can be replaced?

Thanks again for your hard work on this great library.


Messages In This Thread
The Authentication Library 1.0.6 - by El Forum - 06-23-2009, 06:21 AM
The Authentication Library 1.0.6 - by El Forum - 07-09-2009, 12:09 PM
The Authentication Library 1.0.6 - by El Forum - 07-09-2009, 12:58 PM
The Authentication Library 1.0.6 - by El Forum - 07-12-2009, 01:30 PM
The Authentication Library 1.0.6 - by El Forum - 07-12-2009, 03:07 PM
The Authentication Library 1.0.6 - by El Forum - 07-12-2009, 07:08 PM
The Authentication Library 1.0.6 - by El Forum - 07-13-2009, 09:22 AM
The Authentication Library 1.0.6 - by El Forum - 07-21-2009, 05:50 PM
The Authentication Library 1.0.6 - by El Forum - 07-27-2009, 09:20 AM
The Authentication Library 1.0.6 - by El Forum - 07-27-2009, 09:34 AM
The Authentication Library 1.0.6 - by El Forum - 07-28-2009, 12:14 PM
The Authentication Library 1.0.6 - by El Forum - 07-28-2009, 12:27 PM
The Authentication Library 1.0.6 - by El Forum - 07-28-2009, 12:47 PM
The Authentication Library 1.0.6 - by El Forum - 07-29-2009, 01:09 PM
The Authentication Library 1.0.6 - by El Forum - 08-03-2009, 01:32 AM
The Authentication Library 1.0.6 - by El Forum - 08-03-2009, 04:59 AM
The Authentication Library 1.0.6 - by El Forum - 08-03-2009, 05:46 AM
The Authentication Library 1.0.6 - by El Forum - 08-03-2009, 10:13 AM
The Authentication Library 1.0.6 - by El Forum - 08-04-2009, 09:55 AM
The Authentication Library 1.0.6 - by El Forum - 08-10-2009, 09:21 PM
The Authentication Library 1.0.6 - by El Forum - 08-11-2009, 06:41 AM
The Authentication Library 1.0.6 - by El Forum - 08-11-2009, 09:54 AM
The Authentication Library 1.0.6 - by El Forum - 09-06-2009, 02:55 PM
The Authentication Library 1.0.6 - by El Forum - 09-06-2009, 09:50 PM
The Authentication Library 1.0.6 - by El Forum - 09-07-2009, 06:38 PM
The Authentication Library 1.0.6 - by El Forum - 09-07-2009, 07:51 PM
The Authentication Library 1.0.6 - by El Forum - 09-08-2009, 02:35 AM
The Authentication Library 1.0.6 - by El Forum - 09-08-2009, 11:23 AM
The Authentication Library 1.0.6 - by El Forum - 09-08-2009, 11:48 AM
The Authentication Library 1.0.6 - by El Forum - 09-08-2009, 12:57 PM
The Authentication Library 1.0.6 - by El Forum - 09-08-2009, 03:15 PM
The Authentication Library 1.0.6 - by El Forum - 09-10-2009, 12:38 AM
The Authentication Library 1.0.6 - by El Forum - 09-10-2009, 01:04 AM
The Authentication Library 1.0.6 - by El Forum - 09-10-2009, 07:54 PM
The Authentication Library 1.0.6 - by El Forum - 09-11-2009, 10:06 PM
The Authentication Library 1.0.6 - by El Forum - 09-12-2009, 12:06 AM
The Authentication Library 1.0.6 - by El Forum - 09-12-2009, 08:44 AM
The Authentication Library 1.0.6 - by El Forum - 10-02-2009, 01:14 PM
The Authentication Library 1.0.6 - by El Forum - 10-02-2009, 01:32 PM
The Authentication Library 1.0.6 - by El Forum - 10-02-2009, 01:50 PM
The Authentication Library 1.0.6 - by El Forum - 10-02-2009, 02:02 PM
The Authentication Library 1.0.6 - by El Forum - 10-02-2009, 02:06 PM
The Authentication Library 1.0.6 - by El Forum - 10-02-2009, 02:34 PM
The Authentication Library 1.0.6 - by El Forum - 10-05-2009, 04:31 AM
The Authentication Library 1.0.6 - by El Forum - 10-07-2009, 12:55 AM
The Authentication Library 1.0.6 - by El Forum - 10-07-2009, 06:53 AM
The Authentication Library 1.0.6 - by El Forum - 10-07-2009, 07:12 AM
The Authentication Library 1.0.6 - by El Forum - 10-07-2009, 09:48 AM
The Authentication Library 1.0.6 - by El Forum - 10-07-2009, 03:03 PM
The Authentication Library 1.0.6 - by El Forum - 10-07-2009, 03:43 PM
The Authentication Library 1.0.6 - by El Forum - 10-08-2009, 06:10 AM
The Authentication Library 1.0.6 - by El Forum - 10-08-2009, 07:41 AM
The Authentication Library 1.0.6 - by El Forum - 10-08-2009, 08:23 AM
The Authentication Library 1.0.6 - by El Forum - 10-08-2009, 10:25 AM
The Authentication Library 1.0.6 - by El Forum - 10-08-2009, 10:35 AM
The Authentication Library 1.0.6 - by El Forum - 10-09-2009, 01:44 AM
The Authentication Library 1.0.6 - by El Forum - 10-09-2009, 07:46 AM
The Authentication Library 1.0.6 - by El Forum - 10-09-2009, 09:22 AM
The Authentication Library 1.0.6 - by El Forum - 10-09-2009, 09:24 AM
The Authentication Library 1.0.6 - by El Forum - 10-16-2009, 03:06 AM
The Authentication Library 1.0.6 - by El Forum - 10-16-2009, 03:07 AM
The Authentication Library 1.0.6 - by El Forum - 10-16-2009, 04:19 AM
The Authentication Library 1.0.6 - by El Forum - 10-16-2009, 04:33 AM
The Authentication Library 1.0.6 - by El Forum - 10-24-2009, 01:28 AM
The Authentication Library 1.0.6 - by El Forum - 11-01-2009, 04:02 PM
The Authentication Library 1.0.6 - by El Forum - 11-02-2009, 09:39 PM
The Authentication Library 1.0.6 - by El Forum - 11-04-2009, 02:58 PM
The Authentication Library 1.0.6 - by El Forum - 11-06-2009, 08:52 AM
The Authentication Library 1.0.6 - by El Forum - 11-06-2009, 12:24 PM
The Authentication Library 1.0.6 - by El Forum - 11-06-2009, 12:31 PM
The Authentication Library 1.0.6 - by El Forum - 11-06-2009, 12:36 PM
The Authentication Library 1.0.6 - by El Forum - 11-06-2009, 12:37 PM
The Authentication Library 1.0.6 - by El Forum - 11-12-2009, 03:32 PM
The Authentication Library 1.0.6 - by El Forum - 11-12-2009, 05:25 PM
The Authentication Library 1.0.6 - by El Forum - 11-20-2009, 06:12 AM
The Authentication Library 1.0.6 - by El Forum - 11-20-2009, 08:38 AM
The Authentication Library 1.0.6 - by El Forum - 11-30-2009, 08:47 PM
The Authentication Library 1.0.6 - by El Forum - 12-03-2009, 12:53 PM
The Authentication Library 1.0.6 - by El Forum - 12-03-2009, 01:23 PM
The Authentication Library 1.0.6 - by El Forum - 12-07-2009, 11:22 AM
The Authentication Library 1.0.6 - by El Forum - 12-20-2009, 05:35 AM
The Authentication Library 1.0.6 - by El Forum - 12-27-2009, 02:03 PM
The Authentication Library 1.0.6 - by El Forum - 01-14-2010, 11:29 AM
The Authentication Library 1.0.6 - by El Forum - 01-31-2010, 12:27 AM
The Authentication Library 1.0.6 - by El Forum - 01-31-2010, 02:09 AM
The Authentication Library 1.0.6 - by El Forum - 02-08-2010, 02:16 PM
The Authentication Library 1.0.6 - by El Forum - 03-08-2010, 05:16 PM
The Authentication Library 1.0.6 - by El Forum - 03-08-2010, 07:28 PM
The Authentication Library 1.0.6 - by El Forum - 03-17-2010, 09:29 AM
The Authentication Library 1.0.6 - by El Forum - 03-19-2010, 01:22 AM
The Authentication Library 1.0.6 - by El Forum - 03-19-2010, 03:51 AM
The Authentication Library 1.0.6 - by El Forum - 03-19-2010, 10:42 AM
The Authentication Library 1.0.6 - by El Forum - 05-04-2010, 08:17 PM
The Authentication Library 1.0.6 - by El Forum - 05-20-2010, 12:40 PM
The Authentication Library 1.0.6 - by El Forum - 05-29-2010, 06:33 PM
The Authentication Library 1.0.6 - by El Forum - 03-20-2011, 12:12 PM
The Authentication Library 1.0.6 - by El Forum - 05-22-2011, 06:23 AM
The Authentication Library 1.0.6 - by El Forum - 03-12-2012, 06:28 AM
The Authentication Library 1.0.6 - by El Forum - 03-12-2012, 07:24 AM
The Authentication Library 1.0.6 - by El Forum - 03-12-2012, 07:49 AM
The Authentication Library 1.0.6 - by El Forum - 03-28-2012, 10:56 PM
The Authentication Library 1.0.6 - by El Forum - 03-29-2012, 12:24 AM
The Authentication Library 1.0.6 - by El Forum - 03-29-2012, 07:08 AM
The Authentication Library 1.0.6 - by El Forum - 10-06-2012, 08:01 AM
The Authentication Library 1.0.6 - by El Forum - 03-18-2013, 08:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB