2008-10-13 Sancho Lerena <slerena@artica.es>

* agent_disk_conf_editor.php: Now load enterprise code
	using a normalized code.

	* setup.php: Removed some features of enterprise on setup.

	* functions.php: Added enterprise load code and load hook 
	functions.

	* datos_agente.php: Fixed stupid problem with string data
	deletion.

	* custom_reporting.php:  Now load enterprise code
	using a normalized code.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1147 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2008-10-13 17:13:34 +00:00
parent eec4ea2213
commit a508f64b7e
6 changed files with 56 additions and 9 deletions

View File

@ -1,5 +1,19 @@
2008-10-13 Sancho Lerena <slerena@artica.es>
* agent_disk_conf_editor.php: Now load enterprise code
using a normalized code.
* setup.php: Removed some features of enterprise on setup.
* functions.php: Added enterprise load code and load hook
functions.
* datos_agente.php: Fixed stupid problem with string data
deletion.
* custom_reporting.php: Now load enterprise code
using a normalized code.
* include/help/en/help_tcp_send.php: Added mising help file.
2008-10-13 Jorge Gonzalez <jorgegonz@artica.es>

View File

@ -1,10 +1,12 @@
<?PHP
echo "<h3>This feature is not included on OpenSource version. Please visit our website to learn more about the advanced features of <a href='http://pandorafms.com'>Pandora FMS Enterprise edition</a></h3>";
if (enterprise_include ("godmode/agentes/agent_disk_conf_editor.php"))
return;
// Footer
echo "</div><div id='foot'>";
include ("general/footer.php");
echo "</div>";
echo "<h3>This feature is not included on OpenSource version. Please visit our website to learn more about the advanced features of <a href='http://pandorafms.com'>Pandora FMS Enterprise edition</a></h3>";
// Footer
echo "</div><div id='foot'>";
include ("general/footer.php");
echo "</div>";
?>

View File

@ -27,6 +27,11 @@ if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user']
exit;
}
// Load enterprise extensions
if (file_exists( $config["homedir"] . "/enterprise/godmode/setup/setup.php")) {
include $config["homedir"] . "/enterprise/godmode/setup/setup.php";
}
$update_settings = (bool) get_parameter ('update_settings');
if ($update_settings) {
@ -121,8 +126,7 @@ $table->data[13][1] = print_select ($file_styles, 'style', $config["style"], '',
$table->data[14][0] = __('Block size for pagination');
$table->data[14][1] = print_input_text ('block_size', $config["block_size"], '', 5, 5, true);
$table->data[15][0] = __('Forward SNMP traps to agent (if exist)');
$table->data[15][1] = print_checkbox ('trap2agent', 1, $config["trap2agent"], true);
enterprise_hook ('load_snmpforward_enterprise');
$table->data[16][0] = __('Automatic update check');
$table->data[16][1] = print_checkbox ('autoupdate', 1, $config["autoupdate"], true);

View File

@ -1199,4 +1199,20 @@ function safe_sql_string ($string) {
return $string;
}
function enterprise_hook ($function_name) {
if (function_exists ($function_name))
call_user_func ($function_name);
}
function enterprise_include ($filename) {
global $config;
// Load enterprise extensions
$fullfilename = $config["homedir"]."/enterprise/" . $filename;
if (file_exists ($fullfilename)) {
include ($fullfilename);
return true;
}
return false;
}
?>

View File

@ -93,7 +93,7 @@ function datos_raw ($id_agente_modulo, $periodo) {
if ($string_type == 0)
echo "<a href='index.php?sec=estado&sec2=operation/agentes/datos_agente&tipo=$periodo_label&id=$id_agente_modulo&delete=".$row["id_agente_datos"]."'><img src='images/cross.png' border=0>";
else
echo "<a href='index.php?sec=estado&sec2=operation/agentes/datos_agente&tipo=$periodo_label&id=$id_agente_modulo&delete_text=".$row["id_agente_datos"]."'><img src='images/cross.png' border=0>";
echo "<a href='index.php?sec=estado&sec2=operation/agentes/datos_agente&tipo=$periodo_label&id=$id_agente_modulo&delete_text=".$row["id_tagente_datos_string"]."'><img src='images/cross.png' border=0>";
} else {
echo "<td class='".$tdcolor."'>";
}
@ -132,7 +132,7 @@ if (isset($_GET["delete"])) {
if (isset($_GET["delete_text"])) {
$delete = $_GET["delete_text"];
$sql = "DELETE FROM tagente_datos_string WHERE id_agente_datos = $delete";
$sql = "DELETE FROM tagente_datos_string WHERE id_tagente_datos_string = $delete";
$result = process_sql ($sql);
}

View File

@ -22,6 +22,12 @@ require ("include/config.php");
check_login ();
// Load enterprise extensions
if (file_exists( $config["homedir"] . "/enterprise/operation/reporting/custom_reporting.php")) {
include $config["homedir"] . "/enterprise/operation/reporting/custom_reporting.php";
}
echo "<h2>".__('Reporting')." &gt; ";
echo __('Custom reporting')."</h2>";
@ -38,6 +44,9 @@ $table->head[0] = __('Report name');
$table->head[1] = __('Description');
$table->head[2] = __('HTML');
$table->head[3] = __('XML');
enterprise_hook ('load_custom_reporting_1');
$table->align = array ();
$table->align[2] = 'center';
$table->align[3] = 'center';
@ -51,6 +60,8 @@ foreach ($reports as $report) {
$data[2] = '<a href="index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$report['id_report'].'">
<img src="images/reporting.png" /></a>';
$data[3] = '<a href="ajax.php?page=operation/reporting/reporting_xml&id='.$report['id_report'].'"><img src="images/database_lightning.png" /></a>'; //I chose ajax.php because it's supposed to give XML anyway
enterprise_hook ('load_custom_reporting_2');
array_push ($table->data, $data);
}