www/www-header.php - FIX: non-set _SESSION variables causing 'undefined index' in...
authorJustin J. Novack <jnovack@gmail.com>
Sun, 16 Sep 2012 15:27:56 +0000 (11:27 -0400)
committerJustin J. Novack <jnovack@gmail.com>
Sun, 16 Sep 2012 15:27:56 +0000 (11:27 -0400)
www/www-header.php

index 3bb7e89..74863e1 100644 (file)
@@ -64,9 +64,11 @@ function render($tplname, $vars)
     $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 +79,4 @@ function redirect($target)
     header('Location: ' . $target);
     exit();
 }
-?>
\ No newline at end of file
+?>