git.cweiske.de
/
phorkie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
www/www-header.php - FIX: non-set _SESSION variables causing 'undefined index' in...
[phorkie.git]
/
www
/
www-header.php
diff --git
a/www/www-header.php
b/www/www-header.php
index c0b18d35b54b4de06057fa0d837ea14f8f5a7d73..74863e1637f18b011a31ec2609eb38105e0bbea2 100644
(file)
--- a/
www/www-header.php
+++ b/
www/www-header.php
@@
-1,5
+1,6
@@
<?php
namespace phorkie;
<?php
namespace phorkie;
+session_start();
set_include_path(
__DIR__ . '/../src/'
. PATH_SEPARATOR . get_include_path()
set_include_path(
__DIR__ . '/../src/'
. PATH_SEPARATOR . get_include_path()
@@
-63,6
+64,12
@@
function render($tplname, $vars)
$vars['css'] = $GLOBALS['phorkie']['cfg']['css'];
$vars['title'] = $GLOBALS['phorkie']['cfg']['title'];
$vars['topbar'] = $GLOBALS['phorkie']['cfg']['topbar'];
$vars['css'] = $GLOBALS['phorkie']['cfg']['css'];
$vars['title'] = $GLOBALS['phorkie']['cfg']['title'];
$vars['topbar'] = $GLOBALS['phorkie']['cfg']['topbar'];
+ 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');
echo $template->render($vars);
$template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
echo $template->render($vars);
@@
-72,4
+79,4
@@
function redirect($target)
header('Location: ' . $target);
exit();
}
header('Location: ' . $target);
exit();
}
-?>
\ No newline at end of file
+?>