2012-03-21 Sergio Martin <sergio.martin@artica.es>

* include/config_process.php
	include/functions.php
	include/constants.php: Add a new include file
	only for constants



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5804 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-03-21 08:50:14 +00:00
parent 7630a88fbd
commit 1d2cb33c36
4 changed files with 85 additions and 44 deletions

View File

@ -1,3 +1,10 @@
2012-03-21 Sergio Martin <sergio.martin@artica.es>
* include/config_process.php
include/functions.php
include/constants.php: Add a new include file
only for constants
2012-03-20 Sergio Martin <sergio.martin@artica.es> 2012-03-20 Sergio Martin <sergio.martin@artica.es>
* include/functions.php: Recoded the human_time_description_raw * include/functions.php: Recoded the human_time_description_raw

View File

@ -69,6 +69,7 @@ if (!isset($config['dbtype'])) {
$config['dbtype'] = 'mysql'; $config['dbtype'] = 'mysql';
} }
require_once ($ownDir . 'constants.php');
require_once ($ownDir . 'functions_db.php'); require_once ($ownDir . 'functions_db.php');
require_once ($ownDir . 'functions.php'); require_once ($ownDir . 'functions.php');

View File

@ -0,0 +1,63 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2012 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; 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.
/**
* @package Include
* @subpackage Constants
*/
/* Enterprise hook constant */
define ('ENTERPRISE_NOT_HOOK', -1);
/* Events state constants */
define ('EVENT_NEW', 0);
define ('EVENT_VALIDATE', 1);
define ('EVENT_PROCESS', 2);
/* Agents disabled status */
define ('AGENT_ENABLED',0);
define ('AGENT_DISABLED',1);
/* Error report codes */
define ('ERR_GENERIC',-10000);
define ('ERR_EXIST',-20000);
define ('ERR_INCOMPLETE', -30000);
define ('ERR_DB', -40000);
define ('ERR_FILE', -50000);
define ('ERR_NOCHANGES', -60000);
/* Visual console constants */
define('MIN_WIDTH',300);
define('MIN_HEIGHT',120);
define('MIN_WIDTH_CAPTION',420);
/* Seconds in a time unit constants */
define('SECONDS_1MINUTE',60);
define('SECONDS_5MINUTES',300);
define('SECONDS_30MINUTES',1800);
define('SECONDS_1HOUR',3600);
define('SECONDS_6HOURS',21600);
define('SECONDS_12HOURS',43200);
define('SECONDS_1DAY',86400);
define('SECONDS_1WEEK',604800);
define('SECONDS_15DAYS',1296000);
define('SECONDS_1MONTH',2592000);
define('SECONDS_3MONTHS',7776000);
define('SECONDS_6MONTHS',15552000);
define('SECONDS_1YEAR',31104000);
define('SECONDS_2YEARS',62208000);
define('SECONDS_3YEARS',93312000);
?>

View File

@ -18,9 +18,6 @@
* @subpackage Generic_Functions * @subpackage Generic_Functions
*/ */
/* Enterprise hook constant */
define ('ENTERPRISE_NOT_HOOK', -1);
/** /**
* Include the html and ui functions. * Include the html and ui functions.
*/ */
@ -28,33 +25,6 @@ require_once ('functions_html.php');
require_once ('functions_ui.php'); require_once ('functions_ui.php');
require_once('functions_io.php'); require_once('functions_io.php');
/* Events state constants */
define ('EVENT_NEW', 0);
define ('EVENT_VALIDATE', 1);
define ('EVENT_PROCESS', 2);
/* Agents disabled status */
define ('AGENT_ENABLED',0);
define ('AGENT_DISABLED',1);
/* Error report codes */
define ('ERR_GENERIC',-10000);
define ('ERR_EXIST',-20000);
define ('ERR_INCOMPLETE', -30000);
define ('ERR_DB', -40000);
define ('ERR_FILE', -50000);
define ('ERR_NOCHANGES', -60000);
/* Visual console constants */
define("MIN_WIDTH",300);
define("MIN_HEIGHT",120);
define("MIN_WIDTH_CAPTION",420);
function check_refererer() { function check_refererer() {
global $config; global $config;
@ -1622,20 +1592,20 @@ function get_periods () {
$periods = array (); $periods = array ();
$periods[0] = __('custom'); $periods[0] = __('custom');
$periods[300] = '5 '.__('minutes'); $periods[SECONDS_5MINUTES] = '5 '.__('minutes');
$periods[1800] = '30 '.__('minutes'); $periods[SECONDS_30MINUTES] = '30 '.__('minutes');
$periods[3600] = __('1 hour'); $periods[SECONDS_1HOUR] = __('1 hour');
$periods[21600] = '6 '.__('hours'); $periods[SECONDS_6HOURS] = '6 '.__('hours');
$periods[43200] = '12 '.__('hours'); $periods[SECONDS_12HOURS] = '12 '.__('hours');
$periods[86400] = __('1 day'); $periods[SECONDS_1DAY] = __('1 day');
$periods[604800] = __('1 week'); $periods[SECONDS_1WEEK] = __('1 week');
$periods[1296000] = __('15 days'); $periods[SECONDS_15DAYS] = __('15 days');
$periods[2592000] = '1 '.__('month'); $periods[SECONDS_1MONTH] = '1 '.__('month');
$periods[7776000] = '3 '.__('months'); $periods[SECONDS_3MONTHS] = '3 '.__('months');
$periods[15552000] = '6 '.__('months'); $periods[SECONDS_6MONTHS] = '6 '.__('months');
$periods[31104000] = '1 '.__('year'); $periods[SECONDS_1YEAR] = '1 '.__('year');
$periods[62208000] = '2 '.__('years'); $periods[SECONDS_2YEARS] = '2 '.__('years');
$periods[93312000] = '3 '.__('years'); $periods[SECONDS_3YEARS] = '3 '.__('years');
return $periods; return $periods;
} }