[development] how to intercept user login with cookie

Lior Kesos lior.kesos at gmail.com
Wed Apr 4 05:13:03 UTC 2007


Hi,
I've changed my lgin to be done in a dedicated div (not the /user page).
I need to give a message upon a failed login which does not show now(is this
the same area for implementation -catching the failed login and
drupal_set_messaging it?)
How can I do it without interveeing with core...
Lior


On 4/3/07, Khalid Baheyeldin <kb at 2bits.com> wrote:
>
> I think what you need happens in sesson.inc
>
> function sess_read($key) {
>  ...
>   $user = db_fetch_object(db_query("SELECT u.*, s.* FROM {users} u INNER
> JOIN {sessions} s ON u.uid = s.uid WHERE s.sid = '%s'", $key));
>
>   // We found the client's session record and they are an authenticated
> user
>   if ($user && $user->uid > 0) {
>     // user logged in via cookie
>
> Not sure if there is a way to do that via a hook.
>
> Perhaps extending hook_user to do that is a good idea.
>
> http://api.drupal.org/api/5/function/hook_user
>
> On 4/3/07, vitamona <vitamona at gmail.com> wrote:
> >
> > hi,
> > is there a way for intercept a user when login via cookie?
> >
> > For example, when a user login with a form (no cookie stored) is
> > possible to intercept them with hook user:
> >
> > function hook_user($type, &$edit, &$user, $category = FALSE) {
> >         if ($type == 'login') {
> >
> > Thanks a lot
> >
> > Vita
> >
>
>
>
> --
> 2bits.com
> http://2bits.com
> Drupal development, customization and consulting.




-- 
---
ליאור קסוס , לינוויט
http://www.linnovate.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20070404/2ade849f/attachment.htm 


More information about the development mailing list