Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Login log - Log successful login attempts Details »»
Login log - Log successful login attempts
Version: 4.1, by Dave Dave is offline
Developer Last Online: Aug 2021 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 4.x.x Rating:
Released: 05-27-2014 Last Update: 01-15-2016 Installs: 39
DB Changes Uses Plugins
Re-useable Code  
No support by the author.

Hi,

This plugin will allow you to log all successful login attempts of all users.
This can be useful to see if users share their account or if the account of someone got hijacked. Usernames and IP addresses can be clicked.

It will log the following
- Userid
- Username
- IP
- ISP (Internet Service Provider)
- Country
- HTTP user agent

Settings:
- Enable/disable the product.
- Exclude usergroups from being logged.
- Purge the logs.

Picture


Installation
1. Download the .zip file specified.
2. Upload the contents of the upload folder to the root of your forum.
3. Import the product with the .xml file in the import folder.

Note
The script will log using the current time on the server, in case there's a difference between the server time and your local computer time, you can change the offset in the loginlog.php script on line 12.

Also keep in mind that the country and/or ISP resolving might not be 100% accurate and that it might show no value in the logs.

Credits
Telize.com its API is being used to get the ISP and country off the IP address.

Let me know if it works well.


Changelog
11 June 2014 V4: Added the table_prefix global to the login hook.
5 June 2014 V3: Fixed searching only showing the last 25 entries. Pagination will now work as intended.
30 May 2014 V2: Changed hook location, added enable/disable setting and a setting to exclude usergroups.
28 May 2014 V1: Fixed a little mistake with the filter.

Download Now

File Type: zip product-loginlog.zip (4.1 KB, 133 views)

Screenshots

