[imp] case sensitivity with login
Andrew Morgan
morgan at orst.edu
Sat Jul 10 07:29:44 PDT 2004
On Fri, 9 Jul 2004, Eric Rostetter wrote:
> Quoting Kris Efland <kris_efland at yahoo.com>:
>
> > my question is, is there a way to modify the sql.php so that the
> > select statements are using a tolower command or similar so that all
> > queries coming into sql are lowercase?
>
> There is, depending on your Horde/IMP version, ways to fix this. In most
> recent versions, you can use a hook to convert their username to lowercase
> after it is accepted at the login screen and before it is used anywhere.
> This would be better and easier and more consistent than hacking the source
> code.
Here is what I use in my imp/config/conf.php:
$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);
}
}
}
Andy
More information about the imp
mailing list