From: Felix Eckhofer Date: Thu, 5 Oct 2017 21:00:55 +0000 (+0200) Subject: Add checkbox for authentication in edit feed dialog X-Git-Tag: 17.12~122^2 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=cc50affb62fd66028dd18b7c0a451d1310a24489;p=tt-rss.git Add checkbox for authentication in edit feed dialog This makes the UI more consistent with the "add feed" dialog and prevents overzealous password-managers from leaking the login password. --- diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index b0f82e7e..690a158a 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -634,16 +634,8 @@ class Pref_Feeds extends Handler_Protected { ((FORCE_ARTICLE_PURGE == 0) ? "" : 'disabled="1"')); print ""; - print "
".__("Authentication")."
"; - print "
"; $auth_login = htmlspecialchars($this->dbh->fetch_result($result, 0, "auth_login")); - - print "
"; - $auth_pass = $this->dbh->fetch_result($result, 0, "auth_pass"); if ($auth_pass_encrypted && function_exists("mcrypt_decrypt")) { @@ -652,6 +644,18 @@ class Pref_Feeds extends Handler_Protected { } $auth_pass = htmlspecialchars($auth_pass); + $auth_enabled = $auth_login !== '' || $auth_pass !== ''; + + $auth_style = $auth_enabled ? '' : 'display: none'; + print "
"; + print "
".__("Authentication")."
"; + print "
"; + + print "
"; + print "Hint: you need to fill in your login information if your feed requires authentication, except for Twitter feeds.')."
"; - print "
"; + print "
"; + + $auth_checked = $auth_enabled ? 'checked' : ''; + print "
+ +
"; print '
'; @@ -988,6 +999,10 @@ class Pref_Feeds extends Handler_Protected { } if (!$batch) { + if ($_POST["need_auth"] !== 'on') { + $auth_login = ''; + $auth_pass = ''; + } $result = db_query("SELECT feed_url FROM ttrss_feeds WHERE id = " . $feed_id); $orig_feed_url = db_fetch_result($result, 0, "feed_url");