logo       

Re: Auth: two instances on the same page: msg#00326

php.pear.general

Subject: Re: Auth: two instances on the same page

On Wed, 19 Nov 2003 17:11:36 +0100, Jeroen Houben wrote:
> Hi,
>
>
> Is it possible to have two instances of Auth running on the same
> page?

Of course it is, I've added a patch to set the session name
few months ago.

=======================
$auth1Params = array(
'table' => 'table1',
'usernamecol' => 'col1',
'passwordcol' => 'pwdcol1',
'dsn' => $dbinfo,
'sessionName' => '_AuthSession1'
);
$auth2Params = array(
'table' => 'table2',
'usernamecol' => 'col2',
'passwordcol' => 'pwdcol2',
'dsn' => $dbinfo,
'sessionName' => '_AuthSession2'
);

$auth1 = new Auth('MDB', $auth1Params, 'loginFunction');
$auth1->start();
$auth2 = new Auth('MDB', $auth2Params, 'loginFunction');
$auth2->setSessionname('PHP_AUTH2_SESS');
$auth2->start();

if ($auth1->checkAuth()) {
// some code
}
if ($auth2->checkAuth()) {
// some other code
}

=======================

This should work.

HTH
Lorenzo

--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise