e539595a88b76e5298898738179f338d606efaf5
2 /***************************************************************************
3 * Copyright (C) 2003-2006 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
22 require_once('diogenes/diogenes.core.globals.inc.php');
23 require_once('diogenes/diogenes.database.inc.php');
24 require_once dirname(__FILE__
).'/../../classes/XDB.php';
28 var $locale = 'fr_FR';
31 class PlatalGlobals
extends DiogenesCoreGlobals
33 var $page = 'XorgPage';
38 /** The x.org version */
39 var $version = '@VERSION@';
44 var $dbhost = 'localhost';
45 var $dbuser = 'x4dat';
48 var $table_log_actions = 'logger.actions';
49 var $table_log_sessions = 'logger.sessions';
50 var $table_log_events = 'logger.events';
53 var $tauth = array('native'=>'auth_user_md5');
54 var $tlabel = array('native'=>'X.Org');
60 function PlatalGlobals($sess)
62 $this->session
= $sess;
64 $base = empty($_SERVER['HTTPS']) ?
'http://' : 'https://';
65 $this->baseurl
= trim($base.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']), '/');
66 $this->spoolroot
= dirname(dirname(dirname(__FILE__
)));
69 function read_config()
71 $array = parse_ini_file($this->spoolroot
.'/configs/platal.ini', true
);
72 foreach ($array as $cat => $conf) {
73 $c = strtolower($cat);
74 foreach ($conf as $k => $v) {
79 $array = parse_ini_file($this->spoolroot
.'/configs/platal.conf', true
);
80 if (!is_array($array)) {
84 foreach ($array as $cat=>$conf) {
85 $c = strtolower($cat);
86 foreach ($conf as $key=>$val) {
87 if ($c == 'core' && isset($this->$key)) {
90 $this->$c->$key = $val;
99 setlocale(LC_MESSAGES
, $globals->core
->locale
);
100 setlocale(LC_TIME
, $globals->core
->locale
);
101 setlocale(LC_CTYPE
, $globals->core
->locale
);
105 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: