[dev] Adding to the user's session and login credentials

Jan Schneider jan at horde.org
Mon Aug 18 09:30:12 UTC 2008


Zitat von Adrian Overbury <adrian at inomial.com>:

> This is just a bump, because I can't for the life of me figure out  
> who to implement this properly.  I've got the form field for the  
> user to enter data into onto the login page templates, but I still  
> need to figure out how to make the contents of this field part of  
> the user's session object as well as the credentials array that gets  
> passed through to the authentication object (and then onto the  
> preauthenticate hook, which I think would be the right place to put  
> my actual check).  Is it even possible to look at the current  
> session in the preauthenticate hook?  If we can't, i suppose I could  
> put both pieces of data into $credentials, but that doesn't feel  
> right.  Any help you guys can give would be greatly appreciated.
>
> Adrian
>
> Adrian wrote:
>> Because of upstream authentication requirements (long story --  
>> don't ask) I have to add a field the login forms for Horde and IMP  
>> that will get added to the credentials passed to the  
>> preauthenticate hook.  I also need to add a corresponding field to  
>> the user's session object that preauthenticate will combine with  
>> what the user entered in the credentials to determine if they're  
>> allowed to log in or not.
>>
>> I'm not sure if it's even possible for me to pull something out of  
>> the user's session object in the preauthenticate hook -- some  
>> clarification here would be greatly appreciated, as well as an idea  
>> of where I should be putting the comparison code if preauth isn't  
>> going to do the job for me.
>>
>> As I said, this is a requirement that's being passed down to me, so  
>> don't shoot the messenger/implementer if you think it's a bad idea.  
>> Thanks for your time.

Since the pre-auth hook should theoretically be called during the  
request after the login form submission, you could simply use the  
$_POST entry (or better Util::getFormData()) to retrieve and process  
the additional login form field.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the dev mailing list