Fix for session_start() after sending headers #433

This commit is contained in:
Tobias Reich 2016-01-24 13:07:25 +01:00
parent 70d7e1e6f2
commit d5a03a31f8
2 changed files with 6 additions and 4 deletions

View File

@ -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'])) {

View File

@ -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'])) {