$args[0] = &$page;
if ($hook['auth'] > S::v('auth', AUTH_PUBLIC)) {
- // FIXME: don't use 'session' object anymore
- if (!$_SESSION['session']->doAuth()) {
+ global $globals;
+
+ if (call_user_func(array($globals->session, 'doAuth'))) {
$this->force_login($page);
}
}
$base = empty($_SERVER['HTTPS']) ? 'http://' : 'https://';
$this->baseurl = trim($base.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']), '/');
- $this->spoolroot = dirname(dirname(dirname(__FILE__)));
+ $this->spoolroot = dirname(dirname(__FILE__));
$this->read_config();
return;
case 'logged':
- if (empty($GLOBALS['IS_XNET_SITE']) && !XorgSession::doAuthCookie()) {
- $platal = new Platal();
- $platal->force_login($page);
- }
- if ($GLOBALS['IS_XNET_SITE'] && !$_SESSION['session']->doAuth()) {
- $platal = new Xnet();
- $platal->force_login($page);
+ if (empty($GLOBALS['IS_XNET_SITE'])) {
+ if (!XorgSession::doAuthCookie()) {
+ $platal = new Platal();
+ $platal->force_login($page);
+ }
+ return;
}
- return;
+ /* fallthrough */
default:
- if (!$_SESSION['session']->doAuth()) {
+ if (call_user_func(array($globals->session, 'doAuth'))) {
$platal = empty($GLOBALS['IS_XNET_SITE']) ? new Platal() : new Xnet();
$platal->force_login($page);
}
S::init();
- $_SESSION['session'] = new XnetSession;
-
if (!S::logged()) {
// prevent connexion to be linked to deconnexion
if (($i = strpos($_SERVER['REQUEST_URI'], 'exit')) !== false)