ncp-web: fix output buffering off

This commit is contained in:
nachoparker 2019-03-03 19:06:03 -07:00
parent 9c39606aab
commit 23bcf21896
4 changed files with 18 additions and 11 deletions

View File

@ -1,3 +1,4 @@
<?php session_start(); ?>
<!DOCTYPE html> <!DOCTYPE html>
<html class="ng-csp" data-placeholder-focus="false" lang="en"> <html class="ng-csp" data-placeholder-focus="false" lang="en">
<head> <head>
@ -11,7 +12,6 @@
<meta http-equiv="pragma" content="no-cache"> <meta http-equiv="pragma" content="no-cache">
<link rel="icon" type="image/png" href="img/favicon.png"/> <link rel="icon" type="image/png" href="img/favicon.png"/>
<link rel="stylesheet" href="CSS.css"> <link rel="stylesheet" href="CSS.css">
<?php session_start(); ?>
</head> </head>
<body id="body-login"> <body id="body-login">
<noscript> <noscript>

View File

@ -1,11 +1,23 @@
<!-- <?php
/*
NextCloudPi Web Panel frontend NextCloudPi Web Panel frontend
Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com> 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! GPL licensed (see end of file) * Use at your own risk!
More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/ 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> <!DOCTYPE html>
<html class="ng-csp" data-placeholder-focus="false" lang="en"> <html class="ng-csp" data-placeholder-focus="false" lang="en">
@ -16,14 +28,7 @@
<meta name="referrer" content="never"> <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="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"> <meta name="mobile-web-app-capable" content="yes">
<?php <?php
// redirect to activation first time
exec("a2query -s ncp-activation", $output, $ret);
if ($ret == 0) {
header("Location: activate");
exit();
}
ini_set('session.cookie_httponly', 1); ini_set('session.cookie_httponly', 1);
if (isset($_SERVER['HTTPS'])) if (isset($_SERVER['HTTPS']))
ini_set('session.cookie_secure', 1); ini_set('session.cookie_secure', 1);

View File

@ -10,6 +10,7 @@
include ('csrf.php'); include ('csrf.php');
ob_start();
session_start(); session_start();
$cfg_dir = '/usr/local/etc/ncp-config.d/'; $cfg_dir = '/usr/local/etc/ncp-config.d/';
$l10nDir = "l10n"; $l10nDir = "l10n";

View File

@ -8,6 +8,7 @@
// More at https://ownyourbits.com/2017/02/13/nextcloud-ready-raspberry-pi-image/ // 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('Content-Type: text/event-stream; charset=utf-8');
header('Cache-Control: no-cache'); // recommended to prevent caching of event data. header('Cache-Control: no-cache'); // recommended to prevent caching of event data.