mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Warn if different MR on centralised environments
This commit is contained in:
parent
db85675c97
commit
54576be543
@ -8430,3 +8430,18 @@ div.stat-win-spinner img {
|
|||||||
margin: 5px;
|
margin: 5px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* err_msg_centralised */
|
||||||
|
div#err_msg_centralised div {
|
||||||
|
margin-top: 1em;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#err_msg_centralised img {
|
||||||
|
width: 100px;
|
||||||
|
margin-right: 3em;
|
||||||
|
}
|
||||||
|
div#err_msg_centralised {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
@ -1121,6 +1121,63 @@ if ($config['pure'] == 0) {
|
|||||||
include 'godmode/menu.php';
|
include 'godmode/menu.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (has_metaconsole() === true
|
||||||
|
&& (bool) $config['centralized_management'] === true
|
||||||
|
) {
|
||||||
|
$MR = (float) $config['MR'];
|
||||||
|
// Node attached to a metaconsole.
|
||||||
|
$server_id = $config['metaconsole_node_id'];
|
||||||
|
|
||||||
|
// Connect to meta.
|
||||||
|
metaconsole_load_external_db(
|
||||||
|
[
|
||||||
|
'dbhost' => $config['replication_dbhost'],
|
||||||
|
'dbuser' => $config['replication_dbuser'],
|
||||||
|
'dbpass' => io_output_password($config['replication_dbpass']),
|
||||||
|
'dbname' => $config['replication_dbname'],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
$metaMR = (float) db_get_value(
|
||||||
|
'value',
|
||||||
|
'tconfig',
|
||||||
|
'token',
|
||||||
|
'MR',
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
// Return connection to node.
|
||||||
|
metaconsole_restore_db();
|
||||||
|
|
||||||
|
if ($MR !== $metaMR) {
|
||||||
|
$err = '<div id="err_msg_centralised">'.html_print_image(
|
||||||
|
'/images/warning_modern.png',
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
$err .= '<div>'.__(
|
||||||
|
'Metaconsole MR (%d) is different than this one (%d)',
|
||||||
|
$metaMR,
|
||||||
|
$MR
|
||||||
|
);
|
||||||
|
|
||||||
|
$err .= '<br>';
|
||||||
|
$err .= __('Please keep all environment updated to same version.');
|
||||||
|
$err .= '</div>';
|
||||||
|
?>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function () {
|
||||||
|
infoMessage({
|
||||||
|
title: '<?php echo __('Warning'); ?>',
|
||||||
|
text: '<?php echo $err; ?>',
|
||||||
|
simple: true,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Session locking concurrency speedup!
|
* Session locking concurrency speedup!
|
||||||
* http://es2.php.net/manual/en/ref.session.php#64525
|
* http://es2.php.net/manual/en/ref.session.php#64525
|
||||||
@ -1362,8 +1419,6 @@ echo "\n<!-- Page generated in ".$run_time." seconds -->\n";
|
|||||||
|
|
||||||
// Values from PHP to be recovered from JAVASCRIPT.
|
// Values from PHP to be recovered from JAVASCRIPT.
|
||||||
require 'include/php_to_js_values.php';
|
require 'include/php_to_js_values.php';
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script type="text/javascript" language="javascript">
|
<script type="text/javascript" language="javascript">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user