Require SSL for the RCC.

Resolves T116
This commit is contained in:
Marcel Kapfer (mmk2410) 2016-05-17 22:34:33 +02:00
parent 655b982f9d
commit 42f1992c97
2 changed files with 23 additions and 6 deletions

View File

@ -32,6 +32,17 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
require '../vendor/autoload.php';
require '../res/php/Config.php';
use \mmk2410\rbe\config\Config as Config;
$config = new Config("../config.yaml", '../vendor/autoload.php');
$settings = $config->getConfig();
include './ssl.php';
?>
<!DOCTYPE html>
@ -64,12 +75,7 @@
<div class="main">
<?php
require '../res/php/Config.php';
use mmk2410\rbe\config\Config as Config;
$configParser = new Config('../config.yaml', '../vendor/autoload.php');
$config = $configParser->getConfig();
$config = $settings;
if ($config["rcc"]["rcc"] == "on") {
include 'password.php';

11
rcc/ssl.php Normal file
View File

@ -0,0 +1,11 @@
<?php
// Marcel Kapfer (mmk2410) / Wilson O'Sullivan
// License: MIT License
// SSL Verification
if ($settings["rcc"]["debug"] != "on") {
if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on") {
header('HTTP/1.1 400 Bad Request');
exit();
}
}