mirror of
https://github.com/YunoHost-Apps/bludit_ynh.git
synced 2024-09-03 18:06:13 +02:00
22 lines
795 B
Diff
22 lines
795 B
Diff
|
*** /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;
|