Skip to content

Commit

Permalink
Feed attributes only for admin (FreshRSS#1905)
Browse files Browse the repository at this point in the history
* Feed attributes only for admin

FreshRSS#1838

* Changelog 1905

FreshRSS#1905
  • Loading branch information
Alkarex authored and mdemoss committed Mar 25, 2021
1 parent ab4df09 commit 7ebd995
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* Several per-feed options (implemented in JSON) [#1838](https://github.com/FreshRSS/FreshRSS/pull/1838)
* Mark updated articles as read [#891](https://github.com/FreshRSS/FreshRSS/issues/891)
* Mark as read upon reception [#1702](https://github.com/FreshRSS/FreshRSS/issues/1702)
* Feed cURL timeout
* Ignore SSL (unsafe) [#1811](https://github.com/FreshRSS/FreshRSS/issues/1811)
* Only for admin user [#1905](https://github.com/FreshRSS/FreshRSS/pull/1905)
* Feed cURL timeout
* Ignore SSL (unsafe) [#1811](https://github.com/FreshRSS/FreshRSS/issues/1811)
* Light Boolean search implementation [#879](https://github.com/FreshRSS/FreshRSS/issues/879)
* All parts are implicitly `AND` (which must not be written), except if `OR` is stated.
* No use of parentheses. Support for quotes to disable the Boolean search, like `"This or that"`.
Expand Down
11 changes: 8 additions & 3 deletions app/Controllers/subscriptionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,15 @@ public function feedAction() {

$feed->_attributes('mark_updated_article_unread', Minz_Request::paramTernary('mark_updated_article_unread'));
$feed->_attributes('read_upon_reception', Minz_Request::paramTernary('read_upon_reception'));
$feed->_attributes('ssl_verify', Minz_Request::paramTernary('ssl_verify'));

$timeout = intval(Minz_Request::param('timeout', 0));
$feed->_attributes('timeout', $timeout > 0 ? $timeout : null);
if (FreshRSS_Auth::hasAccess('admin')) {
$feed->_attributes('ssl_verify', Minz_Request::paramTernary('ssl_verify'));
$timeout = intval(Minz_Request::param('timeout', 0));
$feed->_attributes('timeout', $timeout > 0 ? $timeout : null);
} else {
$feed->_attributes('ssl_verify', null);
$feed->_attributes('timeout', null);
}

$values = array(
'name' => Minz_Request::param('name', ''),
Expand Down
2 changes: 2 additions & 0 deletions app/views/helpers/feed/update.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
</div>
</div>

<?php if (FreshRSS_Auth::hasAccess('admin')) { ?>
<div class="form-group">
<label class="group-name" for="timeout"><?php echo _t('sub.feed.timeout'); ?></label>
<div class="group-controls">
Expand All @@ -224,6 +225,7 @@
</label>
</div>
</div>
<?php } ?>

<div class="form-group form-actions">
<div class="group-controls">
Expand Down

0 comments on commit 7ebd995

Please sign in to comment.