[horde] Upper and Lower case and Horde IMP username

Steffen skhorde at smail.inf.fh-bonn-rhein-sieg.de
Mon Mar 17 09:01:47 UTC 2014


On Mon, 17 Mar 2014, George ccto wrote:

> Recently, I found Horde webmail username is case-sensitive.
>
> For example, if a user usually login as "xyz at abc.com" in the past,
> then some day some time he inputs "xyz at ABC.COM"
>
> Then, Horde will raise error as below -
> 'QUERY FAILED: Duplicate entry ???? for key 'rampage_users_user_name'

Actually, my Postgres backend does not raise that error, but I don't want 
the case-sensitive username anyway. Therefore I added a hook to lowercase 
them:

config/hook.php:

//    // USERNAME HOOK: See above for description of format.
     public function authusername($userId, $toHorde)
     {
//        // Example #2: Convert username to all lowercase. This might be
//        // necessary if an authentication backend is case insensitive to
//        // take into account that Horde's preference system is case
//        // sensitive.
//        // ex. $userId = 'MyName' returns: 'myname'
         return $toHorde
             ? Horde_String::lower($userId)
             : $userId;
}

-- 
Steffen


More information about the horde mailing list