Sugestions for auth
| From: | Yavor Shahpasov | Date: | Sun, 03 Nov 2002 17:10:50 +0000 |
| Subject: | Sugestions for auth | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-10459@lists.php.net to get a copy of this message | ||
Hello,
I was playing with auth and I have noticed one limitation which I didi not
manage to overcome.
I want to have some sections in a site which require a login and some which
don't. This is easily accomplished by setting the optional login parameter.
Is it feasible to have some list of urls which change the default befaviour
of the optional login.
Say we have an array of urls which require login
$required = array('/admin/', 'change_password.php');
$showLogin = false;
foreach($required as $url){
if(strstr($PHP_SELF, $url)){
$showLogin = true;
}
}
$a = new Auth('DB', $dsn, 'myLogin', $showLogin);
$a->start();
This would be coded in an include file which sets up auth.
Is it possible to have a function setRequireAuth($required) (name can be
anything else of cource if it does not make sence)
ex:
$required = array('/admin/', 'change_password.php');
$showLogin = false;
$a = new Auth('DB', $dsn, 'myLogin', $showLogin);
$a->setRequireAuth($required);
$a->start();
in this case auth would de the required work to check where the login form
is to be shown.
Yavor Shahpasov
NetSmart Internet Services
http://www.netsmart.com.cy
Tel: +35722452565
Fax: +35722452566
email: yavo@netsmart.com.cy