登录vBulletin 5

chx*_*chx 6 vbulletin

我有第三方应用程序进行身份验证,并希望同时将用户登录到本地安装的vBulletin实例.登录的唯一方法是通过此第三方应用程序.这就是我所拥有$vbpath的vBulletin安装路径,它$username是要登录的用户的名称:

require_once($vbpath . '/includes/vb5/autoloader.php');
\vB5_Autoloader::register($vbpath);
\vB5_Frontend_Application::init('config.php');
\vB::getDbAssertor()->delete('session', array('sessionhash' => \vB::getCurrentSession()->get('dbsessionhash')));
$username = \vB_String::htmlSpecialCharsUni($username);
$userinfo = \vB::getDbAssertor()->getRow('user', array('username' => $username));
$auth = array_intersect_key($userinfo, array_flip(['userid', 'lastvisit', 'lastactivity']));
$loginInfo = \vB_User::processNewLogin($auth);
\vB5_Auth::setLoginCookies($loginInfo);
Run Code Online (Sandbox Code Playgroud)

乍一看它似乎工作但我想知道:还有什么需要做才能正确登录vBulletin 5?我绕过了API,因为它似乎API需要密码,如果我将它存储在第三方应用程序中很快就会变得一团糟 - 它需要使用第三方密码进行加密,而且这只是一个巨大的同步混乱,我没有'真的需要.