diff options
author | Andrew Dolgov <[email protected]> | 2013-04-13 18:24:27 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-04-13 18:24:41 +0400 |
commit | 044cff2d74ece46256201695346d1a0d1d66c746 (patch) | |
tree | f8c4c039e69bde071b74ca27f35839f0a3a55eb7 /include/functions.php | |
parent | 5b27cb05a8af1bcf741a3885b17fc7d03d456c5f (diff) |
implement basic feed authentication parameter encryption in the database (FEED_CRYPT_KEY)
Diffstat (limited to 'include/functions.php')
-rw-r--r-- | include/functions.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/functions.php b/include/functions.php index f5685b89a..73ed97d08 100644 --- a/include/functions.php +++ b/include/functions.php @@ -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' |