Merge branch 'ent-11459-Mientras-dura-el-mergeo-en-Metaconsola-en-nodos-no-aparece-el-mensaje-indicando-que-no-estan-disponibles' into 'develop'

limited access to nodes when merging

See merge request artica/pandorafms!6129
This commit is contained in:
Rafael Ameijeiras 2023-08-18 06:48:25 +00:00
commit 976f07c1e9
2 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,81 @@
<?php
/**
* Static page to lock access to console
*
* @category Wizard
* @package Pandora FMS
* @subpackage Applications.VMware
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
ui_require_css_file('maintenance');
?>
<html>
<body>
<div class="responsive center padding-6">
<p>
<?php
if (is_metaconsole() === true) {
echo __('You cannot use this metaconsole until merging process is finished');
} else {
echo __('You cannot use this console until merging process is finished');
}
?>
</p>
<br>
<br>
<?php
html_print_image(
'images/pandora_tinylogo.png',
false,
['class' => 'responsive flex margn']
);
html_print_image(
'images/maintenance.png',
false,
[
'class' => 'responsive',
'width' => 800,
]
);
?>
<br>
<br>
<p><?php echo __('You will be automatically redirected when all tasks finish'); ?></p>
</div>
</body>
<script type="text/javascript">
$(document).ready(function() {
setTimeout(
function() {
location.reload();
},
10000
);
})
</script>
</html>

View File

@ -1042,6 +1042,33 @@ if (isset($config['id_user']) === false) {
}
}
if ((bool) ($config['maintenance_mode'] ?? false) === true
&& is_user_admin($config['id_user']) === false
) {
// Show maintenance web-page. For non-admin users only.
include $config['homedir'].'/general/maintenance.php';
while (ob_get_length() > 0) {
ob_end_flush();
}
exit('</html>');
}
if ((bool) ($config['maintenance_mode'] ?? false) === true
&& $page !== 'advanced/command_center'
&& is_user_admin($config['id_user']) === true
) {
// Prevent access to metaconsole if not merged.
include 'general/admin_maintenance_mode.php';
while (ob_get_length() > 0) {
ob_end_flush();
}
exit('</html>');
}
// Enterprise support.
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
include_once ENTERPRISE_DIR.'/load_enterprise.php';