[horde] Dynamic, Minimalist, Traditional selection?

horde at corwyn.net horde at corwyn.net
Fri Oct 10 02:04:17 UTC 2008


Well, this idea is brilliant. I do have a few questions. The wiki says
"Next we need to select the correct drivers for the different 
purposes of the authentication API. The driver gets selected by the 
name we used in the last step. There are currently three possible 
switches for selecting a driver: "

but I only see two options after that? Should there be a third, or 
are there only two?

I can understand (great instructions!) how to define mysql as one of 
the drivers, and application for the other. I can see how to set the 
login driver to be one or the other, and pick which one actually 
determines who the horde admins are (although I don't quite 
understand, because horde admins I thought were defined by 
$conf['auth']['admins'].   (Copy of my config below my name.)

I see the login driver needs to be the application driver to trigger 
the choices for Dyn, Min, and Trad, yes?.  How does everything else 
know what to pick?

Questions aside, all of that appears to work swimmingly even if I 
have no idea how. I can log in, get the options, and yet still pick 
the Users tab and modify users. cool.

I do still have one thing I'm stuck on. I finally got the sql right 
to update the mailbox table (from postfixadmin) for the domains (at 
least if your user IDs are user at example.com). But I need to update 
TWO tables when working with postfixadmin in the background (as I 
also have to update the "alias" table). I tried just appending the 
second query to the primary query (as query1; query2;) , but the sql 
function in horde submits it as all one big SQL query.

Possible, or have I finally stretched things too far?

Rick

//composite of mysql and application driver
$conf['auth']['driver'] = 'composite';
//composite mysql driver
$conf['auth']['params']['drivers']['customsql_mod']['driver'] = 'customsql';
$conf['auth']['params']['drivers']['customsql_mod']['params'] = array(
'phptype' => 'mysqli',
'protocol' => 'unix',
'hostspec' => 'localhost',
'username' => 'postfix',
'password' => 'pfix1723',
'database' => 'postfix',
'query_auth' => 'SELECT * FROM mailbox WHERE username = \L and password=\P; ',
'query_add' => 'INSERT INTO mailbox 
(username,password,maildir,quota,domain,created,modified) VALUES (\L, 
\P, CONCAT(RIGHT(\L, (LENGTH(\L)-(INSTR(\L, \'@\')))), \'/\', 
LEFT(\L, INSTR(\L,\'@\')-1) , \'/\') ,\'512000000\', RIGHT(\L, 
(LENGTH(\L)-(INSTR(\L, \'@\')))), now(), now());',
'query_getpw' => 'SELECT password FROM mailbox WHERE username = \L;',
'query_update' => 'UPDATE mailbox SET username = \L WHERE username = 
\O) LIMIT 1;',
'query_resetpassword' => 'UPDATE mailbox SET password = \P WHERE 
username = \L;',
'query_remove' => 'DELETE FROM mailbox WHERE username = \L;',
'query_list' => 'SELECT * FROM mailbox;',
'query_exists' => 'SELECT 1 FROM mailbox WHERE username = \L;',
'encryption' => 'crypt-md5',
'show_encryption' => false);
//composite application driver
$conf['auth']['params']['drivers']['application_mod']['driver'] = 
'application';
$conf['auth']['params']['drivers']['application_mod']['params'] = array(
    'app' => 'imp');
//selecting the login driver
$conf['auth']['params']['admin_driver'] = 'customsql_mod';
$conf['auth']['params']['loginscreen_switch'] = '_horde_select_loginscreen';
if (!function_exists('_horde_select_loginscreen')) {
     function _horde_select_loginscreen()
     {
         return 'application_mod';
     }
}


At 07:50 PM 10/9/2008, Jan Schneider wrote:
>2b. Use composite authentication.



More information about the horde mailing list