Re: Re: Liveruser with extended PEAR::Auth classes
| From: | Jeroen Houben | Date: | Tue, 30 Aug 2005 10:31:04 +0000 |
| Subject: | Re: Re: Liveruser with extended PEAR::Auth classes | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20660@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Jeroen Houben wrote: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.Hi, I've been playing with LU and a DB container for storing my users. This seems to work well. Now I want to change my setup to use PEAR::Auth to authenticate my users. Permissions will still be stored in a database. Is it possible to use an instance of an extended PEAR::Auth class (I don't think it is judging from the source code) and if so, what would my configuration array look like?You can pass in an existing instance. Just specify a "pearAuth" key with the instance inside your configuration array. That should work.
$auth =& LiveUser::authFactory($this->authContainers[$index], $index);
var_dump($auth);
if ($auth === false) {
echo 'false';
var_dump($auth);
}
The first var_dump prints an Object:
object(LiveUser_Auth_PEARAuth)#5 (20) {
["pearAuth"]=>
object(Auth)#6 (15) {
["expire"]=>
int(0)
["expired"]=>
bool(false)
["idle"]=>
int(0)
["idled"]=>
bool(false)
["storage"]=>
object(Auth_Container_RADIUS)#7 (4) {
["radius"]=>
object(Auth_RADIUS_PAP)#8 (14) {
["_servers"]=>
... etc ... etc ... etc
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).
Why is this? Am I overlooking something really simple?
Okay 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? Many thanks, JeroenRegarding permissions, would I have to create entries in both the perm_users table and the users table, or only in the perm_users table?Only the perm_users table. The users table is used by the database auth container, which you obviously dont need if you are using a different auth source (note: of course you can use the pear auth container and database auth container at the same time if you put both in your config array).