From 534aff6e2db2cf4d1cbd58e65a8c4c6588caad22 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 8 Mar 2012 18:24:24 +0000 Subject: [PATCH] 2012-03-08 Sancho Lerena * operation/visual_console/public_console.php: I miss commit the file :) git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5730 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- .../visual_console/public_console.php | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 pandora_console/operation/visual_console/public_console.php diff --git a/pandora_console/operation/visual_console/public_console.php b/pandora_console/operation/visual_console/public_console.php new file mode 100644 index 0000000000..c6bc17753b --- /dev/null +++ b/pandora_console/operation/visual_console/public_console.php @@ -0,0 +1,141 @@ +'."\n"; +echo ''."\n"; +echo ''; + +// This starts the page head. In the call back function, +// things from $page['head'] array will be processed into the head +ob_start ('ui_process_page_head'); + +require ('include/functions_visual_map.php'); + +// Auto Refresh page (can now be disabled anywhere in the script) +$config["refr"] = (int) get_parameter ("refr"); +$config["remote_addr"] = $_SERVER['REMOTE_ADDR']; + +$hash = get_parameter ('hash'); +$id_layout = (int) get_parameter ('id_layout'); +$config["id_user"] = get_parameter ('id_user'); + +$myhash = md5($config["dbpass"].$id_layout. $config["id_user"]); + +// Check input hash +if ( $myhash != $hash){ + exit; +} + +$refr = (int) get_parameter ('refr', $config['vc_refr']); +$vc_refr = false; +$layout = db_get_row ('tlayout', 'id', $id_layout); + +if (! $layout) { + db_pandora_audit("ACL Violation","Trying to access visual console without id layout"); + include ("../../general/noaccess.php"); + exit; +} + +$id_group = $layout["id_group"]; +$layout_name = $layout["name"]; +$fullscreen = $layout["fullscreen"]; +$background = $layout["background"]; +$bwidth = $layout["width"]; +$bheight = $layout["height"]; + +$pure_url = "&pure=".$config["pure"]; + +// Render map +$options = array(); + +echo "

". $layout_name. "

"; + +visual_map_print_visual_map ($id_layout); + +$values = array (); +$values[5] = human_time_description_raw (5); +$values[30] = human_time_description_raw (30); +$values[60] = human_time_description_raw (60); +$values[120] = human_time_description_raw (120); +$values[300] = human_time_description_raw (300); +$values[600] = human_time_description_raw (600); +$values[1800] = human_time_description_raw (1800); + +$table->width = '90%'; +$table->data = array (); +$table->style = array (); +$table->style[2] = 'text-align: center'; +$table->data[0][0] = __('Autorefresh time'); + +if (empty($config["vc_refr"])){ + $vc_refr = true; + $config["vc_refr"] = $refr; +} + +$table->data[0][1] = html_print_select ($values, 'refr', $config["vc_refr"], '', 'N/A', 0, true, false, false); +$table->data[0][2] = html_print_submit_button (__('Refresh'), '', false, 'class="sub next"', true); +$table->data[0][2] .= html_print_input_hidden ('vc_refr', $config["vc_refr"], true); + +if ($vc_refr){ + $config["vc_refr"] = 0; +} + +echo '
 
'; + +if ($config['pure'] && $config["refr"] != 0) { + echo '

'; +} + +echo '
 
'; + +echo '
'; +html_print_input_hidden ('pure', $config["pure"]); +html_print_input_hidden ('id', $id_layout); +html_print_table ($table); +echo '
'; + +if ($config["pure"] && $config["refr"] != 0) { + ui_require_jquery_file ('countdown'); + ui_require_css_file ('countdown'); +} +ui_require_javascript_file ('wz_jsgraphics'); +ui_require_javascript_file ('pandora_visual_console'); +?> +