mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-29 12:41:27 +00:00
add auth support to subscribe-to-feed dialog
This commit is contained in:
@@ -72,6 +72,19 @@
|
||||
print "</div></td></tr>"; */
|
||||
|
||||
print "</table>";
|
||||
|
||||
print "<div id='fadd_login_prompt'><br/>
|
||||
<a href='javascript:showBlockElement(\"fadd_login_container\",
|
||||
\"fadd_login_prompt\")'>Click here if this feed requires authentication.</a></div>";
|
||||
|
||||
print "<div id='fadd_login_container'>
|
||||
<table width='100%'>
|
||||
<tr><td>Login:</td><td><input name='auth_login' class='iedit'></td></tr>
|
||||
<tr><td>Password:</td><td><input type='password'
|
||||
name='auth_pass' class='iedit'></td></tr>
|
||||
</table>
|
||||
</div>";
|
||||
|
||||
print "</form>";
|
||||
|
||||
print "<div align='right'>
|
||||
|
||||
@@ -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 "<html>
|
||||
@@ -442,7 +447,7 @@
|
||||
<div class=\"content\">";
|
||||
}
|
||||
|
||||
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 <b>%s</b>.", $feed_url));
|
||||
} else {
|
||||
print_warning(T_sprintf("Already subscribed to <b>%s</b>.", $feed_url));
|
||||
|
||||
Reference in New Issue
Block a user