[horde] Preauthenticate Hook - problems with retrieving $userId

Florian Schmidt florian.schmidt787 at googlemail.com
Tue Dec 3 19:57:10 UTC 2013


Hi,

On Tue, Dec 3, 2013 at 1:00 PM, Jan Schneider <jan at horde.org> wrote:

> Please don't top-post.
>
>
> Zitat von Florian Schmidt <florian.schmidt787 at googlemail.com>:
>
>  Hi Jan,
>>
>> thank you for your reply.
>>
>> The examples for the preauthenticate hook say that I can check the userId
>> within the preauthentication hook?! So is $userID availabvle in the
>> preauthenticate hook if I have submitted the login from or only after the
>> lgoin? If the latter is the case, then the examples are very misleading.
>>
>> Best regards.
>> Flo
>>
>>
>> On Mon, Dec 2, 2013 at 12:18 PM, Jan Schneider <jan at horde.org> wrote:
>>
>>
>>> Zitat von Florian Schmidt <florian.schmidt787 at googlemail.com>:
>>>
>>>
>>>  Hi all,
>>>
>>>>
>>>>
>>>> I want to use the preauthenticate hook in order to allow only certain
>>>> users
>>>> to login. Thus, my approach is (like in the examples) to use the $userId
>>>> and return true or false in the preauthenticate hook depending on the
>>>> $userId.
>>>> But my problem is, that the $userId is not set.
>>>> if I dump all variables in php with var_dump(get_defined_vars()) within
>>>> the
>>>> preauthenticate hook, I get the following:
>>>> array(2) { ["userId"]=> bool(false) ["credentials"]=> array(1) {
>>>> ["authMethod"]=> string(11) "transparent" } }
>>>>
>>>> In general horde is working fine.
>>>>
>>>> Any idea what I am doing wrong?
>>>>
>>>> Best regards
>>>> Flo
>>>>
>>>>
>>> The user id is only set *at login*, not when loading the login form.
>>> --
>>> Jan Schneider
>>> The Horde Project
>>> http://www.horde.org/
>>> https://www.facebook.com/hordeproject
>>>
>>>
>>>
> From during the login, after logging in there is no login form anymore.
>
>
(Sorry to ask again, but it is not yet clear to me.)

so, well, the examples in the preauthentication hook, where the userId is
checked to be not equal "foo" (or Joe?) are not working for me. Does that
mean my config of horde is wrong or that the examples are not right anymore?
Either $userId is supposed to be not empty (as it is used in the
preauthenticate hook example) or it should be used later (then I do get the
example wrong)?
So how and what exactly shall be handled in the preauthenticate hook?

Best regards
Flo


More information about the horde mailing list