[#4964] Passwd fails to get a the instance of Driver
Summary Passwd fails to get a the instance of Driver
Queue Passwd
Queue Version 3.0
Type Bug
State Resolved
Priority 2. Medium
Owners
Requester bertoncello (at) internet24 (dot) de
Created 02/01/2007 (465 days ago)
Due
Updated 02/01/2007 (465 days ago)
Assigned
Resolved 02/01/2007 (465 days ago)
Attachments
Milestone
Patch

History
02/01/2007 Chuck Hagenbuch Comment #3
State ⇒ Resolved
Reply to this comment
This has already been fixed in both HEAD and the FW_3 branch.
02/01/2007 wcravens (at) cortex-it (dot) com Comment #2 Reply to this comment
I concur with this bug.  Although I am using a mysql backend the setup was very similar and symptoms identical.  I can also confirm that the fix works.
02/01/2007 bertoncello (at) internet24 (dot) de Comment #1
Queue ⇒ Passwd
Summary ⇒ Passwd fails to get a the instance of Driver
State ⇒ Unconfirmed
Type ⇒ Bug
Priority ⇒ 2. Medium
Reply to this comment
I configured a Backend as sql (Postgres) with this data:

$backends['cf'] = array (
    'name' => 'CF',
    'preferred' => '',
    'password policy' => array(
        'minLength' => 3,
        'maxLength' => 24,
        'maxSpace' => 0,
        'minUpper' => 0,
        'minLower' => 0,
        'minNumeric' => 0,
        'minSymbols' => 0
    ),
    'driver' => 'sql',
    'params' => array(
        'phptype'    => 'pgsql',
        'hostspec'   => 'myserver.de',
        'protocol'   => 'tcp',
        'username'   => 'postgres',
        'password'   => 'mypassword',
        'encryption' => 'plain',
        'database'   => 'config',
        'table'      => 'account',
        'user_col'   => 'accountname',
        'pass_col'   => 'passwd',
        'show_encryption' => false
        // The following two settings allow you to specify custom queries for
        // lookup and modify functions if special functions need to be
        // performed.  In places where a username or a password needs to be
        // used, refer to this placeholder reference:
        //    %u -> gets substituted with the user
        //    %p -> gets substituted with the plaintext password
        //    %e -> gets substituted with the encrypted password
        //
        // 'query_lookup' => 'SELECT user_pass FROM horde_users WHERE user_uid = %u',
        // 'query_modify' => 'UPDATE horde_users SET user_pass = %e WHERE user_uid = %u',
    )
);

When the user tries to change his password, he gets this error:

Notice: Only variable references should be returned by reference in /usr/share/horde3/passwd/lib/Driver.php on line 110

I resolved this error by changing the line 110 of Driver.php as follow:

            $ret = &new $class($params);
            return $ret;
//            return $ret = &new $class($params);

Then, it runs without problem...
I hope, this change will appears by the next release... :)