Only show force button when user have a correct permmisions. Ticket: #3912
(cherry picked from commit 2476e499cf
)
This commit is contained in:
parent
e2e681ea0c
commit
de9ac07ad1
|
@ -690,7 +690,7 @@ if ($list_modules) {
|
|||
$table->data = array ();
|
||||
|
||||
$isFunctionPolicies = enterprise_include_once ('include/functions_policies.php');
|
||||
|
||||
if ($agent_w)
|
||||
$table->head[0] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
|
||||
|
||||
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
||||
|
@ -744,6 +744,7 @@ if ($list_modules) {
|
|||
|
||||
$data = array ();
|
||||
if (($module["id_modulo"] != 1) && ($module["id_tipo_modulo"] != 100)) {
|
||||
if ($agent_w) {
|
||||
if ($module["flag"] == 0) {
|
||||
$data[0] = '<a href="index.php?' .
|
||||
'sec=estado&' .
|
||||
|
@ -757,6 +758,7 @@ if ($list_modules) {
|
|||
$data[0] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&id_agente_modulo='.$module["id_agente_modulo"].'&refr=60">' . html_print_image("images/refresh.png", true, array("border" => "0", "title" => __("Refresh"))) . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$data[0] = '';
|
||||
}
|
||||
|
|
|
@ -816,6 +816,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f
|
|||
if (!defined('METACONSOLE')) {
|
||||
// Force alert execution
|
||||
$data[$index['force_execution']] = '';
|
||||
if (check_acl ($config["id_user"], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "LM")) {
|
||||
if ($alert["force_execution"] == 0) {
|
||||
$data[$index['force_execution']] =
|
||||
'<a href="'.$url.'&id_alert='.$alert["id"].'&force_execution=1&refr=60">' . html_print_image("images/target.png", true, array("border" => '0', "title" => __('Force'))) . '</a>';
|
||||
|
@ -825,6 +826,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f
|
|||
'<a href="'.$url.'&id_alert='.$alert["id"].'&refr=60">' . html_print_image("images/refresh.png", true) . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$data[$index['agent_name']] = $disabledHtmlStart;
|
||||
if ($agent == 0) {
|
||||
|
@ -2416,7 +2418,7 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "",
|
|||
|
||||
$buffer .= '<ul class="mn"><li class="' . $type . '"> ' . ' ';
|
||||
$buffer .= '<span style="margin-right:10px;">' .
|
||||
ui_print_truncate_text($title, 46);
|
||||
ui_print_truncate_text($title, 'item_title');
|
||||
if ($modal && !enterprise_installed()){
|
||||
$buffer .= "
|
||||
<div id='".$message."' class='publienterprise' title='Community version' style='float: right;margin-top: -2px !important; margin-left: 2px !important;'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>
|
||||
|
|
|
@ -417,10 +417,12 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
|||
__('S.') . "</span>";
|
||||
|
||||
if (!is_metaconsole()) {
|
||||
if (check_acl($config['id_user'], $id_group, "AW") || check_acl($config['id_user'], $id_group, "LM")) {
|
||||
$table->head[2] =
|
||||
"<span title='" . __('Force execution') . "'>" .
|
||||
__('F.') . "</span>";
|
||||
}
|
||||
}
|
||||
|
||||
$table->head[3] = __('Agent');
|
||||
$table->head[4] = __('Module');
|
||||
|
@ -460,6 +462,7 @@ if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
|||
$table->head[1] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>";
|
||||
|
||||
if (!is_metaconsole()) {
|
||||
if (check_acl($config['id_user'], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "LM"))
|
||||
$table->head[2] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
|
||||
}
|
||||
|
||||
|
@ -493,6 +496,7 @@ else {
|
|||
if ($print_agent) {
|
||||
$table->head[0] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>";
|
||||
if (!is_metaconsole()) {
|
||||
if (check_acl($config['id_user'], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "LM"))
|
||||
$table->head[1] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
|
||||
}
|
||||
$table->head[2] = __('Agent');
|
||||
|
@ -527,6 +531,7 @@ else {
|
|||
else {
|
||||
$table->head[0] = "<span title='" . __('Standby') . "'>" . __('S.') . "</span>";
|
||||
if (!is_metaconsole()) {
|
||||
if (check_acl($config['id_user'], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "LM"))
|
||||
$table->head[1] = "<span title='" . __('Force execution') . "'>" . __('F.') . "</span>";
|
||||
}
|
||||
$table->head[2] = __('Module');
|
||||
|
|
|
@ -616,6 +616,7 @@ $table->rowspan[1][0] = 0;
|
|||
|
||||
$data[0][2] = '<div style="width:100%; text-align:right">';
|
||||
$data[0][2] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&refr=60">' . html_print_image("images/refresh.png", true, array("border" => '0', "title" => __('Refresh data'), "alt" => "")) . '</a><br>';
|
||||
if (check_acl ($config["id_user"], $agent["id_grupo"], "AW"))
|
||||
$data[0][2] .= '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&flag_agent=1&id_agente='.$id_agente.'">' . html_print_image("images/target.png", true, array("border" => '0', "title" => __('Force'), "alt" => "")) . '</a>';
|
||||
$data[0][2] .= '</div>';
|
||||
|
||||
|
|
Loading…
Reference in New Issue