[imp] default identities

Jan Schneider jan at horde.org
Thu Dec 18 01:29:27 PST 2003


Zitat von Andreas Kotowicz <kotoml at mynetix.de>:

> On Wed, 2003-12-17 at 17:36, Jan Schneider wrote:
>
> >
> > Lock the preference that you don't want to let the user change and
> configure
> > a hook for that preference that fills in the correct default value.
>
> how would a hook for fetching the prefs from a sql database look like?

Take a look at the _connect() method of one of the Driver/sql.php files to
see how to use the DB package to create a connection to the database.
If you have the handler, it's as easy as doing

$from_addr = $db->getOne('SELECT from_addr FROM table WHERE user=' .
$db->quote($imp['user']));

inside the hook. YMMV of course, depending on your versions, your local
setup and the temperature of your cpu.

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft


More information about the imp mailing list