58 lines
1.5 KiB
PHP
58 lines
1.5 KiB
PHP
<?php
|
|
/*
|
|
* Über startup.php werden globale Konstanten definiert, Skripte eingebunden
|
|
* und Benutzerchecks durchgeführt, bevor der eigentliche Inhalt beginnt.
|
|
*/
|
|
|
|
define('SEPARATOR', '/');
|
|
define('UP_DIR', '../');
|
|
include_once($_SERVER['DOCUMENT_ROOT'].'/daten/php/functions.php');
|
|
|
|
/*
|
|
* Falls eine Session läuft, wird diese fortgesetzt
|
|
*/
|
|
// zur Zeit nur GET-Sessions
|
|
ini_set('session.use_trans_sid', '1');
|
|
ini_set('session.use_cookies', '1');
|
|
session_name('id');
|
|
|
|
if (sessionRunning() /*& (!$_SERVER['PHP_SELF'] == '/logout.php')*/) {
|
|
@session_start();
|
|
|
|
if (!isset($_SESSION['user'])) {
|
|
header('Location: http://'.$_SERVER['HTTP_HOST'].'/index.php');
|
|
exit;
|
|
}
|
|
|
|
// wenn Session zu lange nicht aktiv war, beenden
|
|
if ((time() - $_SESSION['last_activity']) < 1440) {
|
|
$_SESSION['last_activity'] = time();
|
|
}
|
|
else { // kill session
|
|
unset($_GET['id']);
|
|
|
|
// Löschen sämtlicher Session-Daten.
|
|
$_SESSION = array();
|
|
|
|
if (isset($_COOKIE[session_name()])) {
|
|
setcookie(session_name(), '', time()-42000, '/');
|
|
}
|
|
|
|
session_destroy();
|
|
|
|
header('Location: http://'.$_SERVER['HTTP_HOST'].'/index.php');
|
|
exit;
|
|
}
|
|
}
|
|
|
|
include_once($_SERVER['DOCUMENT_ROOT'].'/daten/php/security.php');
|
|
|
|
if ($access_restricted) {
|
|
if (!itemAccessible(getHomePath($_SERVER['SCRIPT_FILENAME']))) {
|
|
header('Location: http://'.$_SERVER['HTTP_HOST'].'/login.php?restricted='.urlencode(getHomePath($_SERVER['SCRIPT_FILENAME'])));
|
|
exit;
|
|
}
|
|
}
|
|
|
|
?>
|