Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 17 Sep 2013, 01:12
veena veena is offline
 
Join Date: Jun 2010
VB 5.0 login via API - process_new_login not working after upgrade to VB 5.0

We have integrated our plugin with VB 5.0. When a user registers to our site, we are able to automatically create a VB account for the user and add user to the right forum group etc.

But when a user logs in to our site, the auto-login (single-sign-on) to VB 5.0 is NOT working.
It used to work really well in VB 4.x.

We make a call to setcookie to set the 'userid' and 'password' and then call the VB API to autologin:

process_new_login('', false, '');

Looks like VB 5.0 has removed support for this API.

Need help with the single-login integration between our plugin (written in php) and VBulletin 5.0.
Has anyone here experienced a similar problem? Any solution for this?

Thanks,
Veena Prashanth
Reply With Quote
  #2  
Old 17 Sep 2013, 12:22
marco_kellershoff's Avatar
marco_kellershoff marco_kellershoff is offline
 
Join Date: Sep 2013
Real name: marco
Things changed a bit I guess - but I'm pretty new to all this stuff:

Here is that the user class of the VB API does:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I guess you could write an extension that extends the user class.
__________________
I'm a full time developer working for gofeminin.de and I love to share my thoughts with you.


Last edited by marco_kellershoff; 17 Sep 2013 at 13:02.
Reply With Quote
  #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
  #4  
Old 17 Sep 2013, 21:31
marco_kellershoff's Avatar
marco_kellershoff marco_kellershoff is offline
 
Join Date: Sep 2013
Real name: marco
Originally Posted by veena View Post
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);
}
}
Some things are documented, but not very well. And most of the docs are not easily to be found.. I googled my a** off to find out some basic stuff :/

Anyway glad you made it
__________________
I'm a full time developer working for gofeminin.de and I love to share my thoughts with you.

Reply With Quote
  #5  
Old 29 Oct 2014, 21:40
psanchez psanchez is offline
 
Join Date: Sep 2012
Hi,

I'm trying to implement something similar. Can you share how you were able to do this further?

Thanks!
Reply With Quote
  #6  
Old 16 Feb 2015, 00:21
WeBBy WeBBy is offline
 
Join Date: Jun 2003
If you have this working (auto-login) in vb 5.x would really appreciate some additional info as I am pulling my hair out to gety an auto-login working
Thanx
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 17:45.

Layout Options | Width: Wide Color: