PDA

View Full Version : user import problem


sledgeboy
06-27-2002, 11:57 PM
Hi i´ve just imported 9000 users from our old database (using version 2.0.3 ) to our new one (2.2.6). Everthing worked perfect but no user can log on anymore because there is a new table called "useractivation" but this table isn´t n the old database. so i think the boarb thinks that all those users haven´t activated their account yet, so how can i make the board accept those users and see them as activated ? Please answer quickly it´s very important for us to hold the board online and working !

And please forgive my bad english, i´m not from the US and it isn´t as good as well !

Greetings

Sledge

scsa20
06-28-2002, 06:24 AM
actuly, if I remember reading around the board, 2.0.3 never encripted user passwords, but in 2.2.x it did...so what you might have to do is change all the users password and e-mail it to them asking them to change it right away (one way is just change there password to there userid number and do a mulit-email to all your users using that one code that shows there userid number as there password).

Xenon
06-28-2002, 10:45 AM
write a small script to encrypt ther pws automatically:

[php]
<?php
require('./global.php');
for($i=2;$i<=9000;$i++) {
$info=$DB_site->query_first("SELECT userid,password FROM user WHERE userid='".$i."');
if($info[userid]==$i) $DB_site->query("UPDATE user SET password='".md5($info[password])."' WHERE userid='".$i."');

}
?>

replace the 9000 with the highest userid you have

Admin
06-28-2002, 11:00 AM
Originally posted by Xenon
write a small script to encrypt ther pws automatically:


<?php
require('./global.php');
for($i=2;$i<=9000;$i++) {
$info=$DB_site->query_first("SELECT userid,password FROM user WHERE userid='".$i."');
if($info[userid]==$i) $DB_site->query("UPDATE user SET password='".md5($info[password])."' WHERE userid='".$i."');

}
?>

replace the 9000 with the highest userid you have
Ouch man, that'll cause 18,000 queries a large headache to your host! :)

<?php
require('./global.php');
$DB_site->query('UPDATE user SET password=MD5(password)');
echo 'Yes, we did it!';
?>
Unless you have a terribly old version of MySQL which doesn't support the MD5() function.

Xenon
06-28-2002, 11:21 AM
hehe, hosts just want to have fun ;)

i didn't know that MD5 is also an MySQL-included function.
thank, learning never ends :)