6ad5a3c5e2da82c8125c8b477384a993493f1473
2 /***************************************************************************
3 * Copyright (C) 2003-2007 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 ***************************************************************************/
26 /** The x.org version */
27 public $version = '@VERSION@';
31 public $dbdb = 'x4dat';
32 public $dbhost = 'localhost';
33 public $dbuser = 'x4dat';
34 public $dbpwd = 'x4dat';
35 public $dbcharset = 'utf8';
39 public $register_skin;
48 public function __construct($sess)
50 $this->session
= $sess;
52 $base = empty($_SERVER['HTTPS']) ?
'http://' : 'https://';
53 $this->baseurl
= @trim
($base.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']), '/');
54 $this->spoolroot
= dirname(dirname(__FILE__
));
60 private function read_ini_file($filename)
62 $array = parse_ini_file($filename, true
);
63 if (!is_array($array)) {
66 foreach ($array as $cat => $conf) {
67 $c = strtolower($cat);
68 foreach ($conf as $k => $v) {
69 if ($c == 'core' && property_exists($this, $k)) {
72 if (!isset($this->$c)) {
73 $this->$c = new stdClass
;
81 private function read_config()
83 $this->read_ini_file($this->spoolroot
.'/configs/platal.ini');
84 $this->read_ini_file($this->spoolroot
.'/configs/platal.conf');
87 private function setlocale()
89 setlocale(LC_MESSAGES
, $this->locale
);
90 setlocale(LC_TIME
, $this->locale
);
91 setlocale(LC_CTYPE
, $this->locale
);
92 date_default_timezone_set($this->timezone
);
93 mb_internal_encoding("UTF-8");
96 public function asso($key=null
)
102 if ($p = strpos($gp, '/')) {
103 $gp = substr($gp, 0, $p);
107 $res = XDB
::query('SELECT a.*, d.nom AS domnom
108 FROM groupex.asso AS a
109 LEFT JOIN groupex.dom AS d ON d.id = a.dom
110 WHERE diminutif = {?}', $gp);
111 if (!($aid = $res->fetchOneAssoc())) {
120 } elseif ( isset($aid[$key]) ) {
128 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: