0337d704 |
1 | <?php |
2 | /*************************************************************************** |
3 | * Copyright (C) 2003-2004 Polytechnique.org * |
4 | * http://opensource.polytechnique.org/ * |
5 | * * |
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. * |
10 | * * |
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. * |
15 | * * |
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 * |
18 | * Foundation, Inc., * |
19 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * |
20 | ***************************************************************************/ |
21 | |
22 | require_once('diogenes/diogenes.core.globals.inc.php'); |
23 | require_once('diogenes/diogenes.database.inc.php'); |
24 | require_once('platal/iterator.inc.php'); |
25 | require_once('platal/database.inc.php'); |
26 | |
27 | // {{{ class CoreConfig |
28 | |
29 | class CoreConfig |
30 | { |
31 | var $locale = 'fr_FR'; |
32 | } |
33 | |
34 | // }}} |
35 | |
36 | // {{{ class XorgGlobals |
37 | |
38 | class PlatalGlobals extends DiogenesCoreGlobals |
39 | { |
40 | var $page = 'XorgPage'; |
41 | var $session; |
42 | var $menu; |
43 | var $hook; |
44 | |
45 | /** The x.org version */ |
46 | var $version = '@VERSION@'; |
47 | var $debug = 0; |
48 | |
49 | /** db params */ |
50 | var $dbdb = 'x4dat'; |
51 | var $dbhost = 'localhost'; |
52 | var $dbuser = 'x4dat'; |
53 | var $dbpwd = 'x4dat'; |
54 | |
55 | var $table_auth = 'auth_user_md5'; |
56 | var $table_log_actions = 'logger.actions'; |
57 | var $table_log_sessions = 'logger.sessions'; |
58 | var $table_log_events = 'logger.events'; |
59 | |
60 | /** logger */ |
61 | var $tauth = array('native'=>'auth_user_md5'); |
62 | var $tlabel = array('native'=>'X.Org'); |
63 | |
64 | /** paths */ |
65 | var $baseurl = 'http://localhost/xorg'; |
66 | var $spoolroot = '/var/spool/xorg'; |
67 | var $root = null; |
68 | |
69 | function PlatalGlobals($sess) |
70 | { |
71 | $this->session = $sess; |
72 | } |
73 | |
74 | function read_config() |
75 | { |
76 | $array = parse_ini_file($this->root.'/configs/platal.conf', true); |
77 | if (!is_array($array)) { |
78 | return; |
79 | } |
80 | |
81 | foreach ($array as $cat=>$conf) { |
82 | $c = strtolower($cat); |
83 | foreach ($conf as $key=>$val) { |
84 | if ($c == 'core' && isset($this->$key)) { |
85 | $this->$key=$val; |
86 | } else { |
87 | $this->$c->$key = $val; |
88 | } |
89 | } |
90 | } |
91 | } |
92 | |
93 | function setlocale() |
94 | { |
95 | global $globals; |
96 | setlocale(LC_MESSAGES, $globals->core->locale); |
97 | setlocale(LC_TIME, $globals->core->locale); |
98 | setlocale(LC_CTYPE, $globals->core->locale); |
99 | } |
100 | } |
101 | |
102 | // }}} |
103 | |
104 | // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: |
105 | ?> |