[horde] Action (php script) on First Login - How to?

Jan Schneider jan at horde.org
Wed Mar 26 13:59:14 UTC 2008


Zitat von k bah <kbah at linuxmail.org>:

>
>> ----- Original Message -----
>> From: "Jan Schneider" <jan at horde.org>
>> To: horde at lists.horde.org
>> Subject: Re: [horde] Action (php script) on First Login - How to?
>> Date: Fri, 21 Mar 2008 00:57:42 +0100
>>
>>
>> Zitat von k bah <kbah at linuxmail.org>:
>>
>> > ----------
>> > IMP H3 (4.1.4)
>> > Horde (horde) 3.1.4
>> > ----------
>> >  I read on the mailing list archives this:
>> >
>> >>> Zitat von Christian Hernmarck <news-NO.SPAM>:
>> >>> hello
>> >>>
>> >>> is it possible to "redirect" to the (horde-)identity-page when users
>> >>> login for the _first_ time?
>> >>> Just to give them the possibility to fill in the needed values (or to
>> >>> correct the values filled in by a preference hook)...
>> >>>
>> >
>> >> You could probably create a maintenance task that is run on the first
>> >> login and redirects the user to the identity screen.
>> >
>> >> Jan.
>> >
>> > 1)
>> >
>> >  From what I found, a maintenance task depends on user
>> > confirmation,  right? I don't wan't all tasks to be performed
>> > despite of the user's  will, just this one (action on first
>> > login), _if_ he/she decides not  to perform this first login
>> > task. I didn't find how to create such  task ,as I can do with
>> > hooks, "in a clean/modular fashion" (which  will be ok on
>> > upgrades).
>> >
>> >  - Where do I find examples or docs about that (create those tasks)?
>>
>> You have to take a look at the code of the existing maintenance tasks.
>> There are no better docs unfortunately.
>>
>> >  - How can I prevent users from _not_ performing this maintenance task?
>>
>> Probably not at all. There is also the TOS maintenance task that can't
>> be skipped, but I don't see how this could be safely integrated with
>> setting the identities.
>>
>> > 2)
>> >
>> > Is there a patch for a first login hook or something like that?
>>
>> You could use the post_login hook and check the last_login preference
>> whether this user has been logged in already.
>>
>
>  If the user exists on LDAP but never logged in, he does not exist  
> on any horde mysql table, right?
>
>  If so, is it safe to not use this:
>
>  > select pref_uid,pref_name,pref_value from horde_prefs where  
> pref_uid like "his username" and pref_name like "last_login" from  
> horde_prefs;
>
>  since he will not be in this table, so there's no pref_value for  
> pref_name=last_login for this user?
>
>  and use this instead:
>
>  >  select pref_uid from horde_prefs where pref_uid like "his  
> username"? I mean, if he never logged in, he should not be in this  
> table, and if he did, he should be, *assuming his record is created  
> on horde_prefs table /after/ post_login hook is executed*.

Yes, that should theoretically work.

Jan.

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



More information about the horde mailing list