Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 23 Oct 2012, 14:19
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Real name: Kerry-Anne (really!)
phpbb3 to vb3.8 password importing

I'm hoping that someone can save me many more hours of banging my head against the wall. I've done a test impex of phpbb3 to vb3.8 and it has gone really well, except the age old problem of passwords importing. I know the official line is to just get everyone to reset their passwords, but that isn't an option for me as valid email addresses are not required at registration, so probably 75% of the email addresses on accounts are just pure nonsense meaning that password resets will not be possible.

I found lurking around on here some code to import the passwords into vb4 on first login by checking the plain text password against the phpbb database with the phpbb encoding and if it matches then to update the password in the vbulletin database, but i haven't been able to get it working with vb3.8, although i will admit i am very rusty these days.

Basically what I need to do is really understand how the phpbb passwords are encoded then I can run a hopefully simple bit of code to encode the plain text password that way and then can do something along the lines of


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

of course to do this, I'll first be doing


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

this whole thing is giving me so much grief though, so hoping someone might have some ideas. It really is just getting the phpbb encoding making sense that is the problem. I've been pouring over the files and can't make head nor tail of it.

I know it isn't an ideal way of doing it, especially as I am just coding direct into login.php and not using any plugins of anything (old school here still unfortunately - plus no useful hooks anyway), but any pointers, or if anyone has been able to do this successfully before, then that would be awesome. I really don't want to have to renew a licence just to use the vb4 code i found, as that will only result in having a lot more work to do, and a whole new system to learn which tbh i cba doing when i know vb3 like the back of my hand and it does exactly what i want and need it to do.
__________________
Kerry-Anne
Previously known as peterska2

My Sites: peterska2.co.uk Super Clickers World News Zone English Football League Popular Usenet Groups
Do NOT PM or email me for Support or Modification Requests - No Exceptions!!
I do NOT do custom requests. Do not ask for them. - No Exceptions!!
Reply With Quote
  #2  
Old 23 Oct 2012, 15:04
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
I don't know anything about phpbb3, but googling for "phpbb3 password encryption" I found that there is a function in includes/functions.php (in the phpbb3 code) called phpbb_hash() that you can use to check the passwords. So you could probably grab that or at least refer to it.

Also, in vbulletin the password will normally be put through an md5 hash in the browser before it's sent, and the plain text password field will be cleared. But you can stop the plain text field being cleared by putting define('DISABLE_PASSWORD_CLEARING', 1); in your config.php.

