mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-15 20:55:56 +00:00
implement basic feed authentication parameter encryption in the database (FEED_CRYPT_KEY)
This commit is contained in:
@@ -1614,12 +1614,20 @@
|
||||
"SELECT id FROM ttrss_feeds
|
||||
WHERE feed_url = '$url' AND owner_uid = ".$_SESSION["uid"]);
|
||||
|
||||
if (strlen(FEED_CRYPT_KEY) > 0) {
|
||||
require_once "crypt.php";
|
||||
$auth_pass = substr(encrypt_string($auth_pass), 0, 250);
|
||||
$auth_pass_encrypted = 'true';
|
||||
} else {
|
||||
$auth_pass_encrypted = 'false';
|
||||
}
|
||||
|
||||
if (db_num_rows($result) == 0) {
|
||||
$result = db_query($link,
|
||||
"INSERT INTO ttrss_feeds
|
||||
(owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method)
|
||||
(owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method,auth_pass_encrypted)
|
||||
VALUES ('".$_SESSION["uid"]."', '$url',
|
||||
'[Unknown]', $cat_qpart, '$auth_login', '$auth_pass', 0)");
|
||||
'[Unknown]', $cat_qpart, '$auth_login', '$auth_pass', 0, $auth_pass_encrypted)");
|
||||
|
||||
$result = db_query($link,
|
||||
"SELECT id FROM ttrss_feeds WHERE feed_url = '$url'
|
||||
|
||||
Reference in New Issue
Block a user