2010-03-03 Sancho Lerena <slerena@artica.es>

* (A lot of files): Updated include("config.php") and replaced
        by global $config.

        * functions_db.php, functions_html.php: Fixed way to get data
        from the hash instead from the array.  




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2459 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2010-03-03 17:10:37 +00:00
parent 8f3d8f9185
commit ab2dd5a5be
49 changed files with 98 additions and 63 deletions

View File

@ -1,3 +1,11 @@
2010-03-03 Sancho Lerena <slerena@artica.es>
* (A lot of files): Updated include("config.php") and replaced by
global $config.
* functions_db.php, functions_html.php: Fixed way to get data from the hash
instead from the array.
2010-03-03 Miguel de Dios <miguel.dedios@artica.es> 2010-03-03 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_gis.php: add in the last time a function "printMap2" * include/functions_gis.php: add in the last time a function "printMap2"

View File

@ -13,7 +13,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -12,7 +12,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,8 @@
// GNU General Public License for more details. // GNU General Public License for more details.
require_once ("include/config.php"); global $config;
if ($config['flash_charts']) { if ($config['flash_charts']) {
require_once ("include/fgraph.php"); require_once ("include/fgraph.php");
} }

View File

@ -15,7 +15,8 @@
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
enterprise_include ('godmode/agentes/configurar_agente.php'); enterprise_include ('godmode/agentes/configurar_agente.php');
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login(); check_login();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login(); check_login();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -16,7 +16,8 @@
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
if ($config['flash_charts']) { if ($config['flash_charts']) {
require('include/fgraph.php'); require('include/fgraph.php');
} }

View File

@ -15,7 +15,8 @@
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
if ($config['flash_charts']) { if ($config['flash_charts']) {
require_once ("include/fgraph.php"); require_once ("include/fgraph.php");
} }

View File

@ -16,7 +16,8 @@
// Load global vars // Load global vars
require("include/config.php"); global $config;
if ($config['flash_charts']) { if ($config['flash_charts']) {
require('include/fgraph.php'); require('include/fgraph.php');
} }

View File

