2011-06-01, 02:31 AM
Link: http://mods.mybb.com/view/user-ip-log
Version: 1.1
Issue:
The plugin installs fine. However, whenever someone actually logs in, the uid logged is always 0 (ie, Guest). I'm assuming either something in the code changed to grab the user's ID or something similar.
The code in the plugin that grabs the user's ID is:
The last update to the plugin was August 5th of 2010, I believe for MyBB v1.6. Anyone have an idea how this might be fixed to work properly?
I've tried changing the $user global to $mybb and appending $mybb-> in front of $user['uid'], but then it gives an error when logging in about there being an empty property.
-----
Addendum: It seems it catches uids properly when a user registers, but only then.
Version: 1.1
Issue:
The plugin installs fine. However, whenever someone actually logs in, the uid logged is always 0 (ie, Guest). I'm assuming either something in the code changed to grab the user's ID or something similar.
The code in the plugin that grabs the user's ID is:
function iplog_exec()
{
global $user, $db;
$values = array(
'uid' => $db->escape_string( $user['uid'] ),
'ipaddress' => $db->escape_string( get_ip() ),
'dateline' => $db->escape_string( time() )
);
$db->insert_query( 'iplogs', $values );
}
The last update to the plugin was August 5th of 2010, I believe for MyBB v1.6. Anyone have an idea how this might be fixed to work properly?
I've tried changing the $user global to $mybb and appending $mybb-> in front of $user['uid'], but then it gives an error when logging in about there being an empty property.
-----
Addendum: It seems it catches uids properly when a user registers, but only then.