From d5a03a31f8411d57a39cb2debccb477d0fb683b9 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 24 Jan 2016 13:07:25 +0100 Subject: [PATCH] Fix for session_start() after sending headers #433 --- plugins/check/index.php | 5 +++-- plugins/displaylog/index.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/check/index.php b/plugins/check/index.php index dfcbd12..7340573 100644 --- a/plugins/check/index.php +++ b/plugins/check/index.php @@ -15,6 +15,9 @@ require($lychee . 'php/define.php'); require($lychee . 'php/autoload.php'); require($lychee . 'php/modules/misc.php'); +# Start the session +session_start(); + # Set content header('content-type: text/plain'); @@ -103,8 +106,6 @@ echo(PHP_EOL . PHP_EOL . 'System Information' . PHP_EOL); echo('------------------' . PHP_EOL); # Ensure that user is logged in -session_start(); - if ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& (isset($_SESSION['identifier'])&&$_SESSION['identifier']===$settings['identifier'])) { diff --git a/plugins/displaylog/index.php b/plugins/displaylog/index.php index a9ac561..52aa698 100644 --- a/plugins/displaylog/index.php +++ b/plugins/displaylog/index.php @@ -10,6 +10,9 @@ # Location $lychee = __DIR__ . '/../../'; +# Start the session +session_start(); + # Load requirements require($lychee . 'php/define.php'); require($lychee . 'php/autoload.php'); @@ -41,8 +44,6 @@ $settings = new Settings($database); $settings = $settings->get(); # Ensure that user is logged in -session_start(); - if ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& (isset($_SESSION['identifier'])&&$_SESSION['identifier']===$settings['identifier'])) {