git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-548
exit;
}
- $this->assign('menu', $globals->menu->menu());
-
if ($globals->debug) {
if ($globals->debug & 1) {
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2004 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program 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. *
+ * *
+ * This program 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 this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+require_once('platal.inc.php');
+require_once('xnet/globals.inc.php');
+require_once('xnet/session.inc.php');
+XnetGlobals::init();
+XnetSession::init();
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+?>
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2004 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program 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. *
+ * *
+ * This program 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 this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+require_once('platal/globals.inc.php');
+
+// {{{ class XorgGlobals
+
+class XnetGlobals extends PlatalGlobals
+{
+ function XnetGlobals()
+ {
+ $this->PlatalGlobals('XnetSession');
+ }
+
+ function init()
+ {
+ global $globals;
+# require_once('xorg/hook.inc.php');
+# require_once('xorg/menu.inc.php');
+
+ $globals = new XnetGlobals;
+ $globals->core = new CoreConfig;
+ $globals->root = dirname(dirname(dirname(__FILE__)));
+# $globals->hook = new XOrgHook();
+# $globals->menu = new XOrgMenu();
+
+# $globals->hook->config(null);
+
+ $array = parse_ini_file($globals->root.'/configs/platal.conf', true);
+ if (!is_array($array)) {
+ return;
+ }
+
+ foreach ($array as $cat=>$conf) {
+ $c = strtolower($cat);
+ foreach ($conf as $key=>$val) {
+ if ($c == 'core' && isset($globals->$key)) {
+ $globals->$key=$val;
+ } else {
+ $globals->$c->$key = $val;
+ }
+ }
+ }
+
+# $globals->hook->menu(null);
+
+ $globals->dbconnect();
+ if ($globals->debug & 1) {
+ $globals->db->trace_on();
+ }
+ $globals->xdb =& new XOrgDB;
+ }
+}
+
+// }}}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+?>
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2004 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program 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. *
+ * *
+ * This program 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 this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+require_once('diogenes/diogenes.core.session.inc.php');
+require_once('diogenes/diogenes.misc.inc.php');
+
+// {{{ class XorgSession
+
+class XnetSession extends DiogenesCoreSession
+{
+ // {{{ function XorgSession()
+
+ function XorgSession()
+ {
+ $this->DiogenesCoreSession();
+ if (!Session::has('uid')) {
+ try_cookie();
+ }
+ set_skin();
+ }
+
+ // }}}
+ // {{{ function init
+
+ function init() {
+ @session_start();
+ if (!Session::has('session')) {
+ $_SESSION['session'] = new XorgSession;
+ }
+ }
+
+ // }}}
+ // {{{ function destroy()
+
+ function destroy() {
+ @session_destroy();
+ unset($_SESSION);
+ XorgSession::init();
+ }
+
+ // }}}
+}
+
+// }}}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+?>
function run()
{
+ if ($this->_page_type != NO_SKIN) {
+ $this->assign('menu', $globals->menu->menu());
+ }
$this->_run('skin/'.Session::get('skin'));
}