Page 1 of 2

Migrated database from php-fusion ::HELP::

Posted: Thu Oct 04, 2007 5:04 pm
by Elvenelf
Your board's URI: http://www.dclans.com

Version of phpBB2: v2 (latest stable)

Was this a fresh install or a(n) update/upgrade/conversion (please be specific)? Conversion from PHP-Fusion. Passwords there were double md5 encrypted, now having issues with users not logging in cuz they dont really know how to reset their passwords. I would like to send the reset password email to them, looking for a way to reset their passwords automatically and have them re-activate their accounts.

Was this an install through your host? No, i did it myself.

MODs you have installed:EasyMOD, AntiSpam(not working properly, still fixing up installation, something went wrong).

When the problem started: Since day one.


OK, basically what I would like to do is to switch passwords back to single md5 protection... php-fusion had a mod from core code to up the md5 encryption to double... so their password variables looked like... md5(md5($_POST['usr_password'])); like so... and I would like an easy way for my users o log in without having to put them through a password reset process all over again.... is there anything I can do to help em in?

Re: Migrated database from php-fusion ::HELP::

Posted: Fri Oct 05, 2007 4:03 am
by D¡cky
This should work

Code: Select all

############################################################## 
## MOD Title: Allow login for php-fusion users
## MOD Author: Dicky < dicky@askmaggymae.com >
## MOD Description: Allows converted php-fusion users to log in to the new phpBB board with their smf passwords
## MOD Version: 1.0.0
## MOD date: Oct 4, 2007
## 
## Installation Level: easy
## Installation Time: 3 Minutes 
## Files To Edit: (1) login.php
## Included Files: n/a
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ OPEN ]------------------------------------------ 
# 
login.php
# 
#-----[ FIND ]------------------------------------------ 
# Line 86
				{
					message_die(GENERAL_MESSAGE, sprintf($lang['Login_attempts_exceeded'], $board_config['max_login_attempts'], $board_config['login_reset_time']));
				}
# 
#-----[ AFTER, ADD ]------------------------------------
#
			// check if this is a converted user
			// handles php-fusion user passwords
				if( md5($password) !== $row['user_password'] && $row['user_active'] )
				{
					if ( $row['user_password'] == md5(md5($row['user_password'])))
					{
						// this is a converted user. Now make them a phpBB user!
						// take the subbed pass and put a md5 encryption on it and insert it into the database 
						$sql = "UPDATE " . USERS_TABLE . " SET user_password = '" . md5( $HTTP_POST_VARS['password'] ) . "' WHERE user_id = '" . $row['user_id'] . "'";
						if( !$db->sql_query($sql) ) 
						{ 
							message_die(GENERAL_ERROR, 'Password Error:<br />Please contact the board administrator immediately.', '', __LINE__, __FILE__, $sql); 
						}
						// reset $row[user_password]
						$sql = "SELECT user_id, username, user_password, user_active, user_level FROM " . USERS_TABLE . "
						WHERE username = '" . str_replace("\\'", "''", $username) . "'";

						if ( !($result = $db->sql_query($sql)) )
						{
							message_die(GENERAL_ERROR, 'Error in obtaining userdata', '', __LINE__, __FILE__, $sql);
						}
						$row = $db->sql_fetchrow($result); 
					}
				}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

Re: Migrated database from php-fusion ::HELP::

Posted: Mon Dec 10, 2007 5:03 am
by Manifest
I've been trying to convert my PHP Fusion to PHPBB and the PHP-Fusion 5.x converter worked somewhat...

The main issue I was having was with passwords, and your above edit didn't work for me. Instead, I modified login.php to check for md5 OR double md5 encryption and proceed as normal - this allowed me to login straight away.

Code: Select all

#-----[ FIND ]------------------------------------------ 
# Line 90
# 	if( md5($password) == $row['user_password'] && $row['user_active'] )
#
#-----[ INLINE, FIND ]------------------------------------------ 
# 	if( md5($password)
#
#-----[ ADD AFTER ]------------------------------------------ 
#  || md5(md5($row['user_password']))
Now, before I make this a permanent conversion i'd like to know if there are any potential problems with my edit or not... I'm an amateur with PHP so would greatly appreciate the clearance of this method by someone in the know. It worked for me, now i'm just trying to get a few 'select' members to see if they can login straight away too.

Re: Migrated database from php-fusion ::HELP::

