2013-04-25 Miguel de Dios <miguel.dedios@artica.es>

* general/shortcut_bar.php, general/main_menu.php,
	extensions/update_manager/update_pandora.php,
	extensions/plugin_registration.php, godmode/setup/gis_step_2.php,
	godmode/massive/massive_delete_alerts.php,
	godmode/alerts/alert_actions.php, godmode/tag/edit_tag.php,
	godmode/category/edit_category.php,
	godmode/agentes/configurar_agente.php,
	operation/snmpconsole/snmp_view.php,
	operation/search_graphs.getdata.php,
	operation/agentes/status_monitor.php: cleaned source code style.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8053 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-04-25 09:01:28 +00:00
parent 924e4c85df
commit b7de933a23
14 changed files with 41 additions and 27 deletions

View File

@ -1,3 +1,16 @@
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
* general/shortcut_bar.php, general/main_menu.php,
extensions/update_manager/update_pandora.php,
extensions/plugin_registration.php, godmode/setup/gis_step_2.php,
godmode/massive/massive_delete_alerts.php,
godmode/alerts/alert_actions.php, godmode/tag/edit_tag.php,
godmode/category/edit_category.php,
godmode/agentes/configurar_agente.php,
operation/snmpconsole/snmp_view.php,
operation/search_graphs.getdata.php,
operation/agentes/status_monitor.php: cleaned source code style.
2013-04-24 Miguel de Dios <miguel.dedios@artica.es> 2013-04-24 Miguel de Dios <miguel.dedios@artica.es>
* operation/users/user_edit.php: fixed the call to function from * operation/users/user_edit.php: fixed the call to function from

View File

