Zitat von Otto Stolz <[EMAIL PROTECTED]>: > Hello, > > Listaccount <[EMAIL PROTECTED]> had asked: >> It would be *really* nice if one can limit the mail addresses a user >> can set to the ones the administrator has tied to the account. Instead >> of entering free text it should be a list-box with addresses from the >> database. > > Jan Schneider had replied: >> This is already possible and has always been, at least since IMP 3, >> probably earlier. > ... >> Lock the from_addr preference. > > Listaccount <[EMAIL PROTECTED]> has asked: >> Yes of course, but we like to give the user the ability to choose >> from a bunch of addresses which where defined as aliases to this >> account anyway. > > Then you should write a pertinent hook function > to retrieve these data from your user data base > and present them to the user.
I have tried to do so but failed to pass a "enum" array to prefs.php. Here is what we use as hook. // database. if (!function_exists('_prefs_hook_tieto_addr')) { function _prefs_hook_tieto_addr($account = null) { global $conf; if (is_null($account)) { $name = Auth::getAuth(); } if (!empty($account)) { include_once 'DB.php'; $_db = &DB::connect($conf['sql2'], true); $query = 'SELECT username,alias FROM virtual WHERE username = ?'; $values = array($account); $result = $_db->getOne($query, $values); if (!is_a($result, 'PEAR_Error') && $result > 0) { $enum_result = array($result); return ($enum_result); } else { return ''; } } } } Jan 31 13:55:57 vx4 httpd2-prefork: PHP Notice: Undefined index: enum in /srv/www/horde/templates/prefs/enum.inc on line 3 Jan 31 13:55:57 vx4 httpd2-prefork: PHP Warning: Invalid argument supplied for foreach() in /srv/www/horde/templates/prefs/enum.inc on line 3 Would be nice if someone PHP capable would give hint. Thanxs Andreas -- All your trash belong to us ;-) www.spamschlucker.org To: [EMAIL PROTECTED] -- IMP mailing list - Join the hunt: http://horde.org/bounties/#imp Frequently Asked Questions: http://horde.org/faq/ To unsubscribe, mail: [EMAIL PROTECTED]