1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
<?php
/*
* @version $Id: includes.php 3798 2006-08-22 15:12:55Z moyo $
-------------------------------------------------------------------------
GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2006 by the INDEPNET Development Team.
http://indepnet.net/ http://glpi-project.org
-------------------------------------------------------------------------
LICENSE
This file is part of GLPI.
GLPI 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; either version 2 of the License, or
(at your option) any later version.
GLPI 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.
You should have received a copy of the GNU General Public License
along with GLPI; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file:
// Purpose of file:
// ----------------------------------------------------------------------
include ("_relpos.php");
session_save_path($phproot."/files/_sessions");
if(!session_id()){@session_start();}
include_once ($phproot . "/inc/timer.class.php");
// Init Timer to compute time of display
$TIMER_DEBUG=new Script_Timer;
$TIMER_DEBUG->Start_Timer();
include_once ($phproot . "/inc/dbmysql.class.php");
include_once ($phproot . "/inc/commondbtm.class.php");
include_once ($phproot . "/inc/commonitem.class.php");
include_once ($phproot . "/inc/common.function.php");
include_once ($phproot . "/inc/auth.function.php");
include_once ($phproot . "/inc/display.function.php");
include_once ($phproot . "/inc/dropdown.function.php");
include_once ($phproot . "/inc/config.class.php");
include_once ($phproot . "/config/config.php");
// Load Language file
loadLanguage();
if ($cfg_glpi["debug"]){
if ($cfg_glpi["debug_profile"]){
$SQL_TOTAL_TIMER=0;
$SQL_TOTAL_REQUEST=0;
}
if ($cfg_glpi["debug_sql"]){
$DEBUG_SQL_STRING="";
}
}
include_once ($phproot . "/inc/db.function.php");
if (!isset($AJAX_INCLUDE)){
include_once ($phproot . "/inc/auth.class.php");
include_once ($phproot . "/inc/connection.class.php");
include_once ($phproot . "/inc/mailing.class.php");
include_once ($phproot . "/inc/mailing.function.php");
include_once ($phproot . "/inc/report.function.php");
include_once ($phproot . "/inc/export.function.php");
include_once ($phproot . "/inc/log.function.php");
include_once ($phproot . "/inc/connection.function.php");
include_once ($phproot . "/inc/plugin.function.php");
}
// Security system
if (isset($_POST)){
if (!get_magic_quotes_gpc())
$_POST = array_map('addslashes_deep', $_POST);
$_POST = array_map('clean_cross_side_scripting_deep', $_POST);
}
if (isset($_GET)){
if (!get_magic_quotes_gpc())
$_GET = array_map('addslashes_deep', $_GET);
$_GET = array_map('clean_cross_side_scripting_deep', $_GET);
}
/* On startup, register all plugins configured for use. */
if (!isset($AJAX_INCLUDE)){
if (!isset($_SESSION["glpi_plugins"])) initPlugins();
if (isset($_SESSION["glpi_plugins"]) && is_array($_SESSION["glpi_plugins"])) {
do_hook("config");
if (count($_SESSION["glpi_plugins"]))
foreach ($_SESSION["glpi_plugins"] as $name) {
use_plugin($name);
if (isset($_SESSION["glpilanguage"])&&file_exists($phproot . "/plugins/$name/locales/".$cfg_glpi["languages"][$_SESSION["glpilanguage"]][1]))
include_once ($phproot . "/plugins/$name/locales/".$cfg_glpi["languages"][$_SESSION["glpilanguage"]][1]);
else if (file_exists($phproot . "/plugins/$name/locales/".$cfg_glpi["languages"][$cfg_glpi["default_language"]][1]))
include_once ($phproot . "/plugins/$name/locales/".$cfg_glpi["languages"][$cfg_glpi["default_language"]][1]);
else if (file_exists($phproot . "/plugins/$name/locales/en_GB.php"))
include_once ($phproot . "/plugins/$name/locales/en_GB.php");
else if (file_exists($phproot . "/plugins/$name/locales/fr_FR.php"))
include_once ($phproot . "/plugins/$name/locales/fr_FR.php");
}
}
}
// Mark if Header is loaded or not :
$HEADER_LOADED=false;
$FOOTER_LOADED=false;
if (isset($AJAX_INCLUDE))
$HEADER_LOADED=true;;
if (isset($NEEDED_ITEMS)&&is_array($NEEDED_ITEMS)){
foreach ($NEEDED_ITEMS as $item){
if (file_exists($phproot . "/inc/$item.class.php"))
include_once ($phproot . "/inc/$item.class.php");
if (file_exists($phproot . "/inc/$item.function.php"))
include_once ($phproot . "/inc/$item.function.php");
if ($item=="ocsng"&&$cfg_glpi["ocs_mode"]&&isset($USE_OCSNGDB))
$dbocs=new DBocs;
}
}
if (!isset($_SESSION["MESSAGE_AFTER_REDIRECT"])) $_SESSION["MESSAGE_AFTER_REDIRECT"]="";
?>
|