//get secure code checking status (pos. -2) $seccodecheck = substr(sprintf('%05b', $seccodestatus), -2, 1); if ($seccodecheck && $seccodedata['loginfailedcount']) { $seccodecheck = $db->result($db->query("SELECT count(*) FROM {$tablepre}failedlogins WHERE ip='{$onlineip}' AND count>='{$seccodedata['loginfailedcount']}' AND {$timestamp}-lastupdate<=900"), 0); } if (!GlobalCore::submitcheck('loginsubmit', 1, $seccodecheck)) { $chobits_action = 6; $referer = GlobalCore::nwReferer(); $thetimenow = '(GMT ' . ($timeoffset > 0 ? '+' : '') . $timeoffset . ') ' . gmdate("{$dateformat} {$timeformat}", $timestamp + $timeoffset * 3600) . ($_DCOOKIE['cookietime'] = isset($_DCOOKIE['cookietime']) ? $_DCOOKIE['cookietime'] : 2592000); $cookietimecheck = array(isset($_DCOOKIE['cookietime']) ? intval($_DCOOKIE['cookietime']) : 2592000 => 'checked'); include GlobalCore::template('login'); } else { $nw_uid = 0; $nw_user = $nw_pw = $md5_password = ''; $member = array(); $loginperm = GlobalCore::logincheck(); if (!$loginperm) { GlobalCore::showmessage('login_strike'); } if (isset($loginauth)) { $password = '******'; list($email, $md5_password) = GlobalCore::chobits_addslashes(explode("\t", GlobalCore::authcode($loginauth, 'DECODE')), 1); } else { $md5_password = md5($password); $password = preg_replace("/^(.{" . round(strlen($password) / 4) . "})(.+?)(.{" . round(strlen($password) / 6) . "})\$/s", "\\1***\\3", $password); } if (preg_match("%^[A-Za-z][A-Za-z0-9]*_?[A-Za-z0-9]*\$%i", $email)) { $where = "m.username = '******'"; } else { $where = "m.email = '{$email}'"; }