2012-12-11 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/ajax/agent.php include/functions_ui.php include/javascript/pandora.js godmode/alerts/alert_list.list.php godmode/alerts/alert_list.php godmode/alerts/alert_list.builder.php godmode/users/user_list.php godmode/users/profile_list.php godmode/users/configure_user.php godmode/users/configure_profile.php: Added user and alert editor in metaconsole. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7261 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
16e038ff15
commit
cba92b1a08
|
@ -1,3 +1,17 @@
|
|||
2012-12-11 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
|
||||
|
||||
* include/ajax/agent.php
|
||||
include/functions_ui.php
|
||||
include/javascript/pandora.js
|
||||
godmode/alerts/alert_list.list.php
|
||||
godmode/alerts/alert_list.php
|
||||
godmode/alerts/alert_list.builder.php
|
||||
godmode/users/user_list.php
|
||||
godmode/users/profile_list.php
|
||||
godmode/users/configure_user.php
|
||||
godmode/users/configure_profile.php: Added user and alert editor
|
||||
in metaconsole.
|
||||
|
||||
2012-12-11 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* include/functions_netflow.php: Added a new way of retrieving netflow
|
||||
|
|
|
@ -28,6 +28,8 @@ if (! check_acl ($config['id_user'], 0, "LW")) {
|
|||
include_once($config['homedir'] . "/include/functions_agents.php");
|
||||
include_once($config['homedir'] . '/include/functions_users.php');
|
||||
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
$table->id = 'add_alert_table';
|
||||
$table->class = 'databox';
|
||||
$table->width = '98%';
|
||||
|
@ -52,6 +54,7 @@ if (! $id_agente) {
|
|||
$params['input_name'] = 'id_agent';
|
||||
$params['selectbox_id'] = 'id_agent_module';
|
||||
$params['javascript_is_function_select'] = true;
|
||||
$params['metaconsole_enabled'] = false;
|
||||
$table->data['agent'][1] = ui_print_agent_autocomplete_input($params);
|
||||
}
|
||||
|
||||
|
@ -84,7 +87,7 @@ $table->data[1][1] .= ' <a class="template_details invisible" href="#">' .
|
|||
html_print_image("images/zoom.png", true, array("class" => 'img_help')) . '</a>';
|
||||
if (check_acl ($config['id_user'], 0, "LM")) {
|
||||
$table->data[1][1] .= html_print_image ('images/add.png', true);
|
||||
$table->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template">';
|
||||
$table->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
|
||||
$table->data[1][1] .= __('Create Template');
|
||||
$table->data[1][1] .= '</a>';
|
||||
}
|
||||
|
@ -114,18 +117,18 @@ $table->data[2][1] .= __('Number of alerts match from').' ';
|
|||
$table->data[2][1] .= html_print_input_text ('fires_min', '', '', 4, 10, true);
|
||||
$table->data[2][1] .= ' '.__('to').' ';
|
||||
$table->data[2][1] .= html_print_input_text ('fires_max', '', '', 4, 10, true);
|
||||
$table->data[2][1] .= ui_print_help_icon ("alert-matches", true);
|
||||
$table->data[2][1] .= ui_print_help_icon ("alert-matches", true, ui_get_full_url(false, false, false, false));
|
||||
$table->data[2][1] .= '</span>';
|
||||
$table->data[2][1] .= '</div>';
|
||||
if (check_acl ($config['id_user'], 0, "LM")) {
|
||||
$table->data[2][1] .= html_print_image ('images/add.png', true);
|
||||
$table->data[2][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action">';
|
||||
$table->data[2][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
|
||||
$table->data[2][1] .= __('Create Action');
|
||||
$table->data[2][1] .= '</a>';
|
||||
}
|
||||
$table->data[3][0] = __('Threshold');
|
||||
$table->data[3][1] = html_print_extended_select_for_time ('module_action_threshold', 0, '', 0,
|
||||
__('None'), false, true) . ui_print_help_icon ('action_threshold', true);
|
||||
__('None'), false, true) . ui_print_help_icon ('action_threshold', true, ui_get_full_url(false, false, false, false));
|
||||
|
||||
echo '<form class="add_alert_form" method="post">';
|
||||
|
||||
|
@ -163,7 +166,7 @@ $(document).ready (function () {
|
|||
return;
|
||||
}
|
||||
$a.unbind ()
|
||||
.attr ("href", "ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template="+id)
|
||||
.attr ("href",<?php echo "'" . ui_get_full_url(false, false, false, false) . "'"; ?> + "ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template="+id)
|
||||
.show ()
|
||||
.cluetip ({
|
||||
arrows: true,
|
||||
|
@ -190,7 +193,7 @@ $(document).ready (function () {
|
|||
var $value = $(this).siblings ("span#latest_value").hide ();
|
||||
var $loading = $(this).siblings ("span#module_loading").show ();
|
||||
$("#value", $value).empty ();
|
||||
jQuery.post ("ajax.php",
|
||||
jQuery.post (<?php echo "'" . ui_get_full_url(false, false, false, false) . "'"; ?> + "ajax.php",
|
||||
{"page" : "operation/agentes/estado_agente",
|
||||
"get_agent_module_last_value" : 1,
|
||||
"id_agent_module" : this.value
|
||||
|
|
|
@ -38,8 +38,21 @@ require_once ($config['homedir'].'/include/functions_agents.php');
|
|||
require_once ($config['homedir'].'/include/functions_modules.php');
|
||||
require_once ($config['homedir'].'/include/functions_users.php');
|
||||
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
|
||||
$sec = 'advanced';
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
$sec = 'galertas';
|
||||
|
||||
}
|
||||
|
||||
// Table for filter controls
|
||||
$form_filter = '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_list&refr='.$config["refr"].'&pure='.$config["pure"].'">';
|
||||
$form_filter = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&refr='.$config["refr"].'&pure='.$config["pure"].'">';
|
||||
$form_filter .= "<input type='hidden' name='search' value='1' />\n";
|
||||
$form_filter .= '<table style="width: 98%;" cellpadding="4" cellspacing="4" class="databox">'."\n";
|
||||
$form_filter .= "<tr>\n";
|
||||
|
@ -65,6 +78,8 @@ $params['show_helptip'] = true;
|
|||
$params['input_name'] = 'agent_name';
|
||||
$params['value'] = $agentName;
|
||||
$params['size'] = 12;
|
||||
$params['metaconsole_enabled'] = false;
|
||||
|
||||
$form_filter .= ui_print_agent_autocomplete_input($params);
|
||||
|
||||
|
||||
|
@ -295,18 +310,19 @@ if ($id_agente) {
|
|||
ui_pagination ($total, 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=' . $id_agente);
|
||||
}
|
||||
else {
|
||||
ui_pagination ($total, 'index.php?sec=galertas&sec2=godmode/alerts/alert_list&search=1' . '&template_name=' . $templateName . '&agent_name=' . $agentName . '&module_name=' . $moduleName . '&action_id=' . $actionID . '&field_content=' . $fieldContent. '&priority=' . $priority . '&enabledisable=' . $enabledisable . '&standby=' . $standby);
|
||||
ui_pagination ($total, 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&search=1' . '&template_name=' . $templateName . '&agent_name=' . $agentName . '&module_name=' . $moduleName . '&action_id=' . $actionID . '&field_content=' . $fieldContent. '&priority=' . $priority . '&enabledisable=' . $enabledisable . '&standby=' . $standby);
|
||||
}
|
||||
$simple_alerts = agents_get_alerts_simple (array_keys ($agents), false,
|
||||
array ('offset' => (int) get_parameter ('offset'),
|
||||
'limit' => $config['block_size'], 'order' => $order), $where, false);
|
||||
|
||||
$offset = get_parameter('offset');
|
||||
|
||||
if (!$id_agente) {
|
||||
$url = 'index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&offset=' . $offset;
|
||||
$url = 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'&offset=' . $offset;
|
||||
}
|
||||
else {
|
||||
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente=' . $id_agente;
|
||||
$url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente=' . $id_agente;
|
||||
}
|
||||
|
||||
$table->class = 'alert_list';
|
||||
|
@ -324,8 +340,8 @@ if (! $id_agente) {
|
|||
$table->style = array ();
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->head[0] = __('Agent') . '<br>' .
|
||||
'<a href="' . $url . '&sort_field=agent&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '</a>' .
|
||||
'<a href="' . $url . '&sort_field=agent&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . '</a>';
|
||||
'<a href="' . $url . '&sort_field=agent&sort=up&pure='.$pure.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '</a>' .
|
||||
'<a href="' . $url . '&sort_field=agent&sort=down&pure='.$pure.'">' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . '</a>';
|
||||
$table->size[0] = '20%';
|
||||
$table->size[1] = '15%';
|
||||
$table->size[2] = '15%';
|
||||
|
@ -350,11 +366,11 @@ else {
|
|||
}
|
||||
|
||||
$table->head[1] = __('Module') . '<br>' .
|
||||
'<a href="' . $url . '&sort_field=module&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' .
|
||||
'<a href="' . $url . '&sort_field=module&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>';
|
||||
'<a href="' . $url . '&sort_field=module&sort=up&pure='.$pure.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '</a>' .
|
||||
'<a href="' . $url . '&sort_field=module&sort=down&pure='.$pure.'">' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . '</a>';
|
||||
$table->head[2] = __('Template') . '<br>' .
|
||||
'<a href="' . $url . '&sort_field=template&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '</a>' .
|
||||
'<a href="' . $url . '&sort_field=template&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . '</a>';
|
||||
'<a href="' . $url . '&sort_field=template&sort=up&pure='.$pure.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '</a>' .
|
||||
'<a href="' . $url . '&sort_field=template&sort=down&pure='.$pure.'">' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . '</a>';
|
||||
/*if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
|
||||
$table->head[5] = "<span title='" . __('Policy') . "'>" . __('P.') . "</span>";
|
||||
}*/
|
||||
|
@ -407,9 +423,9 @@ foreach ($simple_alerts as $alert) {
|
|||
modules_get_agentmodule_name ($alert['id_agent_module']), 'module_small', false, true, true, '[…]', 'font-size: 7.2pt');
|
||||
|
||||
$data[2] = ' <a class="template_details"
|
||||
href="ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$alert['id_alert_template'].'">' .
|
||||
href="'.ui_get_full_url(false,false,false,false).'ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$alert['id_alert_template'].'">' .
|
||||
html_print_image("images/zoom.png", true, array("id" => 'template-details-'.$alert['id_alert_template'], "class" => "img_help")) . '</a> ';
|
||||
$data[2] .= "<a href='index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&id=".$alert['id_alert_template']."'>";
|
||||
$data[2] .= "<a href='index.php?sec=".$sec."&sec2=godmode/alerts/configure_alert_template&id=".$alert['id_alert_template']."'>";
|
||||
$data[2] .= ui_print_truncate_text(
|
||||
alerts_get_alert_template_name ($alert['id_alert_template']), GENERIC_SIZE_TEXT, false, true, true, '[…]', 'font-size: 7.1pt');
|
||||
$data[2] .= "</a>";
|
||||
|
@ -488,9 +504,9 @@ foreach ($simple_alerts as $alert) {
|
|||
$data[3] .= html_print_input_text ('fires_min', -1, '', 4, 10, true);
|
||||
$data[3] .= ' '.__('to').' ';
|
||||
$data[3] .= html_print_input_text ('fires_max', -1, '', 4, 10, true);
|
||||
$data[3] .= ui_print_help_icon ("alert-matches", true);
|
||||
$data[3] .= ui_print_help_icon ("alert-matches", true, ui_get_full_url(false, false, false, false));
|
||||
$data[3] .= '<br />' . __('Threshold');
|
||||
$data[3] .= html_print_input_text ('module_action_threshold', '', '', 4, 10, true) . ui_print_help_icon ('action_threshold', true);
|
||||
$data[3] .= html_print_input_text ('module_action_threshold', '', '', 4, 10, true) . ui_print_help_icon ('action_threshold', true, ui_get_full_url(false, false, false, false));
|
||||
$data[3] .= '</span>';
|
||||
$data[3] .= '<div class="right">';
|
||||
$data[3] .= html_print_submit_button (__('Add'), 'add_action', false, 'class="sub next"', true);
|
||||
|
@ -546,7 +562,7 @@ foreach ($simple_alerts as $alert) {
|
|||
else {
|
||||
$img = 'images/policies.png';
|
||||
|
||||
$data[5] .= ' <a href="?sec=gpolicies&sec2=enterprise/godmode/policies/policies&id=' . $policyInfo['id'] . '">' .
|
||||
$data[5] .= ' <a href="?sec=gpolicies&sec2=enterprise/godmode/policies/policies&pure='.$pure.'&id=' . $policyInfo['id'] . '">' .
|
||||
html_print_image($img,true, array('title' => $policyInfo['name'])) .
|
||||
'</a>';
|
||||
}
|
||||
|
@ -576,7 +592,7 @@ if (isset($dont_display_alert_create_bttn))
|
|||
|
||||
if ($display_create){
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=builder">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">';
|
||||
html_print_submit_button (__('Create'), 'crtbtn', false, 'class="sub next"');
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
|
|
@ -25,10 +25,11 @@ if (! check_acl ($config['id_user'], 0, "LW")) {
|
|||
exit;
|
||||
}
|
||||
|
||||
require_once ('include/functions_agents.php');
|
||||
require_once ('include/functions_alerts.php');
|
||||
require_once ('include/functions_users.php');
|
||||
require_once ($config['homedir'] . '/include/functions_agents.php');
|
||||
require_once ($config['homedir'] . '/include/functions_alerts.php');
|
||||
require_once ($config['homedir'] . '/include/functions_users.php');
|
||||
$isFunctionPolicies = enterprise_include_once ('include/functions_policies.php');
|
||||
enterprise_include_once ('meta/include/functions_alerts_meta.php');
|
||||
|
||||
$id_group = 0;
|
||||
/* Check if this page is included from a agent edition */
|
||||
|
@ -60,7 +61,7 @@ $priority = get_parameter('priority','');
|
|||
$searchFlag = get_parameter('search',0);
|
||||
$enabledisable = get_parameter('enabledisable','');
|
||||
$standby = get_parameter('standby','');
|
||||
|
||||
$pure = get_parameter('pure', 0);
|
||||
$messageAction = '';
|
||||
|
||||
if ($create_alert) {
|
||||
|
@ -263,23 +264,31 @@ if ($id_agente) {
|
|||
return;
|
||||
}
|
||||
else {
|
||||
$buttons = array(
|
||||
'list' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list">' .
|
||||
html_print_image ("images/god6.png", true, array ("title" => __('List alerts'))) .'</a>'),
|
||||
'builder' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=builder">' .
|
||||
html_print_image ("images/config.png", true, array ("title" => __('Builder alert'))) .'</a>'));
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
if ($tab == 'list') {
|
||||
ui_print_page_header(__('Alerts') . ' » ' . __('Manage alerts') . ' » ' . __('List'), "images/god2.png", false, "manage_alert_list", true, $buttons);
|
||||
}
|
||||
if (!defined('METACONSOLE')) {
|
||||
$buttons = array(
|
||||
'list' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">' .
|
||||
html_print_image ("images/god6.png", true, array ("title" => __('List alerts'))) .'</a>'),
|
||||
'builder' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">' .
|
||||
html_print_image ("images/config.png", true, array ("title" => __('Builder alert'))) .'</a>'));
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
if ($tab == 'list') {
|
||||
ui_print_page_header(__('Alerts') . ' » ' . __('Manage alerts') . ' » ' . __('List'), "images/god2.png", false, "manage_alert_list", true, $buttons);
|
||||
}
|
||||
else {
|
||||
ui_print_page_header(__('Alerts') . ' » ' . __('Manage alerts') . ' » ' . __('Create'), "images/god2.png", false, "manage_alert_list", true, $buttons);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
ui_print_page_header(__('Alerts') . ' » ' . __('Manage alerts') . ' » ' . __('Create'), "images/god2.png", false, "manage_alert_list", true, $buttons);
|
||||
|
||||
alerts_meta_print_header();
|
||||
|
||||
}
|
||||
|
||||
echo $messageAction;
|
||||
|
@ -294,7 +303,7 @@ else {
|
|||
}
|
||||
$agents = agents_get_group_agents (array_keys ($groups), false, "none");
|
||||
|
||||
require_once('godmode/alerts/alert_list.list.php');
|
||||
require_once($config['homedir'] . '/godmode/alerts/alert_list.list.php');
|
||||
|
||||
return;
|
||||
break;
|
||||
|
@ -306,7 +315,7 @@ else {
|
|||
$groups = array(0 => __('All'));
|
||||
}
|
||||
|
||||
require_once('godmode/alerts/alert_list.builder.php');
|
||||
require_once($config['homedir'] . '/godmode/alerts/alert_list.builder.php');
|
||||
|
||||
return;
|
||||
break;
|
||||
|
|
|
@ -25,22 +25,34 @@ if (! check_acl ($config['id_user'], 0, "PM")) {
|
|||
return;
|
||||
}
|
||||
|
||||
enterprise_include_once ('meta/include/functions_users_meta.php');
|
||||
|
||||
$tab = get_parameter('tab', 'profile');
|
||||
|
||||
$buttons = array(
|
||||
'user' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user">' .
|
||||
html_print_image ("images/god3.png", true, array ("title" => __('User management'))) .'</a>'),
|
||||
'profile' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile">' .
|
||||
html_print_image ("images/profiles.png", true, array ("title" => __('Profile management'))) .'</a>'));
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__('User management').' » '.__('Profiles defined in Pandora'), "images/god3.png", false, "", true, $buttons);
|
||||
if (!defined('METACONSOLE')) {
|
||||
$buttons = array(
|
||||
'user' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure='.$pure.'">' .
|
||||
html_print_image ("images/god3.png", true, array ("title" => __('User management'))) .'</a>'),
|
||||
'profile' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile&pure='.$pure.'">' .
|
||||
html_print_image ("images/profiles.png", true, array ("title" => __('Profile management'))) .'</a>'));
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
ui_print_page_header (__('User management').' » '.__('Profiles defined in Pandora'), "images/god3.png", false, "", true, $buttons);
|
||||
$sec2 = 'gusuarios';
|
||||
}
|
||||
else {
|
||||
|
||||
user_meta_print_header();
|
||||
$sec2 = 'advanced';
|
||||
|
||||
}
|
||||
|
||||
$new_profile = (bool) get_parameter ('new_profile');
|
||||
$id_profile = (int) get_parameter ('id');
|
||||
|
@ -136,7 +148,7 @@ if ($id_profile || $new_profile) {
|
|||
$table->data[10][0] = __('Pandora management');
|
||||
$table->data[10][1] = html_print_checkbox ('pandora_management', 1, $pandora_management, true);
|
||||
|
||||
echo '<form method="post" action="index.php?sec=gusuarios&sec2=godmode/users/profile_list">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/users/profile_list&pure='.$pure.'">';
|
||||
|
||||
html_print_table ($table);
|
||||
|
||||
|
|
|
@ -30,10 +30,14 @@ if (ENTERPRISE_NOT_HOOK !== enterprise_include('include/functions_policies.php')
|
|||
$enterprise_include = true;
|
||||
}
|
||||
|
||||
if ($enterprise_include)
|
||||
enterprise_include_once ('meta/include/functions_users_meta.php');
|
||||
|
||||
// This defines the working user. Beware with this, old code get confusses
|
||||
// and operates with current logged user (dangerous).
|
||||
|
||||
$id = get_parameter ('id', get_parameter ('id_user', '')); // ID given as parameter
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
$user_info = get_user_info ($id);
|
||||
|
||||
|
@ -56,21 +60,29 @@ if (!check_referer()) {
|
|||
|
||||
$tab = get_parameter('tab', 'user');
|
||||
|
||||
$buttons = array(
|
||||
'user' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user">' .
|
||||
html_print_image ("images/god3.png", true, array ("title" => __('User management'))) .'</a>'),
|
||||
'profile' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile">' .
|
||||
html_print_image ("images/profiles.png", true, array ("title" => __('Profile management'))) .'</a>'));
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__('User detail editor'), "images/god3.png", false, "", true, $buttons);
|
||||
if (defined('METACONSOLE')) {
|
||||
|
||||
user_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
|
||||
}
|
||||
else {
|
||||
$buttons = array(
|
||||
'user' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure='.$pure.'">' .
|
||||
html_print_image ("images/god3.png", true, array ("title" => __('User management'))) .'</a>'),
|
||||
'profile' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile&pure='.$pure.'">' .
|
||||
html_print_image ("images/profiles.png", true, array ("title" => __('Profile management'))) .'</a>'));
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
ui_print_page_header (__('User detail editor'), "images/god3.png", false, "", true, $buttons);
|
||||
$sec = 'gusuarios';
|
||||
}
|
||||
|
||||
if ($config['user_can_update_info']) {
|
||||
$view_mode = false;
|
||||
|
@ -510,9 +522,9 @@ foreach ($result as $profile) {
|
|||
|
||||
$data = array ();
|
||||
|
||||
$data[0] = '<a href="index.php?sec=gusaurios&sec2=godmode/users/configure_profile&id='.$profile['id_perfil'].'">'.profile_get_name ($profile['id_perfil']).'</a>';
|
||||
$data[0] = '<a href="index.php?sec=gusaurios&sec2=godmode/users/configure_profile&id='.$profile['id_perfil'].'&pure='.$pure.'">'.profile_get_name ($profile['id_perfil']).'</a>';
|
||||
$data[1] = ui_print_group_icon($profile["id_grupo"], true) .
|
||||
' <a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$profile['id_grupo'].'">' .
|
||||
' <a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$profile['id_grupo'].'&pure='.$pure.'">' .
|
||||
ui_print_truncate_text(groups_get_name ($profile['id_grupo'], True), GENERIC_SIZE_TEXT).'</a>';
|
||||
$data[2] = '<form method="post" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
||||
$data[2] .= html_print_input_hidden ('delete_profile', 1, true);
|
||||
|
|
|
@ -29,23 +29,32 @@ if (! check_acl ($config['id_user'], 0, "UM")) {
|
|||
exit;
|
||||
}
|
||||
|
||||
$tab = get_parameter('tab', 'profile');
|
||||
enterprise_include_once ('meta/include/functions_users_meta.php');
|
||||
|
||||
$buttons = array(
|
||||
$tab = get_parameter('tab', 'profile');
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
// Header
|
||||
if (!defined('METACONSOLE')) {
|
||||
$buttons = array(
|
||||
'user' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user">' .
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure='.$pure.'">' .
|
||||
html_print_image ("images/god3.png", true, array ("title" => __('User management'))) .'</a>'),
|
||||
'profile' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile">' .
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile&pure='.$pure.'">' .
|
||||
html_print_image ("images/profiles.png", true, array ("title" => __('Profile management'))) .'</a>'));
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__('User management').' » '.__('Profiles defined in Pandora'), "images/god3.png", false, "profile", true, $buttons);
|
||||
ui_print_page_header (__('User management').' » '.__('Profiles defined in Pandora'), "images/god3.png", false, "profile", true, $buttons);
|
||||
$sec = 'gusuarios';
|
||||
}
|
||||
else {
|
||||
user_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
}
|
||||
|
||||
$delete_profile = (bool) get_parameter ('delete_profile');
|
||||
$create_profile = (bool) get_parameter ('create_profile');
|
||||
|
@ -209,7 +218,7 @@ if ($profiles === false) {
|
|||
$img = html_print_image ("images/ok.png", true, array ("border" => 0));
|
||||
|
||||
foreach ($profiles as $profile) {
|
||||
$data[0] = '<a href="index.php?sec=gusuarios&sec2=godmode/users/configure_profile&id='.$profile["id_perfil"].'"><b>'.$profile["name"].'</b></a>';
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/users/configure_profile&id='.$profile["id_perfil"].'&pure='.$pure.'"><b>'.$profile["name"].'</b></a>';
|
||||
$data[1] = ($profile["incident_view"] ? $img : '');
|
||||
$data[2] = ($profile["incident_edit"] ? $img : '');
|
||||
$data[3] = ($profile["incident_management"] ? $img : '');
|
||||
|
@ -220,12 +229,12 @@ foreach ($profiles as $profile) {
|
|||
$data[8] = ($profile["db_management"] ? $img : '');
|
||||
$data[9] = ($profile["alert_management"] ? $img : '');
|
||||
$data[10] = ($profile["pandora_management"] ? $img : '');
|
||||
$data[11] = '<a href="index.php?sec=gusuarios&sec2=godmode/users/configure_profile&id='.$profile["id_perfil"].'"><b>'. html_print_image('images/config.png', true, array('title' => __('Edit'))) .'</b></a>';
|
||||
$data[11] .= ' <a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile["id_perfil"].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'. html_print_image("images/cross.png", true) . '</a>';
|
||||
$data[11] = '<a href="index.php?sec='.$sec.'&sec2=godmode/users/configure_profile&id='.$profile["id_perfil"].'&pure='.$pure.'"><b>'. html_print_image('images/config.png', true, array('title' => __('Edit'))) .'</b></a>';
|
||||
$data[11] .= ' <a href="index.php?sec='.$sec.'&sec2=godmode/users/profile_list&delete_profile=1&id='.$profile["id_perfil"].'&pure='.$pure.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'. html_print_image("images/cross.png", true) . '</a>';
|
||||
array_push ($table->data, $data);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=gusuarios&sec2=godmode/users/configure_profile">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/users/configure_profile&pure='.$pure.'">';
|
||||
if (isset($data)) {
|
||||
html_print_table ($table);
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ check_login ();
|
|||
include_once($config['homedir'] . "/include/functions_profile.php");
|
||||
include_once ($config['homedir'].'/include/functions_users.php');
|
||||
require_once ($config['homedir'] . '/include/functions_groups.php');
|
||||
enterprise_include_once ('meta/include/functions_users_meta.php');
|
||||
|
||||
if (! check_acl ($config['id_user'], 0, "UM")) {
|
||||
db_pandora_audit("ACL Violation",
|
||||
|
@ -32,6 +33,7 @@ if (! check_acl ($config['id_user'], 0, "UM")) {
|
|||
$sortField = get_parameter('sort_field');
|
||||
$sort = get_parameter('sort', 'none');
|
||||
$tab = get_parameter('tab', 'user');
|
||||
$pure = get_parameter('pure', 0);
|
||||
|
||||
$selected = 'border: 1px solid black;';
|
||||
$selectUserIDUp = '';
|
||||
|
@ -90,20 +92,33 @@ switch ($sortField) {
|
|||
break;
|
||||
}
|
||||
|
||||
$buttons = array(
|
||||
'user' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user">' .
|
||||
html_print_image ("images/god3.png", true, array ("title" => __('User management'))) .'</a>'),
|
||||
'profile' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile">' .
|
||||
html_print_image ("images/profiles.png", true, array ("title" => __('Profile management'))) .'</a>'));
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
// Header
|
||||
ui_print_page_header (__('User management').' » '.__('Users defined in Pandora'), "images/god3.png", false, "", true, $buttons);
|
||||
if (defined('METACONSOLE')) {
|
||||
|
||||
user_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
$buttons = array(
|
||||
'user' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure='.$pure.'">' .
|
||||
html_print_image ("images/god3.png", true, array ("title" => __('User management'))) .'</a>'),
|
||||
'profile' => array(
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile&pure='.$pure.'">' .
|
||||
html_print_image ("images/profiles.png", true, array ("title" => __('Profile management'))) .'</a>'));
|
||||
|
||||
ui_print_page_header (__('User management').' » '.__('Users defined in Pandora'), "images/god3.png", false, "", true, $buttons);
|
||||
|
||||
$sec = 'gusuarios';
|
||||
|
||||
}
|
||||
|
||||
$disable_user = get_parameter ("disable_user", false);
|
||||
|
||||
|
@ -169,14 +184,14 @@ $table->align = array ();
|
|||
$table->size = array ();
|
||||
|
||||
$table->head[0] = __('User ID') . ' ' .
|
||||
'<a href="?sec=gusuarios&sec2=godmode/users/user_list&sort_field=id_user&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectUserIDUp)) . '</a>' .
|
||||
'<a href="?sec=gusuarios&sec2=godmode/users/user_list&sort_field=id_user&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectUserIDDown)) . '</a>';
|
||||
'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=up&pure='.$pure.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectUserIDUp)) . '</a>' .
|
||||
'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=down&pure='.$pure.'">' . html_print_image("images/sort_down.png", true, array("style" => $selectUserIDDown)) . '</a>';
|
||||
$table->head[1] = __('Name') . ' ' .
|
||||
'<a href="?sec=gusuarios&sec2=godmode/users/user_list&sort_field=fullname&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectFullnameUp )) . '</a>' .
|
||||
'<a href="?sec=gusuarios&sec2=godmode/users/user_list&sort_field=fullname&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectFullnameDown)) . '</a>';
|
||||
'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=fullname&sort=up&pure='.$pure.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectFullnameUp )) . '</a>' .
|
||||
'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=fullname&sort=down&pure='.$pure.'">' . html_print_image("images/sort_down.png", true, array("style" => $selectFullnameDown)) . '</a>';
|
||||
$table->head[2] = __('Last contact') . ' ' .
|
||||
'<a href="?sec=gusuarios&sec2=godmode/users/user_list&sort_field=last_connect&sort=up">' . html_print_image("images/sort_up.png", true, array("style" => $selectLastConnectUp )) . '</a>' .
|
||||
'<a href="?sec=gusuarios&sec2=godmode/users/user_list&sort_field=last_connect&sort=down">' . html_print_image("images/sort_down.png", true, array("style" => $selectLastConnectDown)) . '</a>';
|
||||
'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=last_connect&sort=up&pure='.$pure.'">' . html_print_image("images/sort_up.png", true, array("style" => $selectLastConnectUp )) . '</a>' .
|
||||
'<a href="?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=last_connect&sort=down&pure='.$pure.'">' . html_print_image("images/sort_down.png", true, array("style" => $selectLastConnectDown)) . '</a>';
|
||||
$table->head[3] = __('Profile');
|
||||
$table->head[4] = __('Description');
|
||||
$table->head[5] = '<span title="Operations">' . __('Op.') . '</span>';
|
||||
|
@ -225,7 +240,7 @@ foreach ($info as $user_id => $user_info) {
|
|||
}
|
||||
$iterator++;
|
||||
|
||||
$data[0] = '<a href="index.php?sec=gusuarios&sec2=godmode/users/configure_user&id='.$user_id.'">'.$user_id.'</a>';
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/users/configure_user&pure='.$pure.'&id='.$user_id.'">'.$user_id.'</a>';
|
||||
$data[1] = $user_info["fullname"] . '<a href="#" class="tip"><span>';
|
||||
$data[1] .= __('First name') . ': ' . $user_info["firstname"].'<br />';
|
||||
$data[1] .= __('Last name') . ': ' . $user_info["lastname"].'<br />';
|
||||
|
@ -263,14 +278,14 @@ foreach ($info as $user_id => $user_info) {
|
|||
$data[4] = ui_print_string_substr ($user_info["comments"], 24, true);
|
||||
|
||||
if ($user_info['disabled'] == 0) {
|
||||
$data[5] = '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&disable_user=1&id='.$user_info['id_user'].'">'.html_print_image('images/lightbulb.png', true, array('title' => __('Disable'))).'</a>';
|
||||
$data[5] = '<a href="index.php?sec='.$sec.'&sec2=godmode/users/user_list&disable_user=1&pure='.$pure.'&id='.$user_info['id_user'].'">'.html_print_image('images/lightbulb.png', true, array('title' => __('Disable'))).'</a>';
|
||||
}
|
||||
else {
|
||||
$data[5] = '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&disable_user=0&id='.$user_info['id_user'].'">'.html_print_image('images/lightbulb_off.png', true, array('title' => __('Enable'))).'</a>';
|
||||
$data[5] = '<a href="index.php?sec='.$sec.'&sec2=godmode/users/user_list&disable_user=0&pure='.$pure.'&id='.$user_info['id_user'].'">'.html_print_image('images/lightbulb_off.png', true, array('title' => __('Enable'))).'</a>';
|
||||
}
|
||||
$data[5] .= '<a href="index.php?sec=gusuarios&sec2=godmode/users/configure_user&id='.$user_id.'">'.html_print_image('images/config.png', true, array('title' => __('Edit'))).'</a>';
|
||||
$data[5] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/users/configure_user&pure='.$pure.'&id='.$user_id.'">'.html_print_image('images/config.png', true, array('title' => __('Edit'))).'</a>';
|
||||
if ($config["admin_can_delete_user"] && $user_info['id_user'] != $config['id_user']) {
|
||||
$data[5] .= " <a href='index.php?sec=gusuarios&sec2=godmode/users/user_list&user_del=1&delete_user=".$user_info['id_user']."'>".html_print_image('images/cross.png', true, array ('title' => __('Delete'), 'onclick' => "if (! confirm ('" .__('Deleting User'). " ". $user_info['id_user'] . ". " . __('Are you sure?') ."')) return false"))."</a>";
|
||||
$data[5] .= " <a href='index.php?sec=".$sec."&sec2=godmode/users/user_list&user_del=1&pure=".$pure."&delete_user=".$user_info['id_user']."'>".html_print_image('images/cross.png', true, array ('title' => __('Delete'), 'onclick' => "if (! confirm ('" .__('Deleting User'). " ". $user_info['id_user'] . ". " . __('Are you sure?') ."')) return false"))."</a>";
|
||||
}
|
||||
else {
|
||||
$data[5] .= ''; //Delete button not in this mode
|
||||
|
@ -283,7 +298,7 @@ html_print_table ($table);
|
|||
echo '<div style="width: '.$table->width.'" class="action-buttons">';
|
||||
unset ($table);
|
||||
if ($config["admin_can_add_user"] !== false) {
|
||||
echo '<form method="post" action="index.php?sec=gusuarios&sec2=godmode/users/configure_user">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/users/configure_user&pure='.$pure.'">';
|
||||
html_print_input_hidden ('new_user', 1);
|
||||
html_print_submit_button (__('Create user'), "crt", false, 'class="sub next"');
|
||||
echo '</form>';
|
||||
|
|
|
@ -28,6 +28,7 @@ enterprise_include_once ('include/functions_metaconsole.php');
|
|||
$search_agents = (bool) get_parameter ('search_agents');
|
||||
$search_agents_2 = (bool) get_parameter ('search_agents_2');
|
||||
$get_agents_group = (bool) get_parameter('get_agents_group', false);
|
||||
$force_local = (bool) get_parameter('force_local', false);
|
||||
|
||||
if ($get_agents_group) {
|
||||
$id_group = (int)get_parameter('id_group', -1);
|
||||
|
@ -163,7 +164,7 @@ elseif ($search_agents && ($config['metaconsole'] == 1)) {
|
|||
return;
|
||||
}
|
||||
|
||||
if ($search_agents_2 && (!defined('METACONSOLE'))) {
|
||||
if ($search_agents_2 && ((!defined('METACONSOLE')) || $force_local)) {
|
||||
|
||||
require_once ('include/functions_agents.php');
|
||||
|
||||
|
|
|
@ -939,14 +939,17 @@ function ui_print_alert_template_example ($id_alert_template, $return = false, $
|
|||
*
|
||||
* @param string Id of the help article
|
||||
* @param bool Whether to return or output the result
|
||||
* @param string Home url if its necessary
|
||||
*
|
||||
* @return string The help tip
|
||||
*/
|
||||
function ui_print_help_icon ($help_id, $return = false) {
|
||||
function ui_print_help_icon ($help_id, $return = false, $home_url = '') {
|
||||
if (empty($home_url))
|
||||
$home_url = "";
|
||||
$output = ' '.html_print_image ("images/help.png", true,
|
||||
array ("class" => "img_help",
|
||||
"title" => __('Help'),
|
||||
"onclick" => "open_help ('".$help_id."')"));
|
||||
"onclick" => "open_help ('".$help_id."','".$home_url."')"));
|
||||
if (!$return)
|
||||
echo $output;
|
||||
|
||||
|
@ -2427,7 +2430,7 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||
|
||||
// Javascript configurations
|
||||
//------------------------------------------------------------------
|
||||
$javascript_ajax_page = 'ajax.php'; //Default value
|
||||
$javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false, false); //Default value
|
||||
if (isset($parameters['javascript_ajax_page'])) {
|
||||
$javascript_ajax_page = $parameters['javascript_ajax_page'];
|
||||
}
|
||||
|
@ -2491,6 +2494,10 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||
inputs.push ("get_agent_modules_json=1");
|
||||
inputs.push ("page=operation/agentes/ver_agente");
|
||||
|
||||
if (' . ((int) !$metaconsole_enabled) . ') {
|
||||
inputs.push ("force_local_modules=1");
|
||||
}
|
||||
|
||||
if (' . ((int)$metaconsole_enabled) . ') {
|
||||
inputs.push ("server_name=" + $("#' . $input_server_id . '").val());
|
||||
}
|
||||
|
@ -2551,6 +2558,11 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||
return group_id;
|
||||
}',
|
||||
'q' => 'term');
|
||||
|
||||
if (!$metaconsole_enabled) {
|
||||
$javascript_change_ajax_params_original['force_local'] = 1;
|
||||
}
|
||||
|
||||
if (isset($parameters['javascript_change_ajax_params'])) {
|
||||
$javascript_change_ajax_params = array();
|
||||
|
||||
|
@ -2815,7 +2827,11 @@ function ui_print_agent_autocomplete_input($parameters) {
|
|||
var data_params = {"page": "include/ajax/agent",
|
||||
"search_agents_2": 1,
|
||||
"id_group": 0,
|
||||
"q": term};
|
||||
"q": term};
|
||||
|
||||
if (' . ((int) !$metaconsole_enabled) . ') {
|
||||
data_params[\'force_local\'] = 1;
|
||||
}
|
||||
|
||||
jQuery.ajax ({
|
||||
data: data_params,
|
||||
|
|
|
@ -22,8 +22,8 @@ function winopeng_var (url, wid, width, height) {
|
|||
status = wid;
|
||||
}
|
||||
|
||||
function open_help (help_id) {
|
||||
open ("general/pandora_help.php?id="+help_id, "pandorahelp", "width=650,height=500,status=0,toolbar=0,menubar=0,scrollbars=1,location=0");
|
||||
function open_help (help_id, home_url) {
|
||||
open (home_url+"general/pandora_help.php?id="+help_id, "pandorahelp", "width=650,height=500,status=0,toolbar=0,menubar=0,scrollbars=1,location=0");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue