From f27de5153111f07ecfa6204baa2b77c93b48a09d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 25 Apr 2007 16:00:08 +0100 Subject: add auth support to subscribe-to-feed dialog --- modules/popup-dialog.php | 13 +++++++++++++ modules/pref-feeds.php | 13 +++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/popup-dialog.php b/modules/popup-dialog.php index b69d36e2f..7eab1bae7 100644 --- a/modules/popup-dialog.php +++ b/modules/popup-dialog.php @@ -72,6 +72,19 @@ print ""; */ print ""; + + print "

+ Click here if this feed requires authentication.
"; + + print "
+ + + +
Login:
Password:
+
"; + print ""; print "
diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php index 61fc2167c..c11ce2aa3 100644 --- a/modules/pref-feeds.php +++ b/modules/pref-feeds.php @@ -425,9 +425,14 @@ if (!WEB_DEMO_MODE) { - $feed_url = db_escape_string(trim($_POST["feed_url"])); - $cat_id = db_escape_string($_POST["cat_id"]); - $p_from = db_escape_string($_POST["from"]); + $feed_url = db_escape_string(trim($_REQUEST["feed_url"])); + $cat_id = db_escape_string($_REQUEST["cat_id"]); + $p_from = db_escape_string($_REQUEST["from"]); + + /* only read authentication information from POST */ + + $auth_login = db_escape_string(trim($_POST["auth_login"])); + $auth_pass = db_escape_string(trim($_POST["auth_pass"])); if ($p_from != 'tt-rss') { print " @@ -442,7 +447,7 @@
"; } - if (subscribe_to_feed($link, $feed_url, $cat_id)) { + if (subscribe_to_feed($link, $feed_url, $cat_id, $auth_login, $auth_pass)) { print_notice(T_sprintf("Subscribed to %s.", $feed_url)); } else { print_warning(T_sprintf("Already subscribed to %s.", $feed_url)); -- cgit v1.2.3