Re: Re: Liveruser with extended PEAR::Auth classes

From: Date: Tue, 30 Aug 2005 14:15:42 +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-20670@lists.php.net to get a copy of this message
Lukas Smith wrote:
Jeroen Houben wrote:
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.
I've finally gotten this to work properly using, but I did have to change the source a tiny bit. In PEARAuth.php I had to change the property pearAuth to initialize to false. I think what you want to do in the init() method is check if any keys of the array are present as a property of the class. But isset() doesn't cut it when the property is initialized to null. /**
    * Contains the PEAR::Auth object.
    *
    * @var    Auth
    * @access private
    */
var $pearAuth = null; I changed it to this var $pearAuth = false; here's my config array which worked. $LUOptions = array( 'login' => array(
       'force'    => true
    ),
'logout' => array(
       'destroy'  => true,
    ),
'authContainers' => array(
       'radius' => array(
           'type'  => "PEARAuth",
           'pearAuth'  => new TERENA_Auth_Radius(null, false) // my own extended PEAR::Auth class
       ),
), 'permContainer' => array(
       'type' => 'Medium',
       'storage' => array(
           'DB' => array(
               'dsn' => $dsn,
               'prefix' => 'lu_',
           )
        ),
), ); Jeroen

« previous php.pear.general (#20670) next »