Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option to disable and hide self-update #1436

Merged
merged 2 commits into from
Feb 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Controllers/updateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function checkAction() {
}

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);
}

Expand Down
2 changes: 2 additions & 0 deletions app/layout/aside_configure.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
2 changes: 2 additions & 0 deletions app/layout/header.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 2 additions & 1 deletion cli/do-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
'auth_type:',
'api_enabled',
'allow_robots',
'disable_update',
);

$dBparams = array(
Expand All @@ -31,7 +32,7 @@
" --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");
Expand Down
3 changes: 3 additions & 0 deletions data/config.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,7 @@

# List of enabled FreshRSS extensions.
'extensions_enabled' => array(),

# Disable self-update,
'disable_update' => false,
);