View Single Post
  #4  
Old 10-24-2011, 04:28 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 393,150
Hall of Famer is on a distinguished road
Default

Well your userencrypt.php file should looks like this below:

PHP Code:
<?php

include("inc/functions.php");

//***************//
//  START SCRIPT //
//***************//

$article_title "User Password Encryption Wizard"
$article_content "You are trying to encrypt every user's password, this may take a few secs or mins depending on the size of your memberbase. </br></br>";
$vers grabanysetting("version");

if(
$vers == "1.2.3"){

$query "SELECT * FROM {$prefix}users";
$result runquery($query);

while(
$user mysql_fetch_array($result)){
$newpass updatepass($user['username'], $user['password']);

$query "UPDATE {$prefix}users SET password='{$newpass}' WHERE username='{$user['username']}'";
runquery($query);

$article_content .= "Updating user {$user['username']}, action complete.</br>";

}



$article_content .= "</br>You have successfully encrypted your password! You can now log into your account and build an awesome adoptables site of yours!</br>
<br><b>We strongly recommend you to remove usercrypt.php now, together with the entire /install folder before managing your site.</b>"
;

$query "DELETE FROM {$prefix}settings WHERE name='version'";
runquery($query);

}
else{
  
$article_content .= "You are still using an old version of Mysidia Adoptables, please upgrade before running user password encryption wizard.";
}

//***************//
//  OUTPUT PAGE  //
//***************//

echo showpage($article_title$article_content$date);

?>
Replace with:
PHP Code:
<?php

include("inc/functions.php");

//***************//
//  START SCRIPT //
//***************//

$article_title "User Password Encryption Wizard"
$article_content "You are trying to encrypt every user's password, this may take a few secs or mins depending on the size of your memberbase. </br></br>";

$query "SELECT * FROM {$prefix}users";
$result runquery($query);

while(
$user mysql_fetch_array($result)){
$newpass updatepass($user['username'], $user['password']);

$query "UPDATE {$prefix}users SET password='{$newpass}' WHERE username='{$user['username']}'";
runquery($query);

$article_content .= "Updating user {$user['username']}, action complete.</br>";

}



$article_content .= "</br>You have successfully encrypted your password! You can now log into your account and build an awesome adoptables site of yours!</br>
<br><b>We strongly recommend you to remove usercrypt.php now, together with the entire /install folder before managing your site.</b>"
;

$query "DELETE FROM {$prefix}settings WHERE name='version'";
runquery($query);

//***************//
//  OUTPUT PAGE  //
//***************//

echo showpage($article_title$article_content$date);

?>
Make sure you back up your table prefix.users before running the new script, since you will mess up the password encryption if you by any chance executes the script twice or more. Sometimes you may not even realize that you've done this, it happens to me too with slower internet.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote