function verify_authentication2($username) { global $vbulletin; $username = strip_blank_ascii($username, ' '); if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '******'")) { set_authentication_cookies($cookieuser); $return_value = true; ($hook = vBulletinHook::fetch_hook('login_verify_success')) ? eval($hook) : false; return $return_value; } $return_value = false; ($hook = vBulletinHook::fetch_hook('login_verify_failure_username')) ? eval($hook) : false; return $return_value; }
function verify_authentication($username, $password, $md5password, $md5password_utf, $cookieuser, $send_cookies) { global $vbulletin; $username = strip_blank_ascii($username, ' '); if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '******'")) { if ( $vbulletin->userinfo['password'] != iif($password AND !$md5password, md5(md5($password) . $vbulletin->userinfo['salt']), '') AND $vbulletin->userinfo['password'] != iif($md5password, md5($md5password . $vbulletin->userinfo['salt']), '') AND $vbulletin->userinfo['password'] != iif($md5password_utf, md5($md5password_utf . $vbulletin->userinfo['salt']), '') ) { $return_value = false; ($hook = vBulletinHook::fetch_hook('login_verify_failure_password')) ? eval($hook) : false; if (isset($return_value)) { // unset $return_value if you want to run the $send_cookies stuff return $return_value; } } else if ($vbulletin->userinfo['password'] == '') { // sanity check, though there should never really be an empty string for a password $return_value = false; ($hook = vBulletinHook::fetch_hook('login_verify_failure_password')) ? eval($hook) : false; if (isset($return_value)) { // unset $return_value if you want to run the $send_cookies stuff return $return_value; } } if ($send_cookies) { set_authentication_cookies($cookieuser); } $return_value = true; ($hook = vBulletinHook::fetch_hook('login_verify_success')) ? eval($hook) : false; return $return_value; } $return_value = false; ($hook = vBulletinHook::fetch_hook('login_verify_failure_username')) ? eval($hook) : false; return $return_value; }
function verify_authentication($username, $password, $md5password, $md5password_utf, $cookieuser, $send_cookies) { global $vbulletin; $username = strip_blank_ascii($username, ' '); // See VBM-635: &#xxx; should be converted to windows-1252 extended char. This may not happen if a browser submits the form. But from API or user manually input, it does. // See also vB_DataManager_User::verify_username() $charset = strtolower(vB_Template_Runtime::fetchStyleVar('charset')) == 'iso-8859-1' ? 'windows-1252' : vB_Template_Runtime::fetchStyleVar('charset'); $username = preg_replace('/&#([0-9]+);/ie', "convert_unicode_char_to_charset('\\1', '{$charset}')", $username); if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '******'")) { if ($vbulletin->userinfo['password'] != iif($password and !$md5password, md5(md5($password) . $vbulletin->userinfo['salt']), '') and $vbulletin->userinfo['password'] != iif($md5password, md5($md5password . $vbulletin->userinfo['salt']), '') and $vbulletin->userinfo['password'] != iif($md5password_utf, md5($md5password_utf . $vbulletin->userinfo['salt']), '')) { $return_value = false; ($hook = vBulletinHook::fetch_hook('login_verify_failure_password')) ? eval($hook) : false; if (isset($return_value)) { // unset $return_value if you want to run the $send_cookies stuff return $return_value; } } else { if ($vbulletin->userinfo['password'] == '') { // sanity check, though there should never really be an empty string for a password $return_value = false; ($hook = vBulletinHook::fetch_hook('login_verify_failure_password')) ? eval($hook) : false; if (isset($return_value)) { // unset $return_value if you want to run the $send_cookies stuff return $return_value; } } } if ($send_cookies) { set_authentication_cookies($cookieuser); } $return_value = true; ($hook = vBulletinHook::fetch_hook('login_verify_success')) ? eval($hook) : false; return $return_value; } $return_value = false; ($hook = vBulletinHook::fetch_hook('login_verify_failure_username')) ? eval($hook) : false; return $return_value; }