[sork] backends.local.php not obeyed.

Simon Brereton simon.brereton at buongiorno.com
Tue Nov 8 18:37:33 UTC 2011


On 8 November 2011 11:17, Ralf Lang <lang at b1-systems.de> wrote:
> Am Dienstag, 8. November 2011, 16:22:00 schrieb Simon Brereton:
>> On 8 November 2011 09:37, Ralf Lang <lang at b1-systems.de> wrote:
>> > Am Dienstag, 8. November 2011, 15:31:12 schrieb Simon Brereton:
>> >> On 2 November 2011 15:18, Simon Brereton
>> >> <simon.brereton at buongiorno.com>
>> >>
>> >> wrote:
>> >> > On 2 November 2011 15:03, Simon Brereton
>> >> > <simon.brereton at buongiorno.com>
>> >> >
>> >> > wrote:

>> >> > "/usr/share/horde4/passwd/config/backends.php"]
>> >> >
>> >> >
>> >> >
>> >> > 116 $backends['hordesql'] = array (
>> >> > 117     'disabled' => false,
>> >> > 118     'name' => 'Horde SQL Authentication',
>> >> > 119     'preferred' => '',
>> >> > 120     'policy' => array(
>> >> > 121         'minLength' => 6,
>> >> > 122         'minNumeric' => 1,
>> >> > 123     ),
>> >> > 124     'driver' => 'Sql',
>> >> > 125     'params' => array_merge(
>> >> > 126         $GLOBALS['conf']['sql'],
>> >> > 127         array('table' => 'horde_users',
>> >> > 128               'user_col' => 'user_uid',
>> >> > 129               'pass_col' => 'user_pass',
>> >> > 130               'show_encryption' => false,
>> >> > 131               'encryption' =>
>> >> > $GLOBALS['conf']['auth']['params']['encryption'])
>> >> > 132     ),
>> >> > 133 );
>> >> >
>> >> >
>> >> > I haven't touched anything in backends.php
>> >>
>> >> Anyone got anything to add before I have another go at this?
>> >>
>> >>
>> >> Thanks.
>> >>
>> >> Simon
>> > If you're only editing the horde sql backend, you could also use the
>> > "Horde" backend instead of the Sql backend.
>>
>> By Horde backend you mean the Horde DB? All my auth is done against
>> IMAP (dovecot) which uses a separate DB (also used by postfix) for
>> domains/mail accounts.
>>
>> As far as I know, I have to use the SQL backend to change that.
>>
>> Simon
>
> See line 117:
>
> Horde Sql Backend is NOT disabled - why?

Er..  Because I try not to edit backends.php - it's my understanding
that any changes I make there will be over-written on upgrade.

But I disabled it in the backends.local.php and of course now it's working.

After a fashion - that is to say, my next issue is with the query..  I
get this error:

Failure in changing password for All Services: sql: unable to load sub
driver: Could not instantiate PDO with DSN
"mysql:encryption=crypt;table=Mail;user_col=Email;pass_col=Password;query_lookup=SELECT
Password FROM Mail WHERE Email = %u;query_modify=UPDATE Mail SET
Password = %e WHERE Email = %u;name=Mail and VPN
Services;driver=Sql;required=1;is_subdriver=1;host=127.0.0.1;dbname=Mail".
PDOException: SQLSTATE[HY000] [2003] Can't connect to MySQL server on
'127.0.0.1' (111)[Tue 08 Nov 2011 01:29:43 PM EST]

139        'sql' => array(
140                         'name' => 'Mail and VPN Services',
141                         'driver' => 'Sql',
142                         'required' => true,
143                         'params' => array(
144          'phptype'    => 'mysql',
145          'hostspec'   => 'localhost',
146          'username'   => 'noneedtoknowbutitsright',
147          'password'   => 'imnottellingyouthat',
148          'encryption' => 'crypt',
149          'database'   => 'Mail',
150          'table'      => 'Mail',
151          'user_col'   => 'Email',
152          'pass_col'   => 'Password',
153          'show_encryption' => false,
154          // The following two settings allow you to specify custom
queries for
155          // lookup and modify functions if special functions need to be
156          // performed.  In places where a username or a password needs to be
157          // used, refer to this placeholder reference:
158          //    %u -> gets substituted with the user
159          //    %p -> gets substituted with the plaintext password
160          //    %e -> gets substituted with the encrypted password
161          //
162          'query_lookup' => 'SELECT Password FROM Mail WHERE Email = %u',
163          'query_modify' => 'UPDATE Mail SET Password = %e WHERE Email = %u',
164         ),
165     ))
166  ));


I so wasn't expecting it to complain about not being able to connect
to mysql that I don't know where to go next.  I was at least expecting
to debug the query - but the connection..?

Simon


More information about the sork mailing list