[sork] Passwd module/mysql

Ilya mail at krel.org
Tue Mar 2 12:07:59 PST 2004


Kent, I have mysql backend with cyrus running with no issues with password.
Enable debugging in Horde and also you could put in lines like these:

Horde::logMessage(sprintf('SQL search by %s: table = %s; query = "%s"',
                                  Auth::getAuth(), $this->_params['table'],
$query),
                          __FILE__, __LINE__, PEAR_LOG_DEBUG);
replacing the strings with what you are looking for. In part of horde where
compare is done - put the debug line in front of it and see whats in both
variables.



On Sat, Feb 28, 2004 at 05:20:56PM +0000, Kent Martin wrote:
> Hey folks,
> 
> I am trying to get the password module up and running, but cannot seem
> to get it to match the user's existing password (it gives a you input
> the wrong password type error message).
> 
> I have a mysql backend which holds the auth info for my imap server
> (courier).
> 
> I can see the query coming through (which mysql debugging turned on) and
> have run it manually - it is fine, it is just that passwd seems to thing
> the output of that query doesn't match what I put in.  The same problem
> occurs with clear and crypt so I have concentrated my efforts on getting
> clear going. Don't worry about the update line, I am sure that won't be
> a problem once I get the password matching working.
> 
> I am using the CVS cut from 27th Feb 2004.
> 
> Relevant table description:
> 
> mysql> describe users;
> +---------+------------------+------+-----+---------+-------+
> | Field   | Type             | Null | Key | Default | Extra |
> +---------+------------------+------+-----+---------+-------+
> | id      | varchar(128)     |      | MUL |         |       |
> | crypt   | varchar(128)     |      |     |         |       |
> | clear   | varchar(128)     |      |     |         |       |
> | name    | varchar(128)     |      |     |         |       |
> | uid     | int(10) unsigned |      |     | 65534   |       |
> | gid     | int(10) unsigned |      |     | 65534   |       |
> | home    | varchar(255)     |      |     |         |       |
> | maildir | varchar(255)     |      |     |         |       |
> | quota   | varchar(255)     |      |     |         |       |
> | shell   | varchar(255)     |      |     |         |       |
> +---------+------------------+------+-----+---------+-------+
> 10 rows in set (0.00 sec)
> 
> And finally, the relevant chunk of config:
> 
>  $backends['sql'] = array (
>     'name' => 'Horde Authentication',
>     'preferred' => '',
>     'password policy' => array(
>         'minLength' => 3,
>         'maxLength' => 8,
>         'maxSpace' => 0,
>         'minUpper' => 0,
>         'minLower' => 0,
>         'minNumeric' => 0
>     ),
>     'driver' => 'sql',
>     'params' => array(
>         'phptype'    => 'mysql',
>         'hostspec'   => 'localhost',
>         'username'   => 'the authentication info is fine',
>         'password'   => 'xxx',
>         'encryption' => 'clear',
>         'database'   => 'i can see the correct query hitting the
> relevant database',
>         'table'      => 'users',
>         'user_col'   => 'id',
>         'pass_col'   => 'clear',
>         '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 clear FROM users WHERE id = %u',
>         //'query_lookup' => 'UPDATE users SET clear = %p, SET crypt = %e
> WHERE id = %u',
>         // 'query_lookup' => 'SELECT user_pass FROM horde_users WHERE
> user_uid = %u',
>         'query_modify' => 'UPDATE users SET clear = %p, SET crypt = %p
> WHERE id
> = %u'
>         // 'query_modify' => 'UPDATE horde_users SET user_pass = %e
> WHERE user_uid = %u',
>     )
> );
> 
> Regards,
> 
> Kent.
> 
> -- 
> Sork mailing list - Join the hunt: http://horde.org/bounties/#sork
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: sork-unsubscribe at lists.horde.org


More information about the sork mailing list