diff --git a/pandora_console/extensions/system_info.php b/pandora_console/extensions/system_info.php
index d747d8db83..8c8ab2c7e1 100644
--- a/pandora_console/extensions/system_info.php
+++ b/pandora_console/extensions/system_info.php
@@ -26,54 +26,54 @@ function getPandoraDiagnostic(&$systemInfo) {
$systemInfo["PHP Version"] = phpversion();
- $systemInfo['tagente'] = get_db_sql("SELECT COUNT(*) FROM tagente");
- $systemInfo['tagent_access'] = get_db_sql("SELECT COUNT(*) FROM tagent_access");
- $systemInfo['tagente_datos'] = get_db_sql("SELECT COUNT(*) FROM tagente_datos");
- $systemInfo['tagente_datos_string'] = get_db_sql("SELECT COUNT(*) FROM tagente_datos_string");
- $systemInfo['tagente_estado'] = get_db_sql("SELECT COUNT(*) FROM tagente_estado");
- $systemInfo['tagente_modulo'] = get_db_sql("SELECT COUNT(*) FROM tagente_modulo");
- $systemInfo['talert_actions'] = get_db_sql("SELECT COUNT(*) FROM talert_actions");
- $systemInfo['talert_commands'] = get_db_sql("SELECT COUNT(*) FROM tagente");
- $systemInfo['talert_template_modules'] = get_db_sql("SELECT COUNT(*) FROM talert_template_modules");
- $systemInfo['tlayout'] = get_db_sql("SELECT COUNT(*) FROM tlayout");
+ $systemInfo['tagente'] = db_get_sql("SELECT COUNT(*) FROM tagente");
+ $systemInfo['tagent_access'] = db_get_sql("SELECT COUNT(*) FROM tagent_access");
+ $systemInfo['tagente_datos'] = db_get_sql("SELECT COUNT(*) FROM tagente_datos");
+ $systemInfo['tagente_datos_string'] = db_get_sql("SELECT COUNT(*) FROM tagente_datos_string");
+ $systemInfo['tagente_estado'] = db_get_sql("SELECT COUNT(*) FROM tagente_estado");
+ $systemInfo['tagente_modulo'] = db_get_sql("SELECT COUNT(*) FROM tagente_modulo");
+ $systemInfo['talert_actions'] = db_get_sql("SELECT COUNT(*) FROM talert_actions");
+ $systemInfo['talert_commands'] = db_get_sql("SELECT COUNT(*) FROM tagente");
+ $systemInfo['talert_template_modules'] = db_get_sql("SELECT COUNT(*) FROM talert_template_modules");
+ $systemInfo['tlayout'] = db_get_sql("SELECT COUNT(*) FROM tlayout");
if($config['enterprise_installed'])
- $systemInfo['tlocal_component'] = get_db_sql("SELECT COUNT(*) FROM tlocal_component");
- $systemInfo['tserver'] = get_db_sql("SELECT COUNT(*) FROM tserver");
- $systemInfo['treport'] = get_db_sql("SELECT COUNT(*) FROM treport");
- $systemInfo['ttrap'] = get_db_sql("SELECT COUNT(*) FROM ttrap");
- $systemInfo['tusuario'] = get_db_sql("SELECT COUNT(*) FROM tusuario");
- $systemInfo['tsesion'] = get_db_sql("SELECT COUNT(*) FROM tsesion");
+ $systemInfo['tlocal_component'] = db_get_sql("SELECT COUNT(*) FROM tlocal_component");
+ $systemInfo['tserver'] = db_get_sql("SELECT COUNT(*) FROM tserver");
+ $systemInfo['treport'] = db_get_sql("SELECT COUNT(*) FROM treport");
+ $systemInfo['ttrap'] = db_get_sql("SELECT COUNT(*) FROM ttrap");
+ $systemInfo['tusuario'] = db_get_sql("SELECT COUNT(*) FROM tusuario");
+ $systemInfo['tsesion'] = db_get_sql("SELECT COUNT(*) FROM tsesion");
switch ($config["dbtype"]) {
case "mysql":
- $systemInfo['db_scheme_version'] = get_db_sql("SELECT `value` FROM tconfig WHERE `token` = 'db_scheme_version'");
- $systemInfo['db_scheme_build'] = get_db_sql("SELECT `value` FROM tconfig WHERE `token` = 'db_scheme_build'");
- $systemInfo['enterprise_installed'] = get_db_sql("SELECT `value` FROM tconfig WHERE `token` = 'enterprise_installed'");
- $systemInfo['db_maintance'] = date ("Y/m/d H:i:s", get_db_sql ("SELECT `value` FROM tconfig WHERE `token` = 'db_maintance'"));
- $systemInfo['customer_key'] = get_db_sql("SELECT value FROM tupdate_settings WHERE `key` = 'customer_key';");
- $systemInfo['updating_code_path'] = get_db_sql("SELECT value FROM tupdate_settings WHERE `key` = 'updating_code_path'");
- $systemInfo['keygen_path'] = get_db_sql("SELECT value FROM tupdate_settings WHERE `key` = 'keygen_path'");
- $systemInfo['current_update'] = get_db_sql("SELECT value FROM tupdate_settings WHERE `key` = 'current_update'");
+ $systemInfo['db_scheme_version'] = db_get_sql("SELECT `value` FROM tconfig WHERE `token` = 'db_scheme_version'");
+ $systemInfo['db_scheme_build'] = db_get_sql("SELECT `value` FROM tconfig WHERE `token` = 'db_scheme_build'");
+ $systemInfo['enterprise_installed'] = db_get_sql("SELECT `value` FROM tconfig WHERE `token` = 'enterprise_installed'");
+ $systemInfo['db_maintance'] = date ("Y/m/d H:i:s", db_get_sql ("SELECT `value` FROM tconfig WHERE `token` = 'db_maintance'"));
+ $systemInfo['customer_key'] = db_get_sql("SELECT value FROM tupdate_settings WHERE `key` = 'customer_key';");
+ $systemInfo['updating_code_path'] = db_get_sql("SELECT value FROM tupdate_settings WHERE `key` = 'updating_code_path'");
+ $systemInfo['keygen_path'] = db_get_sql("SELECT value FROM tupdate_settings WHERE `key` = 'keygen_path'");
+ $systemInfo['current_update'] = db_get_sql("SELECT value FROM tupdate_settings WHERE `key` = 'current_update'");
break;
case "postgresql":
- $systemInfo['db_scheme_version'] = get_db_sql("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_scheme_version'");
- $systemInfo['db_scheme_build'] = get_db_sql("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_scheme_build'");
- $systemInfo['enterprise_installed'] = get_db_sql("SELECT \"value\" FROM tconfig WHERE \"token\" = 'enterprise_installed'");
- $systemInfo['db_maintance'] = date ("Y/m/d H:i:s", get_db_sql ("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_maintance'"));
- $systemInfo['customer_key'] = get_db_sql("SELECT value FROM tupdate_settings WHERE \"key\" = 'customer_key';");
- $systemInfo['updating_code_path'] = get_db_sql("SELECT value FROM tupdate_settings WHERE \"key\" = 'updating_code_path'");
- $systemInfo['keygen_path'] = get_db_sql("SELECT value FROM tupdate_settings WHERE \"key\" = 'keygen_path'");
- $systemInfo['current_update'] = get_db_sql("SELECT value FROM tupdate_settings WHERE \"key\" = 'current_update'");
+ $systemInfo['db_scheme_version'] = db_get_sql("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_scheme_version'");
+ $systemInfo['db_scheme_build'] = db_get_sql("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_scheme_build'");
+ $systemInfo['enterprise_installed'] = db_get_sql("SELECT \"value\" FROM tconfig WHERE \"token\" = 'enterprise_installed'");
+ $systemInfo['db_maintance'] = date ("Y/m/d H:i:s", db_get_sql ("SELECT \"value\" FROM tconfig WHERE \"token\" = 'db_maintance'"));
+ $systemInfo['customer_key'] = db_get_sql("SELECT value FROM tupdate_settings WHERE \"key\" = 'customer_key';");
+ $systemInfo['updating_code_path'] = db_get_sql("SELECT value FROM tupdate_settings WHERE \"key\" = 'updating_code_path'");
+ $systemInfo['keygen_path'] = db_get_sql("SELECT value FROM tupdate_settings WHERE \"key\" = 'keygen_path'");
+ $systemInfo['current_update'] = db_get_sql("SELECT value FROM tupdate_settings WHERE \"key\" = 'current_update'");
break;
case "oracle":
- $systemInfo['db_scheme_version'] = get_db_sql("SELECT value FROM tconfig WHERE token = 'db_scheme_version'");
- $systemInfo['db_scheme_build'] = get_db_sql("SELECT value FROM tconfig WHERE token = 'db_scheme_build'");
- $systemInfo['enterprise_installed'] = get_db_sql("SELECT value FROM tconfig WHERE token = 'enterprise_installed'");
- $systemInfo['db_maintance'] = get_db_sql ("SELECT value FROM tconfig WHERE token = 'db_maintance'");
- $systemInfo['customer_key'] = get_db_sql("SELECT value FROM tupdate_settings WHERE key = 'customer_key';");
- $systemInfo['updating_code_path'] = get_db_sql("SELECT value FROM tupdate_settings WHERE key = 'updating_code_path'");
- $systemInfo['keygen_path'] = get_db_sql("SELECT value FROM tupdate_settings WHERE key = 'keygen_path'");
- $systemInfo['current_update'] = get_db_sql("SELECT value FROM tupdate_settings WHERE key = 'current_update'");
+ $systemInfo['db_scheme_version'] = db_get_sql("SELECT value FROM tconfig WHERE token = 'db_scheme_version'");
+ $systemInfo['db_scheme_build'] = db_get_sql("SELECT value FROM tconfig WHERE token = 'db_scheme_build'");
+ $systemInfo['enterprise_installed'] = db_get_sql("SELECT value FROM tconfig WHERE token = 'enterprise_installed'");
+ $systemInfo['db_maintance'] = db_get_sql ("SELECT value FROM tconfig WHERE token = 'db_maintance'");
+ $systemInfo['customer_key'] = db_get_sql("SELECT value FROM tupdate_settings WHERE key = 'customer_key';");
+ $systemInfo['updating_code_path'] = db_get_sql("SELECT value FROM tupdate_settings WHERE key = 'updating_code_path'");
+ $systemInfo['keygen_path'] = db_get_sql("SELECT value FROM tupdate_settings WHERE key = 'keygen_path'");
+ $systemInfo['current_update'] = db_get_sql("SELECT value FROM tupdate_settings WHERE key = 'current_update'");
break;
}
}
@@ -240,7 +240,7 @@ function mainSystemInfo() {
global $config;
if (! check_acl ($config['id_user'], 0, "PM") && ! is_user_admin ($config['id_user'])) {
- pandora_audit("ACL Violation", "Trying to access Setup Management");
+ db_pandora_audit("ACL Violation", "Trying to access Setup Management");
require ("general/noaccess.php");
return;
diff --git a/pandora_console/extensions/update_manager.php b/pandora_console/extensions/update_manager.php
index 031e2153fd..6781ef1c8f 100644
--- a/pandora_console/extensions/update_manager.php
+++ b/pandora_console/extensions/update_manager.php
@@ -52,13 +52,13 @@ function pandora_update_manager_install () {
break;
}
foreach ($sentences as $sentence) {
- $success = process_sql ($sentence);
+ $success = db_process_sql ($sentence);
if ($success === false)
return;
}
$values = array("token" => "update_manager_installed", "value" => 1);
- process_sql_insert('tconfig', $values);
+ db_process_sql_insert('tconfig', $values);
um_db_connect ('mysql', $config['dbhost'], $config['dbuser'],
$config['dbpass'], $config['dbname']);
@@ -72,25 +72,25 @@ function pandora_update_manager_uninstall () {
switch ($config["dbtype"]) {
case "mysql":
- process_sql ('DELETE FROM `tconfig` WHERE `token` = "update_manager_installed"');
- process_sql ('DROP TABLE `tupdate_settings`');
- process_sql ('DROP TABLE `tupdate_journal`');
- process_sql ('DROP TABLE `tupdate`');
- process_sql ('DROP TABLE `tupdate_package`');
+ db_process_sql ('DELETE FROM `tconfig` WHERE `token` = "update_manager_installed"');
+ db_process_sql ('DROP TABLE `tupdate_settings`');
+ db_process_sql ('DROP TABLE `tupdate_journal`');
+ db_process_sql ('DROP TABLE `tupdate`');
+ db_process_sql ('DROP TABLE `tupdate_package`');
break;
case "postgresql":
- process_sql ('DELETE FROM "tconfig" WHERE "token" = \'update_manager_installed\'');
- process_sql ('DROP TABLE "tupdate_settings"');
- process_sql ('DROP TABLE "tupdate_journal"');
- process_sql ('DROP TABLE "tupdate"');
- process_sql ('DROP TABLE "tupdate_package"');
+ db_process_sql ('DELETE FROM "tconfig" WHERE "token" = \'update_manager_installed\'');
+ db_process_sql ('DROP TABLE "tupdate_settings"');
+ db_process_sql ('DROP TABLE "tupdate_journal"');
+ db_process_sql ('DROP TABLE "tupdate"');
+ db_process_sql ('DROP TABLE "tupdate_package"');
break;
case "oracle":
- process_sql ('DELETE FROM tconfig WHERE token = \'update_manager_installed\'');
- process_sql ('DROP TABLE tupdate_settings');
- process_sql ('DROP TABLE tupdate_journal');
- process_sql ('DROP TABLE tupdate');
- process_sql ('DROP TABLE tupdate_package');
+ db_process_sql ('DELETE FROM tconfig WHERE token = \'update_manager_installed\'');
+ db_process_sql ('DROP TABLE tupdate_settings');
+ db_process_sql ('DROP TABLE tupdate_journal');
+ db_process_sql ('DROP TABLE tupdate');
+ db_process_sql ('DROP TABLE tupdate_package');
break;
}
}
@@ -116,7 +116,7 @@ function pandora_update_manager_login () {
if (!isset($config["autoupdate"])){
$config["autoupdate"] = 1;
- process_sql_insert('tconfig', array('token' => 'autoupdate', 'value' => 0));
+ db_process_sql_insert('tconfig', array('token' => 'autoupdate', 'value' => 0));
}
if ($config["autoupdate"] == 0)
diff --git a/pandora_console/extensions/update_manager/lib/libupdate_manager.php b/pandora_console/extensions/update_manager/lib/libupdate_manager.php
index a02c08a877..2e861d5275 100644
--- a/pandora_console/extensions/update_manager/lib/libupdate_manager.php
+++ b/pandora_console/extensions/update_manager/lib/libupdate_manager.php
@@ -20,7 +20,7 @@ require_once ('libupdate_manager_components.php');
require_once ('libupdate_manager_client.php');
function um_db_load_settings () {
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_settings');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_settings');
if($result === false) {
echo '
Error reading settings';
return NULL;
@@ -43,13 +43,13 @@ function um_db_update_setting ($key, $value = '') {
switch ($config["dbtype"]) {
case "mysql":
- $result = get_db_value('COUNT(*)', DB_PREFIX.'tupdate_settings', '`key`', $key);
+ $result = db_get_value('COUNT(*)', DB_PREFIX.'tupdate_settings', '`key`', $key);
break;
case "postgresql":
- $result = get_db_value('COUNT(*)', DB_PREFIX.'tupdate_settings', '"key"', $key);
+ $result = db_get_value('COUNT(*)', DB_PREFIX.'tupdate_settings', '"key"', $key);
break;
case "oracle":
- $result = get_db_value('COUNT(*)', DB_PREFIX.'tupdate_settings', 'key', $key);
+ $result = db_get_value('COUNT(*)', DB_PREFIX.'tupdate_settings', 'key', $key);
break;
}
@@ -61,13 +61,13 @@ function um_db_update_setting ($key, $value = '') {
if($result > 0) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql_update(DB_PREFIX.'tupdate_settings', array('value' => $value), array('`key`' => $key));
+ $result = db_process_sql_update(DB_PREFIX.'tupdate_settings', array('value' => $value), array('`key`' => $key));
break;
case "postgresql":
- $result = process_sql_update(DB_PREFIX.'tupdate_settings', array('value' => $value), array('"key"' => $key));
+ $result = db_process_sql_update(DB_PREFIX.'tupdate_settings', array('value' => $value), array('"key"' => $key));
break;
case "oracle":
- $result = process_sql_update(DB_PREFIX.'tupdate_settings', array('value' => $value), array('key' => $key));
+ $result = db_process_sql_update(DB_PREFIX.'tupdate_settings', array('value' => $value), array('key' => $key));
break;
}
@@ -79,13 +79,13 @@ function um_db_update_setting ($key, $value = '') {
else {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql_insert(DB_PREFIX.'tupdate_settings', array('`key`' => $key, '`value`' => $value));
+ $result = db_process_sql_insert(DB_PREFIX.'tupdate_settings', array('`key`' => $key, '`value`' => $value));
break;
case "postgresql":
- $result = process_sql_insert(DB_PREFIX.'tupdate_settings', array('"key"' => $key, '"value"' => $value));
+ $result = db_process_sql_insert(DB_PREFIX.'tupdate_settings', array('"key"' => $key, '"value"' => $value));
break;
case "oracle":
- $result = process_sql_insert(DB_PREFIX.'tupdate_settings', array('key' => $key, 'value' => $value));
+ $result = db_process_sql_insert(DB_PREFIX.'tupdate_settings', array('key' => $key, 'value' => $value));
break;
}
@@ -99,14 +99,14 @@ function um_db_update_setting ($key, $value = '') {
}
function um_db_get_latest_package_by_status ($id_package = '0', $status = 'public') {
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_package WHERE status = "'.$status.'" AND id > ' . $id_package . ' ORDER BY id DESC LIMIT 1');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_package WHERE status = "'.$status.'" AND id > ' . $id_package . ' ORDER BY id DESC LIMIT 1');
if($result === false) {
echo '
Error reading latest package with status ' . $status . '';
return false;
}
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_package WHERE status = "'.$status.'" AND id > ' . $id_package . ' ORDER BY id DESC LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_package WHERE status = "'.$status.'" AND id > ' . $id_package . ' ORDER BY id DESC LIMIT 1');
$package = um_std_from_result($result);
@@ -124,7 +124,7 @@ function um_db_get_next_package ($id_package = '0', $development = false) {
}
function um_db_create_package ($description = '') {
- $result = process_sql_insert(DB_PREFIX.'tupdate_package', array('description' => $description));
+ $result = db_process_sql_insert(DB_PREFIX.'tupdate_package', array('description' => $description));
if($result === false) {
echo '
Error creating package';
@@ -138,7 +138,7 @@ function um_db_update_package ($id_package, $description = '', $status = 'disabl
$values = array ('description' => $description, 'status' => $status);
$where = array ('id' => $id_package);
- $result = process_sql_update(DB_PREFIX.'tupdate_package', $values, $where);
+ $result = db_process_sql_update(DB_PREFIX.'tupdate_package', $values, $where);
if($result === false) {
echo '
Error updating package';
@@ -156,7 +156,7 @@ function um_db_delete_package ($id_package) {
return false;
}
- $result = process_sql_delete(DB_PREFIX.'tupdate_package', array('id' => $id_package));
+ $result = db_process_sql_delete(DB_PREFIX.'tupdate_package', array('id' => $id_package));
if($result === false) {
echo '
Error deleting package';
@@ -167,7 +167,7 @@ function um_db_delete_package ($id_package) {
}
function um_db_get_package ($id_package) {
- $result = process_sql ('SELECT * FROM '.DB_PREFIX.'tupdate_package WHERE id = ' . $id_package . ' LIMIT 1');
+ $result = db_process_sql ('SELECT * FROM '.DB_PREFIX.'tupdate_package WHERE id = ' . $id_package . ' LIMIT 1');
if ($result === false) {
echo '
Error getting package info';
return NULL;
@@ -194,7 +194,7 @@ function um_std_from_result($array, $i = 0) {
}
function um_db_get_all_packages () {
- $result = process_sql ('SELECT * FROM '.DB_PREFIX.'tupdate_package');
+ $result = db_process_sql ('SELECT * FROM '.DB_PREFIX.'tupdate_package');
if ($result === false) {
echo '
Error getting all packages';
return NULL;
@@ -215,13 +215,13 @@ function um_db_get_all_packages () {
}
function um_db_get_package_updates ($id_package) {
- $result = process_sql ('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate WHERE id_update_package = ' . $id_package);
+ $result = db_process_sql ('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate WHERE id_update_package = ' . $id_package);
if ($result === false) {
echo '
Error getting all packages '.$id_package.''.'SELECT * FROM '.DB_PREFIX.'tupdate WHERE id_update_package = ' . $id_package;
return NULL;
}
- $result = process_sql ('SELECT * FROM '.DB_PREFIX.'tupdate WHERE id_update_package = ' . $id_package);
+ $result = db_process_sql ('SELECT * FROM '.DB_PREFIX.'tupdate WHERE id_update_package = ' . $id_package);
$cont = 0;
$updates = array();
@@ -252,7 +252,7 @@ function um_db_create_package_log ($id_package, $client_key, $user_package, $res
'result' => $result,
'description' => $description);
- $result = process_sql_insert (DB_PREFIX.'tupdate_package_log', $values);
+ $result = db_process_sql_insert (DB_PREFIX.'tupdate_package_log', $values);
if ($result === false) {
return false;
@@ -262,7 +262,7 @@ function um_db_create_package_log ($id_package, $client_key, $user_package, $res
}
function um_db_get_total_package_logs ($ip = '') {
- $result = process_sql('SELECT COUNT(*) total FROM '.DB_PREFIX.'tupdate_package_log WHERE ip_address LIKE "%'.$ip.'%"');
+ $result = db_process_sql('SELECT COUNT(*) total FROM '.DB_PREFIX.'tupdate_package_log WHERE ip_address LIKE "%'.$ip.'%"');
if ($result === false) {
echo '
Error reading package log ';
@@ -279,10 +279,10 @@ function um_db_get_all_package_logs ($ip = '', $order_by = 'timestamp', $limit =
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_package_log WHERE ip_address LIKE "%'.$ip.'%" ORDER BY '.$order_by.' DESC LIMIT '.$limit.' OFFSET '.$offset);
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_package_log WHERE ip_address LIKE "%'.$ip.'%" ORDER BY '.$order_by.' DESC LIMIT '.$limit.' OFFSET '.$offset);
break;
case "postgresql":
- $result = process_sql('SELECT COUNT(*)
+ $result = db_process_sql('SELECT COUNT(*)
FROM '.DB_PREFIX.'tupdate_package_log
WHERE ip_address LIKE \'%'.$ip.'%\' ORDER BY '.$order_by.' DESC LIMIT '.$limit.' OFFSET '.$offset);
break;
@@ -292,7 +292,7 @@ function um_db_get_all_package_logs ($ip = '', $order_by = 'timestamp', $limit =
$set['order'] = $order_by . ' DESC';
$set['limit'] = $limit;
$set['offset'] = $offset;
- $result = get_db_num_rows(oracle_recode_query ('SELECT * FROM '.DB_PREFIX.'tupdate_package_log WHERE', $set, 'AND', true));
+ $result = db_get_num_rows(oracle_recode_query ('SELECT * FROM '.DB_PREFIX.'tupdate_package_log WHERE', $set, 'AND', true));
break;
}
@@ -304,10 +304,10 @@ function um_db_get_all_package_logs ($ip = '', $order_by = 'timestamp', $limit =
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_package_log WHERE ip_address LIKE "%'.$ip.'%" ORDER BY '.$order_by.' DESC LIMIT '.$limit.' OFFSET '.$offset);
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_package_log WHERE ip_address LIKE "%'.$ip.'%" ORDER BY '.$order_by.' DESC LIMIT '.$limit.' OFFSET '.$offset);
break;
case "postgresql":
- $result = process_sql('SELECT *
+ $result = db_process_sql('SELECT *
FROM '.DB_PREFIX.'tupdate_package_log
WHERE ip_address LIKE \'%'.$ip.'%\' ORDER BY '.$order_by.' DESC LIMIT '.$limit.' OFFSET '.$offset);
break;
@@ -335,7 +335,7 @@ function um_db_get_all_package_logs ($ip = '', $order_by = 'timestamp', $limit =
}
function um_db_delete_package_logs ($ip) {
- $result = process_sql_delete(DB_PREFIX.'tupdate_package_log', array('ip_address' => $ip));
+ $result = db_process_sql_delete(DB_PREFIX.'tupdate_package_log', array('ip_address' => $ip));
if($result === false) {
echo '
Error deleting logs';
@@ -352,7 +352,7 @@ function um_db_create_component ($type, $name, $path = '', $binary = false, $rel
'`binary`' => $binary,
'relative_path' => $relative_path);
- $result = process_sql_insert(DB_PREFIX.'tupdate_component', $values);
+ $result = db_process_sql_insert(DB_PREFIX.'tupdate_component', $values);
if($result === false) {
echo '
Error creating component';
@@ -366,7 +366,7 @@ function um_db_update_component ($name, $path = '', $binary = false, $relative_p
$values = array ('path' => $path, 'binary' => $binary, 'relative_path' => $relative_path);
$where = array ('name' => $name);
- $result = process_sql_update(DB_PREFIX.'tupdate_component', $values, $where);
+ $result = db_process_sql_update(DB_PREFIX.'tupdate_component', $values, $where);
if($result === false) {
echo '
Error updating component';
@@ -377,7 +377,7 @@ function um_db_update_component ($name, $path = '', $binary = false, $relative_p
}
function um_db_delete_component ($name) {
- $result = process_sql_delete(DB_PREFIX.'tupdate_component', array('name' => $name));
+ $result = db_process_sql_delete(DB_PREFIX.'tupdate_component', array('name' => $name));
if($result === false) {
echo '
Error deleting component';
@@ -392,13 +392,13 @@ function um_db_get_component ($name) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component WHERE name = "'.$name.'" LIMIT 1');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component WHERE name = "'.$name.'" LIMIT 1');
break;
case "postgresql":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component WHERE name = \''.$name.'\' LIMIT 1');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component WHERE name = \''.$name.'\' LIMIT 1');
break;
case "oracle":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component WHERE name = \''.$name.'\' AND rownum < 2');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component WHERE name = \''.$name.'\' AND rownum < 2');
break;
}
@@ -409,13 +409,13 @@ function um_db_get_component ($name) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component WHERE name = "'.$name.'" LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component WHERE name = "'.$name.'" LIMIT 1');
break;
case "postgresql":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component WHERE name = \''.$name.'\' LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component WHERE name = \''.$name.'\' LIMIT 1');
break;
case "oracle":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component WHERE name = \''.$name.'\' AND rownum < 2');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component WHERE name = \''.$name.'\' AND rownum < 2');
break;
}
@@ -432,10 +432,10 @@ function um_db_get_component ($name) {
function um_db_get_all_components ($type = '') {
if ($type != '') {
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component WHERE type = '.$type);
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component WHERE type = '.$type);
}
else {
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component');
}
if ($result === false) {
@@ -459,7 +459,7 @@ function um_db_get_all_components ($type = '') {
function um_db_create_component_db ($table_name, $field_name, $order, $component_name) {
$values = array('table_name' => $table_name, 'field_name' => $field_name, '`order`' => $order, 'component' => $component_name);
- $result = process_sql_insert(DB_PREFIX.'tupdate_component_db', $values);
+ $result = db_process_sql_insert(DB_PREFIX.'tupdate_component_db', $values);
if ($result === false) {
echo '
Error creating database component ';
@@ -474,7 +474,7 @@ function um_db_update_component_db ($id, $table_name = '', $field_name = '', $or
$values = array ('table_name' => $table_name, 'field_name' => $field_name, '`order`' => $order);
$where = array ('id' => $id);
- $result = process_sql_update(DB_PREFIX.'tupdate_component_db', $values, $where);
+ $result = db_process_sql_update(DB_PREFIX.'tupdate_component_db', $values, $where);
if($result === false) {
echo '
Error updating database component';
@@ -506,7 +506,7 @@ function um_delete_directory($dirname) {
}
function um_db_delete_component_db ($id) {
- $result = process_sql_delete(DB_PREFIX.'tupdate_component_db', array('id' => $id));
+ $result = db_process_sql_delete(DB_PREFIX.'tupdate_component_db', array('id' => $id));
if($result === false) {
echo '
Error deleting database component';
@@ -521,13 +521,13 @@ function um_db_get_component_db ($id_component_db) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component_db WHERE id = "'.$id_component_db.'" LIMIT 1');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component_db WHERE id = "'.$id_component_db.'" LIMIT 1');
break;
case "postgresql":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component_db WHERE id = \''.$id_component_db.'\' LIMIT 1');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component_db WHERE id = \''.$id_component_db.'\' LIMIT 1');
break;
case "oracle":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component_db WHERE id = \''.$id_component_db.'\' AND rownum < 2');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component_db WHERE id = \''.$id_component_db.'\' AND rownum < 2');
break;
}
@@ -538,13 +538,13 @@ function um_db_get_component_db ($id_component_db) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component_db WHERE id = "'.$id_component_db.'" LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component_db WHERE id = "'.$id_component_db.'" LIMIT 1');
break;
case "postgresql":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component_db WHERE id = \''.$id_component_db.'\' LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component_db WHERE id = \''.$id_component_db.'\' LIMIT 1');
break;
case "oracle":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component_db WHERE id = \''.$id_component_db.'\' AND rownum < 2');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component_db WHERE id = \''.$id_component_db.'\' AND rownum < 2');
break;
}
@@ -558,11 +558,11 @@ function um_db_get_database_components ($component_name) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component_db WHERE component = "'. $component_name.'" ORDER BY `order` ASC');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component_db WHERE component = "'. $component_name.'" ORDER BY `order` ASC');
break;
case "postgresql":
case "oracle":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component_db WHERE component = \''. $component_name.'\' ORDER BY "order" ASC');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_component_db WHERE component = \''. $component_name.'\' ORDER BY "order" ASC');
break;
}
@@ -573,11 +573,11 @@ function um_db_get_database_components ($component_name) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component_db WHERE component = "'. $component_name.'" ORDER BY `order` ASC');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component_db WHERE component = "'. $component_name.'" ORDER BY `order` ASC');
break;
case "postgresql":
case "oracle":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component_db WHERE component = \''. $component_name.'\' ORDER BY "order" ASC');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_component_db WHERE component = \''. $component_name.'\' ORDER BY "order" ASC');
break;
}
@@ -604,7 +604,7 @@ function um_db_create_auth ($client_key, $subscription_limit, $description = '',
}
$values = array ('client_key' => $client_key, 'subscription_limit' => $subscription_limit, 'description' => $description, 'developer' => $developer);
- $result = process_sql_insert(DB_PREFIX.'tupdate_auth', $values);
+ $result = db_process_sql_insert(DB_PREFIX.'tupdate_auth', $values);
if ($result === false) {
echo '
Error creating authorization ';
@@ -626,7 +626,7 @@ function um_db_update_auth ($id_auth, $client_key, $subscription_limit, $descrip
'developer' => $developer);
$where = array ('id' => $id_auth);
- $result = process_sql_update(DB_PREFIX.'tupdate_auth', $values, $where);
+ $result = db_process_sql_update(DB_PREFIX.'tupdate_auth', $values, $where);
if($result === false) {
echo '
Error updating authorization';
@@ -637,7 +637,7 @@ function um_db_update_auth ($id_auth, $client_key, $subscription_limit, $descrip
}
function um_db_delete_auth ($id_auth) {
- $result = process_sql_delete(DB_PREFIX.'tupdate_auth', array('id' => $id_auth));
+ $result = db_process_sql_delete(DB_PREFIX.'tupdate_auth', array('id' => $id_auth));
if($result === false) {
echo '
Error deleting authorization';
@@ -652,13 +652,13 @@ function um_db_get_auth ($id_auth) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE id = "'.$id_auth.'" LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE id = "'.$id_auth.'" LIMIT 1');
break;
case "postgresql":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE id = \''.$id_auth.'\' LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE id = \''.$id_auth.'\' LIMIT 1');
break;
case "oracle":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE id = \''.$id_auth.'\' AND rownum < 2');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE id = \''.$id_auth.'\' AND rownum < 2');
break;
}
@@ -673,14 +673,14 @@ function um_db_get_auth ($id_auth) {
}
function um_db_get_all_auths () {
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_auth');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate_auth');
if ($result === false) {
echo '
Error getting authorizations ';
return array();
}
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth');
$cont = 0;
$auths = array();
@@ -701,13 +701,13 @@ function um_db_check_auth ($client_key, $subscription_limit) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE client_key = "'.$client_key.'" LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE client_key = "'.$client_key.'" LIMIT 1');
break;
case "postgresql":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE client_key = \''.$client_key.'\' LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE client_key = \''.$client_key.'\' LIMIT 1');
break;
case "oracle":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE client_key = \''.$client_key.'\' AND rownum < 2');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate_auth WHERE client_key = \''.$client_key.'\' AND rownum < 2');
break;
}
@@ -730,7 +730,7 @@ function um_db_check_auth ($client_key, $subscription_limit) {
}
function um_db_is_auth_developer ($id_auth) {
- $developer = get_db_value('developer', DB_PREFIX.'tupdate_auth', '`id`', $id_auth);
+ $developer = db_get_value('developer', DB_PREFIX.'tupdate_auth', '`id`', $id_auth);
if ($developer === false) {
echo '
Error reading authorization developers bit ';
@@ -741,13 +741,13 @@ function um_db_is_auth_developer ($id_auth) {
}
function um_db_connect ($backend = 'mysql', $host = '', $user = '', $password = '', $db_name = '') {
- return connect_db ($host, $db_name, $user, $password);
+ return db_connect ($host, $db_name, $user, $password);
}
function um_component_db_connect () {
$settings = um_db_load_settings ();
- return connect_db ($settings->dbhost, $settings->dbname, $settings->dbuser, $settings->dbpass);
+ return db_connect ($settings->dbhost, $settings->dbname, $settings->dbuser, $settings->dbpass);
}
function um_get_package_status () {
diff --git a/pandora_console/extensions/update_manager/lib/libupdate_manager_client.php b/pandora_console/extensions/update_manager/lib/libupdate_manager_client.php
index 1d8055dd6a..986a76eb88 100644
--- a/pandora_console/extensions/update_manager/lib/libupdate_manager_client.php
+++ b/pandora_console/extensions/update_manager/lib/libupdate_manager_client.php
@@ -162,7 +162,7 @@ function um_client_db_save_package ($package, $settings) {
um_client_db_connect($settings);
- $result = process_sql_insert(DB_PREFIX.'tupdate_package', $fields);
+ $result = db_process_sql_insert(DB_PREFIX.'tupdate_package', $fields);
if($result === false) {
return false;
@@ -188,7 +188,7 @@ function um_client_db_save_update ($update) {
unset($fields['order']);
}
- $result = process_sql_insert(DB_PREFIX.'tupdate', $fields);
+ $result = db_process_sql_insert(DB_PREFIX.'tupdate', $fields);
if($result === false) {
return false;
@@ -231,7 +231,7 @@ function um_client_create_update_file ($data, $md5path_name) {
function um_client_apply_update_database (&$update) {
if ($update->type == 'db_data') {
- $exists = get_db_value('COUNT(*)', $update->db_table, $update->db_field, $update->db_field_value);
+ $exists = db_get_value('COUNT(*)', $update->db_table, $update->db_field, $update->db_field_value);
/* If it exists, it failed. */
if ($exists != 0) {
@@ -240,7 +240,7 @@ function um_client_apply_update_database (&$update) {
}
$query_array = explode(';',um_data_decode($update->data));
- $result = process_sql($query_array[0]);
+ $result = db_process_sql($query_array[0]);
if ($result === false) {
//echo $result->getMessage ();
@@ -292,7 +292,7 @@ function um_client_rollback_update (&$update, $settings) {
$filename = $settings->updating_binary_path.'/'.$update->filename;
$success = um_client_rollback_update_file ($update, $filename);
} else if ($update->type == 'db_data' || $update->type == 'db_schema') {
- process_sql_rollback();
+ db_process_sql_rollback();
$success = true;
} else {
return false;
@@ -515,7 +515,7 @@ function um_client_upgrade_to_package ($package, $settings, $force = true, $upda
um_db_update_setting ('current_update', $package->id);
- process_sql_commit();
+ db_process_sql_commit();
}
else {
$data_queries = '';
@@ -620,7 +620,7 @@ function um_client_upgrade_to_package ($package, $settings, $force = true, $upda
function um_client_upgrade_to_latest ($user_key, $force = true) {
$settings = um_db_load_settings ();
- process_sql_begin();
+ db_process_sql_begin();
do {
$package = um_client_get_package ($settings, $user_key);
diff --git a/pandora_console/extensions/update_manager/lib/libupdate_manager_components.php b/pandora_console/extensions/update_manager/lib/libupdate_manager_components.php
index fbe9b60bec..9bdcf372dc 100644
--- a/pandora_console/extensions/update_manager/lib/libupdate_manager_components.php
+++ b/pandora_console/extensions/update_manager/lib/libupdate_manager_components.php
@@ -22,13 +22,13 @@ function um_component_database_get_data ($component_db) {
$fields = um_component_database_get_table_fields ($component_db->table_name);
- $result = process_sql('SELECT COUNT(*) FROM '.$component_db->table_name);
+ $result = db_process_sql('SELECT COUNT(*) FROM '.$component_db->table_name);
if ($result === false) {
echo '
Error getting table fields ';
return NULL;
}
- $result = process_sql('SELECT '.implode (',', $fields).' FROM '.$component_db->table_name);
+ $result = db_process_sql('SELECT '.implode (',', $fields).' FROM '.$component_db->table_name);
$cont = 0;
$resultdata = array();
@@ -62,13 +62,13 @@ function um_component_database_get_all_tables () {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SHOW TABLES');
+ $result = db_process_sql('SHOW TABLES');
break;
case "postgresql":
- $result = process_sql('SELECT table_name FROM information_schema.tables WHERE table_schema = \'public\';');
+ $result = db_process_sql('SELECT table_name FROM information_schema.tables WHERE table_schema = \'public\';');
break;
case "oracle":
- $result = process_sql('SELECT table_name FROM user_tables');
+ $result = db_process_sql('SELECT table_name FROM user_tables');
break;
}
@@ -113,14 +113,14 @@ function um_component_database_get_table_fields ($table_name) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SHOW COLUMNS FROM '.$table_name.' WHERE `Key` != "PRI"');
+ $result = db_process_sql('SHOW COLUMNS FROM '.$table_name.' WHERE `Key` != "PRI"');
break;
case "postgresql":
//TODO: verificar que se extraen todos los campos menos clave primaria
- $result = process_sql("SELECT * FROM pg_indexes WHERE tablename = '" . $table_name . "'");
+ $result = db_process_sql("SELECT * FROM pg_indexes WHERE tablename = '" . $table_name . "'");
break;
case "oracle":
- $result = process_sql("SELECT cols1.column_name as Fields, cols1.data_type as Type,
+ $result = db_process_sql("SELECT cols1.column_name as Fields, cols1.data_type as Type,
CASE WHEN (cols1.nullable = 'Y') THEN 'YES' ELSE 'NO' END as \"Null\",
cols1.data_default as \"Default\", '' as Extra
FROM user_tab_columns cols1
@@ -197,11 +197,11 @@ function um_component_get_all_blacklisted ($component) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT COUNT(name) FROM '.DB_PREFIX.'tupdate_component_blacklist WHERE component = "'.$component->name.'"');
+ $result = db_process_sql('SELECT COUNT(name) FROM '.DB_PREFIX.'tupdate_component_blacklist WHERE component = "'.$component->name.'"');
break;
case "postgresql":
case "oracle":
- $result = process_sql('SELECT COUNT(name)
+ $result = db_process_sql('SELECT COUNT(name)
FROM '.DB_PREFIX.'tupdate_component_blacklist
WHERE component = \''.$component->name.'\'');
break;
@@ -214,11 +214,11 @@ function um_component_get_all_blacklisted ($component) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT name FROM '.DB_PREFIX.'tupdate_component_blacklist WHERE component = "'.$component->name.'"');
+ $result = db_process_sql('SELECT name FROM '.DB_PREFIX.'tupdate_component_blacklist WHERE component = "'.$component->name.'"');
break;
case "postgresql":
case "oracle":
- $result = process_sql('SELECT name
+ $result = db_process_sql('SELECT name
FROM '.DB_PREFIX.'tupdate_component_blacklist
WHERE component = \''.$component->name.'\'');
break;
@@ -243,11 +243,11 @@ function um_component_is_blacklisted ($component, $name) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT COUNT(*) AS blacklisted FROM '.DB_PREFIX.'tupdate_component_blacklist WHERE component = "'.$component->name.'" AND name = "'.$name.'"');
+ $result = db_process_sql('SELECT COUNT(*) AS blacklisted FROM '.DB_PREFIX.'tupdate_component_blacklist WHERE component = "'.$component->name.'" AND name = "'.$name.'"');
break;
case "postgresql":
case "oracle":
- $result = process_sql('SELECT COUNT(*) AS blacklisted
+ $result = db_process_sql('SELECT COUNT(*) AS blacklisted
FROM '.DB_PREFIX.'tupdate_component_blacklist
WHERE component = \''.$component->name.'\' AND name = \''.$name.'\'');
break;
@@ -265,7 +265,7 @@ function um_component_is_blacklisted ($component, $name) {
function um_component_add_blacklist ($component, $name) {
$values = array('component' => $component->name, 'name' => $name);
- $result = process_sql_insert(DB_PREFIX.'tupdate_component_blacklist', $values);
+ $result = db_process_sql_insert(DB_PREFIX.'tupdate_component_blacklist', $values);
if ($result === false) {
echo '
Error creating blacklist component ';
diff --git a/pandora_console/extensions/update_manager/lib/libupdate_manager_updates.php b/pandora_console/extensions/update_manager/lib/libupdate_manager_updates.php
index abccc6f4b9..a479925c75 100644
--- a/pandora_console/extensions/update_manager/lib/libupdate_manager_updates.php
+++ b/pandora_console/extensions/update_manager/lib/libupdate_manager_updates.php
@@ -24,13 +24,13 @@ function um_update_get_last_from_filename ($component_name, $filename) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate WHERE component = "'.$component_name.'" AND filename = "'.$component->relative_path.$filename.'" ORDER BY id DESC LIMIT 1');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate WHERE component = "'.$component_name.'" AND filename = "'.$component->relative_path.$filename.'" ORDER BY id DESC LIMIT 1');
break;
case "postgresql":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate WHERE component = \''.$component_name.'\' AND filename = \''.$component->relative_path.$filename.'\' ORDER BY id DESC LIMIT 1');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate WHERE component = \''.$component_name.'\' AND filename = \''.$component->relative_path.$filename.'\' ORDER BY id DESC LIMIT 1');
break;
case "oracle":
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate WHERE (component = \''.$component_name.'\' AND filename = \''.$component->relative_path.$filename.'\') AND rownum < 2 ORDER BY id DESC');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate WHERE (component = \''.$component_name.'\' AND filename = \''.$component->relative_path.$filename.'\') AND rownum < 2 ORDER BY id DESC');
break;
}
@@ -41,16 +41,16 @@ function um_update_get_last_from_filename ($component_name, $filename) {
switch ($config["dbtype"]) {
case "mysql":
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate WHERE component = "'.$component_name.'" AND filename = "'.$component->relative_path.$filename.'" ORDER BY id DESC LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate WHERE component = "'.$component_name.'" AND filename = "'.$component->relative_path.$filename.'" ORDER BY id DESC LIMIT 1');
break;
case "postgresql":
- $result = process_sql('SELECT *
+ $result = db_process_sql('SELECT *
FROM '.DB_PREFIX.'tupdate
WHERE component = \''.$component_name.'\'
AND filename = \''.$component->relative_path.$filename.'\' ORDER BY id DESC LIMIT 1');
break;
case "oracle":
- $result = process_sql('SELECT *
+ $result = db_process_sql('SELECT *
FROM '.DB_PREFIX.'tupdate
WHERE (component = \''.$component_name.'\'
AND filename = \''.$component->relative_path.$filename.'\') AND rownum < 2 ORDER BY id DESC');
@@ -63,14 +63,14 @@ function um_update_get_last_from_filename ($component_name, $filename) {
}
function um_update_get_last_from_table_field_value ($component_name, $id_component_db, $field_value) {
- $result = process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate WHERE component = "'.$component_name.'" AND id_component_db = "'.$id_component_db.'" AND db_field_value = "'.$field_value.'" ORDER BY id DESC LIMIT 1');
+ $result = db_process_sql('SELECT COUNT(*) FROM '.DB_PREFIX.'tupdate WHERE component = "'.$component_name.'" AND id_component_db = "'.$id_component_db.'" AND db_field_value = "'.$field_value.'" ORDER BY id DESC LIMIT 1');
if ($result === false) {
echo '
Error getting last value ';
return NULL;
}
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate WHERE component = "'.$component_name.'" AND id_component_db = "'.$id_component_db.'" AND db_field_value = "'.$field_value.'" ORDER BY id DESC LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate WHERE component = "'.$component_name.'" AND id_component_db = "'.$id_component_db.'" AND db_field_value = "'.$field_value.'" ORDER BY id DESC LIMIT 1');
$update = um_std_from_result($result);
@@ -78,7 +78,7 @@ function um_update_get_last_from_table_field_value ($component_name, $id_compone
}
function um_db_get_orphan_updates () {
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate WHERE id_update_package IS NULL');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate WHERE id_update_package IS NULL');
if ($result === false) {
echo '
Error getting orphan updates ';
@@ -100,7 +100,7 @@ function um_db_get_orphan_updates () {
}
function um_db_get_update ($id_update) {
- $result = process_sql('SELECT * FROM '.DB_PREFIX.'tupdate WHERE id = "'.$id_update.'" LIMIT 1');
+ $result = db_process_sql('SELECT * FROM '.DB_PREFIX.'tupdate WHERE id = "'.$id_update.'" LIMIT 1');
if ($result === false) {
echo '
Error getting update ';
@@ -121,7 +121,7 @@ function um_db_delete_update ($id_update) {
echo '
Error: '.'Only packages in development state can be deleted';
return false;
}
- $result = process_sql_delete(DB_PREFIX.'tupdate', array('id' => $id_update));
+ $result = db_process_sql_delete(DB_PREFIX.'tupdate', array('id' => $id_update));
if ($result === false) {
echo '
Error deleting update ';
@@ -193,7 +193,7 @@ function um_db_create_update ($type, $component_name, $id_package, $update, $db_
return false;
}
- $result = process_sql_insert(DB_PREFIX.'tupdate', $values);
+ $result = db_process_sql_insert(DB_PREFIX.'tupdate', $values);
if ($result === false) {
echo '
Error creating update ';
diff --git a/pandora_console/extensions/update_manager/load_updatemanager.php b/pandora_console/extensions/update_manager/load_updatemanager.php
index 325df499c5..4bf9ec7de9 100644
--- a/pandora_console/extensions/update_manager/load_updatemanager.php
+++ b/pandora_console/extensions/update_manager/load_updatemanager.php
@@ -63,18 +63,18 @@ function get_user_key ($settings) {
switch ($config['dbtype']) {
case 'mysql':
- $n = (int) get_db_value ('COUNT(`id_agente`)', 'tagente', 'disabled', 0);
- $m = (int) get_db_value ('COUNT(`id_agente_modulo`)', 'tagente_modulo',
+ $n = (int) db_get_value ('COUNT(`id_agente`)', 'tagente', 'disabled', 0);
+ $m = (int) db_get_value ('COUNT(`id_agente_modulo`)', 'tagente_modulo',
'disabled', 0);
break;
case 'postgresql':
- $n = (int) get_db_value ('COUNT("id_agente")', 'tagente', 'disabled', 0);
- $m = (int) get_db_value ('COUNT("id_agente_modulo")', 'tagente_modulo',
+ $n = (int) db_get_value ('COUNT("id_agente")', 'tagente', 'disabled', 0);
+ $m = (int) db_get_value ('COUNT("id_agente_modulo")', 'tagente_modulo',
'disabled', 0);
break;
case 'oracle':
- $n = (int) get_db_value ('COUNT(id_agente)', 'tagente', 'disabled', 0);
- $m = (int) get_db_value ('COUNT(id_agente_modulo)', 'tagente_modulo',
+ $n = (int) db_get_value ('COUNT(id_agente)', 'tagente', 'disabled', 0);
+ $m = (int) db_get_value ('COUNT(id_agente_modulo)', 'tagente_modulo',
'disabled', 0);
break;
}
diff --git a/pandora_console/extensions/update_manager/main.php b/pandora_console/extensions/update_manager/main.php
index 148860e6ce..a8518ea6b3 100644
--- a/pandora_console/extensions/update_manager/main.php
+++ b/pandora_console/extensions/update_manager/main.php
@@ -141,7 +141,7 @@ else {
$error = '
'.__('File cannot be uploaded').'
';
}
-clean_cache();
+db_clean_cache();
$settings = um_db_load_settings ();
$user_key = get_user_key ($settings);
diff --git a/pandora_console/extensions/update_manager/settings.php b/pandora_console/extensions/update_manager/settings.php
index c30675404f..91ee84bf84 100644
--- a/pandora_console/extensions/update_manager/settings.php
+++ b/pandora_console/extensions/update_manager/settings.php
@@ -17,7 +17,7 @@ global $config;
check_login ();
if (! check_acl ($config['id_user'], 0, 'PM')) {
- pandora_audit("ACL Violation", "Trying to use Open Update Manager extension");
+ db_pandora_audit("ACL Violation", "Trying to use Open Update Manager extension");
include ("general/noaccess.php");
return;
}
diff --git a/pandora_console/extensions/users_connected.php b/pandora_console/extensions/users_connected.php
index 46501a78ab..ad43440b6c 100644
--- a/pandora_console/extensions/users_connected.php
+++ b/pandora_console/extensions/users_connected.php
@@ -48,7 +48,7 @@ function users_extension_main_god ($god = true) {
break;
}
- $rows = get_db_all_rows_sql ($sql);
+ $rows = db_get_all_rows_sql ($sql);
if (empty ($rows)) {
$rows = array ();
echo "
".__('No other users connected')."
";
diff --git a/pandora_console/extensions/vnc_view.php b/pandora_console/extensions/vnc_view.php
index 4f9e5116f0..7d49d72d07 100644
--- a/pandora_console/extensions/vnc_view.php
+++ b/pandora_console/extensions/vnc_view.php
@@ -16,7 +16,7 @@
function vnc_view() {
$idAgent = (int)get_parameter('id_agente', 0);
- $ipAgent = get_db_value('direccion', 'tagente', 'id_agente', $idAgent);
+ $ipAgent = db_get_value('direccion', 'tagente', 'id_agente', $idAgent);
echo '
diff --git a/pandora_console/general/error_dbconfig.php b/pandora_console/general/error_dbconfig.php
index 744ca0619d..0ce3da4c48 100644
--- a/pandora_console/general/error_dbconfig.php
+++ b/pandora_console/general/error_dbconfig.php
@@ -43,7 +43,7 @@
Cannot connect to the database, please check your database setup in the include/config.php file or read the documentation on how to setup Pandora FMS.
Probably one or more of your user, database or hostname values are incorrect or
the database server is not running.
- DB ERROR:
+ DB ERROR:
diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php
index 93eb8b17b0..b328083d54 100644
--- a/pandora_console/general/header.php
+++ b/pandora_console/general/header.php
@@ -15,6 +15,8 @@
// GNU General Public License for more details.
require_once ("include/functions_messages.php");
+require_once ('include/functions_servers.php');
+
$msg_cnt = 0;
@@ -68,7 +70,7 @@ $msg_cnt = 0;
if ($config["metaconsole"] == 0){
echo '