Skip to content

Commit

Permalink
ncp-web: fix output buffering off
Browse files Browse the repository at this point in the history
nachoparker committed Mar 5, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9c39606 commit 23bcf21
Showing 4 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ncp-web/activate/index.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php session_start(); ?>
<!DOCTYPE html>
<html class="ng-csp" data-placeholder-focus="false" lang="en">
<head>
@@ -11,7 +12,6 @@
<meta http-equiv="pragma" content="no-cache">
<link rel="icon" type="image/png" href="img/favicon.png"/>
<link rel="stylesheet" href="CSS.css">
<?php session_start(); ?>
</head>
<body id="body-login">
<noscript>
25 changes: 15 additions & 10 deletions ncp-web/index.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
<!--
<?php
/*
NextCloudPi Web Panel frontend
Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
GPL licensed (see end of file) * Use at your own risk!
More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
-->
**/

// redirect to activation first time
ob_start();
exec("a2query -s ncp-activation", $output, $ret);
if ($ret == 0) {
header("Location: activate");
exit();
}

?>

<!DOCTYPE html>
<html class="ng-csp" data-placeholder-focus="false" lang="en">
@@ -16,14 +28,7 @@
<meta name="referrer" content="never">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="mobile-web-app-capable" content="yes">
<?php

// redirect to activation first time
exec("a2query -s ncp-activation", $output, $ret);
if ($ret == 0) {
header("Location: activate");
exit();
}
<?php
ini_set('session.cookie_httponly', 1);
if (isset($_SERVER['HTTPS']))
ini_set('session.cookie_secure', 1);
1 change: 1 addition & 0 deletions ncp-web/ncp-launcher.php
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@

include ('csrf.php');

ob_start();
session_start();
$cfg_dir = '/usr/local/etc/ncp-config.d/';
$l10nDir = "l10n";
1 change: 1 addition & 0 deletions ncp-web/ncp-output.php
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
// More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/
///

ob_start();
header('Content-Type: text/event-stream; charset=utf-8');
header('Cache-Control: no-cache'); // recommended to prevent caching of event data.

0 comments on commit 23bcf21

Please sign in to comment.