X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=update.php;h=273e75de7d53bccc84e49a548245120b731ca3f1;hb=b021b766611619713b72883c0557c10451d4e0ce;hp=eb91baf3a194af6af743f59a6079e66e5a1828b6;hpb=a614b17ed57f22c7a85113ab204380fcfc66ff31;p=friendica.git diff --git a/update.php b/update.php index eb91baf3a1..273e75de7d 100644 --- a/update.php +++ b/update.php @@ -1,11 +1,11 @@ true], ['SUBSTR(password, 1, 4) != "$2y$"']); + + // All legacy hashes are re-hashed using the new secure hashing function + $stmt = dba::select('user', ['uid', 'password'], ['legacy_password' => true]); + while($user = dba::fetch($stmt)) { + dba::update('user', ['password' => User::hashPassword($user['password'])], ['uid' => $user['uid']]); + } + + // Logged in users are forcibly logged out + dba::delete('session', ['1 = 1']); + + return UPDATE_SUCCESS; +} + +function update_1245() { + $rino = Config::get('system', 'rino_encrypt'); + + if (!$rino) { + return UPDATE_SUCCESS; + } + + Config::set('system', 'rino_encrypt', 1); + + return UPDATE_SUCCESS; +}