vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Unbanning Hook (https://vborg.vbsupport.ru/showthread.php?t=102263)

Sheps 12-05-2005 10:46 AM

Unbanning Hook
 
Okay,

Here is what I am looking for. I figure I would ask here since you all should know. Hopefully.

I am looking for the hook that would allow me to catch the user before it goes into the check banning process. Basically, there are a few conditions, that if met, the user needs to be unbanned for.

So this hook has to be after the gathering of user data, but before it is passed onto the ban check.

I thought of using fetch_userinfo() but relised it would check for all users in threads and the like(Unless this is not how fetch_userinfo works) and I don't want that. I only want for the currently logged in user.

Currently I have it in the global start, and it sort of works. Viewing initially you will get the ban message, but refreshing it goes away. So this code works, it just needs to be sooner. Any ideas?

Andreas 12-05-2005 11:02 AM

I don't understand a word :)
What exactly do you want to achieve?

Marco van Herwaarden 12-05-2005 11:08 AM

You want to do something when the user gets banned, or when a banned user is trying to login?

Sheps 12-05-2005 09:11 PM

Sorry, I thought it was fairly clear. When a banned user is logging in or visiting the site while the session is still active.

So lets say user X is banned a week previous, and he visits the site. If certain conditions are met, I want to run a custom function that unbans that user.

I know how to do it, but I don't know where to put it.

Like I said, if it is placed in global_start, the user still sees the "You are banned" message initially, upon a refresh or viewing a different page, the message is gone, as it should be since the user is unbanned.

Now I suppose I could just make another call to vB_Session::fetch_userinfo but that would seem redundant and I am not totally sure if it would fix the problem.

Is it easier to keep it where it is and just recreate the user permissions/settings/info?

Marco van Herwaarden 12-06-2005 06:01 AM

Not tried it, but i guess you will need to use one of the login_* hook locations.


All times are GMT. The time now is 08:17 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.00996 seconds
  • Memory Usage 1,713KB
  • 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)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