[horde] Horde 4 and custom passwd driver
Jan Schneider
jan at horde.org
Mon Mar 19 13:35:59 UTC 2012
Zitat von Ralf Lang <lang at b1-systems.de>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> - -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Am 19.03.2012 13:42, schrieb Peter Meier:
>> Hi all,
>>
>> I have a question regarding Horde 4 and passwd:
>>
>> I have an own driver for an sql based but using bcrypt hashed
>> passwords authentication mechanism. So in Horde 3 I created an own
>> driver inheriting from the sql driver and overriding the
>> encryptPassword and comparePasswords methods and selected that
>> driver in the backends configuration.
>>
>> I tried the same thing (adjusting class name as well as method
>> names to _encryptPassword and _comparePasswords) in Horde 4, but I
>> wasn't able to use the driver until I adjusted the case statement @
>>
>> https://github.com/horde/horde/blob/master/passwd/lib/Factory/Driver.php#L90
>>
>>
>>
> to treat my driver the same way as the Sql driver.
>>
>> To me this seems to be a clumsy and I wondered how custom drivers
>> should be implemented correctly in Horde 4, without having to
>> touch passwd core code?
>>
>
> Are you talking about a custom passwd backend or a custom auth driver?
> How would you indicate to the factory that your 3rd party driver needs
> an sql instance?
I guess this is exactly his question. And the answer is: you can't.
You have to pull in the dependencies manually, e.g. $db =
$GLOBALS['injector']->getInstance('Horde_Db_Adapter'), inside the
custom driver.
Jan.
--
The Horde Project
http://www.horde.org/
More information about the horde
mailing list