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

Reply
 
Thread Tools
Log Logins Hack Details »»
Log Logins Hack
Version: 2.0, by Abe1 Abe1 is offline
Developer Last Online: Jun 2010 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.6.8 Rating:
Released: 08-24-2006 Last Update: 08-24-2006 Installs: 482
Uses Plugins
Additional Files  
No support by the author.

Log Logins Hack 2.0


About this hack:
This hack will log the userid, username, ipaddress, where the login is, and time all your users log onto your forum.

Installation information on hack:
  • Files edited: 0
  • Templates edited: 0
  • Files to upload via FTP: 2
  • Time to install: 1 minute max

Updates:

Version 2.0 (08/25/06):
  • First release of this hack for vb3.6.
Please post your comments or suggestions for this hack. I read ALL posts.

MAKE SURE YOU CLICK INSTALL!
You will get an email when a new version is released.


This hack is created for your use free of charge. No payment is requested. However, if you would like to donate money for the work I put in to this hack, a donation would show your appreciation.

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 08-27-2006, 03:46 AM
serg472 serg472 is offline
 
Join Date: Mar 2005
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Abe1
This hack only logs when someone uses a username and password. Every time a user goes from one page to another they use a cookie.
I can be wrong, but they use sessions between pages and cookies only for logins.

If you take a look at includes/class_core.php, function vB_Session(), there is such piece of code:

