[horde] USERNAME Hook - help required.
ANANT S ATHAVALE
asa at isac.gov.in
Fri Aug 16 07:50:26 UTC 2013
----- Message from Jan Schneider <jan at horde.org> ---------
Date: Fri, 16 Aug 2013 09:44:46 +0200
From: Jan Schneider <jan at horde.org>
Subject: Re: [horde] USERNAME Hook - help required.
To: horde at lists.horde.org
> Zitat von ANANT S ATHAVALE <asa at isac.gov.in>:
>
>> Dear List,
>>
>> My authentication is based on LDAP which is case insensitive. I
>> want username to be always lower case and also if there any blank
>> space (either at starting or trailing to be trimmed)
>>
>> I have written the hook as below. Please suggest, if it is wrong:
>>
>> public function authusername($userId, $toHorde)
>> {
>> return $toHorde
>> ? trim(Horde_String::lower($userId) . '@isac.gov.in')
>> : trim($userId) . '@isac.gov.in';
>> }
>>
>> I want basically that the preferences to be stored with
>> username at isac.gov.in, where username should be always in lower case
>> and it should not have any space characters.
>>
>> Please suggest.
>
> It also adds the domain part, not sure if this is intended.
This is intended as in my Horde 3 setup, all users preferences are
already stored in the form 'username at domain'.
>
> More important though is the reverse direction, which you have
> wrong. The trim() is no longer necessary because you already trimmed
> in the other direction. And you have to *remove* the domain part,
> not add them another time.
OK.
Will the following hook be OK?
public function authusername($userId, $toHorde)
{
return $toHorde
? trim(Horde_String::lower($userId)) . '@isac.gov.in'
: $userId;
}
> --
> Jan Schneider
> The Horde Project
> http://www.horde.org/
>
> --
> Horde mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
----- End message from Jan Schneider <jan at horde.org> -----
--
Regards
Anant
------------------------------------------------------------------------------
Confidentiality Notice: This e-mail message, including any attachments, is for
the sole use of the intended recipient(s) and may contain confidential and
privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message.
------------------------------------------------------------------------------
More information about the horde
mailing list