Implemented 'Force SSL'
[PHPCredLocker.git] / index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/** System entry point for non-API calls
*
* Copyright (C) 2012 B Tasker
* Released under GNU GPL V2
* See LICENSE
*
*/
session_start();
ob_start();
define('_CREDLOCK',1);
 
// Prevent Caching
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
header('Pragma: no-cache');
header('Expires: Thu, 01 Jan 1970 00:00:00 GMT');
 
 
// Force use of the installer if it's present
if (is_dir (dirname(__FILE__)."/Install")){
header("Location: Install/");
die;
}
 
 
//error_reporting(E_ALL);
 
// 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';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
?>