Re: Re: Liveruser with extended PEAR::Auth classes
| From: | Jeroen Houben | Date: | Tue, 30 Aug 2005 10:50:28 +0000 |
| Subject: | Re: Re: Liveruser with extended PEAR::Auth classes | ||
| References: | 1 2 3 4 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20662@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Jeroen Houben wrote:Yes you are right it does 2 loops (I thought I was going mad - time to start working with a debugger :-) So why the loop then, it must be something with my configuration array, I'm only using one Auth container atm ... $servers = array(); $servers[0] = array('example.com', null, 'string', 10, 3); $PEARAuth_options = array("servers"=>$servers, "authtype"=>'PAP'); $LUOptions = array( 'login' => array(Okay great. In the mean time I've been fiddling with the conf array, passing in the all the necessary values to LU to use PEAR::Auth_radius. It's not yet working and I just added some debug statements in LU's source code to understand the code a bit better. Here's a small portion I don't understand. The login() function in Liveuser.php has this bit of code.$auth =& LiveUser::authFactory($this->authContainers[$index], $index); var_dump($auth); if ($auth === false) { echo 'false'; var_dump($auth); }Seems like $auth is not false, but a proper instance. However somehow the flow enters the if statement and then the second time around my var_dump() prints bool (false).I understand your confusion. But this is obviously not possible. $auth cannot match === false if its an object and since there is no assignment inbetween. I assume you have multiple auth containers configured so its conceivable that the false occurs in a second iteration over the auth containers. However in that case you should get a var dump like "object, false, false" and not just "object, false"
'force' => true
),
'logout' => array(
'destroy' => true,
),
'authContainers' => array(
'radius' => array(
'type' => 'PEARAuth',
'pearAuthContainer' => "RADIUS",
'pearAuthOptions' => $PEARAuth_options
),
),
'permContainer' => array(
'type' => 'Medium',
'storage' => array(
'DB' => array(
'dsn' => $dsn,
'prefix' => 'lu_',
)
),
),
);
Can you spot anything wrong with this?
Sure, that makes sense. So the user will get authenticated and logged in if he's not present in perm_users, he just won't have any permissions, right? JeroenOkay great. How can a user be in_active if he has no entry in the users table? Will a user get authenticated okay even when he has no entry in the perm_users table?This is storage container dependent. However since PEAR::Auth does not seem to have support for an is_active flag, the PEARAuth container also does not support such a flag.