Just FYI, there is a 'login_verify_failure_password' hook that gets called when a password check failed (it's in includes/functions_login.php around line 149). I thought I'd mention it, but I don't think using hooks is all that important especially since vb3 isn't being updated any more.

BTW, in the code you posted above, you have "SELECT importid" then you use $getuserid['importuserid']. I think you probably just included that code as an example, but I thought I'd mention it anyway.

Anyway, I know you were probably looking for someone with more knowledge of converting phpbb3 passwords, but maybe some of this will help.
Reply With Quote
  #3  
Old 23 Oct 2012, 15:25
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Real name: Kerry-Anne (really!)
Cheers Kevin,

I'd forgot about the DISABLE_PASSWORD_CLEARING so thats one problem solved as I was puzzled as to why I couldn't get the $ptpassword to echo.

I'll have another look at the phpbb/includes/functions.php and phpbb_hash() and see if I can see anything different in there.

Yeah, I knew there was errors in my code sample, but that is just pure example code of what my vision is, but nothing has been written yet, other than grabbing the imported userid, and the phpbb password from the database.

I'll be back in a bit, and let you know if I'm making any progress. I hadn't thought about looking in includes/functions_login.php for hooks either, so thats something I'll investigate further later.
__________________
Kerry-Anne
Previously known as peterska2

My Sites: peterska2.co.uk Super Clickers World News Zone English Football League Popular Usenet Groups
Do NOT PM or email me for Support or Modification Requests - No Exceptions!!
I do NOT do custom requests. Do not ask for them. - No Exceptions!!
Reply With Quote
  #4  
Old 25 Oct 2012, 12:57
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Real name: Kerry-Anne (really!)
ok, still having problems here, so open to a fresh set of eyes and maybe some more ideas.

My login.php file has had the following added to it


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

This has been added after

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

Then I have two included files:

phpBB3Auth/controller.php with the contents

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

and phpBB3Auth/phpbb3_functions.php with the contents


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

The phpbb3config.inc.php file is not required as the phpbb tables and vb tables are in the same database, so references to that file have been commented out as second database connections are not required.

When attempting to log in with an imported user, the following is output from the echos

Picture 32.png

with the following normal error message
Picture 33.png

For some reason, despite lots of echos in the code to try and get more info as to what is happening and why it is failing, I'm not getting anywhere quick and just banging my head against the nearest wall (which the computer is also being threatened to be launched at!). It is probably something fairly simple, but it is starting to do my head in, and I can't give up as otherwise I am doomed to be stuck with phpbb3 forever as password resets are not an option as I explained in the first post.

I am open to any more pointers, suggestions, glaringly obvious errors being corrected, or otherwise.

Just for info too, this is a 3.8.3 site (installed wrong version, but anything that works on 3.8.3 should work on 3.8.7 too). vB4 is not an option (expired licenses) at this time, and renewing to upgrade will only happen if the issues are solved and the users are also happy, otherwise it is an expense that cannot be warranted. I think I might have access to 4.1 but not 100% sure, plus the fact that my vb4 access, is for forum only and blogs are being considered for the site which requires 3.8.x

oh, and obviously DISABLE_PASSWORD_CLEARING has been set in config.php too as otherwise it has no chance of working.
__________________
Kerry-Anne
Previously known as peterska2

My Sites: peterska2.co.uk Super Clickers World News Zone English Football League Popular Usenet Groups
Do NOT PM or email me for Support or Modification Requests - No Exceptions!!
I do NOT do custom requests. Do not ask for them. - No Exceptions!!
Reply With Quote
  #5  
Old 25 Oct 2012, 13:58
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Real name: Kerry-Anne (really!)
Update @ 14:55 GMT

I think I might have almost cracked it. Found a couple of missing functions by trial and error so added those in and it is now saying correctly that the passwords match or don't. Now I just need it to update the vb password and actually log in which it isn't doing so far. Fingers crossed I will have it working soon. Will report back again in a bit. Suggestions still greatfully accepted though

--------------- Added 25 Oct 2012 at 14:00 ---------------

The php versions are the same, although it is on my test server not the live one. I checked that before I started for php and mysql versions in case I would hit any difficulties there.
__________________
Kerry-Anne
Previously known as peterska2

My Sites: peterska2.co.uk Super Clickers World News Zone English Football League Popular Usenet Groups
Do NOT PM or email me for Support or Modification Requests - No Exceptions!!
I do NOT do custom requests. Do not ask for them. - No Exceptions!!
Reply With Quote
  #6  
Old 25 Oct 2012, 14:07
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
Originally Posted by peterska2 View Post
The php versions are the same, although it is on my test server not the live one. I checked that before I started for php and mysql versions in case I would hit any difficulties there.
OK. I deleted that post because after reading what you added above, obviuously that wasn't the issue. I just thought of that because there's an if on php version that seems to use a different password encryption for version 4.
Reply With Quote
  #7  
Old 25 Oct 2012, 14:20
peterska2 peterska2 is offline
 
Join Date: Oct 2003
Real name: Kerry-Anne (really!)
It's alive!!!!

I how have quite happily the banned message, which I expected as the permissions for the imported users have not yet been set.

I'll get it all packaged up nicely and release it later too. It certainly isn't pretty code, but it works, and that is the most important thing


The problem was the order of some of the checks taking place. When I moved some things around it started telling me that the entered password was correct or incorrect, so it was then just a case of getting the DM updating done in that place, so now it successfully logs in when the password is correct with the phpbb table and updates the vb password too so the vb login will then be used from that point by checking if the password updating has already taken place or not.
__________________
Kerry-Anne
Previously known as peterska2

My Sites: peterska2.co.uk Super Clickers World News Zone English Football League Popular Usenet Groups
Do NOT PM or email me for Support or Modification Requests - No Exceptions!!
I do NOT do custom requests. Do not ask for them. - No Exceptions!!
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Integration with vBulletin phpBB3Auth - Migrate phpBB3 user/password to VB4 MoreLinux vBulletin 4.x Add-ons 42 21 Jul 2015 10:43



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 03:32.

Layout Options | Width: Wide Color: