vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Notification when members in a particular usergroup come online (https://vborg.vbsupport.ru/showthread.php?t=78371)

John Stone 03-18-2005 10:00 PM

Notification when members in a particular usergroup come online
 
A little background about this hack....

I don't ban users using vB's built-in functionality; instead, I block IPs/subnets by placing rules in my server's iptables configuration so that banned users can't even see the forum or my website. Additionally, I place banned (firewalled) users in a special usergroup I made called "firewalled". If someone in the "firewalled" usergroup gets by my firewall by using a non-blocked IP address, I let that user think s/he got one by me, and allow them to view the forum (but I don't allow posting, PMing or modification to user options). The reason I allow the banned user to view the forum for a short time is so that I can get the new IP and add it (or a subnet) to the firewall's rules.

The problem is, I'm not always online to catch people who get by my firewall and, of course, I can't remember all the users that have been banned. I wrote this little hack so that if a user in my "firewalled" usergroup comes online, it emails me the user name and the IP address. I can then add the IP to my firewall rules and block the user again. This hack works great with Logician's hack that disallows a particular usergroup to log out. It's not a perfect system, but it's pretty darn effective.

This hack could be used in other scenarios. Let's say you have a few users you want to keep an eye on. You could create a special user group for those users, and this hack will email you immediately if one of them comes online. Obviously you could easily send the notification to a pager or cell phone, too.

I have it set so that only one notification is sent per user session. If the user's cookie times out and s/he comes back on, you'll get another notification.

This is a really simple hack. If you can copy and paste, then you have the skills required to install it. :nervous:

Tested with vB 3.07.

Deaths 03-19-2005 03:52 PM

Cool hack, got yourself an install.

KanyeWest 03-19-2005 03:55 PM

cool hack :devious:

WATRD 01-07-2007 03:16 AM

Is there any reason why this would not be compatible with 3.6?

WATRD 01-07-2007 03:30 AM

Hmm... okay, there is no "includes/sessions.php" that I can find in 3.6 :(

So, any suggestions from anyone more knowledgeable than me in this stuff? This would be a handy mod to have.

John Stone 01-07-2007 12:41 PM

Hi WATRD,

I've not officially updated this hack because I've not had any time to mess with it or even learn the vB hooks system. However I did quickly get it working with vB 3.6x with few modifications.

One caveat: The place where this is hack is inserted into the vB code will email you each time the user does something on your forum. That's annoying. There is certainly a much better place to insert the code so that it will only email once per user session, which is how my original hack worked. I have not had time to locate the ideal location, so if anyone reading this wants to chime in, I'm all ears.

-------------

This will work with vB 3.6x, keeping the above caveat in mind:

On the line userinfo['usergroupid']==X, "X" should be replaced with the user group ID you want flagged.
On the line $emailaddr = "REPLACE WITH YOUR EMAIL ADDRESS"; add your email address where indicated.


In "includes/functions.php", look for:

$vbulletin->session->save();
... and insert this immediately after:

Code:

// ### EMAIL ADMIN IF FLAGGED USER COMES ONLINE - JOHN STONE HACK #################################################
$emailaddr = "REPLACE WITH YOUR EMAIL ADDRESS";
$ip = getenv("REMOTE_ADDR");
$user = ($vbulletin->userinfo['username']);
$subject = "Flagged user online!";
$message = "User: $user \nIP address: $ip";
if ($vbulletin->userinfo['usergroupid']==X)
{ // Flagged user
vbmail ($emailaddr, $subject, $message);
vbmail_end();
}
// ### EMAIL ADMIN IF FLAGGED USER COMES ONLINE - JOHN STONE HACK #################################################

I hope this helps. I'll post an official hack if I have time to make it work as intended with vB 3.6x, or if someone provides a better place to insert the code.

WATRD 01-07-2007 01:48 PM

Thank you John! That DOES help. I want the hack for exactly the reasons you describe and have been looking for a way to not have to catch the person in the act.

For now, I will set up a mail filter to catch these mails and file them all away for me, but I will be interested if anyone spots a better place to install this.

Thank you for the response.

daddygrim 03-03-2007 08:20 PM

well anybody?

biggeorge 06-30-2007 06:11 PM

Quote:

Originally Posted by John Stone (Post 1152579)
Hi WATRD,

I've not officially updated this hack because I've not had any time to mess with it or even learn the vB hooks system. However I did quickly get it working with vB 3.6x with few modifications.

I hope this helps. I'll post an official hack if I have time to make it work as intended with vB 3.6x, or if someone provides a better place to insert the code.

Worked like a champ for me... 3.6.4

I will watch the IP's for about 1-month and then include the IP's in my FAVORITE hack... Miserable Users! I like them to suffer the agony of MU then have them blocked at the server level :)

Thank you!


All times are GMT. The time now is 04:55 AM.

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.01410 seconds
  • Memory Usage 1,735KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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