@ -16,7 +16,7 @@
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -15,7 +15,8 @@
// Load global vars // Load global vars
require("include/config.php"); global $config;
check_login(); check_login();
if (! give_acl ($config["id_user"], 0, "DM")) { if (! give_acl ($config["id_user"], 0, "DM")) {

View File

@ -13,7 +13,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -13,7 +13,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -13,8 +13,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config;
require_once ('include/config.php');
if (! give_acl ($config['id_user'], 0, "PM")) { if (! give_acl ($config['id_user'], 0, "PM")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global variables // Load global variables
require_once ('include/config.php'); global $config;
check_login (); check_login ();

View File

@ -15,7 +15,7 @@
// Load global variables // Load global variables
require ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Global variables // Global variables
require ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -13,6 +13,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config;
if (is_ajax ()) { if (is_ajax ()) {
$search_agents = (bool) get_parameter ('search_agents'); $search_agents = (bool) get_parameter ('search_agents');
@ -42,8 +44,6 @@ if (is_ajax ()) {
return; return;
} }
// Login check
require_once ("include/config.php");
if ($config['flash_charts']) { if ($config['flash_charts']) {
require_once ('include/fgraph.php'); require_once ('include/fgraph.php');
} }

View File

@ -13,7 +13,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global variables // Load global variables
require ("include/config.php"); global $config;
require_once ('include/functions_custom_graphs.php'); require_once ('include/functions_custom_graphs.php');

View File

@ -13,6 +13,8 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
global $config;
if (is_ajax ()) { if (is_ajax ()) {
$search_agents = (bool) get_parameter ('search_agents'); $search_agents = (bool) get_parameter ('search_agents');
@ -38,8 +40,6 @@ if (is_ajax ()) {
} }
} }
require_once ("include/config.php");
check_login (); check_login ();
if (! give_acl ($config['id_user'], 0, "IW")) { if (! give_acl ($config['id_user'], 0, "IW")) {

View File

@ -14,6 +14,8 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
global $config;
check_login (); check_login ();
if (! give_acl ($config['id_user'], 0, "AW")) { if (! give_acl ($config['id_user'], 0, "AW")) {

View File

@ -15,7 +15,7 @@
// Login check // Login check
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -16,7 +16,7 @@
// Load global vars // Load global vars
require ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -15,7 +15,7 @@
// Load global vars // Load global vars
require ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -15,7 +15,7 @@
// Load global vars // Load global vars
require ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,8 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require("include/config.php"); global $config;
require_once ("include/functions_servers.php"); require_once ("include/functions_servers.php");
check_login(); check_login();

View File

@ -16,7 +16,7 @@
// Load global vars // Load global vars
require ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
*/ */
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
*/ */
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -13,8 +13,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars global $config;
require_once ("include/config.php");
check_login (); check_login ();

View File

@ -13,7 +13,7 @@
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ('include/config.php'); global $config;
check_login (); check_login ();
$id = get_parameter ('id', $config['id_user']); // ID given as parameter $id = get_parameter ('id', $config['id_user']); // ID given as parameter

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load globar vars // Load globar vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();

View File

@ -1689,7 +1689,8 @@ function get_db_value_sql ($sql) {
if($result === false) if($result === false)
return false; return false;
return $result[0][0]; foreach ($result[0] as $f)
return $f;
} }
/** /**
@ -1804,12 +1805,17 @@ function get_db_row_filter ($table, $filter, $fields = false, $where_join = 'AND
* *
* @return mixed The selected field of the first row in a select statement. * @return mixed The selected field of the first row in a select statement.
*/ */
function get_db_sql ($sql, $field = 0, $search_history_db = false) { function get_db_sql ($sql, $field = 0, $search_history_db = false) {
$result = get_db_all_rows_sql ($sql, $search_history_db); $result = get_db_all_rows_sql ($sql, $search_history_db);
if($result === false) if($result === false)
return false; return false;
$ax = 0;
return $result[0][$field]; foreach ($result[0] as $f){
if ($field == $ax)
return $f;
$ax++;
}
} }
/** /**

View File

@ -261,7 +261,9 @@ function print_select_from_sql ($sql, $name, $selected = '', $script = '', $noth
$result = array (); $result = array ();
foreach ($result as $row) { foreach ($result as $row) {
$fields[$row[0]] = $row[1]; $id = array_shift($row);
$value = array_shift($row);
$fields[$id] = $value;
} }
return print_select ($fields, $name, $selected, $script, $nothing, $nothing_value, $return, $multiple, $sort,'',$disabled); return print_select ($fields, $name, $selected, $script, $nothing, $nothing_value, $return, $multiple, $sort,'',$disabled);

View File

@ -15,7 +15,8 @@
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
require_once ("include/functions_events.php"); require_once ("include/functions_events.php");
require_once ("include/functions_servers.php"); require_once ("include/functions_servers.php");
require_once ("include/functions_reporting.php"); require_once ("include/functions_reporting.php");
@ -44,7 +45,12 @@ function print_cells_temp ($cells) {
if ($row[1] === 0) { if ($row[1] === 0) {
$row[1] = "-"; $row[1] = "-";
} }
if (isset($row["href"]))
echo '<td class="'.$class.'" style="text-align:right;"><a class="big_data" href="'.safe_input ($row["href"]).'" style="color: '.$row["color"].';">'.$row[1].'</a></td></tr>'; echo '<td class="'.$class.'" style="text-align:right;"><a class="big_data" href="'.safe_input ($row["href"]).'" style="color: '.$row["color"].';">'.$row[1].'</a></td></tr>';
else
echo '<td class="'.$class.'" style="text-align:right;"><a class="big_data" s
tyle="color: '.$row["color"].';">'.$row[1].'</a></td></tr>';
} }
} }
@ -198,6 +204,12 @@ $cells[1][1] = $data["server_sanity"] . "%";
$cells[1]["color"] = "#000"; $cells[1]["color"] = "#000";
$cells[1]["href"] = "index.php?sec=estado_server&sec2=operation/servers/view_server&refr=60"; $cells[1]["href"] = "index.php?sec=estado_server&sec2=operation/servers/view_server&refr=60";
$cells[2][0] = __('Agents unknown');
$cells[2][1] = $data["agents_unknown"];
$cells[2]["color"] = "#000";
$cells[2]["url"] = "";
print_cells_temp ($cells); print_cells_temp ($cells);
echo "</table>"; echo "</table>";

View File

@ -14,7 +14,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// Load global vars // Load global vars
require_once ("include/config.php"); global $config;
check_login (); check_login ();