vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   hook after member login (https://vborg.vbsupport.ru/showthread.php?t=318340)

mohammad6006 04-21-2015 03:29 AM

hook after member login
 
I want to run a query after a member login to forum

which hook should I use?

ForceHSS 04-21-2015 03:38 AM

Depends what you want the query to do

MarkFL 04-21-2015 03:38 AM

I would try:

login_verify_success

mohammad6006 04-21-2015 06:02 AM

Quote:

Originally Posted by MarkFL (Post 2543702)
I would try:

login_verify_success

Does this hook work when a member login with cookie or session and without login form?

--------------- Added [DATE]1429603453[/DATE] at [TIME]1429603453[/TIME] ---------------

Quote:

Originally Posted by ForceHSS (Post 2543701)
Depends what you want the query to do

I want to add user id who login to forum to another table ( not user table)

kh99 04-21-2015 10:55 AM

Quote:

Originally Posted by mohammad6006 (Post 2543708)
Does this hook work when a member login with cookie or session and without login form?

I'm not sure if it does or not, but it would be easy to test. But there's another possibility in case that doesn't work for you: there's a variable $vbulletin->session->created which is only true for a request that creates a session, so you could use code like this:
Code:

if ($vbulletin->session->created)
{
  // do your logging here
}


Note that a session is created for a guest, so if you don't want to log every time a new guest arrives, you'll want to check for $vbulletin->userinfo['userid'] != 0 before logging. And yes, if a guest (who will already have a session) logs in, a new session is created (I tested that).

Oh, and that probably works for any hook, although you might want to use global_complete since then whatever you do will happen after the page has been sent.


All times are GMT. The time now is 08:28 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01477 seconds
  • Memory Usage 1,717KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete