On Thu, 20 Mar 2008, Roberto Nunnari wrote: > Hi Jan. > > Could you please point me to a howto or introduction to > vinfo hook? > > Thank you. > Robi. > > > Jan Schneider wrote: >> Zitat von Roberto Nunnari <[EMAIL PROTECTED]>: >> >>> Every mailbox as a local unix account, ie: >>> [EMAIL PROTECTED] --> a1 >>> [EMAIL PROTECTED] --> a2 >>> [EMAIL PROTECTED] --> b1 >>> [EMAIL PROTECTED] --> b2 >>> etc.. >>> >>> Now, everything works fine, but I'm a bit concerned with the >>> webmail login.. I'd like [EMAIL PROTECTED] to login with a >>> username equal to the email, but at present the authentication in >>> horde is handled by imp, I'm not sure how to proceed with that.. >> >> You could use the vinfo hook to convert between both user name styles. >> >> Jan.
Here is an example vinfo hook that we use to force all usernames to lowercase: if (!function_exists('_imp_hook_vinfo')) { function _imp_hook_vinfo($type = 'username') { if ($type == 'username') { return preg_replace('/\s/', '', strtolower($_SESSION['imp']['user'])); } elseif ($type == 'vdomain') { return ''; } else { return PEAR::raiseError('invalid type: ' . $type); } } } You could replace the code inside "if ($type == 'username') { ... }" with code to convert from "[EMAIL PROTECTED]" to "a1". Perhaps you have this mapping stored in LDAP, MySQL, or a flat file? The specifics would be up to you. Andy -- IMP mailing list - Join the hunt: http://horde.org/bounties/#imp Frequently Asked Questions: http://horde.org/faq/ To unsubscribe, mail: [EMAIL PROTECTED]