From 84c78098d27de624319df37ffb1a522318ec6778 Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Sun, 10 Dec 2017 11:31:19 +0100 Subject: added new extension hook using hook for reading modes in navigation --- app/layout/nav_menu.phtml | 42 ++++++++++++++++++++++++++++++------------ lib/Minz/ExtensionManager.php | 4 ++++ 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index f6d824d55..c0141e8a4 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -131,20 +131,38 @@
diff --git a/app/views/index/global.phtml b/app/views/index/global.phtml index f35732c8f..2f25b6dc2 100644 --- a/app/views/index/global.phtml +++ b/app/views/index/global.phtml @@ -37,7 +37,7 @@ $empty = $feed->nbEntries() === 0 ? ' empty' : ''; $url_base['params']['get'] = 'f_' . $feed->id(); ?> -
  • +
  • ✇ name(); ?>
  • diff --git a/app/views/subscription/index.phtml b/app/views/subscription/index.phtml index 48f760d3e..26af0bd7c 100644 --- a/app/views/subscription/index.phtml +++ b/app/views/subscription/index.phtml @@ -125,7 +125,7 @@ $error = $feed->inError() ? ' error' : ''; $empty = $feed->nbEntries() == 0 ? ' empty' : ''; ?> -
  • diff --git a/p/api/greader.php b/p/api/greader.php index 99304f4ec..72f886190 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -261,8 +261,8 @@ function subscriptionList() { $pdo = new MyPDO(); $stm = $pdo->prepare('SELECT f.id, f.name, f.url, f.website, c.id as c_id, c.name as c_name FROM `%_feed` f - INNER JOIN `%_category` c ON c.id = f.category'); - $stm->execute(); + INNER JOIN `%_category` c ON c.id = f.category AND f.priority >= :priority_normal'); + $stm->execute(array(':priority_normal' => FreshRSS_Feed::PRIORITY_NORMAL)); $res = $stm->fetchAll(PDO::FETCH_ASSOC); $salt = FreshRSS_Context::$system_conf->salt; diff --git a/p/themes/base-theme/template.css b/p/themes/base-theme/template.css index e5e1bca05..72487ca17 100644 --- a/p/themes/base-theme/template.css +++ b/p/themes/base-theme/template.css @@ -71,6 +71,9 @@ img.favicon { width: 16px; vertical-align: middle; } +.feed.mute::before { + content: '🔇'; +} /*=== Videos */ iframe, embed, object, video { -- cgit v1.2.3 From 97d4250bd308175b72785f784d5b15e41ed7b04f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 1 Jan 2018 20:48:33 +0100 Subject: Minor syntax --- app/Models/ReadingMode.php | 2 +- app/layout/nav_menu.phtml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/ReadingMode.php b/app/Models/ReadingMode.php index 06170a468..1e97e228a 100644 --- a/app/Models/ReadingMode.php +++ b/app/Models/ReadingMode.php @@ -107,7 +107,7 @@ class FreshRSS_ReadingMode { public static function getReadingModes() { $actualView = Minz_Request::actionName(); $defaultCtrl = Minz_Request::defaultControllerName(); - $isDefaultCtrl = Minz_Request::controllerName() == $defaultCtrl; + $isDefaultCtrl = Minz_Request::controllerName() === $defaultCtrl; $urlOutput = Minz_Request::currentRequest(); $readingModes = array( diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 403ac5cd6..a018a7185 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -136,7 +136,7 @@ $readingModes = Minz_ExtensionManager::callHook('nav_reading_modes', $readingModes); /** @var FreshRSS_ReadingMode $mode */ - foreach($readingModes as $mode) { + foreach ($readingModes as $mode) { ?> getName(); ?> -- cgit v1.2.3 From 24860750e30b65bfb40baf5e1e8b01aa3f8411f9 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 1 Jan 2018 21:24:38 +0100 Subject: Changelog 1739, 1745, 1750, 1755 https://github.com/FreshRSS/FreshRSS/pull/1739 https://github.com/FreshRSS/FreshRSS/pull/1745 https://github.com/FreshRSS/FreshRSS/pull/1750 https://github.com/FreshRSS/FreshRSS/pull/1755 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9125f1869..da23e3b61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ ## 2018-XX-XX FreshRSS 1.9.1-dev +* Features + * Ability to pause feeds, and to hide them from categories [#1750](https://github.com/FreshRSS/FreshRSS/pull/1750) +* UI + * Add shortcuts to switch views [#1755](https://github.com/FreshRSS/FreshRSS/pull/1755) +* Bug fixing + * Fix warning in PHP 7.2 [#1739](https://github.com/FreshRSS/FreshRSS/pull/1739) +* Misc. + * More sites in `force-https.default.txt` [#1745](https://github.com/FreshRSS/FreshRSS/pull/1745) ## 2017-12-17 FreshRSS 1.9.0 -- cgit v1.2.3 From ebe7be4e6b41a115688bc52350470e7f64f949f7 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 1 Jan 2018 22:11:15 +0100 Subject: Fix login bug when HTTP REMOTE_USER changes https://github.com/YunoHost-Apps/freshrss_ynh/issues/33 --- app/Models/Auth.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/Models/Auth.php b/app/Models/Auth.php index 4de058999..32b673b6d 100644 --- a/app/Models/Auth.php +++ b/app/Models/Auth.php @@ -13,6 +13,11 @@ class FreshRSS_Auth { * This method initializes authentication system. */ public static function init() { + if (Minz_Session::param('REMOTE_USER', '') !== httpAuthUser()) { + //HTTP REMOTE_USER has changed + self::removeAccess(); + } + self::$login_ok = Minz_Session::param('loginOk', false); $current_user = Minz_Session::param('currentUser', ''); if ($current_user === '') { @@ -58,6 +63,7 @@ class FreshRSS_Auth { $login_ok = $current_user != ''; if ($login_ok) { Minz_Session::_param('currentUser', $current_user); + Minz_Session::_param('REMOTE_USER', $current_user); } return $login_ok; case 'none': -- cgit v1.2.3 From 73b8fdc1cb172ab81261cad6cf6106e077ab8cdd Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 1 Jan 2018 22:32:53 +0100 Subject: Changelog 1756 https://github.com/FreshRSS/FreshRSS/pull/1756 https://github.com/YunoHost-Apps/freshrss_ynh/issues/33 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da23e3b61..05bb25337 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * UI * Add shortcuts to switch views [#1755](https://github.com/FreshRSS/FreshRSS/pull/1755) * Bug fixing + * Fix login bug when HTTP `REMOTE_USER` changes (used by YunoHost) [#1756](https://github.com/FreshRSS/FreshRSS/pull/1756) * Fix warning in PHP 7.2 [#1739](https://github.com/FreshRSS/FreshRSS/pull/1739) * Misc. * More sites in `force-https.default.txt` [#1745](https://github.com/FreshRSS/FreshRSS/pull/1745) -- cgit v1.2.3 From db959a1a449954c6bea1127dc591bf53bf4e25ce Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Tue, 2 Jan 2018 19:49:38 +0100 Subject: Fix shortcuts triggering view switching --- p/scripts/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/p/scripts/main.js b/p/scripts/main.js index 26b542179..fb01461c6 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -705,25 +705,25 @@ function init_shortcuts() { }); shortcut.add(shortcuts.normal_view, function () { - $('#nav_menu_views .view_normal').get(0).click(); + $('#nav_menu_views a').get(0).click(); }, { 'disable_in_input': true }); shortcut.add(shortcuts.global_view, function () { - $('#nav_menu_views .view_global').get(0).click(); + $('#nav_menu_views a').get(1).click(); }, { 'disable_in_input': true }); shortcut.add(shortcuts.reading_view, function () { - $('#nav_menu_views .view_reader').get(0).click(); + $('#nav_menu_views a').get(2).click(); }, { 'disable_in_input': true }); shortcut.add(shortcuts.rss_view, function () { - $('#nav_menu_views .view_rss').get(0).click(); + $('#nav_menu_views a').get(-1).click(); }, { 'disable_in_input': true }); -- cgit v1.2.3 From 7642d334f827d1c077bb1444dfc4e79acf022891 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Tue, 2 Jan 2018 23:53:35 +0100 Subject: Replace "keep history" magic value by a constant (#1759) I think the use of a magic value repeated many times in the code is prone to have some errors made by people not knowing its meaning. Using a constant is a bit more safe. Judging by some comments in the code, I am not the only one. --- app/Controllers/entryController.php | 4 +--- app/Controllers/feedController.php | 6 ++---- app/Controllers/subscriptionController.php | 2 +- app/Models/ConfigurationSetter.php | 4 ++-- app/Models/Feed.php | 7 +++++-- app/Models/FeedDAO.php | 5 +++-- app/views/configure/archiving.phtml | 4 ++-- app/views/helpers/feed/update.phtml | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php index bd8b65b2b..9c6b248a9 100755 --- a/app/Controllers/entryController.php +++ b/app/Controllers/entryController.php @@ -177,9 +177,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController { foreach ($feeds as $feed) { $feed_history = $feed->keepHistory(); - if ($feed_history == -2) { - // TODO: -2 must be a constant! - // -2 means we take the default value from configuration + if (FreshRSS_Feed::KEEP_HISTORY_DEFAULT === $feed_history) { $feed_history = FreshRSS_Context::$user_conf->keep_history_default; } diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 2793577d5..884172112 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -317,10 +317,8 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feed_history = $feed->keepHistory(); if ($isNewFeed) { - $feed_history = -1; //∞ - } elseif ($feed_history == -2) { - // TODO: -2 must be a constant! - // -2 means we take the default value from configuration + $feed_history = FreshRSS_Feed::KEEP_HISTORY_INFINITE; + } elseif (FreshRSS_Feed::KEEP_HISTORY_DEFAULT === $feed_history) { $feed_history = FreshRSS_Context::$user_conf->keep_history_default; } $needFeedCacheRefresh = false; diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index b3f3df46e..37efd3b57 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -104,7 +104,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController { 'pathEntries' => Minz_Request::param('path_entries', ''), 'priority' => intval(Minz_Request::param('priority', FreshRSS_Feed::PRIORITY_MAIN_STREAM)), 'httpAuth' => $httpAuth, - 'keep_history' => intval(Minz_Request::param('keep_history', -2)), + 'keep_history' => intval(Minz_Request::param('keep_history', FreshRSS_Feed::KEEP_HISTORY_DEFAULT)), 'ttl' => $ttl * ($mute ? -1 : 1), ); diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index ca4709903..645ef644e 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -81,7 +81,7 @@ class FreshRSS_ConfigurationSetter { private function _keep_history_default(&$data, $value) { $value = intval($value); - $data['keep_history_default'] = $value >= -1 ? $value : 0; + $data['keep_history_default'] = $value >= FreshRSS_Feed::KEEP_HISTORY_INFINITE ? $value : 0; } // It works for system config too! @@ -154,7 +154,7 @@ class FreshRSS_ConfigurationSetter { private function _ttl_default(&$data, $value) { $value = intval($value); - $data['ttl_default'] = $value >= -1 ? $value : 3600; + $data['ttl_default'] = $value > FreshRSS_Feed::TTL_DEFAULT ? $value : 3600; } private function _view_mode(&$data, $value) { diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 216a26d44..13ab13df9 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -7,6 +7,9 @@ class FreshRSS_Feed extends Minz_Model { const TTL_DEFAULT = 0; + const KEEP_HISTORY_DEFAULT = -2; + const KEEP_HISTORY_INFINITE = -1; + private $id = 0; private $url; private $category = 1; @@ -21,7 +24,7 @@ class FreshRSS_Feed extends Minz_Model { private $pathEntries = ''; private $httpAuth = ''; private $error = false; - private $keep_history = -2; + private $keep_history = self::KEEP_HISTORY_DEFAULT; private $ttl = self::TTL_DEFAULT; private $mute = false; private $hash = null; @@ -222,7 +225,7 @@ class FreshRSS_Feed extends Minz_Model { public function _keepHistory($value) { $value = intval($value); $value = min($value, 1000000); - $value = max($value, -2); + $value = max($value, self::KEEP_HISTORY_DEFAULT); $this->keep_history = $value; } public function _ttl($value) { diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index deda02c63..011b3d112 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -18,7 +18,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { ttl ) VALUES - (?, ?, ?, ?, ?, ?, 10, ?, 0, -2, ?)'; + (?, ?, ?, ?, ?, ?, 10, ?, 0, ?, ?)'; $stm = $this->bd->prepare($sql); $valuesTmp['url'] = safe_ascii($valuesTmp['url']); @@ -32,6 +32,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { substr($valuesTmp['description'], 0, 1023), $valuesTmp['lastUpdate'], base64_encode($valuesTmp['httpAuth']), + FreshRSS_Feed::KEEP_HISTORY_DEFAULT, FreshRSS_Feed::TTL_DEFAULT, ); @@ -406,7 +407,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo implements FreshRSS_Searchable { $myFeed->_pathEntries(isset($dao['pathEntries']) ? $dao['pathEntries'] : ''); $myFeed->_httpAuth(isset($dao['httpAuth']) ? base64_decode($dao['httpAuth']) : ''); $myFeed->_error(isset($dao['error']) ? $dao['error'] : 0); - $myFeed->_keepHistory(isset($dao['keep_history']) ? $dao['keep_history'] : -2); + $myFeed->_keepHistory(isset($dao['keep_history']) ? $dao['keep_history'] : FreshRSS_Feed::KEEP_HISTORY_DEFAULT); $myFeed->_ttl(isset($dao['ttl']) ? $dao['ttl'] : FreshRSS_Feed::TTL_DEFAULT); $myFeed->_nbNotRead(isset($dao['cache_nbUnreads']) ? $dao['cache_nbUnreads'] : 0); $myFeed->_nbEntries(isset($dao['cache_nbEntries']) ? $dao['cache_nbEntries'] : 0); diff --git a/app/views/configure/archiving.phtml b/app/views/configure/archiving.phtml index 2254f5dba..09be55fd9 100644 --- a/app/views/configure/archiving.phtml +++ b/app/views/configure/archiving.phtml @@ -19,7 +19,7 @@
    () @@ -34,7 +34,7 @@ 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h', 36000 => '10h', 43200 => '12h', 64800 => '18h', 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d', - 604800 => '1wk', -1 => '∞') as $v => $t) { + 604800 => '1wk') as $v => $t) { echo ''; if (FreshRSS_Context::$user_conf->ttl_default == $v) { $found = true; diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index 595309f49..d379c5df8 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -101,7 +101,7 @@
    -- cgit v1.2.3 From a14c160beb360ffb00f255621030c77878f6c8a1 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Thu, 11 Jan 2018 19:18:29 +0100 Subject: Update travis config (#1751) I've enabled tests on PHP 7.2 since it's the latest stable version. I've also installed phpcs from composer since PEAR is not available for all versions of PHP. --- .travis.yml | 19 +++++++------------ app/Controllers/extensionController.php | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7bfefd8ce..0217b61c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,18 +5,20 @@ php: - '5.6' - '7.0' - '7.1' + - '7.2' - hhvm - nightly install: # newest version without https://github.com/squizlabs/PHP_CodeSniffer/pull/1404 - - pear install PHP_CodeSniffer-3.0.0RC4 + - composer global require squizlabs/php_codesniffer "<=3.0.0RC4" script: - phpenv rehash - | if [[ $VALIDATE_STANDARD == yes ]]; then - phpcs . --standard=phpcs.xml --warning-severity=0 --extensions=php -p + COMPOSER_BIN=$(composer global config --absolute bin-dir) + $COMPOSER_BIN/phpcs . --standard=phpcs.xml --warning-severity=0 --extensions=php -p fi - | if [[ $CHECK_TRANSLATION == yes ]]; then @@ -29,18 +31,11 @@ env: matrix: fast_finish: true include: + # PHP 5.3 only runs on Ubuntu 12.04 (precise), not 14.04 (trusty) - php: "5.3" dist: precise - - php: "7.1" + - php: "7.2" env: CHECK_TRANSLATION=yes VALIDATE_STANDARD=no allow_failures: - # PHP 5.3 only runs on Ubuntu 12.04 (precise), not 14.04 (trusty) - - php: "5.3" - dist: precise - - php: "5.4" - - php: "5.5" - - php: "5.6" - - php: "7.0" - - php: hhvm - - php: nightly - env: CHECK_TRANSLATION=yes VALIDATE_STANDARD=no + - dist: precise diff --git a/app/Controllers/extensionController.php b/app/Controllers/extensionController.php index bb846e921..311fd2e96 100644 --- a/app/Controllers/extensionController.php +++ b/app/Controllers/extensionController.php @@ -240,7 +240,7 @@ class FreshRSS_extension_Controller extends Minz_ActionController { $res = recursive_unlink($ext->getPath()); if ($res) { Minz_Request::good(_t('feedback.extensions.removed', $ext_name), - $url_redirect); + $url_redirect); } else { Minz_Request::bad(_t('feedback.extensions.cannot_delete', $ext_name), $url_redirect); -- cgit v1.2.3 From eb814e682bdb932f71529f4d36644c9bb0c6474e Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Thu, 11 Jan 2018 22:41:44 +0100 Subject: Allow favorite in reading mode (#1761) I've got the inspiration from the mark as read action. So I've used the id of the feed to trigger the action and not the url in the link. This way, it works all the time. It works in reading mode, it works in normal mode when icon are not displayed. See #1545 --- app/views/index/reader.phtml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml index f2af75af0..eb6613b28 100644 --- a/app/views/index/reader.phtml +++ b/app/views/index/reader.phtml @@ -18,11 +18,25 @@ if (!empty($this->entries)) { categories, $item->feed()); //We most likely already have the feed object in cache if (empty($feed)) $feed = $item->feed(true); + $favoriteUrl = array('c' => 'entry', 'a' => 'bookmark', 'params' => array('id' => $item->id())); + if ($item->isFavorite()) { + $favoriteUrl['params']['is_favorite'] = 0; + } + $readUrl = array('c' => 'entry', 'a' => 'read', 'params' => array('id' => $item->id())); + if ($item->isRead()) { + $readUrl['params']['is_read'] = 0; + } ?> - + + isRead() ? 'read' : 'unread'); ?> + + + isFavorite() ? 'starred' : 'non-starred'); ?> + + ✇ name(); ?> -

    title(); ?>

    +

    title(); ?>

    author(); -- cgit v1.2.3 From fcfdb30fddab23da09c73b3d667f95e5dece45bf Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 13 Jan 2018 21:24:01 +0100 Subject: Update translations to reflect the real action of buttons (#1766) See #1574 --- app/i18n/en/index.php | 8 ++++---- app/i18n/fr/index.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/i18n/en/index.php b/app/i18n/en/index.php index a4686de4e..29dccc9ed 100644 --- a/app/i18n/en/index.php +++ b/app/i18n/en/index.php @@ -41,18 +41,18 @@ return array( 'mark_cat_read' => 'Mark category as read', 'mark_feed_read' => 'Mark feed as read', 'newer_first' => 'Newer first', - 'non-starred' => 'Show all but favourites', + 'non-starred' => 'Show non-favourites', 'normal_view' => 'Normal view', 'older_first' => 'Oldest first', 'queries' => 'User queries', - 'read' => 'Show only read', + 'read' => 'Show read', 'reader_view' => 'Reading view', 'rss_view' => 'RSS feed', 'search_short' => 'Search', - 'starred' => 'Show only favourites', + 'starred' => 'Show favourites', 'stats' => 'Statistics', 'subscription' => 'Subscriptions management', - 'unread' => 'Show only unread', + 'unread' => 'Show unread', ), 'share' => 'Share', 'tag' => array( diff --git a/app/i18n/fr/index.php b/app/i18n/fr/index.php index 62eedc280..0a3a4abb3 100644 --- a/app/i18n/fr/index.php +++ b/app/i18n/fr/index.php @@ -41,7 +41,7 @@ return array( 'mark_cat_read' => 'Marquer la catégorie comme lue', 'mark_feed_read' => 'Marquer le flux comme lu', 'newer_first' => 'Plus récents en premier', - 'non-starred' => 'Afficher tout sauf les favoris', + 'non-starred' => 'Afficher les non-favoris', 'normal_view' => 'Vue normale', 'older_first' => 'Plus anciens en premier', 'queries' => 'Filtres utilisateurs', -- cgit v1.2.3 From b285a83c6561cc50f53af3f854c34c0d7fba3ebe Mon Sep 17 00:00:00 2001 From: hoilc Date: Wed, 17 Jan 2018 00:41:49 +0800 Subject: [i18n] Add ignore/zh-cn and update simplified Chinese translation (#1769) * update Simplified Chinese translation * update the description of buttons #1766 * trim space to pass PHPCS --- app/i18n/zh-cn/admin.php | 14 +++++++------- app/i18n/zh-cn/conf.php | 10 +++++----- app/i18n/zh-cn/gen.php | 28 ++++++++++++++-------------- app/i18n/zh-cn/index.php | 8 ++++---- app/i18n/zh-cn/sub.php | 8 ++++---- cli/i18n/ignore/zh-cn.php | 41 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 75 insertions(+), 34 deletions(-) create mode 100644 cli/i18n/ignore/zh-cn.php diff --git a/app/i18n/zh-cn/admin.php b/app/i18n/zh-cn/admin.php index ca18bf63d..0e31ed12e 100644 --- a/app/i18n/zh-cn/admin.php +++ b/app/i18n/zh-cn/admin.php @@ -112,13 +112,13 @@ return array( ), 'title' => '扩展', 'user' => '用户扩展', - 'community' => 'Available community extensions', // @todo translate - 'name' => 'Name', // @todo translate - 'version' => 'Version', // @todo translate - 'description' => 'Description', // @todo translate - 'author' => 'Author', // @todo translate - 'latest' => 'Installed', // @todo translate - 'update' => 'Update available', // @todo translate + 'community' => '可用的社区扩展', + 'name' => '名称', + 'version' => '版本', + 'description' => '描述', + 'author' => '作者', + 'latest' => '已安装', + 'update' => '更新可用', ), 'stats' => array( '_' => '统计', diff --git a/app/i18n/zh-cn/conf.php b/app/i18n/zh-cn/conf.php index d63ff7d92..599f42234 100644 --- a/app/i18n/zh-cn/conf.php +++ b/app/i18n/zh-cn/conf.php @@ -148,7 +148,7 @@ return array( 'collapse_article' => '收起文章', 'first_article' => '跳转到第一篇文章', 'focus_search' => '聚焦到搜索框', - 'global_view' => 'Switch to global view', // TODO + 'global_view' => '切换到全屏视图', 'help' => '显示帮助文档', 'javascript' => '若要使用快捷键,必须启用 JavaScript', 'last_article' => '跳转到最后一篇文章', @@ -158,17 +158,17 @@ return array( 'navigation' => '浏览', 'navigation_help' => '搭配 "Shift" 键,浏览快捷键将生效于 RSS 源。
    搭配 "Alt" 键,浏览快捷键将生效于分类。', 'next_article' => '跳转到下一篇文章', - 'normal_view' => 'Switch to normal view', // TODO + 'normal_view' => '切换到普通视图', 'other_action' => '其他操作', 'previous_article' => '跳转到上一篇文章', - 'reading_view' => 'Switch to reading view', // TODO - 'rss_view' => 'Open RSS view in a new tab', // TODO + 'reading_view' => '切换到阅读视图', + 'rss_view' => '在新标签中打开 RSS 视图', 'see_on_website' => '在原网站上查看', 'shift_for_all_read' => '+ shift 可以将全部文章设为已读', 'title' => '快捷键', 'user_filter' => '显示自定义查询', 'user_filter_help' => '如果有多个自定义过滤器,则会按照它们的编号依次访问。', - 'views' => 'Views', // TODO + 'views' => '视图', ), 'user' => array( 'articles_and_size' => '%s 篇文章 (%s)', diff --git a/app/i18n/zh-cn/gen.php b/app/i18n/zh-cn/gen.php index caaa388c7..17f30f001 100644 --- a/app/i18n/zh-cn/gen.php +++ b/app/i18n/zh-cn/gen.php @@ -42,18 +42,18 @@ return array( ), ), 'date' => array( - 'Apr' => '\\A\\p\\r\\i\\l', - 'Aug' => '\\A\\u\\g\\u\\s\\t', - 'Dec' => '\\D\\e\\c\\e\\m\\b\\e\\r', - 'Feb' => '\\F\\e\\b\\r\\u\\a\\r\\y', - 'Jan' => '\\J\\a\\n\\u\\a\\r\\y', - 'Jul' => '\\J\\u\\l\\y', - 'Jun' => '\\J\\u\\n\\e', - 'Mar' => '\\M\\a\\r\\c\\h', - 'May' => '\\M\\a\\y', - 'Nov' => '\\N\\o\\v\\e\\m\\b\\e\\r', - 'Oct' => '\\O\\c\\t\\o\\b\\e\\r', - 'Sep' => '\\S\\e\\p\\t\\e\\m\\b\\e\\r', + 'Apr' => '\\四\\月', + 'Aug' => '\\八\\月', + 'Dec' => '\\十\\二\\月', + 'Feb' => '\\二\\月', + 'Jan' => '\\一\\月', + 'Jul' => '\\七\\月', + 'Jun' => '\\六\\月', + 'Mar' => '\\三\\月', + 'May' => '\\五\\月', + 'Nov' => '\\十\\一\\月', + 'Oct' => '\\十\\月', + 'Sep' => '\\九\\月', 'apr' => '四月', 'april' => '四月', 'aug' => '八月', @@ -159,7 +159,7 @@ return array( 'previous' => '上一页', ), 'share' => array( - 'Known' => 'Known based sites', + 'Known' => '基于 Known 的站点', 'blogotext' => 'Blogotext', 'diaspora' => 'Diaspora*', 'email' => 'Email', @@ -169,7 +169,7 @@ return array( 'jdh' => 'Journal du hacker', 'mastodon' => 'Mastodon', 'movim' => 'Movim', - 'print' => 'Print', + 'print' => '打印', 'shaarli' => 'Shaarli', 'twitter' => 'Twitter', 'wallabag' => 'wallabag v1', diff --git a/app/i18n/zh-cn/index.php b/app/i18n/zh-cn/index.php index 0d6e8e82d..6729524f5 100644 --- a/app/i18n/zh-cn/index.php +++ b/app/i18n/zh-cn/index.php @@ -41,18 +41,18 @@ return array( 'mark_cat_read' => '此分类设为已读', 'mark_feed_read' => '此源设为已读', 'newer_first' => '由新到旧', - 'non-starred' => '不显示收藏', + 'non-starred' => '显示未收藏', 'normal_view' => '普通视图', 'older_first' => '由旧到新', 'queries' => '自定义查询', - 'read' => '只显示已读', + 'read' => '显示已读', 'reader_view' => '阅读视图', 'rss_view' => 'RSS 源', 'search_short' => '搜索', - 'starred' => '只显示收藏', + 'starred' => '显示收藏', 'stats' => '统计', 'subscription' => '订阅管理', - 'unread' => '只显示未读', + 'unread' => '显示未读', ), 'share' => '分享', 'tag' => array( diff --git a/app/i18n/zh-cn/sub.php b/app/i18n/zh-cn/sub.php index c25875b41..bf73f82c4 100644 --- a/app/i18n/zh-cn/sub.php +++ b/app/i18n/zh-cn/sub.php @@ -35,14 +35,14 @@ return array( 'informations' => '信息', 'keep_history' => '至少保存的文章数', 'moved_category_deleted' => '删除分类时,其中的 RSS 源会自动归类到 %s', - 'mute' => 'mute', // TODO + 'mute' => '暂停', 'no_selected' => '未选择 RSS 源。', 'number_entries' => '%d 篇文章', 'priority' => array( - '_' => 'Visibility', // TODO - 'archived' => 'Do not show (archived)', // TODO + '_' => '可见性', + 'archived' => '不显示 (存档)', 'main_stream' => '在首页中显示', - 'normal' => 'Show in its category', // TODO + 'normal' => '在分类中显示', ), 'stats' => '统计', 'think_to_add' => '你可以添加一些 RSS 源。', diff --git a/cli/i18n/ignore/zh-cn.php b/cli/i18n/ignore/zh-cn.php new file mode 100644 index 000000000..c00ac79d3 --- /dev/null +++ b/cli/i18n/ignore/zh-cn.php @@ -0,0 +1,41 @@ + Date: Mon, 22 Jan 2018 15:12:44 +0100 Subject: [fix] Login: HTTP Auth when internal redirects occur (#1772) When Apache performs an internal redirect, it stores the username in the REDIRECT_REMOTE_USER variable instead of REMOTE_USER, breaking HTTP authentication. For more information, see this Stack Overflow discussion: This commit first tries REMOTE_USER, as before. If it is not set, it checks whether REDIRECT_REMOTE_USER is set. --- lib/lib_rss.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/lib_rss.php b/lib/lib_rss.php index e9c4da049..215c4c362 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -364,7 +364,15 @@ function get_user_configuration($username) { function httpAuthUser() { - return isset($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'] : ''; + if (isset($_SERVER['REMOTE_USER'])) { + return $_SERVER['REMOTE_USER']; + } + + if (isset($_SERVER['REDIRECT_REMOTE_USER'])) { + return $_SERVER['REDIRECT_REMOTE_USER']; + } + + return ''; } function cryptAvailable() { -- cgit v1.2.3 From 047fa17aeb65dfb6b551bf73e610057e8d78142c Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Wed, 24 Jan 2018 19:37:24 +0100 Subject: fixed css classes for reading mode buttons #1714 --- app/Models/ReadingMode.php | 24 ++++++++++++++++++------ app/layout/nav_menu.phtml | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/Models/ReadingMode.php b/app/Models/ReadingMode.php index 1e97e228a..06af1704c 100644 --- a/app/Models/ReadingMode.php +++ b/app/Models/ReadingMode.php @@ -5,6 +5,10 @@ */ class FreshRSS_ReadingMode { + /** + * @var string + */ + protected $id; /** * @var string */ @@ -24,18 +28,26 @@ class FreshRSS_ReadingMode { /** * ReadingMode constructor. - * @param string $name + * @param string $id * @param string $title * @param string[] $urlParams * @param bool $active */ - public function __construct($name, $title, $urlParams, $active) { - $this->name = $name; + public function __construct($id, $title, $urlParams, $active) { + $this->id = $id; + $this->name = _i($id); $this->title = $title; $this->urlParams = $urlParams; $this->isActive = $active; } + /** + * @return string + */ + public function getId() { + return $this->id; + } + /** * @return string */ @@ -112,19 +124,19 @@ class FreshRSS_ReadingMode { $readingModes = array( new FreshRSS_ReadingMode( - _i("view-normal"), + "view-normal", _t('index.menu.normal_view'), array_merge($urlOutput, array('c' => $defaultCtrl, 'a' => 'normal')), ($isDefaultCtrl && $actualView === 'normal') ), new FreshRSS_ReadingMode( - _i("view-global"), + "view-global", _t('index.menu.global_view'), array_merge($urlOutput, array('c' => $defaultCtrl, 'a' => 'global')), ($isDefaultCtrl && $actualView === 'global') ), new FreshRSS_ReadingMode( - _i("view-reader"), + "view-reader", _t('index.menu.reader_view'), array_merge($urlOutput, array('c' => $defaultCtrl, 'a' => 'reader')), ($isDefaultCtrl && $actualView === 'reader') diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 7632b944c..e9128d44a 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -138,7 +138,7 @@ /** @var FreshRSS_ReadingMode $mode */ foreach ($readingModes as $mode) { ?> - + getName(); ?> Date: Fri, 26 Jan 2018 08:17:32 +0100 Subject: Fix shortcuts for view switching I've introduced shortcuts to switch between view in #1755. They have been broken by #1714. Then I've made an ugly fix in #1758. This change revert all changes to have something better. See #1757 --- app/layout/nav_menu.phtml | 2 +- p/scripts/main.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index e9128d44a..ab82c723f 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -155,7 +155,7 @@ $url_output['params']['hours'] = FreshRSS_Context::$user_conf->since_hours_posts_per_rss; } ?> - +
    diff --git a/p/scripts/main.js b/p/scripts/main.js index fb01461c6..f8d20767a 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -705,25 +705,25 @@ function init_shortcuts() { }); shortcut.add(shortcuts.normal_view, function () { - $('#nav_menu_views a').get(0).click(); + $('#nav_menu_views .view-normal').get(0).click(); }, { 'disable_in_input': true }); shortcut.add(shortcuts.global_view, function () { - $('#nav_menu_views a').get(1).click(); + $('#nav_menu_views .view-global').get(0).click(); }, { 'disable_in_input': true }); shortcut.add(shortcuts.reading_view, function () { - $('#nav_menu_views a').get(2).click(); + $('#nav_menu_views .view-reader').get(0).click(); }, { 'disable_in_input': true }); shortcut.add(shortcuts.rss_view, function () { - $('#nav_menu_views a').get(-1).click(); + $('#nav_menu_views .view-rss').get(0).click(); }, { 'disable_in_input': true }); -- cgit v1.2.3 From c4bb2b74f7f6e9e38d383fbc141173d46ce05058 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 26 Jan 2018 10:19:58 +0100 Subject: Changelog and credits https://github.com/FreshRSS/FreshRSS/issues/603 https://github.com/FreshRSS/FreshRSS/issues/1400 https://github.com/FreshRSS/FreshRSS/issues/1545 https://github.com/FreshRSS/FreshRSS/pull/1714 https://github.com/FreshRSS/FreshRSS/pull/1769 https://github.com/FreshRSS/FreshRSS/pull/1772 --- CHANGELOG.md | 7 +++++++ CREDITS.md | 1 + 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05bb25337..5ed835205 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,18 @@ * Features * Ability to pause feeds, and to hide them from categories [#1750](https://github.com/FreshRSS/FreshRSS/pull/1750) +* Security + * Allow HTTP Auth login with `REDIRECT_REMOTE_USER` when using Apache internal redirect [#1772](https://github.com/FreshRSS/FreshRSS/pull/1772) * UI + * New icons for marking as favourite and marking as read in the Reading View [#603](https://github.com/FreshRSS/FreshRSS/issues/603) * Add shortcuts to switch views [#1755](https://github.com/FreshRSS/FreshRSS/pull/1755) * Bug fixing * Fix login bug when HTTP `REMOTE_USER` changes (used by YunoHost) [#1756](https://github.com/FreshRSS/FreshRSS/pull/1756) * Fix warning in PHP 7.2 [#1739](https://github.com/FreshRSS/FreshRSS/pull/1739) +* Extensions + * Allow extensions to define their own reading view [#1714](https://github.com/FreshRSS/FreshRSS/pull/1714) +* I18n + * Updated Chinese [#1769](https://github.com/FreshRSS/FreshRSS/pull/1769) * Misc. * More sites in `force-https.default.txt` [#1745](https://github.com/FreshRSS/FreshRSS/pull/1745) diff --git a/CREDITS.md b/CREDITS.md index 2b3536ecc..54a7f4fab 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -37,6 +37,7 @@ People are sorted by name so please keep this order. * [Marien Fressinaud](https://github.com/marienfressinaud): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=marienfressinaud), [Web](https://marienfressinaud.fr/) * [Melvyn Laïly](https://github.com/yaurthek): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=yaurthek), [Web](http://x2a.yt/) * [MSZ](https://github.com/mszkb): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=mszkb) +* [Nico B](https://github.com/youknow0): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:youknow0) * [Nicolas Elie](https://github.com/nicolaselie): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=nicolaselie) * [Nicolas Lœuillet](https://github.com/nicosomb): [contributions](https://github.com/FreshRSS/documentation/commits?author=nicosomb), [Web](http://www.loeuillet.org/) * [Nicola Spanti](https://github.com/RyDroid): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:RyDroid), [Web](http://www.nicola-spanti.info/) -- cgit v1.2.3 From fb541b1bacb198be7ccac9341415facb91b7dc81 Mon Sep 17 00:00:00 2001 From: Seokseong Jeon Date: Wed, 31 Jan 2018 18:06:45 +0900 Subject: [i18n] Translated to Korean (#1776) --- app/i18n/kr/admin.php | 14 +++++++------- app/i18n/kr/conf.php | 10 +++++----- app/i18n/kr/feedback.php | 2 +- app/i18n/kr/sub.php | 14 +++++++------- cli/i18n/ignore/kr.php | 40 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 60 insertions(+), 20 deletions(-) create mode 100644 cli/i18n/ignore/kr.php diff --git a/app/i18n/kr/admin.php b/app/i18n/kr/admin.php index 9781fb640..c34007ca9 100644 --- a/app/i18n/kr/admin.php +++ b/app/i18n/kr/admin.php @@ -112,13 +112,13 @@ return array( ), 'title' => '확장 기능', 'user' => '사용자 확장 기능', - 'community' => 'Available community extensions', // @todo translate - 'name' => 'Name', // @todo translate - 'version' => 'Version', // @todo translate - 'description' => 'Description', // @todo translate - 'author' => 'Author', // @todo translate - 'latest' => 'Installed', // @todo translate - 'update' => 'Update available', // @todo translate + 'community' => '사용 가능한 커뮤니티 확장 기능들', + 'name' => '이름', + 'version' => '버전', + 'description' => '설명', + 'author' => '제작자', + 'latest' => '설치됨', + 'update' => '업데이트 있음', ), 'stats' => array( '_' => '통계', diff --git a/app/i18n/kr/conf.php b/app/i18n/kr/conf.php index e36079a87..dbd902062 100644 --- a/app/i18n/kr/conf.php +++ b/app/i18n/kr/conf.php @@ -148,7 +148,7 @@ return array( 'collapse_article' => '접기', 'first_article' => '첫 글 보기', 'focus_search' => '검색창 사용하기', - 'global_view' => 'Switch to global view', // TODO + 'global_view' => '전체 모드로 전환', 'help' => '도움말 보기', 'javascript' => '단축키를 사용하기 위해선 자바스크립트를 사용하도록 설정하여야 합니다', 'last_article' => '마지막 글 보기', @@ -158,17 +158,17 @@ return array( 'navigation' => '탐색', 'navigation_help' => '"Shift" 키를 누른 상태에선 탐색 단축키가 피드에 적용됩니다.
    "Alt" 키를 누른 상태에선 탐색 단축키가 카테고리에 적용됩니다.', 'next_article' => '다음 글 보기', - 'normal_view' => 'Switch to normal view', // TODO + 'normal_view' => '일반 모드로 전환', 'other_action' => '다른 동작', 'previous_article' => '이전 글 보기', - 'reading_view' => 'Switch to reading view', // TODO - 'rss_view' => 'Open RSS view in a new tab', // TODO + 'reading_view' => '읽기 모드로 전환', + 'rss_view' => '새 탭에서 RSS 피드 열기', 'see_on_website' => '글이 게재된 웹사이트에서 보기', 'shift_for_all_read' => '+ shift를 누른 상태에선 모두 읽음으로 표시', 'title' => '단축키', 'user_filter' => '사용자 필터 사용하기', 'user_filter_help' => '사용자 필터가 하나만 설정되어 있다면 해당 필터를 사용하고, 그렇지 않다면 필터를 번호로 선택할 수 있습니다.', - 'views' => 'Views', // TODO + 'views' => '표시', ), 'user' => array( 'articles_and_size' => '%s 개의 글 (%s)', diff --git a/app/i18n/kr/feedback.php b/app/i18n/kr/feedback.php index a70923761..6e13e7a10 100644 --- a/app/i18n/kr/feedback.php +++ b/app/i18n/kr/feedback.php @@ -51,7 +51,7 @@ return array( 'zip_error' => 'ZIP 파일을 불러오는 동안 문제가 발생했습니다.', ), 'sub' => array( - 'actualize' => 'Updating', + 'actualize' => '피드를 가져오는 중입니다', 'category' => array( 'created' => '%s 카테고리가 생성되었습니다.', 'deleted' => '카테고리가 삭제되었습니다.', diff --git a/app/i18n/kr/sub.php b/app/i18n/kr/sub.php index d290dd635..e11d4588f 100644 --- a/app/i18n/kr/sub.php +++ b/app/i18n/kr/sub.php @@ -2,8 +2,8 @@ return array( 'api' => array( - 'documentation' => 'Copy the following URL to use it within an external tool.',// TODO - 'title' => 'API',// TODO + 'documentation' => '외부 도구에서 API를 사용하기 위해서 아래 URL을 사용하세요.', + 'title' => 'API', ), 'bookmarklet' => array( 'documentation' => '이 버튼을 즐겨찾기 막대로 끌어다 놓거나 마우스 오른쪽 클릭으로 나타나는 메뉴에서 "이 링크를 즐겨찾기에 추가"를 선택하세요. 그리고 피드를 구독하길 원하는 페이지에서 "구독하기" 버튼을 클릭하세요.', @@ -35,14 +35,14 @@ return array( 'informations' => '정보', 'keep_history' => '최소 유지 글 개수', 'moved_category_deleted' => '카테고리를 삭제하면, 해당 카테고리 아래에 있던 피드들은 자동적으로 %s 아래로 분류됩니다.', - 'mute' => 'mute', // TODO + 'mute' => '무기한 새로고침 금지', 'no_selected' => '선택된 피드가 없습니다.', 'number_entries' => '%d 개의 글', 'priority' => array( - '_' => 'Visibility', // TODO - 'archived' => 'Do not show (archived)', // TODO - 'main_stream' => '메인 스트림에 표시하기', // TODO - 'normal' => 'Show in its category', // TODO + '_' => '표시', + 'archived' => '표시하지 않음 (보관됨)', + 'main_stream' => '메인 스트림에 표시하기', + 'normal' => '피드가 속한 카테고리에만 표시하기', ), 'stats' => '통계', 'think_to_add' => '피드를 추가할 수 있습니다.', diff --git a/cli/i18n/ignore/kr.php b/cli/i18n/ignore/kr.php new file mode 100644 index 000000000..24cfbc86a --- /dev/null +++ b/cli/i18n/ignore/kr.php @@ -0,0 +1,40 @@ + Date: Fri, 2 Feb 2018 13:59:48 +0100 Subject: Trim spaces from user given url --- app/Controllers/feedController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 884172112..985b943d2 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -39,12 +39,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController { * @throws FreshRSS_Feed_Exception * @throws Minz_FileNotExistException */ - public static function addFeed($url, $title = '', $cat_id = 0, $new_cat_name = '', $http_auth = '') { + public static function addFeed($param_url, $title = '', $cat_id = 0, $new_cat_name = '', $http_auth = '') { FreshRSS_UserDAO::touch(); @set_time_limit(300); $catDAO = new FreshRSS_CategoryDAO(); + $url = trim($param_url); + $cat = null; if ($new_cat_name != '') { $new_cat_id = $catDAO->addCategory(array('name' => $new_cat_name)); -- cgit v1.2.3 From 80168545eaa9e0183e72931ff7e50bfff36d7c33 Mon Sep 17 00:00:00 2001 From: Django Janny Date: Mon, 5 Feb 2018 20:48:16 +0100 Subject: param name --- app/Controllers/feedController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 985b943d2..7f66b10db 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -39,13 +39,13 @@ class FreshRSS_feed_Controller extends Minz_ActionController { * @throws FreshRSS_Feed_Exception * @throws Minz_FileNotExistException */ - public static function addFeed($param_url, $title = '', $cat_id = 0, $new_cat_name = '', $http_auth = '') { + public static function addFeed($url, $title = '', $cat_id = 0, $new_cat_name = '', $http_auth = '') { FreshRSS_UserDAO::touch(); @set_time_limit(300); $catDAO = new FreshRSS_CategoryDAO(); - $url = trim($param_url); + $url = trim($url); $cat = null; if ($new_cat_name != '') { -- cgit v1.2.3 From e6e0502a5ca48a0b57d8036d1498ffa61308bba2 Mon Sep 17 00:00:00 2001 From: Django Janny Date: Mon, 5 Feb 2018 20:54:36 +0100 Subject: Adding myself as a contributor --- CREDITS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CREDITS.md b/CREDITS.md index 54a7f4fab..0168ed1f8 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -19,6 +19,7 @@ People are sorted by name so please keep this order. * [danc](https://github.com/danc): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=danc), [Web](http://tintouli.free.fr/) * [David Souza](https://github.com/araujo0205): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:araujo0205), [Web](http://davidsouza.tech/) * [dswd](https://github.com/dswd): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:dswd) +* [Django Janny](https://github.com/keltroth): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:keltroth) * [ealdraed](https://github.com/ealdraed): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=ealdraed) * [Frans de Jonge](https://github.com/Frenzie): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=Frenzie), [Web](http://fransdejonge.com/) * [gsongsong](https://github.com/gsongsong): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:gsongsong) -- cgit v1.2.3 From 79f8b440d1303a0cd377cabe18750a2a552919e3 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 8 Feb 2018 20:11:05 +0100 Subject: API /reader/api/0/stream/items/contents (#1774) * API /reader/api/0/stream/items/contents For FeedMe * Fix continuation * Continuation in stream/items/ids * Fix multiple continuations * Allow empty POST tokens For FeedMe. This token is not used by e.g. The Old Reader API. There is the Authorization header anyway. TODO: Check security consequences * API compatibility FeedMe: add/remove feed FeedMe uses GET for some parameters typically given by POST * A bit of sanitization * Links to FeedMe * API favicons more robust when base_url is not set * Changelog FeedMe --- CHANGELOG.md | 4 +- README.fr.md | 1 + README.md | 1 + app/Models/EntryDAO.php | 23 ++++- docs/en/users/06_Mobile_access.md | 1 + docs/fr/users/06_Mobile_access.md | 1 + p/api/greader.php | 179 ++++++++++++++++++++++++++------------ 7 files changed, 149 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ed835205..2908cd616 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ # FreshRSS changelog -## 2018-XX-XX FreshRSS 1.9.1-dev +## 2018-02-XX FreshRSS 1.9.1-dev +* API + * Add compatibility with FeedMe 3.5.3+ on Android [#1774](https://github.com/FreshRSS/FreshRSS/pull/1774) * Features * Ability to pause feeds, and to hide them from categories [#1750](https://github.com/FreshRSS/FreshRSS/pull/1750) * Security diff --git a/README.fr.md b/README.fr.md index b888f7738..4421f92f0 100644 --- a/README.fr.md +++ b/README.fr.md @@ -177,6 +177,7 @@ Tout client supportant une API de type Google Reader. Sélection : * Android * [News+](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus) avec [News+ Google Reader extension](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus.extension.google_reader) (Propriétaire) + * [FeedMe 3.5.3+](https://play.google.com/store/apps/details?id=com.seazon.feedme) (Propriétaire) * [EasyRSS](https://github.com/Alkarex/EasyRSS) (Libre, [F-Droid](https://f-droid.org/fr/packages/org.freshrss.easyrss/)) * GNU/Linux * [FeedReader 2.0+](https://jangernert.github.io/FeedReader/) (Libre) diff --git a/README.md b/README.md index c971675fa..a95593651 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,7 @@ Any client supporting a Google Reader-like API. Selection: * Android * [News+](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus) with [News+ Google Reader extension](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus.extension.google_reader) (Closed source) + * [FeedMe 3.5.3+](https://play.google.com/store/apps/details?id=com.seazon.feedme) (Closed source) * [EasyRSS](https://github.com/Alkarex/EasyRSS) (Open source, [F-Droid](https://f-droid.org/packages/org.freshrss.easyrss/)) * GNU/Linux * [FeedReader 2.0+](https://jangernert.github.io/FeedReader/) (Open source) diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 9e291f4ed..70135e7a0 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -628,10 +628,12 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable { $firstId = $order === 'DESC' ? '9000000000'. '000000' : '0'; }*/ if ($firstId !== '') { - $search .= 'AND ' . $alias . 'id ' . ($order === 'DESC' ? '<=' : '>=') . $firstId . ' '; + $search .= 'AND ' . $alias . 'id ' . ($order === 'DESC' ? '<=' : '>=') . ' ? '; + $values[] = $firstId; } if ($date_min > 0) { - $search .= 'AND ' . $alias . 'id >= ' . $date_min . '000000 '; + $search .= 'AND ' . $alias . 'id >= ? '; + $values[] = $date_min . '000000'; } if ($filter) { if ($filter->getMinDate()) { @@ -781,6 +783,23 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo implements FreshRSS_Searchable { return self::daoToEntries($stm->fetchAll(PDO::FETCH_ASSOC)); } + public function listByIds($ids, $order = 'DESC') { + if (count($ids) < 1) { + return array(); + } + + $sql = 'SELECT id, guid, title, author, ' + . ($this->isCompressed() ? 'UNCOMPRESS(content_bin) AS content' : 'content') + . ', link, date, is_read, is_favorite, id_feed, tags ' + . 'FROM `' . $this->prefix . 'entry` ' + . 'WHERE id IN (' . str_repeat('?,', count($ids) - 1). '?) ' + . 'ORDER BY id ' . $order; + + $stm = $this->bd->prepare($sql); + $stm->execute($ids); + return self::daoToEntries($stm->fetchAll(PDO::FETCH_ASSOC)); + } + public function listIdsWhere($type = 'a', $id = '', $state = FreshRSS_Entry::STATE_ALL, $order = 'DESC', $limit = 1, $firstId = '', $filter = '', $date_min = 0) { //For API list($values, $sql) = $this->sqlListWhere($type, $id, $state, $order, $limit, $firstId, $filter, $date_min); diff --git a/docs/en/users/06_Mobile_access.md b/docs/en/users/06_Mobile_access.md index 3472172b0..166985585 100644 --- a/docs/en/users/06_Mobile_access.md +++ b/docs/en/users/06_Mobile_access.md @@ -46,6 +46,7 @@ This page assumes you have completed the [server setup](../admins/02_Installatio 7. Pick a client supporting a Google Reader-like API. Selection: * Android * [News+](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus) with [News+ Google Reader extension](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus.extension.google_reader) (Closed source) + * [FeedMe 3.5.3+](https://play.google.com/store/apps/details?id=com.seazon.feedme) (Closed source) * [EasyRSS](https://github.com/Alkarex/EasyRSS) (Open source, [F-Droid](https://f-droid.org/packages/org.freshrss.easyrss/)) * Linux * [FeedReader 2.0+](https://jangernert.github.io/FeedReader/) (Open source) diff --git a/docs/fr/users/06_Mobile_access.md b/docs/fr/users/06_Mobile_access.md index 185c94098..8ef3d038a 100644 --- a/docs/fr/users/06_Mobile_access.md +++ b/docs/fr/users/06_Mobile_access.md @@ -44,6 +44,7 @@ Tout client supportant une API de type Google Reader. Sélection : * Android * [News+](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus) avec [News+ Google Reader extension](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus.extension.google_reader) (Propriétaire) + * [FeedMe 3.5.3+](https://play.google.com/store/apps/details?id=com.seazon.feedme) (Propriétaire) * [EasyRSS](https://github.com/Alkarex/EasyRSS) (Libre, F-Droid) * Linux * [FeedReader 2.0+](https://jangernert.github.io/FeedReader/) (Libre) diff --git a/p/api/greader.php b/p/api/greader.php index 72f886190..4add26bd8 100644 --- a/p/api/greader.php +++ b/p/api/greader.php @@ -216,9 +216,13 @@ function token($conf) { function checkToken($conf, $token) { //http://code.google.com/p/google-reader-api/wiki/ActionToken $user = Minz_Session::param('currentUser', '_'); + if ($user !== '_' && $token == '') { + return true; //FeedMe //TODO: Check security consequences + } if ($token === str_pad(sha1(FreshRSS_Context::$system_conf->salt . $user . $conf->apiPasswordHash), 57, 'Z')) { return true; } + Minz_Log::warning('Invalid POST token: ' . $token, API_LOG); unauthorized(); } @@ -266,6 +270,8 @@ function subscriptionList() { $res = $stm->fetchAll(PDO::FETCH_ASSOC); $salt = FreshRSS_Context::$system_conf->salt; + $faviconsUrl = Minz_Url::display('/f.php?', '', true); + $faviconsUrl = str_replace('/api/greader.php/reader/api/0/subscription', '', $faviconsUrl); //Security if base_url is not set properly $subscriptions = array(); foreach ($res as $line) { @@ -282,7 +288,7 @@ function subscriptionList() { //'firstitemmsec' => 0, 'url' => $line['url'], 'htmlUrl' => $line['website'], - 'iconUrl' => Minz_Url::display('/f.php?' . hash('crc32b', $salt . $line['url']), '', true), + 'iconUrl' => $faviconsUrl . hash('crc32b', $salt . $line['url']), ); } @@ -324,6 +330,9 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = ' $addCatId = 1; //Default category } $feedDAO = FreshRSS_Factory::createFeedDao(); + if (!is_array($streamNames) || count($streamNames) < 1) { + badRequest(); + } for ($i = count($streamNames) - 1; $i >= 0; $i--) { $streamName = $streamNames[$i]; //feed/http://example.net/sample.xml ; feed/338 if (strpos($streamName, 'feed/') === 0) { @@ -435,6 +444,51 @@ function unreadCount() { //http://blog.martindoms.com/2009/10/16/using-the-googl exit(); } +function entriesToArray($entries) { + $items = array(); + foreach ($entries as $entry) { + $f_id = $entry->feed(); + if (isset($arrayFeedCategoryNames[$f_id])) { + $c_name = $arrayFeedCategoryNames[$f_id]['c_name']; + $f_name = $arrayFeedCategoryNames[$f_id]['name']; + } else { + $c_name = '_'; + $f_name = '_'; + } + $item = array( + 'id' => /*'tag:google.com,2005:reader/item/' .*/ dec2hex($entry->id()), //64-bit hexa http://code.google.com/p/google-reader-api/wiki/ItemId + 'crawlTimeMsec' => substr($entry->id(), 0, -3), + 'timestampUsec' => '' . $entry->id(), //EasyRSS + 'published' => $entry->date(true), + 'title' => $entry->title(), + 'summary' => array('content' => $entry->content()), + 'alternate' => array( + array('href' => htmlspecialchars_decode($entry->link(), ENT_QUOTES)), + ), + 'categories' => array( + 'user/-/state/com.google/reading-list', + 'user/-/label/' . $c_name, + ), + 'origin' => array( + 'streamId' => 'feed/' . $f_id, + 'title' => $f_name, //EasyRSS + //'htmlUrl' => $line['f_website'], + ), + ); + if ($entry->author() != '') { + $item['author'] = $entry->author(); + } + if ($entry->isRead()) { + $item['categories'][] = 'user/-/state/com.google/read'; + } + if ($entry->isFavorite()) { + $item['categories'][] = 'user/-/state/com.google/starred'; + } + $items[] = $item; + } + return $items; +} + function streamContents($path, $include_target, $start_time, $count, $order, $exclude_target, $continuation) { //http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#feed @@ -476,57 +530,18 @@ function streamContents($path, $include_target, $start_time, $count, $order, $ex break; } - if (!empty($continuation)) { + if ($continuation != '') { $count++; //Shift by one element } $entryDAO = FreshRSS_Factory::createEntryDao(); $entries = $entryDAO->listWhere($type, $include_target, $state, $order === 'o' ? 'ASC' : 'DESC', $count, $continuation, new FreshRSS_Search(''), $start_time); - $items = array(); - foreach ($entries as $entry) { - $f_id = $entry->feed(); - if (isset($arrayFeedCategoryNames[$f_id])) { - $c_name = $arrayFeedCategoryNames[$f_id]['c_name']; - $f_name = $arrayFeedCategoryNames[$f_id]['name']; - } else { - $c_name = '_'; - $f_name = '_'; - } - $item = array( - 'id' => /*'tag:google.com,2005:reader/item/' .*/ dec2hex($entry->id()), //64-bit hexa http://code.google.com/p/google-reader-api/wiki/ItemId - 'crawlTimeMsec' => substr($entry->id(), 0, -3), - 'timestampUsec' => '' . $entry->id(), //EasyRSS - 'published' => $entry->date(true), - 'title' => $entry->title(), - 'summary' => array('content' => $entry->content()), - 'alternate' => array( - array('href' => htmlspecialchars_decode($entry->link(), ENT_QUOTES)), - ), - 'categories' => array( - 'user/-/state/com.google/reading-list', - 'user/-/label/' . $c_name, - ), - 'origin' => array( - 'streamId' => 'feed/' . $f_id, - 'title' => $f_name, //EasyRSS - //'htmlUrl' => $line['f_website'], - ), - ); - if ($entry->author() != '') { - $item['author'] = $entry->author(); - } - if ($entry->isRead()) { - $item['categories'][] = 'user/-/state/com.google/read'; - } - if ($entry->isFavorite()) { - $item['categories'][] = 'user/-/state/com.google/starred'; - } - $items[] = $item; - } + $items = entriesToArray($entries); - if (!empty($continuation)) { + if ($continuation != '') { array_shift($items); //Discard first element that was already sent in the previous response + $count--; } $response = array( @@ -534,15 +549,18 @@ function streamContents($path, $include_target, $start_time, $count, $order, $ex 'updated' => time(), 'items' => $items, ); - if ((count($entries) >= $count) && (!empty($entry))) { - $response['continuation'] = $entry->id(); + if (count($entries) >= $count) { + $entry = end($entries); + if ($entry != false) { + $response['continuation'] = $entry->id(); + } } echo json_encode($response), "\n"; exit(); } -function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude_target) { +function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude_target, $continuation) { //http://code.google.com/p/google-reader-api/wiki/ApiStreamItemsIds //http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI //http://blog.martindoms.com/2009/10/16/using-the-google-reader-api-part-2/#feed @@ -572,8 +590,17 @@ function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude break; } + if ($continuation != '') { + $count++; //Shift by one element + } + $entryDAO = FreshRSS_Factory::createEntryDao(); - $ids = $entryDAO->listIdsWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, '', new FreshRSS_Search(''), $start_time); + $ids = $entryDAO->listIdsWhere($type, $id, $state, $order === 'o' ? 'ASC' : 'DESC', $count, $continuation, new FreshRSS_Search(''), $start_time); + + if ($continuation != '') { + array_shift($ids); //Discard first element that was already sent in the previous response + $count--; + } if (empty($ids)) { //For News+ bug https://github.com/noinnion/newsplus/issues/84#issuecomment-57834632 $ids[] = 0; @@ -585,9 +612,39 @@ function streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude ); } - echo json_encode(array( + $response = array( 'itemRefs' => $itemRefs, - )), "\n"; + ); + if (count($ids) >= $count) { + $id = end($ids); + if ($id != false) { + $response['continuation'] = $id; + } + } + + echo json_encode($response), "\n"; + exit(); +} + +function streamContentsItems($e_ids, $order) { + header('Content-Type: application/json; charset=UTF-8'); + + foreach ($e_ids as $i => $e_id) { + $e_ids[$i] = hex2dec(basename($e_id)); //Strip prefix 'tag:google.com,2005:reader/item/' + } + + $entryDAO = FreshRSS_Factory::createEntryDao(); + $entries = $entryDAO->listByIds($e_ids, $order === 'o' ? 'ASC' : 'DESC'); + + $items = entriesToArray($entries); + + $response = array( + 'id' => 'user/-/state/com.google/reading-list', + 'updated' => time(), + 'items' => $items, + ); + + echo json_encode($response), "\n"; exit(); } @@ -726,7 +783,10 @@ if (count($pathInfos) < 3) { * all items in a timestamp range, it will have a continuation attribute. * The same request can be re-issued with the value of that attribute put * in this parameter to get more items */ - $continuation = isset($_GET['c']) ? $_GET['c'] : ''; + $continuation = isset($_GET['c']) ? trim($_GET['c']) : ''; + if (!ctype_digit($continuation)) { + $continuation = ''; + } if (isset($pathInfos[5]) && $pathInfos[5] === 'contents' && isset($pathInfos[6])) { if (isset($pathInfos[7])) { if ($pathInfos[6] === 'feed') { @@ -755,7 +815,10 @@ if (count($pathInfos) < 3) { * be repeated to fetch the item IDs from multiple streams at once * (more efficient from a backend perspective than multiple requests). */ $streamId = $_GET['s']; - streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude_target); + streamContentsItemsIds($streamId, $start_time, $count, $order, $exclude_target, $continuation); + } else if ($pathInfos[6] === 'contents' && isset($_POST['i'])) { //FeedMe + $e_ids = multiplePosts('i'); //item IDs + streamContentsItems($e_ids, $order); } } break; @@ -775,16 +838,16 @@ if (count($pathInfos) < 3) { subscriptionList($_GET['output']); break; case 'edit': - if (isset($_POST['s']) && isset($_POST['ac'])) { + if (isset($_REQUEST['s']) && isset($_REQUEST['ac'])) { //StreamId to operate on. The parameter may be repeated to edit multiple subscriptions at once - $streamNames = multiplePosts('s'); + $streamNames = empty($_POST['s']) && isset($_GET['s']) ? array($_GET['s']) : multiplePosts('s'); /* Title to use for the subscription. For the `subscribe` action, * if not specified then the feed's current title will be used. Can * be used with the `edit` action to rename a subscription */ - $titles = multiplePosts('t'); - $action = $_POST['ac']; //Action to perform on the given StreamId. Possible values are `subscribe`, `unsubscribe` and `edit` - $add = isset($_POST['a']) ? $_POST['a'] : ''; //StreamId to add the subscription to (generally a user label) - $remove = isset($_POST['r']) ? $_POST['r'] : ''; //StreamId to remove the subscription from (generally a user label) + $titles = empty($_POST['t']) && isset($_GET['t']) ? array($_GET['t']) : multiplePosts('t'); + $action = $_REQUEST['ac']; //Action to perform on the given StreamId. Possible values are `subscribe`, `unsubscribe` and `edit` + $add = isset($_REQUEST['a']) ? $_REQUEST['a'] : ''; //StreamId to add the subscription to (generally a user label) + $remove = isset($_REQUEST['r']) ? $_REQUEST['r'] : ''; //StreamId to remove the subscription from (generally a user label) subscriptionEdit($streamNames, $titles, $action, $add, $remove); } break; -- cgit v1.2.3 From 04a3c3552c7fd3cc9b6156d667c6fc5074d7bfad Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 8 Feb 2018 20:30:00 +0100 Subject: Changelog 1776 1778 https://github.com/FreshRSS/FreshRSS/pull/1776 https://github.com/FreshRSS/FreshRSS/pull/1778 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2908cd616..f144bb639 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,10 @@ * Allow extensions to define their own reading view [#1714](https://github.com/FreshRSS/FreshRSS/pull/1714) * I18n * Updated Chinese [#1769](https://github.com/FreshRSS/FreshRSS/pull/1769) + * Updated Korean [#1776](https://github.com/FreshRSS/FreshRSS/pull/1776) * Misc. * More sites in `force-https.default.txt` [#1745](https://github.com/FreshRSS/FreshRSS/pull/1745) + * Trim URLs when adding new feeds [#1778](https://github.com/FreshRSS/FreshRSS/pull/1778) ## 2017-12-17 FreshRSS 1.9.0 -- cgit v1.2.3 From ac3e38359b420068b75cc848d89a3a6fc7b6e6c6 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Wed, 14 Feb 2018 22:15:34 +0100 Subject: Allow admin user to reset passwords (#1765) See #960 --- app/Controllers/userController.php | 56 ++++++++++++++++++++++++++------------ app/i18n/cz/admin.php | 3 ++ app/i18n/cz/feedback.php | 4 +++ app/i18n/cz/gen.php | 1 + app/i18n/de/admin.php | 3 ++ app/i18n/de/feedback.php | 4 +++ app/i18n/de/gen.php | 1 + app/i18n/en/admin.php | 3 ++ app/i18n/en/feedback.php | 4 +++ app/i18n/en/gen.php | 1 + app/i18n/es/admin.php | 3 ++ app/i18n/es/feedback.php | 4 +++ app/i18n/es/gen.php | 1 + app/i18n/fr/admin.php | 3 ++ app/i18n/fr/feedback.php | 4 +++ app/i18n/fr/gen.php | 1 + app/i18n/he/admin.php | 3 ++ app/i18n/he/feedback.php | 4 +++ app/i18n/he/gen.php | 1 + app/i18n/it/admin.php | 3 ++ app/i18n/it/feedback.php | 4 +++ app/i18n/it/gen.php | 1 + app/i18n/kr/admin.php | 3 ++ app/i18n/kr/feedback.php | 4 +++ app/i18n/kr/gen.php | 1 + app/i18n/nl/admin.php | 3 ++ app/i18n/nl/feedback.php | 4 +++ app/i18n/nl/gen.php | 1 + app/i18n/pt-br/admin.php | 3 ++ app/i18n/pt-br/feedback.php | 4 +++ app/i18n/pt-br/gen.php | 1 + app/i18n/ru/admin.php | 3 ++ app/i18n/ru/feedback.php | 4 +++ app/i18n/ru/gen.php | 1 + app/i18n/tr/admin.php | 3 ++ app/i18n/tr/feedback.php | 4 +++ app/i18n/tr/gen.php | 1 + app/i18n/zh-cn/admin.php | 3 ++ app/i18n/zh-cn/feedback.php | 4 +++ app/i18n/zh-cn/gen.php | 1 + app/views/user/manage.phtml | 41 ++++++++++++++++++++++++++-- cli/update-user.php | 3 +- 42 files changed, 184 insertions(+), 20 deletions(-) diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 2a1d43d9e..820260a08 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -44,29 +44,54 @@ class FreshRSS_user_Controller extends Minz_ActionController { return preg_match('/^' . self::USERNAME_PATTERN . '$/', $username) === 1; } - public static function updateContextUser($passwordPlain, $apiPasswordPlain, $userConfigUpdated = array()) { + public static function updateUser($user, $passwordPlain, $apiPasswordPlain, $userConfigUpdated = array()) { + $userConfig = get_user_configuration($user); if ($passwordPlain != '') { $passwordHash = self::hashPassword($passwordPlain); - FreshRSS_Context::$user_conf->passwordHash = $passwordHash; + $userConfig->passwordHash = $passwordHash; } if ($apiPasswordPlain != '') { $apiPasswordHash = self::hashPassword($apiPasswordPlain); - FreshRSS_Context::$user_conf->apiPasswordHash = $apiPasswordHash; + $userConfig->apiPasswordHash = $apiPasswordHash; } if (is_array($userConfigUpdated)) { foreach ($userConfigUpdated as $configName => $configValue) { if ($configValue !== null) { - FreshRSS_Context::$user_conf->_param($configName, $configValue); + $userConfig->_param($configName, $configValue); } } } - $ok = FreshRSS_Context::$user_conf->save(); + $ok = $userConfig->save(); return $ok; } + public function updateAction() { + if (Minz_Request::isPost()) { + $passwordPlain = Minz_Request::param('newPasswordPlain', '', true); + Minz_Request::_param('newPasswordPlain'); //Discard plain-text password ASAP + $_POST['newPasswordPlain'] = ''; + + $apiPasswordPlain = Minz_Request::param('apiPasswordPlain', '', true); + + $username = Minz_Request::param('username'); + $ok = self::updateUser($username, $passwordPlain, $apiPasswordPlain, array( + 'token' => Minz_Request::param('token', null), + )); + + if ($ok) { + Minz_Request::good(_t('feedback.user.updated', $username), + array('c' => 'user', 'a' => 'manage')); + } else { + Minz_Request::bad(_t('feedback.user.updated.error', $username), + array('c' => 'user', 'a' => 'manage')); + } + + } + } + /** * This action displays the user profile page. */ @@ -84,7 +109,7 @@ class FreshRSS_user_Controller extends Minz_ActionController { $apiPasswordPlain = Minz_Request::param('apiPasswordPlain', '', true); - $ok = self::updateContextUser($passwordPlain, $apiPasswordPlain, array( + $ok = self::updateUser(Minz_Session::param('currentUser'), $passwordPlain, $apiPasswordPlain, array( 'token' => Minz_Request::param('token', null), )); @@ -110,19 +135,16 @@ class FreshRSS_user_Controller extends Minz_ActionController { Minz_View::prependTitle(_t('admin.user.title') . ' · '); - // Get the correct current user. - $username = Minz_Request::param('u', Minz_Session::param('currentUser')); - if (!FreshRSS_UserDAO::exist($username)) { - $username = Minz_Session::param('currentUser'); - } - $this->view->current_user = $username; + $this->view->current_user = Minz_Request::param('u'); - // Get information about the current user. - $entryDAO = FreshRSS_Factory::createEntryDao($this->view->current_user); - $this->view->nb_articles = $entryDAO->count(); + if ($this->view->current_user) { + // Get information about the current user. + $entryDAO = FreshRSS_Factory::createEntryDao($this->view->current_user); + $this->view->nb_articles = $entryDAO->count(); - $databaseDAO = FreshRSS_Factory::createDatabaseDAO(); - $this->view->size_user = $databaseDAO->size(); + $databaseDAO = FreshRSS_Factory::createDatabaseDAO(); + $this->view->size_user = $databaseDAO->size(); + } } public static function createUser($new_user_name, $passwordPlain, $apiPasswordPlain, $userConfig = array(), $insertDefaultFeeds = true) { diff --git a/app/i18n/cz/admin.php b/app/i18n/cz/admin.php index dbfebd4c9..d414ffd07 100644 --- a/app/i18n/cz/admin.php +++ b/app/i18n/cz/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s článků (%s)', 'create' => 'Vytvořit nového uživatele', + 'delete_users' => 'Delete user', // TODO 'language' => 'Jazyk', 'number' => 'Zatím je vytvořen %d účet', 'numbers' => 'Zatím je vytvořeno %d účtů', 'password_form' => 'Heslo
    (pro přihlášení webovým formulářem)', 'password_format' => 'Alespoň 7 znaků', + 'selected' => 'Selected user', // TODO 'title' => 'Správa uživatelů', + 'update_users' => 'Update user', // TODO 'user_list' => 'Seznam uživatelů', 'username' => 'Přihlašovací jméno', 'users' => 'Uživatelé', diff --git a/app/i18n/cz/feedback.php b/app/i18n/cz/feedback.php index f7b8d8c73..22eaf77f7 100644 --- a/app/i18n/cz/feedback.php +++ b/app/i18n/cz/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'Uživatel %s byl smazán', 'error' => 'Uživatele %s nelze smazat', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Váš profil nelze změnit', diff --git a/app/i18n/cz/gen.php b/app/i18n/cz/gen.php index fcddf452c..288be61ec 100644 --- a/app/i18n/cz/gen.php +++ b/app/i18n/cz/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Navštívit WWW stránku', 'submit' => 'Odeslat', 'truncate' => 'Smazat všechny články', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email', diff --git a/app/i18n/de/admin.php b/app/i18n/de/admin.php index bb2c9352d..45bf2de68 100644 --- a/app/i18n/de/admin.php +++ b/app/i18n/de/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s Artikel (%s)', 'create' => 'Neuen Benutzer erstellen', + 'delete_users' => 'Delete user', // TODO 'language' => 'Sprache', 'number' => 'Es wurde bis jetzt %d Account erstellt', 'numbers' => 'Es wurden bis jetzt %d Accounts erstellt', 'password_form' => 'Passwort
    (für die Anmeldemethode per Webformular)', 'password_format' => 'mindestens 7 Zeichen', + 'selected' => 'Selected user', // TODO 'title' => 'Benutzer verwalten', + 'update_users' => 'Update user', // TODO 'user_list' => 'Liste der Benutzer', 'username' => 'Nutzername', 'users' => 'Benutzer', diff --git a/app/i18n/de/feedback.php b/app/i18n/de/feedback.php index e2e9a71ba..0ac6efefc 100644 --- a/app/i18n/de/feedback.php +++ b/app/i18n/de/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'Der Benutzer %s ist gelöscht worden', 'error' => 'Der Benutzer %s kann nicht gelöscht werden', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Ihr Profil kann nicht geändert werden', diff --git a/app/i18n/de/gen.php b/app/i18n/de/gen.php index bed49a4a4..8df0b1f07 100644 --- a/app/i18n/de/gen.php +++ b/app/i18n/de/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Webseite ansehen', 'submit' => 'Abschicken', 'truncate' => 'Alle Artikel löschen', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'E-Mail-Adresse', diff --git a/app/i18n/en/admin.php b/app/i18n/en/admin.php index 187b66a8c..1f857dbab 100644 --- a/app/i18n/en/admin.php +++ b/app/i18n/en/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s articles (%s)', 'create' => 'Create new user', + 'delete_users' => 'Delete user', 'language' => 'Language', 'number' => 'There is %d account created', 'numbers' => 'There are %d accounts created', 'password_form' => 'Password
    (for the Web-form login method)', 'password_format' => 'At least 7 characters', + 'selected' => 'Selected user', 'title' => 'Manage users', + 'update_users' => 'Update user', 'user_list' => 'List of users', 'username' => 'Username', 'users' => 'Users', diff --git a/app/i18n/en/feedback.php b/app/i18n/en/feedback.php index 334d9a8f5..ad7f87fd9 100644 --- a/app/i18n/en/feedback.php +++ b/app/i18n/en/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'User %s has been deleted', 'error' => 'User %s cannot be deleted', ), + 'updated' => array( + '_' => 'User %s has been updated', + 'error' => 'User %s has not been updated', + ), ), 'profile' => array( 'error' => 'Your profile cannot be modified', diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index ac48e3486..82cd4da72 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'See website', 'submit' => 'Submit', 'truncate' => 'Delete all articles', + 'update' => 'Update', ), 'auth' => array( 'email' => 'Email address', diff --git a/app/i18n/es/admin.php b/app/i18n/es/admin.php index 93b1e6e5c..2884721c7 100755 --- a/app/i18n/es/admin.php +++ b/app/i18n/es/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s articles (%s)', 'create' => 'Crear nuevo usuario', + 'delete_users' => 'Delete user', // TODO 'language' => 'Idioma', 'number' => 'Hay %d cuenta creada', 'numbers' => 'Hay %d cuentas creadas', 'password_form' => 'Contraseña
    (para el método de identificación por formulario web)', 'password_format' => 'Mínimo de 7 caracteres', + 'selected' => 'Selected user', // TODO 'title' => 'Administrar usuarios', + 'update_users' => 'Update user', // TODO 'user_list' => 'Lista de usuarios', 'username' => 'Nombre de usuario', 'users' => 'Usuarios', diff --git a/app/i18n/es/feedback.php b/app/i18n/es/feedback.php index 136e70179..7b23f1a8d 100755 --- a/app/i18n/es/feedback.php +++ b/app/i18n/es/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'El usuario %s ha sido eliminado', 'error' => 'El usuario %s no ha podido ser eliminado', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Tu perfil no puede ser modificado', diff --git a/app/i18n/es/gen.php b/app/i18n/es/gen.php index 32fbcdaee..fe495a63f 100755 --- a/app/i18n/es/gen.php +++ b/app/i18n/es/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Ver web', 'submit' => 'Enviar', 'truncate' => 'Borrar todos los artículos', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Correo electrónico', diff --git a/app/i18n/fr/admin.php b/app/i18n/fr/admin.php index b2bc48209..6c582d719 100644 --- a/app/i18n/fr/admin.php +++ b/app/i18n/fr/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s articles (%s)', 'create' => 'Créer un nouvel utilisateur', + 'delete_users' => 'Supprimer un utilisateur', 'language' => 'Langue', 'number' => '%d compte a déjà été créé', 'numbers' => '%d comptes ont déjà été créés', 'password_form' => 'Mot de passe
    (pour connexion par formulaire)', 'password_format' => '7 caractères minimum', + 'selected' => 'Utilisateur sélectionné', 'title' => 'Gestion des utilisateurs', + 'update_users' => 'Mettre à jour un utilisateur', 'user_list' => 'Liste des utilisateurs', 'username' => 'Nom d’utilisateur', 'users' => 'Utilisateurs', diff --git a/app/i18n/fr/feedback.php b/app/i18n/fr/feedback.php index aa19cd02b..1abf1b518 100644 --- a/app/i18n/fr/feedback.php +++ b/app/i18n/fr/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'L’utilisateur %s a été supprimé.', 'error' => 'L’utilisateur %s ne peut pas être supprimé.', ), + 'updated' => array( + '_' => 'L’utilisateur %s a été mis à jour', + 'error' => 'L’utilisateur %s n’a pas été mis à jour', + ), ), 'profile' => array( 'error' => 'Votre profil n’a pas pu être mis à jour', diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index 61a24602a..beb578543 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Voir le site', 'submit' => 'Valider', 'truncate' => 'Supprimer tous les articles', + 'update' => 'Mettre à jour', ), 'auth' => array( 'email' => 'Adresse courriel', diff --git a/app/i18n/he/admin.php b/app/i18n/he/admin.php index b7c83c828..2840213c9 100644 --- a/app/i18n/he/admin.php +++ b/app/i18n/he/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s articles (%s)', // @todo 'create' => 'יצירת משתמש חדש', + 'delete_users' => 'Delete user', // TODO 'language' => 'שפה', 'number' => 'There is %d account created', // @todo 'numbers' => 'There are %d accounts created', // @todo 'password_form' => 'סיסמה
    (לשימוש בטפוס ההרשמה)', 'password_format' => 'At least 7 characters', // @todo + 'selected' => 'Selected user', // TODO 'title' => 'Manage users', // @todo + 'update_users' => 'Update user', // TODO 'user_list' => 'רשימת משתמשים', 'username' => 'שם משתמש', 'users' => 'משתמשים', diff --git a/app/i18n/he/feedback.php b/app/i18n/he/feedback.php index 9a72b2ba0..f773ff270 100644 --- a/app/i18n/he/feedback.php +++ b/app/i18n/he/feedback.php @@ -102,6 +102,10 @@ return array( '_' => 'המשתמש %s נמחק', 'error' => 'User %s cannot be deleted', // @todo ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Your profile cannot be modified', // @todo diff --git a/app/i18n/he/gen.php b/app/i18n/he/gen.php index cacc8eaed..c4262ab66 100644 --- a/app/i18n/he/gen.php +++ b/app/i18n/he/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'ראו אתר', 'submit' => 'אישור', 'truncate' => 'מחיקת כל המאמרים', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email address', // @todo diff --git a/app/i18n/it/admin.php b/app/i18n/it/admin.php index 0248d9317..a3034777f 100644 --- a/app/i18n/it/admin.php +++ b/app/i18n/it/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s articoli (%s)', 'create' => 'Crea nuovo utente', + 'delete_users' => 'Delete user', // TODO 'language' => 'Lingua', 'number' => ' %d profilo utente creato', 'numbers' => 'Sono presenti %d profili utente', 'password_form' => 'Password
    (per il login classico)', 'password_format' => 'Almeno 7 caratteri', + 'selected' => 'Selected user', // TODO 'title' => 'Gestione utenti', + 'update_users' => 'Update user', // TODO 'user_list' => 'Lista utenti', 'username' => 'Nome utente', 'users' => 'Utenti', diff --git a/app/i18n/it/feedback.php b/app/i18n/it/feedback.php index 8f3cf3ed6..d702eb448 100644 --- a/app/i18n/it/feedback.php +++ b/app/i18n/it/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'Utente %s cancellato', 'error' => 'Utente %s non cancellato', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Il tuo profilo non può essere modificato', diff --git a/app/i18n/it/gen.php b/app/i18n/it/gen.php index ccc8c0e7c..d4f83735a 100644 --- a/app/i18n/it/gen.php +++ b/app/i18n/it/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Vai al sito', 'submit' => 'Conferma', 'truncate' => 'Cancella tutti gli articoli', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Indirizzo email', diff --git a/app/i18n/kr/admin.php b/app/i18n/kr/admin.php index c34007ca9..f9e9c9a8e 100644 --- a/app/i18n/kr/admin.php +++ b/app/i18n/kr/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s 개의 글 (%s)', 'create' => '새 사용자 생성', + 'delete_users' => 'Delete user', // TODO 'language' => '언어', 'number' => '%d 개의 계정이 생성되었습니다', 'numbers' => '%d 개의 계정이 생성되었습니다', 'password_form' => '암호
    (웹폼 로그인 방식 사용시)', 'password_format' => '7 글자 이상이어야 합니다', + 'selected' => 'Selected user', // TODO 'title' => '사용자 관리', + 'update_users' => 'Update user', // TODO 'user_list' => '사용자 목록', 'username' => '사용자 이름', 'users' => '전체 사용자', diff --git a/app/i18n/kr/feedback.php b/app/i18n/kr/feedback.php index 6e13e7a10..bccf1aac0 100644 --- a/app/i18n/kr/feedback.php +++ b/app/i18n/kr/feedback.php @@ -101,6 +101,10 @@ return array( '_' => '%s 사용자를 삭제했습니다', 'error' => '%s 사용자를 삭제할 수 없습니다', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => '프로필을 변경할 수 없습니다', diff --git a/app/i18n/kr/gen.php b/app/i18n/kr/gen.php index 8997ba14b..4fb6c92ff 100644 --- a/app/i18n/kr/gen.php +++ b/app/i18n/kr/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => '웹사이트 열기', 'submit' => '설정 저장', 'truncate' => '모든 글 삭제', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => '메일 주소', diff --git a/app/i18n/nl/admin.php b/app/i18n/nl/admin.php index 384242b4d..cbdfd6978 100644 --- a/app/i18n/nl/admin.php +++ b/app/i18n/nl/admin.php @@ -175,6 +175,7 @@ return array( 'user' => array( 'articles_and_size' => '%s artikelen (%s)', 'create' => 'Creëer nieuwe gebruiker', + 'delete_users' => 'Delete user', // TODO 'language' => 'Taal', 'number' => 'Er is %d accounts gemaakt', 'numbers' => 'Er zijn %d accounts gemaakt', @@ -185,7 +186,9 @@ return array( 'help' => '0 betekent dat er geen accountlimiet is', 'number' => 'Max aantal accounts', ), + 'selected' => 'Selected user', // TODO 'title' => 'Beheer gebruikers', + 'update_users' => 'Update user', // TODO 'user_list' => 'Lijst van gebruikers ', 'username' => 'Gebruikersnaam', 'users' => 'Gebruikers', diff --git a/app/i18n/nl/feedback.php b/app/i18n/nl/feedback.php index cf1274767..3fabc97b8 100644 --- a/app/i18n/nl/feedback.php +++ b/app/i18n/nl/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'Gebruiker %s is verwijderd', 'error' => 'Gebruiker %s kan niet worden verwijderd', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), 'set_registration' => 'Het maximale aantal accounts is vernieuwd.', ), 'profile' => array( diff --git a/app/i18n/nl/gen.php b/app/i18n/nl/gen.php index 3215bdfec..ea3e720b4 100644 --- a/app/i18n/nl/gen.php +++ b/app/i18n/nl/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Bekijk website', 'submit' => 'Opslaan', 'truncate' => 'Verwijder alle artikelen', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email adres', diff --git a/app/i18n/pt-br/admin.php b/app/i18n/pt-br/admin.php index e62718e80..16aa027a8 100644 --- a/app/i18n/pt-br/admin.php +++ b/app/i18n/pt-br/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s artigos (%s)', 'create' => 'Criar novo usuário', + 'delete_users' => 'Delete user', // TODO 'language' => 'Idioma', 'number' => 'Há %d conta criada', 'numbers' => 'Há %d contas criadas', 'password_form' => 'Senha
    (para o login pelo método do formulário)', 'password_format' => 'Ao menos 7 caracteres', + 'selected' => 'Selected user', // TODO 'title' => 'Gerenciar usuários', + 'update_users' => 'Update user', // TODO 'user_list' => 'Lista de usuários', 'username' => 'Usuário', 'users' => 'Usuários', diff --git a/app/i18n/pt-br/feedback.php b/app/i18n/pt-br/feedback.php index 0959ad38e..932bb72b1 100644 --- a/app/i18n/pt-br/feedback.php +++ b/app/i18n/pt-br/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'Usuário %s foi deletado', 'error' => 'Usuário %s não pode ser deletado', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Your profile cannot be modified', diff --git a/app/i18n/pt-br/gen.php b/app/i18n/pt-br/gen.php index 4bc8535d6..fa1532787 100644 --- a/app/i18n/pt-br/gen.php +++ b/app/i18n/pt-br/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Ver o site', 'submit' => 'Enviar', 'truncate' => 'Deletar todos os artigos', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Endereço de e-mail', diff --git a/app/i18n/ru/admin.php b/app/i18n/ru/admin.php index d877c5006..4f5e937d7 100644 --- a/app/i18n/ru/admin.php +++ b/app/i18n/ru/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s статей (%s)', 'create' => 'Создать нового пользователя', + 'delete_users' => 'Delete user', // TODO 'language' => 'Язык', 'number' => 'На данный момент создан %d аккаунт', 'numbers' => 'На данный момент аккаунтов создано: %d', 'password_form' => 'Пароль
    (для входа через Веб-форму)', 'password_format' => 'Минимум 7 символов', + 'selected' => 'Selected user', // TODO 'title' => 'Управление пользователями', + 'update_users' => 'Update user', // TODO 'user_list' => 'Список пользователей', 'username' => 'Имя пользователя', 'users' => 'Пользователи', diff --git a/app/i18n/ru/feedback.php b/app/i18n/ru/feedback.php index ffebd6dc9..9416ed878 100644 --- a/app/i18n/ru/feedback.php +++ b/app/i18n/ru/feedback.php @@ -101,6 +101,10 @@ return array( '_' => 'User %s has been deleted', //TODO 'error' => 'User %s cannot be deleted', //TODO ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Your profile cannot be modified', //TODO diff --git a/app/i18n/ru/gen.php b/app/i18n/ru/gen.php index cc7e8765c..6f9020695 100644 --- a/app/i18n/ru/gen.php +++ b/app/i18n/ru/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'See website', 'submit' => 'Submit', 'truncate' => 'Delete all articles', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email address', diff --git a/app/i18n/tr/admin.php b/app/i18n/tr/admin.php index aa3aad7b7..f982bf644 100644 --- a/app/i18n/tr/admin.php +++ b/app/i18n/tr/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s makale (%s)', 'create' => 'Yeni kullanıcı oluştur', + 'delete_users' => 'Delete user', // TODO 'language' => 'Dil', 'number' => 'Oluşturulmuş %d hesap var', 'numbers' => 'Oluşturulmuş %d hesap var', 'password_form' => 'Şifre
    (Tarayıcı girişi için)', 'password_format' => 'En az 7 karakter', + 'selected' => 'Selected user', // TODO 'title' => 'Kullanıcıları yönet', + 'update_users' => 'Update user', // TODO 'user_list' => 'Kullanıcı listesi', 'username' => 'Kullanıcı adı', 'users' => 'Kullanıcılar', diff --git a/app/i18n/tr/feedback.php b/app/i18n/tr/feedback.php index be79630be..8f40e7d85 100644 --- a/app/i18n/tr/feedback.php +++ b/app/i18n/tr/feedback.php @@ -101,6 +101,10 @@ return array( '_' => '%s kullanıcısı silindi', 'error' => '%s kullanıcısı silinemedi', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => 'Profiliniz düzenlenemedi', diff --git a/app/i18n/tr/gen.php b/app/i18n/tr/gen.php index dcfd12c01..293502e74 100644 --- a/app/i18n/tr/gen.php +++ b/app/i18n/tr/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => 'Siteyi gör', 'submit' => 'Onayla', 'truncate' => 'Tüm makaleleri sil', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email adresleri', diff --git a/app/i18n/zh-cn/admin.php b/app/i18n/zh-cn/admin.php index 0e31ed12e..1072dc972 100644 --- a/app/i18n/zh-cn/admin.php +++ b/app/i18n/zh-cn/admin.php @@ -175,12 +175,15 @@ return array( 'user' => array( 'articles_and_size' => '%s 篇文章 (%s)', 'create' => '创建新用户', + 'delete_users' => 'Delete user', // TODO 'language' => '语言', 'number' => '已有 %d 个帐户', 'numbers' => '已有 %d 个帐户', 'password_form' => '密码
    (用于 Web-form 登录方式)', 'password_format' => '至少 7 个字符', + 'selected' => 'Selected user', // TODO 'title' => '用户管理', + 'update_users' => 'Update user', // TODO 'user_list' => '用户列表', 'username' => '用户名', 'users' => '用户', diff --git a/app/i18n/zh-cn/feedback.php b/app/i18n/zh-cn/feedback.php index 4ec833668..a005de0ce 100644 --- a/app/i18n/zh-cn/feedback.php +++ b/app/i18n/zh-cn/feedback.php @@ -101,6 +101,10 @@ return array( '_' => '用户 %s 已删除', 'error' => '用户 %s 删除失败', ), + 'updated' => array( + '_' => 'User %s has been updated', // TODO + 'error' => 'User %s has not been updated', // TODO + ), ), 'profile' => array( 'error' => '你的帐户修改失败', diff --git a/app/i18n/zh-cn/gen.php b/app/i18n/zh-cn/gen.php index 17f30f001..241fce13b 100644 --- a/app/i18n/zh-cn/gen.php +++ b/app/i18n/zh-cn/gen.php @@ -19,6 +19,7 @@ return array( 'see_website' => '查看网站', 'submit' => '提交', 'truncate' => '删除所有文章', + 'update' => 'Update', // TODO ), 'auth' => array( 'email' => 'Email 地址', diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml index 793a3a0bd..26838fcc1 100644 --- a/app/views/user/manage.phtml +++ b/app/views/user/manage.phtml @@ -46,14 +46,51 @@
    +
    + + + +
    + +
    + +
    +
    + +
    + +
    +
    + /> + +
    + + +
    +
    + +
    +
    + + +
    +
    +
    +
    - +
    - +
    show_nav_buttons ? ' checked="checked"' : ''; ?> data-leave-validation="show_nav_buttons; ?>"/> + + +
    +
    +
    diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index ba48b2501..c7cab2d3f 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -83,7 +83,7 @@ if (!empty($this->entries)) { $this->renderHelper('pagination'); ?>
    -partial('nav_entries'); ?> +show_nav_buttons) $this->partial('nav_entries'); ?>
    diff --git a/config-user.default.php b/config-user.default.php index 2e4a96239..5e67d8d9b 100644 --- a/config-user.default.php +++ b/config-user.default.php @@ -76,5 +76,6 @@ return array ( 'queries' => array ( ), 'html5_notif_timeout' => 0, + 'show_nav_buttons' => true, 'extensions_enabled' => array(), ); -- cgit v1.2.3 From cdc221894ca11291d976b653cb6f227f81ac8711 Mon Sep 17 00:00:00 2001 From: Jan van den Berg Date: Fri, 23 Feb 2018 11:27:35 +0100 Subject: Fix Dutch typos (#1792) --- app/i18n/nl/sub.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/i18n/nl/sub.php b/app/i18n/nl/sub.php index 4b699d894..6b1ac268b 100644 --- a/app/i18n/nl/sub.php +++ b/app/i18n/nl/sub.php @@ -2,7 +2,7 @@ /* Dutch translation by Wanabo. http://www.nieuwskop.be */ return array( 'api' => array( - 'documentation' => 'Kopieer de volgende URL om hem in een externe toepassing te gebruiken.', + 'documentation' => 'Kopieer de volgende URL om deze in een externe toepassing te gebruiken.', 'title' => 'API', ), 'bookmarklet' => array( @@ -55,13 +55,13 @@ return array( 'website' => 'Website URL', ), 'firefox' => array( - 'documentation' => 'Volg de stappen die hier beschreven wordem om FreshRSS aan de Firefox-nieuwslezerlijst toe te voegen.', + 'documentation' => 'Volg de stappen die hier beschreven worden om FreshRSS aan de Firefox-nieuwslezerlijst toe te voegen.', 'title' => 'Firefox-nieuwslezer', ), 'import_export' => array( 'export' => 'Exporteer', 'export_opml' => 'Exporteer lijst van feeds (OPML)', - 'export_starred' => 'Exporteer je fovorieten', + 'export_starred' => 'Exporteer je favorieten', 'feed_list' => 'Lijst van %s artikelen', 'file_to_import' => 'Bestand om te importeren
    (OPML, JSON of ZIP)', 'file_to_import_no_zip' => 'Bestand om te importeren
    (OPML of JSON)', -- cgit v1.2.3 From e94e53c4a02ebbe54f17668ccd952d061b1e3e33 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 24 Feb 2018 10:41:20 +0100 Subject: Changelog credits 1792 https://github.com/FreshRSS/FreshRSS/pull/1792 --- CHANGELOG.md | 1 + CREDITS.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08f021724..a6aef3ab6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ * Allow extensions to define their own reading view [#1714](https://github.com/FreshRSS/FreshRSS/pull/1714) * I18n * Updated Chinese [#1769](https://github.com/FreshRSS/FreshRSS/pull/1769) + * Updated Dutch [#1792](https://github.com/FreshRSS/FreshRSS/pull/1792) * Updated Korean [#1776](https://github.com/FreshRSS/FreshRSS/pull/1776) * Misc. * More sites in `force-https.default.txt` [#1745](https://github.com/FreshRSS/FreshRSS/pull/1745) diff --git a/CREDITS.md b/CREDITS.md index 0168ed1f8..e7e7c97a8 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -27,6 +27,7 @@ People are sorted by name so please keep this order. * [Guillaume Hayot](https://github.com/postblue): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:postblue), [Web](https://postblue.info/) * [hckweb](https://github.com/hckweb): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=hckweb) * [hoilc](https://github.com/hoilc): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:hoilc) +* [Jan van den Berg](https://github.com/jan-vandenberg): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:jan-vandenberg), [Web](https://j11g.com/) * [Jaussoin Timothée](https://github.com/edhelas): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=edhelas), [Web](http://edhelas.movim.eu/) * [jlefler](https://github.com/jlefler): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:jlefler) * [Jonas Östanbäck](https://github.com/cez81): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=cez81) -- cgit v1.2.3 From 294f9336ad0f315574c74d6b527b1bb8a280f3c6 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 24 Feb 2018 10:46:11 +0100 Subject: Prepare version 1.10.0 --- CHANGELOG.md | 2 +- constants.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6aef3ab6..88f6fa129 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # FreshRSS changelog -## 2018-02-XX FreshRSS 1.9.1-dev +## 2018-02-24 FreshRSS 1.10.0 * API * Add compatibility with FeedMe 3.5.3+ on Android [#1774](https://github.com/FreshRSS/FreshRSS/pull/1774) diff --git a/constants.php b/constants.php index b02ce1108..f33e2d63e 100644 --- a/constants.php +++ b/constants.php @@ -2,7 +2,7 @@ //NB: Do not edit; use ./constants.local.php instead. // -define('FRESHRSS_VERSION', '1.9.1-dev'); +define('FRESHRSS_VERSION', '1.10.0'); define('FRESHRSS_WEBSITE', 'https://freshrss.org'); define('FRESHRSS_WIKI', 'https://freshrss.github.io/FreshRSS/'); -- cgit v1.2.3