summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/include/setup.php')
-rw-r--r--frontend/include/setup.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/frontend/include/setup.php b/frontend/include/setup.php
index 2239c6c..825d759 100644
--- a/frontend/include/setup.php
+++ b/frontend/include/setup.php
@@ -3,6 +3,7 @@ if (!isset($S)) {
$S=array();
}
$S=array_merge($S, array(
+ 'death' => '',
'request' => $_GET['req'],
'notemplates' => false,
'title' => null,
@@ -17,17 +18,17 @@ $S=array_merge($S, array(
'sql' => null
));
unset($_REQUEST['req'], $_GET['req']);
-$S['cookie_dir']=substr($conf['url'], strpos($conf['url'], '/', 8)).'/';
+$S['cookie_dir']=substr($S['conf']['url'], strpos($S['conf']['url'], '/', 8)).'/';
require_once(SHARED.'/include/dbinit.php');
-if (isset($_COOKIE[$conf['cookiename']])) {
- $cookie=$_COOKIE[$conf['cookiename']];
- debug('session', 'cookie received '.$conf['cookiename'].'='.htmlentities($cookie));
+if (isset($_COOKIE[$S['conf']['cookiename']])) {
+ $cookie=$_COOKIE[$S['conf']['cookiename']];
+ debug('session', 'cookie received '.$S['conf']['cookiename'].'='.htmlentities($cookie));
if (preg_match('/[a-z0-9]{30}/', $cookie)) {
- $r=$S['pdo']->query('SELECT * FROM `sessions` WHERE `id`="'.$cookie.'"');
+ $r=query('SELECT * FROM `sessions` WHERE `id`="'.$cookie.'"');
if ($r->rowCount()) {
$S['session']=new sql_session($r->fetch(PDO::FETCH_ASSOC));
if ($S['session']->atime+$S['session']->expire < time()) {
- setcookie($conf['cookiename'], '', 1, $S['cookie_dir'], '', false, true);
+ setcookie($S['conf']['cookiename'], '', 1, $S['cookie_dir'], '', false, true);
$S['sesion']->delete();
unset($S['session']);
} else {
@@ -35,11 +36,11 @@ if (isset($_COOKIE[$conf['cookiename']])) {
$S['session']->write();
$S['user']=new sql_user($S['session']->user);
debug('session', 'sessionid='.$S['session']->id.', email='.$S['user']->email);
- setcookie($conf['cookiename'], $S['session']->id, time()+$conf['sessionlength'], $S['cookie_dir'], '', false, true);
+ setcookie($S['conf']['cookiename'], $S['session']->id, time()+$S['conf']['sessionlength'], $S['cookie_dir'], '', false, true);
}
} else {
debug('session', 'session not found');
- setcookie($conf['cookiename'], '', 1, $S['cookie_dir'], '', false, true);
+ setcookie($S['conf']['cookiename'], '', 1, $S['cookie_dir'], '', false, true);
}
} else {
debug('session', 'session id invalid');