2013-04-24 Miguel de Dios <miguel.dedios@artica.es>
* mobile/operation/groups.php, mobile/operation/agents.php, mobile/operation/tactical.php, mobile/operation/alerts.php, mobile/operation/agent.php, mobile/operation/events.php, mobile/operation/module_graph.php, mobile/operation/modules.php, mobile/include/style/main.css: some fixes. * include/functions.php: erased the lost trace. * include/functions_graph.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8042 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
5df3aa6bce
commit
78dca092a6
|
@ -1,3 +1,15 @@
|
|||
2013-04-24 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* mobile/operation/groups.php, mobile/operation/agents.php,
|
||||
mobile/operation/tactical.php, mobile/operation/alerts.php,
|
||||
mobile/operation/agent.php, mobile/operation/events.php,
|
||||
mobile/operation/module_graph.php, mobile/operation/modules.php,
|
||||
mobile/include/style/main.css: some fixes.
|
||||
|
||||
* include/functions.php: erased the lost trace.
|
||||
|
||||
* include/functions_graph.php: cleaned source code style.
|
||||
|
||||
2013-04-24 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* godmode/servers/servers.build_table.php
|
||||
|
|
|
@ -892,7 +892,6 @@ function get_event_types ($id_type = false) {
|
|||
return $types;
|
||||
}
|
||||
else {
|
||||
html_debug_print($id_type);
|
||||
return $types[$id_type];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2496,7 +2496,7 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
array ('id_agentmodule' => $agent_module_id,
|
||||
"utimestamp <= $datelimit",
|
||||
'order' => 'utimestamp DESC'));
|
||||
if(isset($prev_event['event_type']) && $prev_event['event_type'] == 'going_unknown') {
|
||||
if (isset($prev_event['event_type']) && $prev_event['event_type'] == 'going_unknown') {
|
||||
$start_unknown = true;
|
||||
}
|
||||
|
||||
|
@ -2554,7 +2554,7 @@ function grafico_modulo_boolean_data ($agent_module_id, $period, $show_events,
|
|||
graphic_error ();
|
||||
}
|
||||
|
||||
if (empty($unit_name)){
|
||||
if (empty($unit_name)) {
|
||||
$unit = modules_get_unit($agent_module_id);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -537,6 +537,46 @@ table#list_events th {
|
|||
#list_Modules .cell_5 a {
|
||||
color: #000000 !important;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 35em) {
|
||||
#list_Modules_Embedded .cell_1 .ui-table-cell-label,
|
||||
#list_Modules_Embedded .cell_6 .ui-table-cell-label {
|
||||
min-width: auto !important;
|
||||
}
|
||||
|
||||
#list_Modules_Embedded .cell_6 .ui-table-cell-label {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
#list_Modules_Embedded .cell_3,
|
||||
#list_Modules_Embedded .cell_4 {
|
||||
display: inline !important;
|
||||
float: none !important;
|
||||
}
|
||||
|
||||
#list_Modules_Embedded .cell_0 .ui-table-cell-label,
|
||||
#list_Modules_Embedded .cell_1 .ui-table-cell-label,
|
||||
#list_Modules_Embedded .cell_3 .ui-table-cell-label,
|
||||
#list_Modules_Embedded .cell_4 .ui-table-cell-label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#list_Modules_Embedded .show_collapside {
|
||||
display: inline !important;
|
||||
}
|
||||
|
||||
#list_Modules_Embedded .data {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#list_Modules_Embedded .cell_2 {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
#list_Modules_Embedded .cell_4 a {
|
||||
color: #000000 !important;
|
||||
}
|
||||
/*END------------Modules styles---------------------------------------*/
|
||||
|
||||
|
||||
|
|
|
@ -54,16 +54,10 @@ class Agent {
|
|||
}
|
||||
|
||||
private function show_fail_acl() {
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
|
||||
$options['type'] = 'onStart';
|
||||
$options['title_text'] = __('You don\'t have access to this page');
|
||||
$options['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$ui->addDialog($options);
|
||||
|
||||
$ui->showPage();
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$home = new Home();
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
private function show_agent() {
|
||||
|
|
|
@ -133,16 +133,10 @@ class Agents {
|
|||
}
|
||||
|
||||
private function show_fail_acl() {
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
|
||||
$options['type'] = 'onStart';
|
||||
$options['title_text'] = __('You don\'t have access to this page');
|
||||
$options['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$ui->addDialog($options);
|
||||
|
||||
$ui->showPage();
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$home = new Home();
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
private function show_agents() {
|
||||
|
@ -248,7 +242,7 @@ class Agents {
|
|||
|
||||
if (empty($agents_db))
|
||||
$agents_db = array();
|
||||
html_debug_print($agents_db, true);
|
||||
|
||||
foreach ($agents_db as $agent) {
|
||||
$row = array();
|
||||
|
||||
|
|
|
@ -126,16 +126,10 @@ class Alerts {
|
|||
}
|
||||
|
||||
private function show_fail_acl() {
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
|
||||
$options['type'] = 'onStart';
|
||||
$options['title_text'] = __('You don\'t have access to this page');
|
||||
$options['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$ui->addDialog($options);
|
||||
|
||||
$ui->showPage();
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$home = new Home();
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
private function show_alerts() {
|
||||
|
@ -218,10 +212,10 @@ class Alerts {
|
|||
|
||||
public function listAlertsHtml ($return = false) {
|
||||
$countAlerts = alerts_get_alerts($this->group,
|
||||
$this->free_search, $this->status, $this->standby, "LM", true, $this->id_agent);
|
||||
$this->free_search, $this->status, $this->standby, "AR", true, $this->id_agent);
|
||||
|
||||
$alerts = alerts_get_alerts($this->group,
|
||||
$this->free_search, $this->status, $this->standby, "LM", false, $this->id_agent);
|
||||
$this->free_search, $this->status, $this->standby, "AR", false, $this->id_agent);
|
||||
if (empty($alerts))
|
||||
$alerts = array();
|
||||
|
||||
|
|
|
@ -376,16 +376,10 @@ class Events {
|
|||
}
|
||||
|
||||
private function show_fail_acl() {
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
|
||||
$options['type'] = 'onStart';
|
||||
$options['title_text'] = __('You don\'t have access to this page');
|
||||
$options['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$ui->addDialog($options);
|
||||
|
||||
$ui->showPage();
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$home = new Home();
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
private function show_events() {
|
||||
|
@ -646,15 +640,34 @@ class Events {
|
|||
|
||||
}
|
||||
|
||||
if ($this->group > 0) {
|
||||
$system = System::getInstance();
|
||||
$groups = users_get_groups($system->getConfig('id_user'), 'IR');
|
||||
|
||||
//Group selection
|
||||
if ($this->group > 0 && in_array ($this->group, array_keys ($groups))) {
|
||||
//If a group is selected and it's in the groups allowed
|
||||
$sql_post = " AND id_grupo = " . $this->group;
|
||||
$sql_post .= " AND id_grupo = " . $this->group;
|
||||
}
|
||||
else {
|
||||
if (is_user_admin ($system->getConfig('id_user'))) {
|
||||
//Do nothing if you're admin, you get full access
|
||||
$sql_post .= "";
|
||||
}
|
||||
else {
|
||||
//Otherwise select all groups the user has rights to.
|
||||
$sql_post .= " AND id_grupo IN (" .
|
||||
implode (",", array_keys ($groups)) . ")";
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->id_agent > 0) {
|
||||
$sql_post = " AND id_agente = " . $this->id_agent;
|
||||
}
|
||||
|
||||
// Skip system messages if user is not PM
|
||||
if (!check_acl($system->getConfig('id_user'), 0, "PM")) {
|
||||
$sql_post .= " AND id_grupo != 0";
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
|
||||
|
||||
|
|
|
@ -47,16 +47,10 @@ class Groups {
|
|||
}
|
||||
|
||||
private function show_fail_acl() {
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
|
||||
$options['type'] = 'onStart';
|
||||
$options['title_text'] = __('You don\'t have access to this page');
|
||||
$options['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$ui->addDialog($options);
|
||||
|
||||
$ui->showPage();
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$home = new Home();
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
private function show_group() {
|
||||
|
|
|
@ -135,7 +135,7 @@ class ModuleGraph {
|
|||
$this->avg_only, false, $date, false,
|
||||
$urlImage, 'adapter_' . $this->graph_type,
|
||||
$time_compare, $this->unknown_graph);
|
||||
if ($show_events_graph) {
|
||||
if ($this->draw_events) {
|
||||
$graph .= '<br>';
|
||||
$graph .= graphic_module_events($this->id,
|
||||
$this->width, $this->height,
|
||||
|
@ -154,7 +154,7 @@ class ModuleGraph {
|
|||
$urlImage, 1, false,
|
||||
'adapter_' . $this->graph_type,
|
||||
$time_compare, $this->unknown_graph);
|
||||
if ($show_events_graph) {
|
||||
if ($this->draw_events) {
|
||||
$graph .= '<br>';
|
||||
$graph .= graphic_module_events($this->id,
|
||||
$this->width, $this->height,
|
||||
|
@ -169,7 +169,7 @@ class ModuleGraph {
|
|||
$label, null, $this->draw_alerts, 1,
|
||||
false, $date, false, $urlImage,
|
||||
'adapter_' . $this->graph_type);
|
||||
if ($show_events_graph) {
|
||||
if ($this->draw_events) {
|
||||
$graph .= '<br>';
|
||||
$graph .= graphic_module_events($this->id,
|
||||
$this->width, $this->height,
|
||||
|
@ -183,7 +183,7 @@ class ModuleGraph {
|
|||
$this->width, $this->height,
|
||||
$label, $unit_name, $this->draw_alerts,
|
||||
1, $pure, $date);
|
||||
if ($show_events_graph) {
|
||||
if ($this->draw_events) {
|
||||
$graph .= '<br>';
|
||||
$graph .= graphic_module_events($this->id,
|
||||
$this->width, $this->height,
|
||||
|
@ -213,16 +213,10 @@ class ModuleGraph {
|
|||
}
|
||||
|
||||
private function show_fail_acl() {
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
|
||||
$options['type'] = 'onStart';
|
||||
$options['title_text'] = __('You don\'t have access to this page');
|
||||
$options['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$ui->addDialog($options);
|
||||
|
||||
$ui->showPage();
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$home = new Home();
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
private function javascript_code() {
|
||||
|
@ -291,6 +285,8 @@ class ModuleGraph {
|
|||
}
|
||||
|
||||
private function showModuleGraph() {
|
||||
$agent_name = agents_get_name($this->module['id_agente']);
|
||||
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
|
@ -303,7 +299,8 @@ class ModuleGraph {
|
|||
'value' => $this->id,
|
||||
'type' => 'hidden'
|
||||
)));
|
||||
$ui->contentBeginCollapsible("Options");
|
||||
$title = sprintf(__('Options for %s : %s'), $agent_name, $this->module["nombre"]);
|
||||
$ui->contentBeginCollapsible($title);
|
||||
$ui->beginForm("index.php?page=module_graph&id=" . $this->id);
|
||||
$options = array(
|
||||
'name' => 'draw_alerts',
|
||||
|
@ -363,21 +360,6 @@ class ModuleGraph {
|
|||
);
|
||||
$ui->formAddSlider($options);
|
||||
|
||||
/*
|
||||
$items = array('1' => __('x1'),
|
||||
'2' => __('x2'),
|
||||
'3' => __('x3'),
|
||||
'4' => __('x4'));
|
||||
$options = array(
|
||||
'name' => 'zoom',
|
||||
'title' => __('Zoom'),
|
||||
'label' => __('Zoom'),
|
||||
'items' => $items,
|
||||
'selected' => $this->zoom
|
||||
);
|
||||
$ui->formAddSelectBox($options);
|
||||
*/
|
||||
|
||||
$options = array(
|
||||
'name' => 'start_date',
|
||||
'value' => $this->start_date,
|
||||
|
|
|
@ -155,16 +155,10 @@ class Modules {
|
|||
}
|
||||
|
||||
private function show_fail_acl() {
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
|
||||
$options['type'] = 'onStart';
|
||||
$options['title_text'] = __('You don\'t have access to this page');
|
||||
$options['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$ui->addDialog($options);
|
||||
|
||||
$ui->showPage();
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$home = new Home();
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
private function show_modules() {
|
||||
|
@ -375,7 +369,7 @@ class Modules {
|
|||
$sql_limit = " LIMIT " . (int)($page * $system->getPageSize()) . "," . (int)$system->getPageSize();
|
||||
}
|
||||
|
||||
$total = db_get_value_sql($sql_total. $sql); html_debug_print($sql_select . $sql . $sql_limit, true);
|
||||
$total = db_get_value_sql($sql_total. $sql);
|
||||
$modules_db = db_get_all_rows_sql($sql_select . $sql . $sql_limit);
|
||||
|
||||
if (empty($modules_db)) {
|
||||
|
@ -520,9 +514,7 @@ class Modules {
|
|||
|
||||
$listModules = $this->getListModules($page);
|
||||
//$ui->debug($listModules, true);
|
||||
html_debug_print("-----------", true);
|
||||
html_debug_print($listModules, true);
|
||||
html_debug_print("===========", true);
|
||||
|
||||
if ($listModules['total'] == 0) {
|
||||
$html = '<p style="color: #ff0000;">' . __('No modules') . '</p>';
|
||||
if (!$return) {
|
||||
|
@ -537,6 +529,7 @@ class Modules {
|
|||
$ui->contentAddHtml($table->getHTML());
|
||||
}
|
||||
else {
|
||||
$table->id = 'list_Modules_Embedded';
|
||||
$html = $table->getHTML();
|
||||
|
||||
return $html;
|
||||
|
|
|
@ -39,16 +39,10 @@ class Tactical {
|
|||
}
|
||||
|
||||
private function show_fail_acl() {
|
||||
$ui = Ui::getInstance();
|
||||
|
||||
$ui->createPage();
|
||||
|
||||
$options['type'] = 'onStart';
|
||||
$options['title_text'] = __('You don\'t have access to this page');
|
||||
$options['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$ui->addDialog($options);
|
||||
|
||||
$ui->showPage();
|
||||
$error['title_text'] = __('You don\'t have access to this page');
|
||||
$error['content_text'] = __('Access to this page is restricted to authorized users only, please contact system administrator if you need assistance. <br><br>Please know that all attempts to access this page are recorded in security logs of Pandora System Database');
|
||||
$home = new Home();
|
||||
$home->show($error);
|
||||
}
|
||||
|
||||
private function show_tactical() {
|
||||
|
|
Loading…
Reference in New Issue