2013-04-16 Sergio Martin <sergio.martin@artica.es>

* include/styles/pandora.css
	images/blade.png: Aesthetic changes
		
	* include/ajax/events.php
	include/functions_ui.php
	include/javascript/pandora_events.js
	operation/events/events.build_table.php
	operation/events/events.php
	include/functions_config.php: Add the readonly
	mode to events list when the new option is 
	enabled on setup



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7992 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-04-16 10:10:44 +00:00
parent c9732d5453
commit bc543ffde3
9 changed files with 74 additions and 29 deletions

View File

@ -1,3 +1,17 @@
2013-04-16 Sergio Martin <sergio.martin@artica.es>
* include/styles/pandora.css
images/blade.png: Aesthetic changes
* include/ajax/events.php
include/functions_ui.php
include/javascript/pandora_events.js
operation/events/events.build_table.php
operation/events/events.php
include/functions_config.php: Add the readonly
mode to events list when the new option is
enabled on setup
2013-04-16 Miguel de Dios <miguel.dedios@artica.es>
* godmode/setup/setup.php: updated the method to fill the header

Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 B

After

Width:  |  Height:  |  Size: 378 B

View File

@ -217,6 +217,14 @@ if ($get_extended_event) {
$event = events_get_event($event_id);
}
$readonly = false;
if(!$meta &&
isset($config['event_replication']) &&
$config['event_replication'] == 1 &&
$config['show_events_in_local'] == 1) {
$readonly = true;
}
// Clean url from events and store in array
$event['clean_tags'] = events_clean_tags($event['tags']);
@ -276,7 +284,8 @@ if ($get_extended_event) {
$tabs .= "<li><a href='#extended_event_details_page' id='link_details'>".html_print_image('images/zoom.png',true).__('Details')."</a></li>";
$tabs .= "<li><a href='#extended_event_custom_fields_page' id='link_custom_fields'>".html_print_image('images/custom_field_col.png',true).__('Agent fields')."</a></li>";
$tabs .= "<li><a href='#extended_event_comments_page' id='link_comments'>".html_print_image('images/pencil.png',true).__('Comments')."</a></li>";
if (tags_check_acl ($config['id_user'], $event['id_grupo'], "EW", $event['clean_tags']) || tags_check_acl ($config['id_user'], $event['id_grupo'], "EM", $event['clean_tags'])) {
if (!$readonly &&
(tags_check_acl ($config['id_user'], $event['id_grupo'], "EW", $event['clean_tags']) || tags_check_acl ($config['id_user'], $event['id_grupo'], "EM", $event['clean_tags']))) {
$tabs .= "<li><a href='#extended_event_responses_page' id='link_responses'>".html_print_image('images/cog.png',true).__('Responses')."</a></li>";
}
$tabs .= "</ul>";
@ -307,7 +316,8 @@ if ($get_extended_event) {
break;
}
if (tags_check_acl ($config['id_user'], $event['id_grupo'], "EW", $event['clean_tags']) || tags_check_acl ($config['id_user'], $event['id_grupo'], "EM", $event['clean_tags'])) {
if (!$readonly &&
(tags_check_acl ($config['id_user'], $event['id_grupo'], "EW", $event['clean_tags']) || tags_check_acl ($config['id_user'], $event['id_grupo'], "EM", $event['clean_tags']))) {
$responses = events_page_responses($event);
}
else {

View File

@ -207,6 +207,8 @@ function config_update_config () {
$error_update[] = __('Replication DB port');
if (!config_update_value ('replication_mode', (string)get_parameter('replication_mode')))
$error_update[] = __('Replication mode');
if (!config_update_value ('show_events_in_local', (string)get_parameter('show_events_in_local')))
$error_update[] = __('Show events list in local console (read only)');
}
if (!config_update_value ('log_collector', (bool)get_parameter('log_collector')))
$error_update[] = __('Activate Log Collector');
@ -679,6 +681,10 @@ function config_process_config () {
config_update_value ('replication_mode', "only_validated");
}
if (!isset ($config["show_events_in_local"])) {
config_update_value ('show_events_in_local', 0);
}
if (!isset ($config["log_collector"])) {
config_update_value ('log_collector', 0);
}

View File

@ -2111,7 +2111,7 @@ function ui_print_page_header ($title, $icon = "", $return = false, $help = "",
$buffer .= '<ul class="mn"><li class="'.$type.'">&nbsp;' . html_print_image($icon, true, array("style" => "vertical-align:middle;", "class" => "bottom", "border" => "0", "alt" => "")) . '&nbsp; ';
$buffer .= '<span style="display: inline-block; vertical-align: top; margin-top: 2px;">' . ui_print_truncate_text($title, 45);
if ($help != "")
$buffer .= "<div style='float: right;'>" . ui_print_help_icon ($help, true, '', 'images/help_w.png') . "</div>";
$buffer .= "<div class='head_help' style='float: right; margin-top: -3px !important; margin-left: 2px !important;'>" . ui_print_help_icon ($help, true, '', 'images/help_w.png') . "</div>";
$buffer .= '</span></li></ul></div>';
if (is_array($options)) {

View File

@ -71,6 +71,8 @@ function show_event_dialog(event_id, group_rep, dialog_page, result) {
$('#notification_owner_error').show();
break;
}
forced_title_callback();
},
"html"
);

View File

@ -84,7 +84,7 @@ textarea.conf_error {
background-repeat: no-repeat;
background-position: top right;
}
input {
input, select {
padding: 2px 3px 4px 3px;
}
input.button {
@ -95,7 +95,6 @@ input.button {
margin: 10px 15px;
}
select {
padding: 0px;
border:1px solid #ddd;
}
checkbox {
@ -2399,7 +2398,7 @@ DIV.forced_title_layer {
display: block;
text-decoration: none;
position: absolute;
z-index: 100;
z-index: 100000;
border: 1px solid #708090;
background-color: #333;
color: #DDD;

View File

@ -475,25 +475,28 @@ foreach ($result as $event) {
if ($i != 0 && $allow_action) {
//Actions
$data[$i] = '';
// Validate event
if (($event["estado"] != 1) && (tags_check_acl ($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags']) == 1)) {
$data[$i] .= '<a href="javascript:validate_event_advanced('.$event["id_evento"].', 1)" id="validate-'.$event["id_evento"].'">';
$data[$i] .= html_print_image ("images/ok.png", true,
array ("title" => __('Validate event')));
$data[$i] .= '</a>';
}
// Delete event
if (tags_check_acl ($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags']) == 1) {
if($event['estado'] != 2) {
$data[$i] .= '<a class="delete_event" href="javascript:" id="delete-'.$event['id_evento'].'">';
$data[$i] .= html_print_image ("images/cross.png", true,
array ("title" => __('Delete event'), "id" => 'delete_cross_' . $event['id_evento']));
if(!$readonly) {
// Validate event
if (($event["estado"] != 1) && (tags_check_acl ($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags']) == 1)) {
$data[$i] .= '<a href="javascript:validate_event_advanced('.$event["id_evento"].', 1)" id="validate-'.$event["id_evento"].'">';
$data[$i] .= html_print_image ("images/ok.png", true,
array ("title" => __('Validate event')));
$data[$i] .= '</a>';
}
else {
$data[$i] .= html_print_image ("images/cross.disabled.png", true,
array ("title" => __('Is not allowed delete events in process'))).'&nbsp;';
// Delete event
if (tags_check_acl ($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags']) == 1) {
if($event['estado'] != 2) {
$data[$i] .= '<a class="delete_event" href="javascript:" id="delete-'.$event['id_evento'].'">';
$data[$i] .= html_print_image ("images/cross.png", true,
array ("title" => __('Delete event'), "id" => 'delete_cross_' . $event['id_evento']));
$data[$i] .= '</a>';
}
else {
$data[$i] .= html_print_image ("images/cross.disabled.png", true,
array ("title" => __('Is not allowed delete events in process'))).'&nbsp;';
}
}
}
@ -539,10 +542,10 @@ if (!empty ($table->data)) {
if ($allow_action) {
echo '<div style="width:'.$table->width.';" class="action-buttons">';
if (tags_check_acl ($config["id_user"], 0, "EW", $event['clean_tags']) == 1) {
if (!$readonly && tags_check_acl ($config["id_user"], 0, "EW", $event['clean_tags']) == 1) {
html_print_button(__('Validate selected'), 'validate_button', false, 'validate_selected();', 'class="sub ok"');
}
if (tags_check_acl ($config["id_user"], 0,"EM", $event['clean_tags']) == 1) {
if (!$readonly && tags_check_acl ($config["id_user"], 0,"EM", $event['clean_tags']) == 1) {
html_print_button(__('Delete selected'), 'delete_button', false, 'delete_selected();', 'class="sub delete"');
?>
<script type="text/javascript">

View File

@ -41,11 +41,22 @@ if(enterprise_installed() && defined("METACONSOLE")) {
// Get the history mode
$history = (bool) get_parameter('history', 0);
if (isset($config['event_replication']) && $config['event_replication'] == 1 && !$meta) {
db_pandora_audit("ACL Violation",
"Trying to access event viewer. View disabled due event replication.");
ui_print_info_message('Event viewer is disabled due event replication. For more information, please contact with the administrator');
return;
$readonly = false;
if(!$meta) {
if (isset($config['event_replication']) &&
$config['event_replication'] == 1) {
if($config['show_events_in_local'] == 0) {
db_pandora_audit("ACL Violation",
"Trying to access event viewer. View disabled due event replication.");
ui_print_info_message('Event viewer is disabled due event replication. For more information, please contact with the administrator');
return;
}
else {
$readonly = true;
}
}
}
if (is_ajax ()) {