PHPlib
Wednesday, August 20, 2008  
download | documentation | faq | changelog | resources 


search for in the  


previousAuthentication Examples
Using Challenge-Response Authenticationnext

Last updated: Thu, 04 Jul 2002
view this page in Plain HTML

Many applications want to use $auth and $perm objects to protect functionality on a page, but do want to make the unprotected part of this page available to users with no account. This presents a kind of dilemma, because you need $auth and $perm objects to protect functionality on a page, but you don't want a login screen to appear by default.

Default authentication solves this dilemma by providing a special uid and uname "nobody", which is guaranteed to fail every permission check. If you set the nobody flag, $auth will not create a login screen to force a user to authenticate, but will authenticate the user silently as nobody. The application must offer a login button or other facility for users with accounts to change from that id to their real user id.

To use default authentication, create a subclass of My_Auth as shown above with the nobody flag set (Note: No need to extend in two steps. The only important thing here is that the nobody flag is set.)

To create a page that uses default authentication, use the page management functions. Check for relogin requests with the login_if() function. Create a relogin link on your page.


User Contributed Notes
Using default authentication
add a note about notes
There are no user contributed notes for this page.


previousAuthentication Examples
Using Challenge-Response Authenticationnext

Last updated: Thu, 04 Jul 2002



 

PHP Copyright © 2001 The PHPlib Group
All rights reserved.
Last updated: Thu Jul 4 15:42:10 2002 IST
Hosted and Maintained by http://www.sanisoft.com