1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category frontend
|
5
|
* @package page
|
6
|
* @author WebsiteBaker Project
|
7
|
* @copyright WebsiteBaker Org. e.V.
|
8
|
* @link http://websitebaker.org/
|
9
|
* @license http://www.gnu.org/licenses/gpl.html
|
10
|
* @platform WebsiteBaker 2.8.3
|
11
|
* @requirements PHP 5.3.6 and higher
|
12
|
* @version $Id: index.php 2 2017-07-02 15:14:29Z Manuela $
|
13
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb/2.10.x/trunk/index.php $
|
14
|
* @lastmodified $Date: 2017-07-02 17:14:29 +0200 (Sun, 02 Jul 2017) $
|
15
|
*
|
16
|
*/
|
17
|
|
18
|
$starttime = array_sum(explode(" ",microtime()));
|
19
|
|
20
|
// Include config file
|
21
|
if (!defined('WB_PATH')) {
|
22
|
$sStartupFile = __DIR__.'/config.php';
|
23
|
if (is_readable($sStartupFile)) {
|
24
|
require($sStartupFile);
|
25
|
}
|
26
|
}
|
27
|
|
28
|
// Check if the config file has been set-up
|
29
|
if(!defined('TABLE_PREFIX'))
|
30
|
{
|
31
|
/*
|
32
|
* Remark: HTTP/1.1 requires a qualified URI incl. the scheme, name
|
33
|
* of the host and absolute path as the argument of location. Some, but
|
34
|
* not all clients will accept relative URIs also.
|
35
|
*/
|
36
|
$host = $_SERVER['HTTP_HOST'];
|
37
|
$uri = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
|
38
|
$file = 'install/index.php';
|
39
|
$target_url = 'http://'.$host.$uri.'/'.$file;
|
40
|
$sResponse = $_SERVER['SERVER_PROTOCOL'].' 307 Temporary Redirect';
|
41
|
header($sResponse);
|
42
|
header('Location: '.$target_url);
|
43
|
exit; // make sure that subsequent code will not be executed
|
44
|
}
|
45
|
|
46
|
if (!class_exists('frontend')) { require(WB_PATH.'/framework/class.frontend.php'); }
|
47
|
// Create new frontend object
|
48
|
if (!isset($wb) || !($wb instanceof frontend)) { $wb = new frontend(); }
|
49
|
|
50
|
// activate frontend Output_Filter (index.php)
|
51
|
if (is_readable(WB_PATH .'/modules/output_filter/index.php')) {
|
52
|
if (!function_exists('executeFrontendOutputFilter')) {
|
53
|
include WB_PATH .'/modules/output_filter/index.php';
|
54
|
}
|
55
|
} else {
|
56
|
throw new RuntimeException('missing mandatory global Output_Filter!');
|
57
|
}
|
58
|
|
59
|
// Figure out which page to display
|
60
|
// Stop processing if intro page was shown
|
61
|
$wb->page_select() or die();
|
62
|
|
63
|
// Collect info about the currently viewed page
|
64
|
// and check permissions
|
65
|
$wb->get_page_details();
|
66
|
|
67
|
// Collect general website settings
|
68
|
$wb->get_website_settings();
|
69
|
|
70
|
// Load functions available to templates, modules and code sections
|
71
|
// also, set some aliases for backward compatibility
|
72
|
if (!function_exists('register_frontend_modfiles')){require(WB_PATH.'/framework/frontend.functions.php');}
|
73
|
|
74
|
//Get pagecontent in buffer for Droplets and/or Filter operations
|
75
|
ob_start();
|
76
|
require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
|
77
|
$output = ob_get_contents();
|
78
|
if(ob_get_length() > 0) { ob_end_clean(); }
|
79
|
// execute frontend output filters
|
80
|
if(file_exists(WB_PATH .'/modules/output_filter/index.php')) {
|
81
|
include_once(WB_PATH .'/modules/output_filter/index.php');
|
82
|
if(function_exists('executeFrontendOutputFilter')) {
|
83
|
$output = executeFrontendOutputFilter($output);
|
84
|
}
|
85
|
}
|
86
|
// now send complete page to the browser
|
87
|
echo $output;
|
88
|
// end of wb-script
|
89
|
exit;
|