PHP Code:
// or maybe we can use a cookie..
if (($gotsession == false OR empty($session['userid'])) AND $userid AND $password AND !defined('SKIP_SESSIONCREATE'))
{
    
    
$useroptions = (defined('IN_CONTROL_PANEL') ? 16 0) + (defined('AVATAR_ON_NAVBAR') ? 0);
    
$userinfo fetch_userinfo($userid$useroptions$languageid);

    if (
md5($userinfo['password'] . COOKIE_SALT) == $password)
    {
        
$gotsession true;

        
// combination is valid 
I think if you insert your log function after this line it should log cookie logins. I tested it a bit and it seems like a right place.
Reply With Quote
  #23  
Old 08-27-2006, 12:10 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by serg472
I can be wrong, but they use sessions between pages and cookies only for logins.

If you take a look at includes/class_core.php, function vB_Session(), there is such piece of code:

PHP Code:
// or maybe we can use a cookie..
if (($gotsession == false OR empty($session['userid'])) AND $userid AND $password AND !defined('SKIP_SESSIONCREATE'))
{
    
    
$useroptions = (defined('IN_CONTROL_PANEL') ? 16 0) + (defined('AVATAR_ON_NAVBAR') ? 0);
    
$userinfo fetch_userinfo($userid$useroptions$languageid);

    if (
md5($userinfo['password'] . COOKIE_SALT) == $password)
    {
        
$gotsession true;

        
// combination is valid 
I think if you insert your log function after this line it should log cookie logins. I tested it a bit and it seems like a right place.
Session if you have the session in the url becuase you are a guest or have cookies disabled. Other wise you would use cookies.
Reply With Quote
  #24  
Old 08-27-2006, 04:26 PM
serg472 serg472 is offline
 
Join Date: Mar 2005
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you go from page to page they try to read a session (from url or cookies), if it exists then they associate user with this session. Only if it doesnt exist they try to authenticate user from the cookie as you can see in that part of the code. This is the place where log function can be placed and it will log cookie authorizations (it is not reading sessions).

Anyway, I think I will just go ahead and make the required changes.
Reply With Quote
  #25  
Old 08-27-2006, 07:46 PM
serg472 serg472 is offline
 
Join Date: Mar 2005
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quick solution for those who want this mod to log cookie logins as well (UNOFFICIAL, UNSUPPORTED, USE AT YOUR OWN RISK etc.).

The only minor issue after the following modification is that when user logs in using a standart login form it will log this twice - as a standart login and a cookie login. I don't want to modify this hack too much, so I left it as it is.

1. Open product-log_logins.xml and find:
PHP Code:
<phrase name="reg_login" date="0" username="" version=""><![CDATA[Standard]]></phrase
add below:
PHP Code:
<phrase name="cookie_login" date="0" username="" version=""><![CDATA[Cookie]]></phrase
2. Open loginlog.php and find:
PHP Code:
else if ($log['logintype'] == 'modcplogin')
{
    
$log['logintype'] = $vbphrase['mod_login'];

add below:
PHP Code:
else if ($log['logintype'] == 'cookie')
{
    
$log['logintype'] = $vbphrase['cookie_login'];

3. Open includes/class_core.php and find:
PHP Code:
// or maybe we can use a cookie..
if (($gotsession == false OR empty($session['userid'])) AND $userid AND $password AND !defined('SKIP_SESSIONCREATE'))
{
    
    
$useroptions = (defined('IN_CONTROL_PANEL') ? 16 0) + (defined('AVATAR_ON_NAVBAR') ? 0);
    
$userinfo fetch_userinfo($userid$useroptions$languageid);

    if (
md5($userinfo['password'] . COOKIE_SALT) == $password)
    {
        
$gotsession true;
        
        

        
// combination is valid
        
if (!empty($session['sessionhash']))
        {
            
// old session still exists; kill it
            
$db->shutdown_query("
                DELETE FROM " 
TABLE_PREFIX "session
                WHERE sessionhash = '" 
$this->registry->db->escape_string($session['sessionhash']). "'
            "
);
        }

        
$this->vars $this->fetch_session($userinfo['userid']);
        
$this->created true;

        
$this->userinfo =& $userinfo
add below:
PHP Code:
//LOGINS HACK - START
$db->query_write("INSERT INTO " TABLE_PREFIX "logins (userid, username, ipaddress, phpdate, logintype) VALUES (" $this->userinfo['userid'] . ", '" $db->escape_string($this->userinfo['username']) . "', '" $db->escape_string(IPADDRESS) . "', " TIMENOW ", 'cookie')");
//LOGINS HACK - END 
4. Reinstall product.
Reply With Quote
  #26  
Old 09-03-2006, 03:09 PM
mIRCnet's Avatar
mIRCnet mIRCnet is offline
 
Join Date: Nov 2001
Location: UAE
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack,
Why not to make the admin have options
* Log Success Logins
* Log Error Logins
* Log All Logins

Beacuse for me I dont find it usefull to log the successed logs, but error logins would be help full for me to track, more over to make it show in the AdminCP under the waiting moderation list in the main page of AdminCP with the Total No. of login logs, so the admin will know whats going on with the users.
Reply With Quote
  #27  
Old 09-05-2006, 11:12 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mIRCnet
Great hack,
Why not to make the admin have options
* Log Success Logins
* Log Error Logins
* Log All Logins

Beacuse for me I dont find it usefull to log the successed logs, but error logins would be help full for me to track, more over to make it show in the AdminCP under the waiting moderation list in the main page of AdminCP with the Total No. of login logs, so the admin will know whats going on with the users.
An error login is not a login.
Reply With Quote
  #28  
Old 09-06-2006, 07:33 AM
mIRCnet's Avatar
mIRCnet mIRCnet is offline
 
Join Date: Nov 2001
Location: UAE
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Abe1
An error login is not a login.
Yep,
I remember before there was a hack which sends an e-mail to the admin if some one try to access the AdminCP this e-mail have the user name, password and also the ip address which was used to access it.
So if the admin was able to track error login tries he will be able to warn the user and so on to reduce the ability of stolen user names.
Reply With Quote
  #29  
Old 09-06-2006, 09:14 PM
eclectica eclectica is offline
 
Join Date: Sep 2003
Location: Brooklyn, New York
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vBulletin has a way to log all failed logins to a log file. It is in admincp->vBulletin Options->Error Handling & Logging->Log Failed Admin Control Panel Logins to a File
Reply With Quote
  #30  
Old 09-06-2006, 10:23 PM
davelacey davelacey is offline
 
Join Date: Mar 2006
Location: UK
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Useful hack.
Thankyou.
Reply With Quote
  #31  
Old 09-07-2006, 12:19 PM
Lord Zedd's Avatar
Lord Zedd Lord Zedd is offline
 
Join Date: Apr 2006
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Abe1
Not sure your question.
Ill try to explain it better.

At my website www.myurl.com/forum I have a vbulletin forum. Members can log in from there. But they visit the website www.myurl.com itself a lot. So on the mainpage www.myurl.com/index.html I would like to have the option that members of the forum be able to log in from the mainpage the www.myurl.com/index.htm

Now I got it to work that people who are a member of the forum can log in on the mainpage www.myurl.com/index.html but only one problem there that I don't know how to fix. So the problem is this :


When a member visits the mainpage, he wants to log in to the forums. He logs in ( you get the vbulletin message that you are logged in) but you stay at the mainpage. So you log in on the www.myurl.com/index.html, the logging in part works, but it doesn't bring you to the www.myurl.com/forum. You just stay at the www.myurl.com/index.html

What I want :

mainpage (index.html) > log in > leads to forum

What the problem is :

mainpage (index.html) > log in > mainpage (index.html)
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 10:59 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.11684 seconds
  • Memory Usage 2,356KB
  • 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
  • (8)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete