X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/a73791f16d10ea0e2c477f29d9049d75516aa774..218e5ea6557b696f6775f71ed88d87fb37b099c4:/www/www-header.php diff --git a/www/www-header.php b/www/www-header.php index 3bb7e89..9aa8732 100644 --- a/www/www-header.php +++ b/www/www-header.php @@ -1,6 +1,7 @@ addExtension(new \Twig_Extension_Debug()); -function render($tplname, $vars) +if (!isset($noSecurityCheck) || $noSecurityCheck !== true) { + require __DIR__ . '/www-security.php'; +} + +function render($tplname, $vars = array()) { $vars['css'] = $GLOBALS['phorkie']['cfg']['css']; $vars['title'] = $GLOBALS['phorkie']['cfg']['title']; $vars['topbar'] = $GLOBALS['phorkie']['cfg']['topbar']; - $vars['identity'] = $_SESSION['identity']; - $vars['name'] = $_SESSION['name']; - $vars['email'] = $_SESSION['email']; + if (isset($_SESSION['identity'])) { + $vars['identity'] = $_SESSION['identity']; + $vars['name'] = $_SESSION['name']; + $vars['email'] = $_SESSION['email']; + } $vars['db'] = new Database(); $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm'); @@ -77,4 +94,4 @@ function redirect($target) header('Location: ' . $target); exit(); } -?> \ No newline at end of file +?>