diff options
| author | 2015-11-02 21:34:14 +0100 | |
|---|---|---|
| committer | 2015-11-02 21:34:14 +0100 | |
| commit | 455e488e791cb0dd64b3b660ed8afa418d6c9641 (patch) | |
| tree | 84ba0bf1bbaaae9f822efe801e4606191864ec74 | |
| parent | a74eac88d8ccd38ff700e12cc42410e4780349a0 (diff) | |
| parent | 697817eebf754c2a05c7b4c88df1f13dbd0179da (diff) | |
Merge pull request #1024 from marienfressinaud/feature/make-url-auto-update-in-config
Move auto-update server URL alterable (config)
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rwxr-xr-x | app/Controllers/configureController.php | 1 | ||||
| -rw-r--r-- | app/Controllers/updateController.php | 5 | ||||
| -rw-r--r-- | app/Models/ConfigurationSetter.php | 8 | ||||
| -rw-r--r-- | app/i18n/cz/admin.php | 1 | ||||
| -rw-r--r-- | app/i18n/de/admin.php | 1 | ||||
| -rw-r--r-- | app/i18n/en/admin.php | 1 | ||||
| -rw-r--r-- | app/i18n/fr/admin.php | 1 | ||||
| -rw-r--r-- | app/i18n/it/admin.php | 1 | ||||
| -rw-r--r-- | app/i18n/nl/admin.php | 11 | ||||
| -rw-r--r-- | app/i18n/nl/gen.php | 1 | ||||
| -rw-r--r-- | app/views/configure/system.phtml | 9 | ||||
| -rw-r--r-- | constants.php | 1 | ||||
| -rw-r--r-- | data/config.default.php | 3 |
14 files changed, 42 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b6a18ce..828884546 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ * Visual alert on categories containing feeds in error [#984](https://github.com/FreshRSS/FreshRSS/pull/984) * I18n * Italian [#1003](https://github.com/FreshRSS/FreshRSS/issues/1003) +* Misc. + * Make auto-update server URL alterable [#1019](https://github.com/FreshRSS/FreshRSS/issues/1019) ## 2015-09-12 FreshRSS 1.1.3-beta diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 0dc7ceab2..d0f0bd68b 100755 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -317,6 +317,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController { $limits['max_categories'] = Minz_Request::param('max-categories', 16384); FreshRSS_Context::$system_conf->limits = $limits; FreshRSS_Context::$system_conf->title = Minz_Request::param('instance-name', 'FreshRSS'); + FreshRSS_Context::$system_conf->auto_update_url = Minz_Request::param('auto-update-url', false); FreshRSS_Context::$system_conf->save(); invalidateHttpCache(); diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 84a33fe85..64c984b04 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -53,7 +53,8 @@ class FreshRSS_update_Controller extends Minz_ActionController { return; } - $c = curl_init(FRESHRSS_UPDATE_WEBSITE); + $auto_update_url = FreshRSS_Context::$system_conf->auto_update_url . '?v=' . FRESHRSS_VERSION; + $c = curl_init($auto_update_url); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 2); @@ -70,7 +71,7 @@ class FreshRSS_update_Controller extends Minz_ActionController { $this->view->message = array( 'status' => 'bad', 'title' => _t('gen.short.damn'), - 'body' => _t('feedback.update.server_not_found', FRESHRSS_UPDATE_WEBSITE) + 'body' => _t('feedback.update.server_not_found', $auto_update_url) ); return; } diff --git a/app/Models/ConfigurationSetter.php b/app/Models/ConfigurationSetter.php index 5c8a1ce29..250c14c39 100644 --- a/app/Models/ConfigurationSetter.php +++ b/app/Models/ConfigurationSetter.php @@ -378,4 +378,12 @@ class FreshRSS_ConfigurationSetter { private function _unsafe_autologin_enabled(&$data, $value) { $data['unsafe_autologin_enabled'] = $this->handleBool($value); } + + private function _auto_update_url(&$data, $value) { + if (!$value) { + return; + } + + $data['auto_update_url'] = $value; + } } diff --git a/app/i18n/cz/admin.php b/app/i18n/cz/admin.php index e1fa5d141..342ac7ccd 100644 --- a/app/i18n/cz/admin.php +++ b/app/i18n/cz/admin.php @@ -148,6 +148,7 @@ return array( ), 'system' => array( '_' => 'System configuration', // @todo translate + 'auto-update-url' => 'Auto-update server URL', // @todo translate 'instance-name' => 'Instance name', // @todo translate 'max-categories' => 'Categories per user limit', // @todo translate 'max-feeds' => 'Feeds per user limit', // @todo translate diff --git a/app/i18n/de/admin.php b/app/i18n/de/admin.php index 395b51acf..6e6cc0956 100644 --- a/app/i18n/de/admin.php +++ b/app/i18n/de/admin.php @@ -148,6 +148,7 @@ return array( ), 'system' => array( '_' => 'System configuration', // @todo translate + 'auto-update-url' => 'Auto-update server URL', // @todo translate 'instance-name' => 'Instance name', // @todo translate 'max-categories' => 'Categories per user limit', // @todo translate 'max-feeds' => 'Feeds per user limit', // @todo translate diff --git a/app/i18n/en/admin.php b/app/i18n/en/admin.php index 6edb38cf0..a58771edf 100644 --- a/app/i18n/en/admin.php +++ b/app/i18n/en/admin.php @@ -148,6 +148,7 @@ return array( ), 'system' => array( '_' => 'System configuration', + 'auto-update-url' => 'Auto-update server URL', 'instance-name' => 'Instance name', 'max-categories' => 'Categories per user limit', 'max-feeds' => 'Feeds per user limit', diff --git a/app/i18n/fr/admin.php b/app/i18n/fr/admin.php index e73622577..f4f267306 100644 --- a/app/i18n/fr/admin.php +++ b/app/i18n/fr/admin.php @@ -148,6 +148,7 @@ return array( ), 'system' => array( '_' => 'Configuration du système', + 'auto-update-url' => 'URL du service de mise à jour', 'instance-name' => 'Nom de l’instance', 'max-categories' => 'Limite de catégories par utilisateur', 'max-feeds' => 'Limite de flux par utilisateur', diff --git a/app/i18n/it/admin.php b/app/i18n/it/admin.php index cb9a55c0b..94b2d6762 100644 --- a/app/i18n/it/admin.php +++ b/app/i18n/it/admin.php @@ -148,6 +148,7 @@ return array( ), 'system' => array( '_' => 'Configurazione di sistema', + 'auto-update-url' => 'Auto-update server URL', // @todo translate 'instance-name' => 'Nome istanza', 'max-categories' => 'Limite categorie per utente', 'max-feeds' => 'Limite feeds per utente', diff --git a/app/i18n/nl/admin.php b/app/i18n/nl/admin.php index 5c6a14fda..c3a3062b9 100644 --- a/app/i18n/nl/admin.php +++ b/app/i18n/nl/admin.php @@ -146,6 +146,17 @@ return array( 'title' => 'Statistieken', 'top_feed' => 'Top tien feeds', ), + 'system' => array( + '_' => 'System configuration', // @todo translate + 'auto-update-url' => 'Auto-update server URL', // @todo translate + 'instance-name' => 'Instance name', // @todo translate + 'max-categories' => 'Categories per user limit', // @todo translate + 'max-feeds' => 'Feeds per user limit', // @todo translate + 'registration' => array( + 'help' => '0 means that there is no account limit', // @todo translate + 'number' => 'Max number of accounts', // @todo translate + ), + ), 'update' => array( '_' => 'Versie controle', 'apply' => 'Toepassen', diff --git a/app/i18n/nl/gen.php b/app/i18n/nl/gen.php index b8467f92f..574f0386b 100644 --- a/app/i18n/nl/gen.php +++ b/app/i18n/nl/gen.php @@ -139,6 +139,7 @@ return array( 'sharing' => 'Delen', 'shortcuts' => 'Snelle toegang', 'stats' => 'Statistieken', + 'system' => 'System configuration', // @todo translate 'update' => 'Versie controle', 'user_management' => 'Beheer gebruikers', 'user_profile' => 'Profiel', diff --git a/app/views/configure/system.phtml b/app/views/configure/system.phtml index 9406c34d6..4af669eb0 100644 --- a/app/views/configure/system.phtml +++ b/app/views/configure/system.phtml @@ -9,7 +9,14 @@ <div class="form-group"> <label class="group-name" for="instance-name"><?php echo _t('admin.system.instance-name'); ?></label> <div class="group-controls"> - <input type="text" id="max-feeds" name="instance-name" value="<?php echo FreshRSS_Context::$system_conf->title; ?>" min="1" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->title; ?>"/> + <input type="text" class="extend" id="instance-name" name="instance-name" value="<?php echo FreshRSS_Context::$system_conf->title; ?>" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->title; ?>"/> + </div> + </div> + + <div class="form-group"> + <label class="group-name" for="auto-update-url"><?php echo _t('admin.system.auto-update-url'); ?></label> + <div class="group-controls"> + <input type="text" class="extend" id="auto-update-url" name="auto-update-url" value="<?php echo FreshRSS_Context::$system_conf->auto_update_url; ?>" data-leave-validation="<?php echo FreshRSS_Context::$system_conf->auto_update_url; ?>"/> </div> </div> diff --git a/constants.php b/constants.php index 0035c259b..1c50d4a83 100644 --- a/constants.php +++ b/constants.php @@ -1,7 +1,6 @@ <?php define('FRESHRSS_VERSION', '1.1.4-dev'); define('FRESHRSS_WEBSITE', 'http://freshrss.org'); -define('FRESHRSS_UPDATE_WEBSITE', 'https://update.freshrss.org?v=' . FRESHRSS_VERSION); define('FRESHRSS_WIKI', 'http://doc.freshrss.org'); // PHP text output compression http://php.net/ob_gzhandler (better to do it at Web server level) diff --git a/data/config.default.php b/data/config.default.php index 8eccee8a5..174592a21 100644 --- a/data/config.default.php +++ b/data/config.default.php @@ -18,6 +18,9 @@ return array( # https://freshrss.example.net/ 'base_url' => '', + # Specify address of the FreshRSS auto-update server. + 'auto_update_url' => 'https://update.freshrss.org', + # Natural language of the user interface, e.g. `en`, `fr`. 'language' => 'en', |
