VBulletin 5 Login

I have a third-party application that performs authentication and wants to simultaneously register a user in a locally installed instance of vBulletin. The only way to log in is through this third-party application. This is what I have, where $vbpath is the path to installing vBulletin, and $username is the login name:

 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); 

At first glance it seems that this works, but I wonder: is there anything else that needs to be done to correctly enter vBulletin 5? I circumvented the API because the API seemed to require a password and quickly becomes a mess if I store it in a third-party application - it needs to be encrypted using a third-party password, obviously, and this is just a huge synchronization mess that I did not use, t really necessary.

+5
source share

Source: https://habr.com/ru/post/1267342/


All Articles