summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-02-24 22:46:47 +0100
committerGravatar GitHub <noreply@github.com> 2017-02-24 22:46:47 +0100
commit686311463b2bf82405d0d113469dab62a0980532 (patch)
tree6bbcd254ff9b8daedec9e585b11b2138e4501dbb
parent9f95783517c49e0c100646113b13d78053710b7b (diff)
parent9e931d1bc52443aeaf9ccf7e2b3d6eaa135368ec (diff)
Merge pull request #1436 from dswd/disable-update
Add config option to disable and hide self-update
-rw-r--r--app/Controllers/updateController.php2
-rw-r--r--app/layout/aside_configure.phtml2
-rw-r--r--app/layout/header.phtml2
-rwxr-xr-xcli/do-install.php3
-rw-r--r--data/config.default.php3
5 files changed, 10 insertions, 2 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index 8f939dbdb..b4e8a0bff 100644
--- a/app/Controllers/updateController.php
+++ b/app/Controllers/updateController.php
@@ -162,7 +162,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {
}
public function applyAction() {
- if (!file_exists(UPDATE_FILENAME) || !is_writable(FRESHRSS_PATH)) {
+ if (!file_exists(UPDATE_FILENAME) || !is_writable(FRESHRSS_PATH) || Minz_Configuration::get('system')->disable_update) {
Minz_Request::forward(array('c' => 'update'), true);
}
diff --git a/app/layout/aside_configure.phtml b/app/layout/aside_configure.phtml
index d956ec21f..94f5b1f6c 100644
--- a/app/layout/aside_configure.phtml
+++ b/app/layout/aside_configure.phtml
@@ -41,9 +41,11 @@
Minz_Request::actionName() === 'checkInstall' ? ' active' : ''; ?>">
<a href="<?php echo _url('update', 'checkInstall'); ?>"><?php echo _t('gen.menu.check_install'); ?></a>
</li>
+ <?php if (!Minz_Configuration::get('system')->disable_update) { ?>
<li class="item<?php echo Minz_Request::controllerName() === 'update' &&
Minz_Request::actionName() === 'index' ? ' active' : ''; ?>">
<a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('gen.menu.update'); ?></a>
</li>
<?php } ?>
+ <?php } ?>
</ul>
diff --git a/app/layout/header.phtml b/app/layout/header.phtml
index 238c664b0..e589ed7ef 100644
--- a/app/layout/header.phtml
+++ b/app/layout/header.phtml
@@ -71,8 +71,10 @@ if (FreshRSS_Auth::accessNeedsAction()) {
<li class="item"><a href="<?php echo _url('user', 'manage'); ?>"><?php echo _t('gen.menu.user_management'); ?></a></li>
<li class="item"><a href="<?php echo _url('auth', 'index'); ?>"><?php echo _t('gen.menu.authentication'); ?></a></li>
<li class="item"><a href="<?php echo _url('update', 'checkInstall'); ?>"><?php echo _t('gen.menu.check_install'); ?></a></li>
+ <?php if (!Minz_Configuration::get('system')->disable_update) { ?>
<li class="item"><a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('gen.menu.update'); ?></a></li>
<?php } ?>
+ <?php } ?>
<li class="separator"></li>
<li class="item"><a href="<?php echo _url('stats', 'index'); ?>"><?php echo _t('gen.menu.stats'); ?></a></li>
<li class="item"><a href="<?php echo _url('index', 'logs'); ?>"><?php echo _t('gen.menu.logs'); ?></a></li>
diff --git a/cli/do-install.php b/cli/do-install.php
index 1f9072060..c9fa3f5ab 100755
--- a/cli/do-install.php
+++ b/cli/do-install.php
@@ -13,6 +13,7 @@ $params = array(
'auth_type:',
'api_enabled',
'allow_robots',
+ 'disable_update',
);
$dBparams = array(
@@ -31,7 +32,7 @@ if (empty($options['default_user'])) {
" --environment production --base_url https://rss.example.net/" .
" --title FreshRSS --allow_anonymous --api_enabled" .
" --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123" .
- " --db-base freshrss --db-prefix freshrss_ )");
+ " --db-base freshrss --db-prefix freshrss_ --disable_update )");
}
fwrite(STDERR, 'FreshRSS install…' . "\n");
diff --git a/data/config.default.php b/data/config.default.php
index 433207a9c..748df1884 100644
--- a/data/config.default.php
+++ b/data/config.default.php
@@ -146,4 +146,7 @@ return array(
# List of enabled FreshRSS extensions.
'extensions_enabled' => array(),
+
+ # Disable self-update,
+ 'disable_update' => false,
);