Created
January 23, 2011 19:41
-
-
Save loganlinn/792359 to your computer and use it in GitHub Desktop.
Forces a login into vBulletin (4.x) using just a username
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class vBulletinUser{ | |
public static function login($username, $remember_me = false){ | |
chdir(VB_ROOT_PATH); | |
require_once('./global.php'); | |
require_once(DIR . '/includes/functions_login.php'); | |
global $vbulletin,$vbphrase; | |
$remember_me = $remember_me ? true : false; //force to true or false value | |
$vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, | |
username, password, salt FROM ".TABLE_PREFIX."user WHERE username = '". | |
$vbulletin->db->escape_string(htmlspecialchars_uni($username))."'"); | |
if ($vbulletin->userinfo){ | |
process_new_login($vbulletin->GPC['logintype'], $remember_me, $vbulletin->GPC['cssprefs']); | |
exec_shut_down(); | |
return true; | |
} | |
return false; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment