vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Administrative and Maintenance Tools - Login IP Address Tracking (https://vborg.vbsupport.ru/showthread.php?t=324877)

Alice 04-03-2017 09:00 PM

Login IP Address Tracking
 
1 Attachment(s)
Description

This is my very first time releasing a vBulletin Modification. This modification involves every user account automatically having their current IP Address recorded after each successful login through a custom profile field. This will allow administrators to better track where the login attempts are coming from, especially if there is an account that has security issues (i.e. Someone claiming that there account was hacked, ect...).

This modification has been tested on vBulletin 3.8.0, 3.8.10, and 4.2.3

Main Features
  • No Template Modification is necessary.
  • No Modification is needed in the vBulletin Source Code.
  • Functions are controlled by a Hidden Profile Field and a Plugin.
Installation Instructions

1. Go to your AdminCP >>> User Profile Fields >>> Add New User Profile Field
  • Profile Field Type: Single-Line Text Box
  • Title: Login IP Address
  • Description: Your choice
  • Profile Field Category: Your Choice
  • Default Value: KEEP BLANK
  • Field Required: No
  • Private Field: Yes
  • Field Searchable on Members List: No
  • Show on Members List: No
  • Regular Expression: KEEP BLANK
Click save, and take note of the profile field ID that is assigned, you will need that later.

2. Go to your AdminCP >>> Plugins & Products >>> Add New Plugin
  • Product: vBulletin
  • Hook Location: global_start
  • Title: Login IP Address Tracking
  • Execution Order: 5
  • Plugin PHP Code:

    PHP Code:

    /*------------Insert Current IP Address for account authentication------------*/     
            
    if ($vbulletin->userinfo['joindate']< (TIMENOW 24 60 60)){ 
            
    // is it older than 24 hours?) 

            
    $vbulletin->db->query_write(
                UPDATE " 
    TABLE_PREFIX "userfield 
                SET field24 = '" 
    $vbulletin->db->escape_string(IPADDRESS) . "' 
                WHERE userid = '" 
    $vbulletin->userinfo['userid'] . "'"); 
            } 
            
    /*--------------------------------------------------------------------------------*/ 

  • Plugin Active: Yes
3. Find
PHP Code:

SET field24 '" . $vbulletin->db->escape_string(IPADDRESS) . "' 

Replace field24 with the field id that represents the profile field that you created in step 1, and then save your plugin.

Operational Checklist
  • Log out of your vBulletin Forum.
  • Login to your vBulletin Forum.
  • Go to your AdminCP.
  • Go to your profile.
If you see an IP Address recorded in the custom profile field that you created, then you have done everything correctly.

Release Notes

v1.1.0
  • Compatible with vBulletin 3.8.0 - 3.8.10
  • Removed All Modifications from the Source Code.
  • Modification is Controlled by Plugin Source
v1.0.0
  • Initial Release of Modification.

DCD.RB 07-12-2017 12:59 PM

Hi,
Is there a way to change it so it adds all the Login IP addresses to that field, separated by a comma or each IP on their own line rather than constantly replacing it with the current login IP?

Thank you

Alice 07-12-2017 02:24 PM

Quote:

Originally Posted by DCD.RB (Post 2588364)
Hi,
Is there a way to change it so it adds all the Login IP addresses to that field, separated by a comma or each IP on their own line rather than constantly replacing it with the current login IP?

Thank you

I can see if I can add it to the next version. :)

Stingray27 07-12-2017 04:00 PM

You should be very wary of doing that, you could end up with a very big string, and that would cause issues.

Alice 07-12-2017 06:15 PM

That was my initial concern as well, but it is worth R&D'ing. :)

Alice 07-20-2018 01:35 AM

Working on an update. :)

I.G.O.T.A. 11-16-2023 03:12 PM

It is installed and working correctly.

I am waiting for any updates.

Thank you!


All times are GMT. The time now is 08:41 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.01080 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
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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