Re: [Phplib-users] Default Auth? 7.2d
Brought to you by:
nhruby,
richardarcher
|
From: Jacob H. <Jac...@fi...> - 2002-02-14 17:49:04
|
Thanks for the responses to the default auth issue. I've got it now.
Perhaps the docs on default auth should be updated... The bit about
$sess using only the first $auth class that is used over the course of
it's life was an important clue for me.
>>> <fr...@on...> 02/13/02 02:41PM >>>
On Wed, Feb 13, 2002 at 11:05:03AM -0700, Jacob Hanson wrote:
> The Default Auth feature seems like it should do the trick, but it's
> not working. I've set library.php to use my default_auth subclass,
but
> I'm still getting the login page when I try to access library.php.
It doesn't work to use different Auth subclasses on different pages of
the same website. Whatever Auth subclass appears in the first
page_open() that the user visits will be the auth class for all pages
visited in the site while that session persists.
A common approach to allowing unrestricted access to some pages and
not others is to set up the application's Auth subclass to use
"default authentication" -- $auth->nobody == true -- and then force
login on restricted pages by using something like this right after
calling page_open():
$auth->login_if($auth->auth["uid"] == "nobody");
--
Fred Yankowski fr...@on... tel: +1.630.879.1312
OntoSys, Inc PGP keyID: 7B449345 fax: +1.630.879.1370
<A href="http://www.ontosys.com www.ontosys.com
38W242 Deerpath Rd, Batavia, IL 60510-9461, USA
|