[imp] Username is not being passed if vdomain hook is ON

Hammad hammad at brisksolutions.com
Wed Oct 8 17:53:50 PDT 2003


Thank you for your help. That seems to do the trick. BTW, check out the 
following lines.

# This is how it was before
return preg_replace('|\.|', '.', $imp['user'] .'@'. $vdomain);

# This is how it is now after I changed it to your recommendation.
return strtolower($_SESSION['imp']['user'] . '@' . $vdomain);

Do you see any problem with it which might come back to haunt me?

-- 
Hammad


Quoting Andrew Morgan <morgan at orst.edu>:

| 
| Here is a working hook:
| 
| $conf['hooks']['vinfo'] = 'imp_get_vinfo';
| 
| if (!function_exists('imp_get_vinfo')) {
|     function imp_get_vinfo ($type = 'username') {
| 
|         if ($type == 'username') {
|                 return strtolower($_SESSION['imp']['user']);
|         } else {
|                 return new PEAR_Error('invalid type: ' . $type);
|         }
|     }
| }
| 
| 
| Notice that it doesn't use $imp['user'] anymore.  Instead you must use
| $_SESSION['imp']['user'].
| 
| The hook above just lowercases all usernames.  We had users that would
| login with different case usernames from time to time and wonder where all
| their preferences had gone.  :)
| 
| 	Andy
| 
| On Wed, 8 Oct 2003, Hammad wrote:
| 
| > What has changed? I looked on both imp-3-2-1 and imp-3-2-2. The vdomain
| hook is
| > exactly the same, I compared it line by line. But imp-3.2.1 works and
| imp-3.2.2
| > does not.
| >
| > Still stuck on this so help will be appreciated.
| >
| > Thanks
| >
| > --
| > Hammad
| >
| >
| > Quoting Jan Schneider <jan at horde.org>:
| >
| > | Zitat von Hammad <hammad at brisksolutions.com>:
| > |
| > | > After I upgraded from IMP-3-2-1 to IMP-3-2-2 and merged the changes
| in
| > | > CVS. I
| > | > couldn't login to IMP anymore. Horde log shows the username part
| being
| > | > empty so
| > | > looked to me that username is not being passed correctly to IMAP
| server
| > | > from the
| > | > login screen. Log only shows the domain part correctly.
| > | >
| > | > This only happens if 'vdomain' hook is being used. If I turn off
| > | > 'vdomain' hook
| > | > and login using the username and full domain it works.
| > |
| > | The hooks have changed a bit. Update your hook to the new syntax.
| > |
| > | Jan.
| > |
| > | --
| > | http://www.horde.org - The Horde Project
| > | http://www.ammma.de - discover your knowledge
| > | http://www.tip4all.de - Deine private Tippgemeinschaft
| > |
| > | --
| > | IMP mailing list
| > | Frequently Asked Questions: http://horde.org/faq/
| > | To unsubscribe, mail: imp-unsubscribe at lists.horde.org
| > |
| >
| >
| > --
| > IMP mailing list
| > Frequently Asked Questions: http://horde.org/faq/
| > To unsubscribe, mail: imp-unsubscribe at lists.horde.org
| >
| 
| 



More information about the imp mailing list