@ -31,7 +31,7 @@ function pluginreg_extension_main () {
echo "<br><br>"; echo "<br><br>";
if (!isset ($_FILES['plugin_upload']['tmp_name'])){ if (!isset ($_FILES['plugin_upload']['tmp_name'])) {
// Upload form // Upload form
echo "<form name='submit_plugin' method='post' enctype='multipart/form-data'>"; echo "<form name='submit_plugin' method='post' enctype='multipart/form-data'>";
echo '<table class="databox" id="table1" width="98%" border="0" cellpadding="4" cellspacing="4">'; echo '<table class="databox" id="table1" width="98%" border="0" cellpadding="4" cellspacing="4">';
@ -67,7 +67,7 @@ function pluginreg_extension_main () {
} }
// Parse with sections // Parse with sections
if (! $ini_array = parse_ini_file($config["attachment_store"] . "/plugin_definition.ini", true)){ if (! $ini_array = parse_ini_file($config["attachment_store"] . "/plugin_definition.ini", true)) {
echo "<h2 class=error>".__("Cannot load INI file")."</h2>"; echo "<h2 class=error>".__("Cannot load INI file")."</h2>";
return; return;
} }
@ -77,7 +77,7 @@ function pluginreg_extension_main () {
// Version 2: From 5.0 // Version 2: From 5.0
$version = isset($ini_array["plugin_definition"]["version"]) ? $ini_array["plugin_definition"]["version"] : 1; $version = isset($ini_array["plugin_definition"]["version"]) ? $ini_array["plugin_definition"]["version"] : 1;
if(!isset($ini_array["plugin_definition"]["execution_postcommand"])) { if (!isset($ini_array["plugin_definition"]["execution_postcommand"])) {
$ini_array["plugin_definition"]["execution_postcommand"] = ''; $ini_array["plugin_definition"]["execution_postcommand"] = '';
} }
@ -92,11 +92,12 @@ function pluginreg_extension_main () {
$file_exec_path = $exec_path; $file_exec_path = $exec_path;
if (isset($ini_array["plugin_definition"]["execution_command"]) && ($ini_array["plugin_definition"]["execution_command"] != "")){ if (isset($ini_array["plugin_definition"]["execution_command"]) &&
($ini_array["plugin_definition"]["execution_command"] != "")) {
$exec_path = $ini_array["plugin_definition"]["execution_command"] . " " . $config["plugin_store"] . "/" . $ini_array["plugin_definition"]["filename"]; $exec_path = $ini_array["plugin_definition"]["execution_command"] . " " . $config["plugin_store"] . "/" . $ini_array["plugin_definition"]["filename"];
} }
if (!file_exists($file_exec_path)){ if (!file_exists($file_exec_path)) {
echo "<h2 class=error>".__("Plugin exec not found. Aborting!")."</h2>"; echo "<h2 class=error>".__("Plugin exec not found. Aborting!")."</h2>";
unlink ($config["attachment_store"] . "/plugin_definition.ini"); unlink ($config["attachment_store"] . "/plugin_definition.ini");
return; return;
@ -148,7 +149,7 @@ function pluginreg_extension_main () {
$create_id = db_process_sql_insert('tplugin', $values); $create_id = db_process_sql_insert('tplugin', $values);
for ($ax=1; $ax <= $ini_array["plugin_definition"]["total_modules_provided"]; $ax++){ for ($ax = 1; $ax <= $ini_array["plugin_definition"]["total_modules_provided"]; $ax++) {
$label = "module".$ax; $label = "module".$ax;
$values = array( $values = array(

View File

@ -79,7 +79,7 @@ function update_pandora_administration($settings, $user_key) {
$conf_update_pandora = update_pandora_get_conf(); $conf_update_pandora = update_pandora_get_conf();
if (!empty($conf_update_pandora['last_installed'])){ if (!empty($conf_update_pandora['last_installed'])) {
echo '<h4>'; echo '<h4>';
echo __('Your Pandora FMS open source package installed is') . echo __('Your Pandora FMS open source package installed is') .
' ' . $conf_update_pandora['last_installed']; ' ' . $conf_update_pandora['last_installed'];

View File

@ -67,7 +67,7 @@ $(document).ready( function() {
openTime = new Date().getTime(); openTime = new Date().getTime();
// Close in 1 second if is not closed manually // Close in 1 second if is not closed manually
setTimeout(function(){ setTimeout(function() {
if(openTime > 0 && handsIn == 0) { if(openTime > 0 && handsIn == 0) {
$('#menu_container').animate({"left": "-=140px"}, 100); $('#menu_container').animate({"left": "-=140px"}, 100);
openTime = 0; openTime = 0;

View File

@ -296,7 +296,7 @@ echo "</div>";
} }
$('#shortcut_button').click (function () { $('#shortcut_button').click (function () {
if ($('#shotcut_bar').css('height') == '0px'){ if ($('#shotcut_bar').css('height') == '0px') {
$('#shotcut_bar').css({height: 0}).animate({ height: '20' }, 900); $('#shotcut_bar').css({height: 0}).animate({ height: '20' }, 900);
$('#shortcut_button').css({height: 22}).animate({ height: '40' }, 900); $('#shortcut_button').css({height: 22}).animate({ height: '40' }, 900);
jQuery.post ("ajax.php", jQuery.post ("ajax.php",

View File

@ -1177,7 +1177,7 @@ if ($delete_module) { // DELETE agent module !
// Get number of components pending to delete to know when it's needed to update orders // Get number of components pending to delete to know when it's needed to update orders
$num_components = count($result_components); $num_components = count($result_components);
$last_target_module = 0; $last_target_module = 0;
foreach ($result_components as $id_target_module){ foreach ($result_components as $id_target_module) {
// Detects change of component or last component to update orders // Detects change of component or last component to update orders
if (($count_components == $num_components) or if (($count_components == $num_components) or
($last_target_module != $id_target_module)) { ($last_target_module != $id_target_module)) {

View File

@ -185,8 +185,8 @@ if ($update_action) {
$al_action = alerts_get_alert_action ($id); $al_action = alerts_get_alert_action ($id);
if ($al_action !== false){ if ($al_action !== false) {
if ($al_action['id_group'] == 0){ if ($al_action['id_group'] == 0) {
if (! check_acl ($config['id_user'], 0, "PM")) { if (! check_acl ($config['id_user'], 0, "PM")) {
db_pandora_audit("ACL Violation", db_pandora_audit("ACL Violation",
"Trying to access Alert Management"); "Trying to access Alert Management");

View File

@ -99,7 +99,7 @@ if ($create_category) {
// Form fields are filled here // Form fields are filled here
// Get results when update action is performed // Get results when update action is performed
if ($action == "update" && $id_category != 0){ if ($action == "update" && $id_category != 0) {
$result_category = db_get_row_filter('tcategory', array('id' => $id_category)); $result_category = db_get_row_filter('tcategory', array('id' => $id_category));
$name_category = $result_category["name"]; $name_category = $result_category["name"];
} // If current action is create (new) or somethig goes wrong fields are filled with void value } // If current action is create (new) or somethig goes wrong fields are filled with void value
@ -122,7 +122,7 @@ echo "<table border=0 cellpadding=4 cellspacing=4 class=databox width=98%>";
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";
echo "<tr>"; echo "<tr>";
if ($action == "update"){ if ($action == "update") {
echo "<td align=center>"; echo "<td align=center>";
html_print_input_hidden ('update_category', 1); html_print_input_hidden ('update_category', 1);
echo "</td>"; echo "</td>";
@ -130,7 +130,7 @@ echo "<table border=0 cellpadding=4 cellspacing=4 class=databox width=98%>";
html_print_submit_button (__('Update'), 'update_button', false, 'class="sub next"'); html_print_submit_button (__('Update'), 'update_button', false, 'class="sub next"');
echo "</td>"; echo "</td>";
} }
if ($action == "new"){ if ($action == "new") {
echo "<td align=center>"; echo "<td align=center>";
html_print_input_hidden ('create_category', 1); html_print_input_hidden ('create_category', 1);
echo "</td>"; echo "</td>";

View File

@ -250,7 +250,7 @@ $(document).ready (function () {
); );
}); });
$("#checkbox-recursion").click(function (){ $("#checkbox-recursion").click(function () {
$("#id_group").trigger("change"); $("#id_group").trigger("change");
}); });

View File

@ -126,7 +126,7 @@ switch ($action) {
} }
//TODO VALIDATE PARAMETERS //TODO VALIDATE PARAMETERS
if ($mapConnection_name != "" && $mapConnection_type != ""){ if ($mapConnection_name != "" && $mapConnection_type != "") {
gis_save_map_connection($mapConnection_name, $mapConnection_group, gis_save_map_connection($mapConnection_name, $mapConnection_group,
$mapConnection_numLevelsZoom, $mapConnection_defaultZoom, $mapConnection_numLevelsZoom, $mapConnection_defaultZoom,
$mapConnection_defaultLatitude, $mapConnection_defaultLongitude, $mapConnection_defaultLatitude, $mapConnection_defaultLongitude,

View File

@ -123,7 +123,7 @@ if ($create_tag) {
// Form fields are filled here // Form fields are filled here
// Get results when update action is performed // Get results when update action is performed
if ($action == "update" && $id_tag != 0){ if ($action == "update" && $id_tag != 0) {
$result_tag = tags_search_tag_id($id_tag); $result_tag = tags_search_tag_id($id_tag);
$name_tag = $result_tag["name"]; $name_tag = $result_tag["name"];
$description_tag = $result_tag["description"]; $description_tag = $result_tag["description"];
@ -179,7 +179,7 @@ echo "<table border=0 cellpadding=4 cellspacing=4 class=databox width=98%>";
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";
echo "<tr>"; echo "<tr>";
if ($action == "update"){ if ($action == "update") {
echo "<td align='center'>"; echo "<td align='center'>";
html_print_input_hidden ('update_tag', 1); html_print_input_hidden ('update_tag', 1);
echo "</td>"; echo "</td>";
@ -187,7 +187,7 @@ echo "<table border=0 cellpadding=4 cellspacing=4 class=databox width=98%>";
html_print_submit_button (__('Update'), 'update_button', false, 'class="sub next"'); html_print_submit_button (__('Update'), 'update_button', false, 'class="sub next"');
echo "</td>"; echo "</td>";
} }
if ($action == "new"){ if ($action == "new") {
echo "<td align=center>"; echo "<td align=center>";
html_print_input_hidden ('create_tag', 1); html_print_input_hidden ('create_tag', 1);
echo "</td>"; echo "</td>";

View File

@ -260,7 +260,7 @@ if (defined('METACONSOLE')) {
$result = array(); $result = array();
foreach($servers as $server) { foreach($servers as $server) {
// If connection was good then retrieve all data server // If connection was good then retrieve all data server
if (metaconsole_connect($server) == NOERR){ if (metaconsole_connect($server) == NOERR) {
$connection = true; $connection = true;
} }
else { else {

View File

@ -28,7 +28,7 @@ if ($searchGraphs) {
$usergraphs_id = array_keys($usergraphs); $usergraphs_id = array_keys($usergraphs);
if(!$usergraphs_id){ if (!$usergraphs_id) {
$graphs_condition = " AND 1<>1"; $graphs_condition = " AND 1<>1";
} }
else { else {
@ -41,7 +41,7 @@ if ($searchGraphs) {
$sql_count = "SELECT COUNT(id_graph) AS count $fromwhere"; $sql_count = "SELECT COUNT(id_graph) AS count $fromwhere";
if($only_count) { if ($only_count) {
$totalGraphs = db_get_value_sql($sql_count); $totalGraphs = db_get_value_sql($sql_count);
} }
else { else {

View File

@ -641,8 +641,8 @@ function CheckAll() {
} }
} }
function toggleDiv (divid){ function toggleDiv (divid) {
if (document.getElementById(divid).style.display == 'none'){ if (document.getElementById(divid).style.display == 'none') {
document.getElementById(divid).style.display = 'block'; document.getElementById(divid).style.display = 'block';
} }
else { else {