Posted: Wed Dec 12, 2007 4:16 am
by D¡cky
Your code looks okay. It does basically the same thing as mine except yours doesn't convert the password to single md5 hash.

Re: Migrated database from php-fusion ::HELP::

Posted: Fri Dec 14, 2007 7:54 am
by Manifest
No - because that didn't work for me.

Re: Migrated database from php-fusion ::HELP::

Posted: Wed Jul 30, 2008 1:02 pm
by PARTyZAN
Would anyone be willing to do a script that automatically converts ALL passwords in database to phpbb compatible ones?

//edit: sorry, I guess I'm to sleepy right now to think straight. I know that I requested something that's impossible to do :(. Can anyone supply me with a solution for phpbb v3 forum?

Any help will be greatly appreciated, since this is the only barrier preventing my migration from php-fusion to phpbb.

Re: Migrated database from php-fusion ::HELP::

Posted: Wed Jul 30, 2008 3:54 pm
by D¡cky
The attached file should work. Unzip and upload to the phpBB3 includes/auth directory

Re: Migrated database from php-fusion ::HELP::

Posted: Wed Jul 30, 2008 5:05 pm
by PARTyZAN
Thanks for your fast reply. I tried your modified auth_db file and it doesn't work:

Parse error: syntax error, unexpected T_ELSE in /www/phpBB3/includes/auth/auth_db.php on line 144

Re: Migrated database from php-fusion ::HELP::

Posted: Wed Jul 30, 2008 6:44 pm
by D¡cky
Sorry about that. A new file has been uploaded to my previous post.

Re: Migrated database from php-fusion ::HELP::

Posted: Wed Jul 30, 2008 7:00 pm
by PARTyZAN
Altho the page now loads like it should, your modification has no effect. I still get the "It was not possible to convert your password when updating this bulletin board’s software." error. I checked the DB, no change was made to my password hash and the "user_pass_convert" field is still set to "1".

//edit: I did it the "foolproof" way. Since I don't have any phpbb2 password hashes I just edited line 144 of auth_db.php to:

Code: Select all

if (md5(md5(($password_old_format))) == $row['user_password'] || md5(md5(utf8_to_cp1252($password_old_format))) == $row['user_password'])
And it works now :). Thanks for help anyway.

Re: Migrated database from php-fusion ::HELP::

Posted: Wed Jul 30, 2008 7:43 pm
by D¡cky
What you did will work. I updated my file anyway.

Re: Migrated database from php-fusion ::HELP::

Posted: Thu Dec 04, 2008 5:55 pm
by fresheris
Hi. after conversation i wasnt able to login. but i change my (admin) password manualy using this http://dicky.askmaggymae.com/md5/ and added it to database. now i can login, edit my own replays in a forum but i cant see the admin panel.. i cant admin my forum. can somebody help? thanks.

Re: Migrated database from php-fusion ::HELP::

Posted: Thu Dec 04, 2008 9:24 pm
by ric323
fresheris wrote:Hi. after conversation i wasnt able to login. but i change my (admin) password manualy using this http://dicky.askmaggymae.com/md5/ and added it to database. now i can login, edit my own replays in a forum but i cant see the admin panel.. i cant admin my forum. can somebody help? thanks.
Use the admin toolkit (link in my sig) to promote yourself to an administrator on the phpBB board.

Re: Migrated database from php-fusion ::HELP::

Posted: Fri Dec 05, 2008 5:57 am
by D¡cky
fresheris wrote:Hi. after conversation i wasnt able to login. but i change my (admin) password manualy using this http://dicky.askmaggymae.com/md5/ and added it to database. now i can login, edit my own replays in a forum but i cant see the admin panel.. i cant admin my forum. can somebody help? thanks.
If you are running on phpBB3, you need to run this query in phpMyAdmin

Code: Select all

UPDATE phpbb_users SET user_type = 3, user_permissions = '' WHERE user_id = xx
Replace the xx in use_id with your user_id and if your table prefix is not phpbb_ replace with your table prefix.
You will need to logout of your board before running the query. You may login after running the query and yu should see the Administration Control Panel link.

Re: Migrated database from php-fusion ::HELP::

Posted: Mon Dec 08, 2008 9:52 pm
by fresheris
THANKS! but i just needed to change group_id to 1 and now everything seems to be working.
One more thing, how to fix the searching problem in the new site? thanks.