PDA

View Full Version : Integration with vBulletin - ipbAuth - Use old Invision Power Board Passwords after migrating to vBulletin


viarun
02-15-2010, 10:00 PM
For anyone that's migrating from IPB ( Invision Power Board ) 2.X to vBulletin 4.x. The reason I built this is because the impex import system does not migrate passwords for a move from IPB to vBulletin. This is largely because the passwords are hashed differently, so there's no way to "convert" a password.

This plugin takes a different approach, where you keep the old IPB passwords around, and authenticate users against it first. If they authenticate successfully, then we sync the password the user typed in with vBulletin. Voila...a migration without making your users reset their passwords.

Borrowed heavily from ideas by malcolmx (https://vborg.vbsupport.ru/member.php?u=35084) in his LDAP Auth Plugin. (https://vborg.vbsupport.ru/showthread.php?t=231909&page=2) THANKS MALCOLMX!

Installation Notes:

1. copy ipbAuth directory to your vb forum installation directory
2. change the path to controller.php directory in ipb-plugin.xml
3. copy the hooks_ipb.xml to FORUM_ROOT/includes/xml directory
4. in login.php search for:

if ($vbulletin->GPC['vb_login_username'] == '')
{
eval(standard_error(fetch_error('badlogin', $vbulletin->options['bburl'], ....
}
And add this hook statement like so:

(if ($vbulletin->GPC['vb_login_username'] == '')
{
eval(standard_error(fetch_error('badlogin', $vbulletin->options['bburl'], ....
}
($hook = vBulletinHook::fetch_hook('ipb_login_hook')) ? eval($hook) : false;

5. activate plugin system (if not done already) in admincp
6. in admin cp import the product at "Plugins & Products -> Download / Upload Plugins", use "Import Plugin Definitions XML File" at the bottom of the page, example import input './ipbAuth/ipb-plugin.xml'
7. in includes/class_bootstrap.php search for:

$show['nopasswordempty']

then change:

defined('DISABLE_PASSWORD_CLEARING') ? 1 : 0;

to:

defined('DISABLE_PASSWORD_CLEARING') ? 0 : 1;

( note that this causes the browser to skip hashing the password in javascript, and passwords will be sent cleartext to the server. technically, a security risk, although many, many, bulletin board systems do this by default. This is the only sensible way to get the cleartext password to be synced though. no other clean way to sync IPB to vB. You can, of course, turn this whole plugin off after most of your users have migrated, and then remove this change. The passwords are properly hashed in the database, and not written to disk, so the risk is relatively low.)


8. Configure the database settings in ipbconfig.inc.php ... this should point to your IPB database that has the members_converge table in it. Be sure to supply a username and password that can read and update the table. Make a copy of the database first...before you turn this plugin on!

9. Make a backup copy of the old IPB database first...before you turn this plugin on!

10. Test

A little story: The whole reason this happened was that IPB treated me like crap. I was a long-time customer of their hosted board service on their 2.X product. Last weekend, I had planned to upgrade to 3.x, and move my board to my own servers. So, I logged into their site and purchased the 3.x product.

It popped up an error that basically said they had flagged the purchase, and were going to keep my money, but not let me download the software until I could be "verified"...perhaps up to 2 days later. So, I decided I didn't like being treated like a thief. I bought a brand-new copy of vB, and wrote this plugin to ease the migration for my board members. I'm posting it here so that hopefully, more people can move away from IPB. Karma rocks.


Download

viarun
02-16-2010, 10:31 AM
Heh. I like that someone gave it 1 star, but without downloading it, trying it, etc.

Suppose someone is trying to boost their own plugin's popularity? Kids....

BlackJacket
02-16-2010, 11:22 AM
I gave you 5 stars! :) Even though i would not need this mod i can see the usefulness it has. Thanks and welcome to VB! :D

Gnoll
02-16-2010, 11:54 AM
ill never use this but useful for impex used forums , might be you sent this to vB-IMPEX team then they add to impex :)

Reeve of shinra
02-16-2010, 02:51 PM
Great mod and very handy for those switching over.

This feature was suggested about 2-3 years ago but the Jerry said that the first concern was preserving the database and thus it was never added.

viarun
02-16-2010, 05:03 PM
Yep. To be clear, this mod doesn't alter the vB database at all. It requires access to the old IPB database. It doesn't change the structure, but it does overwrite the old IPB passwords, one by one, as users get synced and login.

Probably not a good candidate to move into Impex, as it requires DISABLE_PASSWORD_CLEARING. The really right way to do this, and support more than just IPB, would be adding "imported_password" and "imported_salt" columns into vB, and then extending the javascript used at login so that you wouldn't have to DISABLE_PASSWORD_CLEARING. That sounded like too much work for me :)

DaSpyda
03-01-2010, 12:18 AM
OMG, if I had this two years ago, I would've saved tons of hours of answering "My login doesn't work" emails!!!

Dang...

Brandon Sheley
03-09-2010, 12:49 PM
nice mod

giorgino
03-13-2010, 01:51 PM
Is possible to port this add on for phpBB -> vB?

viarun
03-19-2010, 02:04 AM
Is possible to port this add on for phpBB -> vB?
Yes, it should be a pretty easy exercise.

If you are sure that this isn't solved elsewhere, I would take a shot at it.

Not familiar with phpBB, so I would want to be sure there's no existing solution for this before I went and did the research.

giorgino
03-19-2010, 06:34 AM
I'm absolutely sure :)
I've searched in all internet caves! lol
Your solution is a great solution

I've to migrate my phpBB board this sunday, and the only thing that I can do is overwrite password field with user e-mail, so that user can login to vB forum without recover his password via standard procedure.

My board isn't a tech board and my user are all newbe to forum structure...

viarun
03-19-2010, 12:33 PM
I have a beta copy that should work with phpBB. Sent you a pm.

giorgino
03-19-2010, 12:52 PM
Thank you viarun :)

giorgino
03-19-2010, 03:55 PM
So viarun. First of all, really thank you for your support and great plugin :)

I've done this steps:

1. Copied the entire phpbbAuth folder in my root (I'm using vB4 Suite in root of my domain)
2. I haven't changed the path to controller.php. The defaut path seem to be ok for me ( ./phpbbAuth/controller.php )
3. I've copied hooks_phpbb.xml in xml folder (inside /include/xml/ )
4. I've modifyied login.php in vB root
5. I've uploaded hooks_phpbb.xml in Acp
6. I've setup the phpbb information in phpbbconfig.inc.php
test: the login procedure go
7. following your istructions:

in includes/class_bootstrap.php search for:
$show['nopasswordempty']
change: defined('DISABLE_PASSWORD_CLEARING') ? 1 : 0;
to: defined('DISABLE_PASSWORD_CLEARING') ? 0 : 1;

the login procedure go to blank page

viarun
03-19-2010, 04:37 PM
Should probably do this via PM, since it's not related to ipb, but rather phpbb.

Sent a PM.

Adam H
03-19-2010, 10:24 PM
Amazing mod and ive eventually got it working , i had a problem that it wasnt working because my SQL tables were actually different from Viarun , I think this maybe because my IPB install was originally IPB2 but then upgraded to IPB3 so it wasnt a clean install of IPB3

For those of you that have the members table like this : ibf_members , rather than what Viarun has said above with his table being ibf_members_converge .

You will need to use this controller.php file instead of Viaruns :

ATTACHED TO THIS POST

I hope this helps some people as it took me a good 4 hours to finally work it out................yes i know im slow but its been a long day lol.

Enjoy everyone and Massive thank you to viarun for a great mod

arabsdesign
06-12-2010, 02:22 AM
and about vb 3.8.5

r ican used this or no

if no how iget this itry search and not see any thing

neetusn
06-15-2010, 06:27 AM
I have got punbb and passwords saved are in SHA1 format and want to migrate it in to vbulletin but i am also facing password migration issue. i tried you plugin am getting file not found error for controller.php as i have tried path ./phpbbAuth/controller.php and ./contoller.php . I have copied ipdAuth inside the install folder.

neetusn
06-25-2010, 08:59 AM
i have used this plugin for punbb but Imported users and Members are not able to login , getting wrong user id password error

viarun
07-09-2010, 04:06 PM
i have used this plugin for punbb but Imported users and Members are not able to login , getting wrong user id password error
Not surprising, as this module wasn't developed for punbb :)

The module works fine for IPB, and you can see that others ported the module for phpbb.

To make it function for punbb, someone would have to port the code to work in that environment.

ozzy47
07-11-2010, 04:11 PM
Is their a way to have my ipb v2.3.6 board read the members and passwords from vb 4.0

I have ipb for my arcade and need my vb forum members to be able to use their vb log on info at my ipb board

bigrover
08-06-2010, 03:26 PM
This mod solved a big problem and saved me a lot of work. Thank you for putting in the time to code this solution. I also appreciate the level of commenting in your code. It made it very easy for me to see what was happening, know what to expect in the old IPB database to confirm it worked, and allowed me to make a change to search on a different field when looking up the userid. Good work.

deven316
02-21-2011, 08:12 PM
HELP!!

I tried to install this mod as i have upgraded from IPB 2.3.6, i thought i followed the directions correctly, but when i try and login with any username i get this error

Parse error: syntax error, unexpected $end in /home/goozebum/public_html/forums/ipbAuth/controller.php on line 85

briggsbw
02-21-2011, 08:35 PM
I'm guessing this will work for IPB 2.3 to vB 3.8 as well with some table name changes?

cpvrx
02-25-2011, 07:02 AM
Great plugin!

Rebecca217
03-10-2011, 01:15 PM
I'm guessing this will work for IPB 2.3 to vB 3.8 as well with some table name changes?

I'm curious about this, too.

Btw, excellent idea, and thanks so much for posting this mod!

ripley
01-12-2013, 05:51 PM
Receiving the following:

Fatal error:

A required field called import_ipbpass is missing or has an invalid value.

Unable to proceed with save while $errors array is not empty in class vB_DataManager_User in [path]/includes/class_dm.php on line 849

onespot
05-02-2013, 06:18 AM
Hey Everyone - I spent a hell of a lot of time trying to get some functionality that I was just able to finally get wanted to share with everyone.

Basically my clients IPB didn't rely on usernames - it was mostly email addresses so I wanted this process to ALSO check if the user typed in an EMAIL address into the login and initiate this script properly if email matched the "email" field in IPB.

I then use https://vborg.vbsupport.ru/showthread.php?t=275348 which will take over the login process AFTER the new PW is saved.

All you need to do is edit the controller.php file in your ipbauth folder:

Find
function fetch_userid_from_username($username) {
global $vbulletin;
if ($user =
$vbulletin->db->query_first("SELECT userid
FROM " . TABLE_PREFIX . "user WHERE username = '" .
$vbulletin->db->escape_string(trim($username)) . "'")) {
return $user['userid'];
}

Add Below:

else if ($user =
$vbulletin->db->query_first("SELECT userid
FROM " . TABLE_PREFIX . "user WHERE email = '" .
$vbulletin->db->escape_string(trim($username)) . "'")) {
return $user['userid'];
}


Works like a charm!

I'm no programmer so use this at your own risk - I very well could be missing something and it could not be doing something that is important here...