From ac1e91534f94b98a31b3d646ec441a98faa15848 Mon Sep 17 00:00:00 2001 From: Matthieu Leproux Date: Fri, 22 Oct 2021 11:18:53 +0200 Subject: [PATCH] related to #1530 Status verification for Configuration > Menus page --- admin/menubar.php | 8 +++++++- admin/themes/default/template/menubar.tpl | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/admin/menubar.php b/admin/menubar.php index fd97ee293..a79714fe8 100644 --- a/admin/menubar.php +++ b/admin/menubar.php @@ -11,6 +11,10 @@ if (!defined('PHPWG_ROOT_PATH')) die ("Hacking attempt!"); } +if (!is_webmaster()) +{ + $page['warnings'][] = l10n('Webmaster status is required.'); +} function abs_fn_cmp($a, $b) { @@ -69,7 +73,7 @@ foreach ($reg_blocks as $id => $block) } -if ( isset($_POST['submit']) ) +if ( isset($_POST['submit']) and is_webmaster()) { foreach ( $mb_conf as $id => $pos ) { @@ -150,6 +154,8 @@ foreach ($mb_conf as $id => $pos ) $action = get_root_url().'admin.php?page=menubar'; $template->assign(array('F_ACTION'=>$action)); +$template->assign('isWebmaster', (is_webmaster()) ? 1 : 0); + $template->set_filename( 'menubar_admin_content', 'menubar.tpl' ); $template->assign_var_from_handle( 'ADMIN_CONTENT', 'menubar_admin_content'); ?> diff --git a/admin/themes/default/template/menubar.tpl b/admin/themes/default/template/menubar.tpl index ed6e6310a..0260b1173 100644 --- a/admin/themes/default/template/menubar.tpl +++ b/admin/themes/default/template/menubar.tpl @@ -66,7 +66,7 @@ jQuery(document).ready(function(){ {/foreach}