View Single Post
  #3  
Old 17 Sep 2013, 18:54
veena veena is offline
 
Join Date: Jun 2010
Thanks Marco.

Can't believe this has been made so overly complicated with no documentation on the changes between the VB versions for login.

Isn't login a basic function that 3rd party plugins that want to integrate with VB will need?
I am surprised that it is so hard to get login integration done.

Anyway, i figured out how to do it. It is working now.

Wrote my own class that sets these cookies:

vbsetcookie(COOKIE_PREFIX . 'userid', $res['userid'], false, true, true);
vbsetcookie(COOKIE_PREFIX . 'password', $res['password'], false, true, true);
vbsetcookie(COOKIE_PREFIX . 'sessionhash', $res['sessionhash'], false, false, true);

Before call vbsetcookie, need to call :

$auth = vB_User::verifyAuthentication($username, $password, null, null);
if($auth) {
$res = vB_User:rocessNewLogin($auth, $vbulletin->GPC['logintype'], $vbulletin->GPC['cssprefs']);
if($res) {
vbsetcookie(COOKIE_PREFIX . 'userid', $res['userid'], false, true, true);
vbsetcookie(COOKIE_PREFIX . 'password', $res['password'], false, true, true);
vbsetcookie(COOKIE_PREFIX . 'sessionhash', $res['sessionhash'], false, false, true);
}
}
Reply With Quote