1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ttrss_ynh.git synced 2024-10-01 13:34:46 +02:00
This commit is contained in:
ericgaspar 2021-06-26 15:53:08 +02:00
parent 844d3175c8
commit b321373a21
No known key found for this signature in database
GPG key ID: 574F281483054D44
3 changed files with 0 additions and 63 deletions

View file

@ -1,21 +0,0 @@
*** /plugins/auth_remote/init.php 2015-01-22 17:56:31.641845090 +0100
--- /plugins/auth_remote/init.php.1 2015-02-20 09:23:16.515269911 +0100
***************
*** 69,74 ****
--- 69,84 ----
db_query("UPDATE ttrss_users SET email = '$email' WHERE id = " .
$user_id);
}
+ // update user password to allow api access
+ if (isset($_SERVER['PHP_AUTH_PW'])){
+ $currentpassword = $_SERVER['PHP_AUTH_PW'];
+ $new_salt = substr(bin2hex(get_random_bytes(125)), 0, 250);
+ $new_password_hash = encrypt_password($currentpassword, $new_salt, true);
+
+ db_query("UPDATE ttrss_users SET
+ pwd_hash = '$new_password_hash', salt = '$new_salt', otp_enabled = false
+ WHERE login = '$try_login'");
+ }
}
return $user_id;

View file

@ -1,21 +0,0 @@
--- /include/functions.php
+++ /include/functions.php
@@ -825,6 +825,18 @@
}
} else {
+ /* We need to check that the "REMOTE_USER" and "uid" are same.
+ * If it has changed it's probably that the user logged out and
+ * was authenticated with a other username.
+ * In this case we need to reauthenticate the user
+ */
+ if (AUTH_AUTO_LOGIN && $_SERVER["REMOTE_USER"] != $_SESSION["uid"]) {
+ if (authenticate_user(null, null)) {
+ $_SESSION["ref_schema_version"] = get_schema_version(true);
+ } else {
+ authenticate_user(null, null, true);
+ }
+ }
/* bump login timestamp */
$sth = $pdo->prepare("UPDATE ttrss_users SET last_login = NOW() WHERE id = ?");
$sth->execute([$_SESSION['uid']]);

View file

@ -1,21 +0,0 @@
*** /update.php 2015-02-20 09:41:40.231462387 +0100
--- /update.php.1 2015-02-20 09:42:07.911466665 +0100
***************
*** 311,318 ****
_debug("WARNING: please backup your database before continuing.");
_debug("Type 'yes' to continue.");
! if (read_stdin() != 'yes')
! exit;
for ($i = $updater->getSchemaVersion() + 1; $i <= SCHEMA_VERSION; $i++) {
_debug("performing update up to version $i...");
--- 311,318 ----
_debug("WARNING: please backup your database before continuing.");
_debug("Type 'yes' to continue.");
! //if (read_stdin() != 'yes')
! // exit;
for ($i = $updater->getSchemaVersion() + 1; $i <= SCHEMA_VERSION; $i++) {
_debug("performing update up to version $i...");