mirror of
https://github.com/YunoHost-Apps/ttrss_ynh.git
synced 2024-10-01 13:34:46 +02:00
Update ttrss.diff
This commit is contained in:
parent
0d740a714c
commit
34e80ed1d4
1 changed files with 14 additions and 14 deletions
|
@ -4,10 +4,10 @@
|
||||||
_debug("WARNING: please backup your database before continuing.");
|
_debug("WARNING: please backup your database before continuing.");
|
||||||
_debug("Type 'yes' to continue.");
|
_debug("Type 'yes' to continue.");
|
||||||
|
|
||||||
- //if (read_stdin() != 'yes')
|
- if (read_stdin() != 'yes')
|
||||||
- // exit;
|
- exit;
|
||||||
+ if (read_stdin() != 'yes')
|
+ //if (read_stdin() != 'yes')
|
||||||
+ exit;
|
+ // exit;
|
||||||
|
|
||||||
for ($i = $updater->getSchemaVersion() + 1; $i <= SCHEMA_VERSION; $i++) {
|
for ($i = $updater->getSchemaVersion() + 1; $i <= SCHEMA_VERSION; $i++) {
|
||||||
_debug("performing update up to version $i...");
|
_debug("performing update up to version $i...");
|
||||||
|
@ -18,16 +18,16 @@
|
||||||
db_query("UPDATE ttrss_users SET email = '$email' WHERE id = " .
|
db_query("UPDATE ttrss_users SET email = '$email' WHERE id = " .
|
||||||
$user_id);
|
$user_id);
|
||||||
}
|
}
|
||||||
- // update user password to allow api access
|
+ // update user password to allow api access
|
||||||
- if (isset($_SERVER['PHP_AUTH_PW'])){
|
+ if (isset($_SERVER['PHP_AUTH_PW'])){
|
||||||
- $currentpassword = $_SERVER['PHP_AUTH_PW'];
|
+ $currentpassword = $_SERVER['PHP_AUTH_PW'];
|
||||||
- $new_salt = substr(bin2hex(get_random_bytes(125)), 0, 250);
|
+ $new_salt = substr(bin2hex(get_random_bytes(125)), 0, 250);
|
||||||
- $new_password_hash = encrypt_password($currentpassword, $new_salt, true);
|
+ $new_password_hash = encrypt_password($currentpassword, $new_salt, true);
|
||||||
-
|
+
|
||||||
- db_query("UPDATE ttrss_users SET
|
+ db_query("UPDATE ttrss_users SET
|
||||||
- pwd_hash = '$new_password_hash', salt = '$new_salt', otp_enabled = false
|
+ pwd_hash = '$new_password_hash', salt = '$new_salt', otp_enabled = false
|
||||||
- WHERE login = '$try_login'");
|
+ WHERE login = '$try_login'");
|
||||||
- }
|
+ }
|
||||||
}
|
}
|
||||||
|
|
||||||
return $user_id;
|
return $user_id;
|
||||||
|
|
Loading…
Add table
Reference in a new issue