Skip to content

Commit

Permalink
fix: added missing check on enabled online update
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Nov 30, 2024
1 parent 26669ed commit 34d5c4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion phpmyfaq/admin/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@
'ad_menu_stopwordsconfig',
$action
);
$secLevelEntries['config'] .= $adminHelper->addMenuEntry('editconfig', 'upgrade', 'ad_menu_upgrade', $action);
if ($faqConfig->get('upgrade.onlineUpdateEnabled')) {
$secLevelEntries['config'] .= $adminHelper->addMenuEntry('editconfig', 'upgrade', 'ad_menu_upgrade', $action);
}
if ($faqConfig->get('search.enableElasticsearch')) {
$secLevelEntries['config'] .= $adminHelper->addMenuEntry(
'editconfig',
Expand Down
5 changes: 4 additions & 1 deletion phpmyfaq/admin/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
$twig = new TwigWrapper(PMF_ROOT_DIR . '/assets/templates');
$template = $twig->loadTemplate('./admin/configuration/upgrade.twig');

if ($user->perm->hasPermission($user->getUserId(), PermissionType::CONFIGURATION_EDIT->value)) {
if (
$faqConfig->get('upgrade.onlineUpdateEnabled') &&
$user->perm->hasPermission($user->getUserId(), PermissionType::CONFIGURATION_EDIT->value)
) {
$templateVars = [
'adminHeaderUpgrade' => Translation::get('ad_menu_upgrade'),
'headerCheckHealth' => Translation::get('headerCheckHealth'),
Expand Down

0 comments on commit 34d5c4d

Please sign in to comment.