pandorafms/pandora_console/extensions/update_manager/load_updatemanager.php

89 lines
2.6 KiB
PHP
Raw Normal View History

<?php
//Pandora FMS- http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
/* Change to E_ALL for development/debugging */
error_reporting (E_ALL);
/* Database backend, not really tested with other backends, so it's
not functional right now */
define ('DB_BACKEND', 'mysql');
define ('FREE_USER', 'PANDORA-FREE');
if (! extension_loaded ('mysql'))
die ('Your PHP installation appears to be missing the MySQL extension which is required.');
require_once ('lib/libupdate_manager.php');
function get_user_key ($settings) {
global $config;
if ($settings->customer_key != FREE_USER) {
if (! file_exists ($settings->keygen_path)) {
echo '<h3 class="error">';
echo __('Keygen file does not exists');
echo '</h3>';
return '';
}
if (! is_executable ($settings->keygen_path)) {
echo '<h3 class="error">';
echo __('Keygen file is not executable');
echo '</h3>';
return '';
}
global $config;
$user_key = exec (escapeshellcmd ($settings->keygen_path.
' '.$settings->customer_key.' '.$config['dbhost'].
' '.$config['dbuser'].' '.$config['dbpass'].
' '.$config['dbname']));
return $user_key;
}
/* Free users.
We only want to know this for statistics records.
Feel free to disable this extension if you want.
*/
global $build_version;
global $pandora_version;
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',
'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',
'disabled', 0);
break;
2011-04-11 Juan Manuel Ramon <juanmanuel.ramon@artica.es> * include/functions_events.php include/functions_messages.php include/db/oracle.php include/functions_modules.php include/functions_reporting.php include/functions_groups.php include/functions_gis.php include/auth/mysql.php include/functions_networkmap.php include/functions_servers.php include/functions_network_components.php include/ajax/reporting.ajax.php include/ajax/agent.php include/functions_config.php include/functions_api.php include/help/en/help_timesource.php include/help/es/help_timesource.php include/help/ja/help_timesource.php include/fgraph.php include/functions.php include/functions_agents.php include/functions_db.php include/functions_fsgraph.php include/functions_alerts.php include/functions_reports.php pandoradb.oracle.sql install.php extensions/system_info.php extensions/update_manager.php extensions/dbmanager.php extensions/users_connected.php extensions/module_groups.php extensions/update_manager/sql/update_manager.oracle.sql extensions/update_manager/load_updatemanager.php extensions/update_manager/lib/libupdate_manager_client.php extensions/update_manager/lib/libupdate_manager.php extensions/update_manager/lib/libupdate_manager_components.php extensions/update_manager/lib/libupdate_manager_updates.php operation/search_modules.php operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/agentes/datos_agente.php operation/agentes/estado_ultimopaquete.php operation/agentes/exportdata.php operation/agentes/gis_view.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/snmpconsole/snmp_view.php operation/users/user_edit.php operation/gis_maps/render_view.php operation/gis_maps/ajax.php operation/events/events_rss.php operation/events/events_list.php operation/events/events_marquee.php operation/search_alerts.php operation/reporting/reporting_xml.php operation/reporting/reporting_viewer.php pandoradb.data.oracle.sql extras/pandora_diag.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/events/events.php general/logon_ok.php godmode/groups/group_list.php godmode/admin_access_logs.php godmode/db/db_main.php godmode/agentes/agent_template.php godmode/agentes/module_manager.php godmode/agentes/modificar_agente.php godmode/agentes/configurar_agente.php godmode/agentes/module_manager_editor.php godmode/agentes/planned_downtime.php godmode/alerts/alert_list.list.php godmode/alerts/alert_compounds.php godmode/alerts/alert_list.php godmode/setup/setup.php godmode/modules/manage_network_templates.php godmode/modules/manage_network_templates_form.php godmode/reporting/reporting_builder.list_items.php godmode/reporting/reporting_builder.preview.php godmode/reporting/reporting_builder.php godmode/reporting/reporting_builder.item_editor.php: Support for Oracle DBMS over Console code. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4187 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-11 19:05:20 +02:00
case 'oracle':
$n = (int) get_db_value ('COUNT(id_agente)', 'tagente', 'disabled', 0);
$m = (int) get_db_value ('COUNT(id_agente_modulo)', 'tagente_modulo',
'disabled', 0);
break;
}
$user_key = array ('A' => $n, 'M' => $m, 'B' => $build_version, 'P' => $pandora_version);
return json_encode ($user_key);
}
flush ();
?>