3 * Copyright (C) 2003-2004 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
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 /** This class describes Diogenes' global settings.
24 class DiogenesCoreGlobals
{
25 /** Absolute directory location of the Diogenes library */
27 /** Absolute directory location of Diogenes root. */
29 /** The Diogenes root URL */
32 /** The database handler. */
36 var $dbdb = "diogenes";
37 /** The database server. */
38 var $dbhost = "localhost";
39 /** The user to access the database. */
40 var $dbuser = "diogenes";
41 /** The password to connect to the database. */
44 /** The database table holding the logger actions */
45 var $table_log_actions = "diogenes_logactions";
46 /** The database table holding the logger events */
47 var $table_log_events = "diogenes_logevents";
48 /** The database table holding the logger sessions */
49 var $table_log_sessions = "diogenes_logsessions";
50 /** The class to use for session handling. */
51 var $session = 'DiogenesCoreSession';
52 /** The function to call for translation. */
53 var $gettext = 'gettext';
56 /** Connect to the database server.
60 $db = new DiogenesDatabase($this->dbdb
, $this->dbhost
, $this->dbuser
, $this->dbpwd
);
64 header("HTTP/1.0 500 Internal Server Error");
65 die("Could not connect to database (".mysql_error().")");
70 /** Add some automatic hyperlinks to a text.
72 * @param in the text to beautify
76 $out = str_replace("Polytechnique.org","<a href=\"http://www.polytechnique.org/\">Polytechnique.org</a>",$in);
77 $out = str_replace("Diogenes","<a href=\"http://opensource.polytechnique.org/diogenes/\">Diogenes</a>",$out);
84 /** Translation function.
86 * @param msg the message to translate
91 $func = $globals->gettext
;
93 if (function_exists($func))