File Type: jpg Untitled.jpg (87.5 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
7 благодарности(ей) от:
elsa23, josner, madness85, minhmeo.info, puertoblack2003, tbworld, winky8300

Comments
  #12  
Old 06-05-2014, 07:08 AM
Skyrider Skyrider is offline
 
Join Date: Feb 2006
Location: Netherlands
Posts: 1,392
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you 'filter' someone (eg, a userID or username) it only shows a single page of results and hiding the rest with no next page, etc. Might be a slight bug/issue.
Reply With Quote
  #13  
Old 06-05-2014, 07:49 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Skyrider View Post
When you 'filter' someone (eg, a userID or username) it only shows a single page of results and hiding the rest with no next page, etc. Might be a slight bug/issue.
Working on this! Can expect an update soon.
Reply With Quote
  #14  
Old 06-05-2014, 10:28 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

5 June 2014: Fixed searching only showing the last 25 entries. Pagination will now work as intended.

In case you have this product installed already, you only have to replace the loginlog.php file in the admincp folder.
Reply With Quote
  #15  
Old 06-10-2014, 04:40 PM
Bluemax712 Bluemax712 is offline
 
Join Date: Oct 2010
Posts: 186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've installed on 2 different test servers both which have a prefix for all the vbulletin tables of "vb_"

When importing the product it creates the loginlog table with the correct "vb_loginlog" name
but when trying to login afterwards using the "login.php" - it gets an error because it's not adding the prefix of "vb_"
ie:
Table 'mydbname.loginlog' doesn't exist

It should be using mydbname.vb_loginlog

Hope this makes sense
Reply With Quote
  #16  
Old 06-11-2014, 08:28 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bluemax712 View Post
I've installed on 2 different test servers both which have a prefix for all the vbulletin tables of "vb_"

When importing the product it creates the loginlog table with the correct "vb_loginlog" name
but when trying to login afterwards using the "login.php" - it gets an error because it's not adding the prefix of "vb_"
ie:
Table 'mydbname.loginlog' doesn't exist

It should be using mydbname.vb_loginlog

Hope this makes sense
Oops forgot about that. Fixed in V4, now available to download.
Reply With Quote
  #17  
Old 06-11-2014, 02:02 PM
Bluemax712 Bluemax712 is offline
 
Join Date: Oct 2010
Posts: 186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

With the v4 update can now login without error and view the log
but when purging the log it shows error

also when viewing log and filter on "userid" but leave the search term blank
it shows error
Reply With Quote
  #18  
Old 06-12-2014, 08:15 AM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bluemax712 View Post
With the v4 update can now login without error and view the log
but when purging the log it shows error

also when viewing log and filter on "userid" but leave the search term blank
it shows error
Could you give me the errors? It's kind of a guess game now? :P
Reply With Quote
  #19  
Old 06-12-2014, 12:20 PM
Bluemax712 Bluemax712 is offline
 
Join Date: Oct 2010
Posts: 186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When purging the log it doesn't show much even with debugging enabled
=========================================

Database error in vBulletin 4.2.0:

Invalid SQL:
;

MySQL Error :
Error Number : 0
Script : http://.../admincp/loginlog.php?do=purgenow
Referrer : http://.../admincp/loginlog.php?do=purge

Classname : vB_Database
MySQL Version :

Stack Trace:
#0 vB_Database->halt() called in [path]/includes/class_core.php on line 426
#1 vB_Database->execute_query() called in [path]/admincp/loginlog.php on line 41

=========================================
=========================================

Though when filtering on the blank userid it does give this for an error:

Database error in vBulletin 4.2.0:

Invalid SQL:
SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE a.userid = ORDER BY a.id DESC LIMIT 0,25;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY a.id DESC LIMIT 0,25' at line 1
Error Number : 1064

Script : http://.../admincp/loginlog.php?do=&value=&type=1
Referrer : http://.../admincp/loginlog.php?do=&value=192&type=1

Classname : vB_Database
MySQL Version : 5.0.95-log

Stack Trace:
#0 vB_Database->halt() called in [path]/includes/class_core.php on line 426
#1 vB_Database->execute_query() called in [path]/includes/class_core.php on line 459
#2 vB_Database->query_read() called in [path]/admincp/loginlog.php on line 83

============================================

EDIT:
noticed all the other blank queries work but they use "LIKE" instead of "=":

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE b.username LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE a.ip LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.loginstamp LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.isp LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.country LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.browser LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

=====================
EDIT2:
When filling in the userid filter with a number it does work though :
SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.userid = 1 ORDER BY a.id DESC LIMIT 0,25
Reply With Quote
  #20  
Old 06-12-2014, 02:29 PM
EvoDarrenshan EvoDarrenshan is offline
 
Join Date: May 2014
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello, Cloudflare... Is a problem. If i use cloudflare it will display cloudflare IP's. Can you fix this?
Reply With Quote
  #21  
Old 06-12-2014, 03:30 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bluemax712 View Post
When purging the log it doesn't show much even with debugging enabled
=========================================

Database error in vBulletin 4.2.0:

Invalid SQL:
;

MySQL Error :
Error Number : 0
Script : http://.../admincp/loginlog.php?do=purgenow
Referrer : http://.../admincp/loginlog.php?do=purge

Classname : vB_Database
MySQL Version :

Stack Trace:
#0 vB_Database->halt() called in [path]/includes/class_core.php on line 426
#1 vB_Database->execute_query() called in [path]/admincp/loginlog.php on line 41

=========================================
=========================================

Though when filtering on the blank userid it does give this for an error:

Database error in vBulletin 4.2.0:

Invalid SQL:
SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE a.userid = ORDER BY a.id DESC LIMIT 0,25;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY a.id DESC LIMIT 0,25' at line 1
Error Number : 1064

Script : http://.../admincp/loginlog.php?do=&value=&type=1
Referrer : http://.../admincp/loginlog.php?do=&value=192&type=1

Classname : vB_Database
MySQL Version : 5.0.95-log

Stack Trace:
#0 vB_Database->halt() called in [path]/includes/class_core.php on line 426
#1 vB_Database->execute_query() called in [path]/includes/class_core.php on line 459
#2 vB_Database->query_read() called in [path]/admincp/loginlog.php on line 83

============================================

EDIT:
noticed all the other blank queries work but they use "LIKE" instead of "=":

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE b.username LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user b ON a.userid = b.userid WHERE a.ip LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.loginstamp LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.isp LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.country LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.browser LIKE '%%' ORDER BY a.id DESC LIMIT 0,25

=====================
EDIT2:
When filling in the userid filter with a number it does work though :
SELECT a.userid, b.username, a.loginstamp, a.ip, a.isp, a.country, a.browser FROM vb_loginlog a INNER JOIN vb_user
b ON a.userid = b.userid WHERE a.userid = 1 ORDER BY a.id DESC LIMIT 0,25
Does your MySQL user have access to the TRUNCATE function?
The query itself is correct to truncate the table.

I will fix the other error if you search for nothing, although it doesn't have any priority.

Quote:
Originally Posted by EvoDarrenshan View Post
Hello, Cloudflare... Is a problem. If i use cloudflare it will display cloudflare IP's. Can you fix this?
Please refer to https://support.cloudflare.com/hc/en...ith-vBulletin-
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:44 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07654 seconds
  • Memory Usage 2,359KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (7)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete