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') ? 2 : 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.