From 3dd6677421c9ba776f4734a890b4e7241c2faafb Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 21 Feb 2014 10:01:40 +0100 Subject: CHANGELOG 0.7.1 + TMP_PATH 0.8 --- constants.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index a140d0e74..4818f1565 100644 --- a/constants.php +++ b/constants.php @@ -16,5 +16,4 @@ define('FRESHRSS_PATH', dirname(__FILE__)); define('LIB_PATH', FRESHRSS_PATH . '/lib'); define('APP_PATH', FRESHRSS_PATH . '/app'); -//define('TMP_PATH', sys_get_temp_dir()); // need more tests so... -define('TMP_PATH', DATA_PATH); // ... we use DATA_PATH for the 0.7.1 +define('TMP_PATH', sys_get_temp_dir()); -- cgit v1.2.3 From fd829d75676a07a13a635db037efa92e364026a7 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 24 Mar 2014 19:16:09 +0100 Subject: Constant to enable PHP compression https://github.com/marienfressinaud/FreshRSS/issues/303#issuecomment-38477994 --- constants.php | 3 +++ p/i/index.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index 4818f1565..e32b8cbc3 100644 --- a/constants.php +++ b/constants.php @@ -2,6 +2,9 @@ define('FRESHRSS_VERSION', '0.8-dev'); define('FRESHRSS_WEBSITE', 'http://freshrss.org'); +// PHP text output compression http://php.net/ob_gzhandler (better to do it at Web server level) +define('PHP_COMPRESSION', false); + // Constantes de chemins define('FRESHRSS_PATH', dirname(__FILE__)); diff --git a/p/i/index.php b/p/i/index.php index 187bbabe8..4afffb3dd 100755 --- a/p/i/index.php +++ b/p/i/index.php @@ -35,7 +35,7 @@ if (file_exists ('install.php')) { @filemtime(LOG_PATH . '/' . $currentUser . '.log'), @filemtime(DATA_PATH . '/config.php') ); - if (httpConditional($dateLastModification, 0, 0, false, false, true)) { + if (httpConditional($dateLastModification, 0, 0, false, PHP_COMPRESSION, true)) { exit(); //No need to send anything } } -- cgit v1.2.3 From 4580e177e1986f50c71abb26e90800dc46028693 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 13 May 2014 19:33:01 +0200 Subject: Fix version numbers Due to the last pull request --- CHANGELOG | 2 +- README.md | 4 ++-- constants.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'constants.php') diff --git a/CHANGELOG b/CHANGELOG index 372ec4b8d..0893283a5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ # Journal des modifications -## 2014-02-19 FreshRSS 0.7.1 +## 2014-0x-xx FreshRSS 0.8 * API compatible with Google Reader API level 2 * FreshRSS can now be used from e.g.: diff --git a/README.md b/README.md index a1889bf5d..2003b6a9d 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Il permet de gérer plusieurs utilisateurs, et dispose d’un mode de lecture an * Site officiel : http://freshrss.org * Démo : http://demo.freshrss.org/ * Développeur : Marien Fressinaud -* Version actuelle : 0.7.1 -* Date de publication 2014-02-19 +* Version actuelle : 0.8-dev +* Date de publication 2014-0x-xx * License [GNU AGPL 3](http://www.gnu.org/licenses/agpl-3.0.html) ![Logo de FreshRSS](http://marienfressinaud.fr/data/images/freshrss/freshrss_title.png) diff --git a/constants.php b/constants.php index 849a5ada3..e32b8cbc3 100644 --- a/constants.php +++ b/constants.php @@ -1,5 +1,5 @@ Date: Sat, 9 Aug 2014 23:29:13 +0200 Subject: Add basic system of update - Check on update.freshrss.org for new updates - Download script - Apply script - Need translations and verifications NOTE: current script on server indicates version 0.7.3 is an update of 0.8-dev ==> IT'S ONLY FOR MY TESTS! Script just does a backup of ./data actually... See https://github.com/marienfressinaud/FreshRSS/issues/411 --- app/Controllers/updateController.php | 106 +++++++++++++++++++++++++++++++++++ app/i18n/en.php | 2 + app/i18n/fr.php | 2 + app/layout/aside_configure.phtml | 38 ++++++++----- app/layout/header.phtml | 6 ++ app/views/update/index.phtml | 19 +++++++ constants.php | 2 + lib/Minz/View.php | 15 +++-- 8 files changed, 171 insertions(+), 19 deletions(-) create mode 100644 app/Controllers/updateController.php create mode 100644 app/views/update/index.phtml (limited to 'constants.php') diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php new file mode 100644 index 000000000..a15cb9fd5 --- /dev/null +++ b/app/Controllers/updateController.php @@ -0,0 +1,106 @@ +view->loginOk && Minz_Configuration::isAdmin($current_user)) { + Minz_Error::error( + 403, + array('error' => array(_t('access_denied'))) + ); + } + + Minz_View::prependTitle(_t('update_system') . ' · '); + } + + public function indexAction() { + if (file_exists(UPDATE_FILENAME)) { + // There is an update file to apply! + $this->view->message = array( + 'status' => 'good', + 'title' => _t('ok'), + 'body' => _t('update_can_apply', _url('update', 'apply')) + ); + + return; + } + } + + public function checkAction() { + $this->view->change_view('update', 'index'); + + if (file_exists(UPDATE_FILENAME)) { + // There is already an update file to apply: we don't need to check + // the webserver! + $this->view->message = array( + 'status' => 'good', + 'title' => _t('ok'), + 'body' => _t('update_can_apply', _url('update', 'apply')) + ); + + return; + } + + $c = curl_init(FRESHRSS_UPDATE_WEBSITE); + curl_setopt($c, CURLOPT_RETURNTRANSFER, true); + $result = curl_exec($c); + + if (curl_getinfo($c, CURLINFO_HTTP_CODE) == 200) { + $res_array = explode("\n", $result, 2); + $status = $res_array[0]; + + if (strpos($status, 'UPDATE') === 0) { + $script = $res_array[1]; + if (file_put_contents(UPDATE_FILENAME, $script) !== false) { + $this->view->message = array( + 'status' => 'good', + 'title' => _t('ok'), + 'body' => _t('update_can_apply', _url('update', 'apply')) + ); + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('update_problem') + ); + } + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('no_update') + ); + } + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('update_server_not_found', FRESHRSS_UPDATE_WEBSITE) + ); + } + curl_close($c); + } + + public function applyAction() { + require(UPDATE_FILENAME); + $res = apply_update(); + + if ($res === true) { + @unlink(UPDATE_FILENAME); + + Minz_Session::_param('notification', array( + 'type' => 'good', + 'content' => Minz_Translate::t('update_finished') + )); + + Minz_Request::forward(array(), true); + } else { + Minz_Session::_param('notification', array( + 'type' => 'bad', + 'content' => Minz_Translate::t('update_failed', $res) + )); + + Minz_Request::forward(array('c' => 'update'), true); + } + } +} \ No newline at end of file diff --git a/app/i18n/en.php b/app/i18n/en.php index d80299b10..6110ccb11 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -408,4 +408,6 @@ return array ( 'stats_entry_per_category' => 'Entries per category', 'stats_top_feed' => 'Top ten feeds', 'stats_entry_count' => 'Entry count', + + 'update_can_apply' => 'There is an available update. Apply', ); diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 4be028ac3..5f88aa069 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -408,4 +408,6 @@ return array ( 'stats_entry_per_category' => 'Articles par catégorie', 'stats_top_feed' => 'Les dix plus gros flux', 'stats_entry_count' => 'Nombre d’articles', + + 'update_can_apply' => 'Il y’a une mise à jour à appliquer. Appliquer', ); diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml index e66f2f64c..03bea4836 100644 --- a/app/layout/aside_configure.phtml +++ b/app/layout/aside_configure.phtml @@ -1,25 +1,33 @@ diff --git a/app/layout/header.phtml b/app/layout/header.phtml index 2e42bfdea..028e63d8a 100644 --- a/app/layout/header.phtml +++ b/app/layout/header.phtml @@ -75,6 +75,12 @@ if (Minz_Configuration::canLogIn()) {
  • + +
  • +
  • diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml new file mode 100644 index 000000000..a1a872845 --- /dev/null +++ b/app/views/update/index.phtml @@ -0,0 +1,19 @@ +partial('aside_configure'); ?> + +
    +

    + + message)) { ?> +

    + message['title']; ?> + message['body']; ?> +

    + + + message) || $this->message['status'] !== 'good') { ?> +

    + + last_update_time); ?> +

    + +
    diff --git a/constants.php b/constants.php index e32b8cbc3..a968b82f4 100644 --- a/constants.php +++ b/constants.php @@ -1,6 +1,7 @@ change_view(Minz_Request::controllerName(), + Minz_Request::actionName()); + self::$title = Minz_Configuration::title (); + } + + /** + * Change le fichier de vue en fonction d'un controller / action + */ + public function change_view($controller_name, $action_name) { $this->view_filename = APP_PATH . self::VIEWS_PATH_NAME . '/' - . Minz_Request::controllerName () . '/' - . Minz_Request::actionName () . '.phtml'; - - self::$title = Minz_Configuration::title (); + . $controller_name . '/' + . $action_name . '.phtml'; } /** -- cgit v1.2.3 From 909d8747ba09f9c9a6ac895f1f4f0763bdb27a55 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 12 Aug 2014 20:15:46 +0200 Subject: Update system now uses HTTPS connection - Add some curl checks - Refactor code --- app/Controllers/updateController.php | 60 +++++++++++++++++++----------------- constants.php | 2 +- 2 files changed, 33 insertions(+), 29 deletions(-) (limited to 'constants.php') diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index fa62f4a70..857d975b2 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -44,43 +44,47 @@ class FreshRSS_update_Controller extends Minz_ActionController { $c = curl_init(FRESHRSS_UPDATE_WEBSITE); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); + curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2); $result = curl_exec($c); + $c_status = curl_getinfo($c, CURLINFO_HTTP_CODE); + curl_close($c); - if (curl_getinfo($c, CURLINFO_HTTP_CODE) == 200) { - $res_array = explode("\n", $result, 2); - $status = $res_array[0]; - - if (strpos($status, 'UPDATE') === 0) { - $script = $res_array[1]; - if (file_put_contents(UPDATE_FILENAME, $script) !== false) { - $this->view->message = array( - 'status' => 'good', - 'title' => _t('ok'), - 'body' => _t('update_can_apply', _url('update', 'apply')) - ); - } else { - $this->view->message = array( - 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('update_problem', 'Cannot save the update script') - ); - } - } else { - $this->view->message = array( - 'status' => 'bad', - 'title' => _t('damn'), - 'body' => _t('no_update') - ); - } - } else { + if ($c_status !== 200) { $this->view->message = array( 'status' => 'bad', 'title' => _t('damn'), 'body' => _t('update_server_not_found', FRESHRSS_UPDATE_WEBSITE) ); + return; } - curl_close($c); + $res_array = explode("\n", $result, 2); + $status = $res_array[0]; + if (strpos($status, 'UPDATE') !== 0) { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('no_update') + ); + + return; + } + + $script = $res_array[1]; + if (file_put_contents(UPDATE_FILENAME, $script) !== false) { + $this->view->message = array( + 'status' => 'good', + 'title' => _t('ok'), + 'body' => _t('update_can_apply', _url('update', 'apply')) + ); + } else { + $this->view->message = array( + 'status' => 'bad', + 'title' => _t('damn'), + 'body' => _t('update_problem', 'Cannot save the update script') + ); + } } public function applyAction() { diff --git a/constants.php b/constants.php index a968b82f4..ba9c508dc 100644 --- a/constants.php +++ b/constants.php @@ -1,7 +1,7 @@ Date: Sun, 24 Aug 2014 11:34:58 -0400 Subject: Add shortcuts Add a shortcut to open the wiki. Shortcut is F1 and is not modifiable. Add a shortcut to access user filters the same way to access share actions. --- app/Controllers/configureController.php | 2 +- app/Models/Configuration.php | 2 ++ app/i18n/en.php | 2 ++ app/i18n/fr.php | 2 ++ app/layout/nav_menu.phtml | 2 +- app/views/configure/shortcut.phtml | 8 ++++++ app/views/helpers/javascript_vars.phtml | 7 +++-- constants.php | 1 + p/scripts/main.js | 49 ++++++++++++++++++++++++++++++++- 9 files changed, 70 insertions(+), 5 deletions(-) (limited to 'constants.php') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index bb96bfae3..461cbceda 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -240,7 +240,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { 'm', 'n', 'o', 'p', 'page_down', 'page_up', 'q', 'r', 'return', 'right', 's', 'space', 't', 'tab', 'u', 'up', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', - '9', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', + '9', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12'); $this->view->list_keys = $list_keys; diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index 4c804a9fb..989603b20 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -45,6 +45,8 @@ class FreshRSS_Configuration { 'load_more' => 'm', 'auto_share' => 's', 'focus_search' => 'a', + 'user_filter' => 'u', + 'help' => 'f1', ), 'topline_read' => true, 'topline_favorite' => true, diff --git a/app/i18n/en.php b/app/i18n/en.php index be0cdc642..76da5d182 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -180,6 +180,8 @@ return array ( 'auto_share' => 'Share', 'auto_share_help' => 'If there is only one sharing mode, it is used. Else modes are accessible by their number.', 'focus_search' => 'Access search box', + 'user_filter' => 'Access user filters', + 'user_filter_help' => 'If there is only one user filter, it is used. Else filters are accessible by their number.', 'file_to_import' => 'File to import
    (OPML, Json or Zip)', 'file_to_import_no_zip' => 'File to import
    (OPML or Json)', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index 08f12234e..a8f7a3a98 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -180,6 +180,8 @@ return array ( 'auto_share' => 'Partager', 'auto_share_help' => 'S’il n’y a qu’un mode de partage, celui ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', 'focus_search' => 'Accéder à la recherche', + 'user_filter' => 'Accéder aux filtres utilisateur', + 'user_filter_help' => 'S’il n’y a qu’un filtre utilisateur, celui ci est utilisé automatiquement. Sinon ils sont accessibles par leur numéro.', 'file_to_import' => 'Fichier à importer
    (OPML, Json ou Zip)', 'file_to_import_no_zip' => 'Fichier à importer
    (OPML ou Json)', diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index 25833c16d..7cd15c1a3 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -96,7 +96,7 @@ conf->queries as $query) { ?> -
  • +
  • diff --git a/app/views/configure/shortcut.phtml b/app/views/configure/shortcut.phtml index bfb13f003..73ad0ebb8 100644 --- a/app/views/configure/shortcut.phtml +++ b/app/views/configure/shortcut.phtml @@ -103,6 +103,14 @@ +
    + +
    + + +
    +
    +
    diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 7144c519a..2144f1576 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -4,7 +4,8 @@ echo '"use strict";', "\n"; $mark = $this->conf->mark_when; echo 'var ', - 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', + 'help_url="', FRESHRSS_WIKI, '"', + ',hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', ',display_order="', Minz_Request::param('order', $this->conf->sort_order), '"', ',auto_mark_article=', $mark['article'] ? 'true' : 'false', ',auto_mark_site=', $mark['site'] ? 'true' : 'false', @@ -25,7 +26,9 @@ echo ',shortcuts={', 'collapse_entry:"', $s['collapse_entry'], '",', 'load_more:"', $s['load_more'], '",', 'auto_share:"', $s['auto_share'], '",', - 'focus_search:"', $s['focus_search'], '"', + 'focus_search:"', $s['focus_search'], '",', + 'user_filter:"', $s['user_filter'], '",', + 'help:"', $s['help'], '"', "},\n"; if (Minz_Request::param ('output') === 'global') { diff --git a/constants.php b/constants.php index e32b8cbc3..483989371 100644 --- a/constants.php +++ b/constants.php @@ -1,6 +1,7 @@ Date: Sun, 24 Aug 2014 12:46:40 -0400 Subject: Change wiki url --- constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'constants.php') diff --git a/constants.php b/constants.php index 483989371..90c7a38e4 100644 --- a/constants.php +++ b/constants.php @@ -1,7 +1,7 @@