Implemented 'Force SSL'
[PHPCredLocker.git] / index.php
blob:a/index.php -> blob:b/index.php
--- a/index.php
+++ b/index.php
@@ -28,6 +28,12 @@
 // Load the framework
 require_once 'lib/Framework/main.php';
 
+// Force SSL if configured to do so
+if (BTMain::getConf()->forceSSL && !BTMain::getConnTypeSSL()){
+header("Location: " . BTMain::getConf()->SSLURL);
+die;
+}
+
 // pass off to the handler
 include_once 'lib/Handler.php';