mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-10330-14989-Safe-Operation-Mode-en-Bulks-Operations-de-Metaconsola' into 'develop'
minor fix See merge request artica/pandorafms!5673
This commit is contained in:
commit
3199cc484b
@ -289,6 +289,23 @@ if ($update_agents) {
|
|||||||
try {
|
try {
|
||||||
$node = new Node((int) $array_id[0]);
|
$node = new Node((int) $array_id[0]);
|
||||||
$node->connect();
|
$node->connect();
|
||||||
|
|
||||||
|
$id_agent = (int) $array_id[1];
|
||||||
|
|
||||||
|
// Get the id_agente_modulo to update the 'safe_operation_mode' field.
|
||||||
|
if (isset($values['safe_mode_module']) === true
|
||||||
|
&& ($values['safe_mode_module'] != '0')
|
||||||
|
) {
|
||||||
|
$id_module_safe[$id_agent] = db_get_value_filter(
|
||||||
|
'id_agente_modulo',
|
||||||
|
'tagente_modulo',
|
||||||
|
[
|
||||||
|
'id_agente' => $id_agent,
|
||||||
|
'nombre' => $values['safe_mode_module'],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$result[$id_agent] = edit_massive_agent(
|
$result[$id_agent] = edit_massive_agent(
|
||||||
(int) $array_id[1],
|
(int) $array_id[1],
|
||||||
$values,
|
$values,
|
||||||
@ -477,11 +494,7 @@ function edit_massive_agent(
|
|||||||
$agent = new Agent($id_agent);
|
$agent = new Agent($id_agent);
|
||||||
$disabled_old = $agent->disabled();
|
$disabled_old = $agent->disabled();
|
||||||
|
|
||||||
foreach ($values as $key => $value) {
|
if (empty($id_module_safe) === false) {
|
||||||
$agent->{$key}($value);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_metaconsole() === false) {
|
|
||||||
// Get the id_agent_module for this agent to update the 'safe_operation_mode' field.
|
// Get the id_agent_module for this agent to update the 'safe_operation_mode' field.
|
||||||
if (isset($values['safe_mode_module']) === true
|
if (isset($values['safe_mode_module']) === true
|
||||||
&& ($values['safe_mode_module'] != '0')
|
&& ($values['safe_mode_module'] != '0')
|
||||||
@ -490,6 +503,10 @@ function edit_massive_agent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($values as $key => $value) {
|
||||||
|
$agent->{$key}($value);
|
||||||
|
}
|
||||||
|
|
||||||
$result['db'] = $agent->save();
|
$result['db'] = $agent->save();
|
||||||
|
|
||||||
if (is_metaconsole() === false) {
|
if (is_metaconsole() === false) {
|
||||||
@ -1124,37 +1141,36 @@ $table->data[6][1] = html_print_select(
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
if (is_metaconsole() === false) {
|
$table->data[7][0] = __('Safe operation mode').': '.ui_print_help_tip(
|
||||||
$table->data[7][0] = __('Safe operation mode').': '.ui_print_help_tip(
|
__(
|
||||||
__(
|
'This mode allow %s to disable all modules of this agent while the selected module is on CRITICAL status',
|
||||||
'This mode allow %s to disable all modules of this agent while the selected module is on CRITICAL status',
|
get_product_name()
|
||||||
get_product_name()
|
),
|
||||||
),
|
true
|
||||||
true
|
);
|
||||||
);
|
$table->data[7][1] .= html_print_select(
|
||||||
$table->data[7][1] .= html_print_select(
|
[
|
||||||
[
|
1 => __('Enabled'),
|
||||||
1 => __('Enabled'),
|
0 => __('Disabled'),
|
||||||
0 => __('Disabled'),
|
],
|
||||||
],
|
'safe_mode_change',
|
||||||
'safe_mode_change',
|
-1,
|
||||||
-1,
|
'',
|
||||||
'',
|
__('No change'),
|
||||||
__('No change'),
|
-1,
|
||||||
-1,
|
true
|
||||||
true
|
).' ';
|
||||||
).' ';
|
|
||||||
$table->data[7][1] .= __('Module').' ';
|
$table->data[7][1] .= __('Module').' ';
|
||||||
$table->data[7][1] .= html_print_select(
|
$table->data[7][1] .= html_print_select(
|
||||||
'',
|
'',
|
||||||
'safe_mode_module',
|
'safe_mode_module',
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
__('Any'),
|
__('Any'),
|
||||||
-1,
|
-1,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
ui_toggle(html_print_table($table, true), __('Advanced options'));
|
ui_toggle(html_print_table($table, true), __('Advanced options'));
|
||||||
unset($table);
|
unset($table);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user