mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 18:59:21 +02:00
Merge pull request #181 from forgee/master
Update special/database2znoteaac.php
This commit is contained in:
commit
5b22fe4b18
@ -82,23 +82,25 @@ require '../engine/function/users.php';
|
|||||||
if (isset($old_accounts) && $old_accounts !== false) {
|
if (isset($old_accounts) && $old_accounts !== false) {
|
||||||
$time = time();
|
$time = time();
|
||||||
foreach ($old_accounts as $old) {
|
foreach ($old_accounts as $old) {
|
||||||
|
// Get acc id
|
||||||
|
$old_id = $old['id'];
|
||||||
|
|
||||||
// Make acc data compatible:
|
// Make acc data compatible:
|
||||||
mysql_insert("INSERT INTO `znote_accounts` (`account_id`, `ip`, `created`) VALUES ('$old', '0', '$time')");
|
mysql_insert("INSERT INTO `znote_accounts` (`account_id`, `ip`, `created`) VALUES ('$old_id', '0', '$time')");
|
||||||
$updated_acc += 1;
|
$updated_acc += 1;
|
||||||
|
|
||||||
// Fetch unsalted password
|
// Fetch unsalted password
|
||||||
if ($config['TFSVersion'] == 'TFS_03' && $config['salt'] === true) {
|
if ($config['TFSVersion'] == 'TFS_03' && $config['salt'] === true) {
|
||||||
$password = user_data($old, 'password', 'salt');
|
$password = user_data($old_id, 'password', 'salt');
|
||||||
$p_pass = str_replace($password['salt'],"",$password['password']);
|
$p_pass = str_replace($password['salt'],"",$password['password']);
|
||||||
}
|
}
|
||||||
if ($config['TFSVersion'] == 'TFS_02' || $config['salt'] === false) {
|
if ($config['TFSVersion'] == 'TFS_02' || $config['salt'] === false) {
|
||||||
$password = user_data($old, 'password');
|
$password = user_data($old_id, 'password');
|
||||||
$p_pass = $password['password'];
|
$p_pass = $password['password'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify lenght of password is less than 28 characters (most likely a plain password)
|
// Verify lenght of password is less than 28 characters (most likely a plain password)
|
||||||
if (strlen($p_pass) < 28 && $old > 1) {
|
if (strlen($p_pass) < 28 && $old_id > 1) {
|
||||||
// encrypt it with sha1
|
// encrypt it with sha1
|
||||||
if ($config['TFSVersion'] == 'TFS_02' || $config['salt'] === false) $p_pass = sha1($p_pass);
|
if ($config['TFSVersion'] == 'TFS_02' || $config['salt'] === false) $p_pass = sha1($p_pass);
|
||||||
if ($config['TFSVersion'] == 'TFS_03' && $config['salt'] === true) $p_pass = sha1($password['salt'].$p_pass);
|
if ($config['TFSVersion'] == 'TFS_03' && $config['salt'] === true) $p_pass = sha1($password['salt'].$p_pass);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user