Re: Auth Bug
| From: | Wolfram Kriesing | Date: | Fri, 03 May 2002 14:23:52 +0000 |
| Subject: | Re: Auth Bug | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1328@lists.php.net to get a copy of this message | ||
On Thursday 25 April 2002 12:31, Glenn Pierce wrote:
> That did work however after refreshing the same page twice after it has
> expired I get another bug
>
>
> Warning: Undefined index: timestamp in
> /home/glenn/www/bda/includes/Auth/Auth.php on line 466
>
>
> This is because after logout the timestamp in the seesion is removed and
> then checked on next checkauth.
if anyone is interested in a little different approach of an auth system, try
this: http://sf.net/projects/auth (examples provided)
i actually thought of merging it into pear but somehow didnt find the time
yet.
it is fully pear-compatible and all it needs is
$auth = Auth::setup('DB','mysql://root@localhost/test' ,
array(
'debug'=>2,
'expire'=>10,
'table'=>'test_auth',
'digest' => 'none' // set it to 'md5' if you want
// protect all under HTTP_HOST
'protectRoot' => '/'
) );
if( Auth::isError($auth) )
print(Auth::errorMessage($auth));
and since most applications are built this way, that they include a
application-wide config file anyway, you only need to put the block shown
above in this config file and the files under 'protectRoot' will be protected
by the authentication mechanism.
'protectRoot' can also be an array of different sites that shall be
protected, i.e.:
'protectRoot' => array( 'secure.php' , 'secure/*' ,
'secret*' )
this will protect the file "secure.php" everything under the directory
"secure" and everything that starts with "secret" (including directories)
--
Wolfram
... translating template engine ....
http://sf.net/projects/simpletpl
... authentication system ....
http://sf.net/projects/auth