1 |
1373
|
Luisehahne
|
<?php
|
2 |
|
|
/**
|
3 |
|
|
*
|
4 |
|
|
* @category frontend
|
5 |
|
|
* @package page
|
6 |
|
|
* @author WebsiteBaker Project
|
7 |
1696
|
Luisehahne
|
* @copyright 2009-, WebsiteBaker Org. e.V.
|
8 |
1373
|
Luisehahne
|
* @link http://www.websitebaker2.org/
|
9 |
|
|
* @license http://www.gnu.org/licenses/gpl.html
|
10 |
|
|
* @platform WebsiteBaker 2.8.x
|
11 |
|
|
* @requirements PHP 5.2.2 and higher
|
12 |
|
|
* @version $Id$
|
13 |
|
|
* @filesource $HeadURL$
|
14 |
|
|
* @lastmodified $Date$
|
15 |
|
|
*
|
16 |
|
|
*/
|
17 |
|
|
|
18 |
|
|
// Include config file
|
19 |
|
|
$config_file = dirname(__FILE__).'/config.php';
|
20 |
|
|
if(file_exists($config_file))
|
21 |
|
|
{
|
22 |
|
|
require_once($config_file);
|
23 |
|
|
}
|
24 |
|
|
|
25 |
|
|
// Check if the config file has been set-up
|
26 |
1450
|
DarkViper
|
if(!defined('TABLE_PREFIX'))
|
27 |
1373
|
Luisehahne
|
{
|
28 |
|
|
/*
|
29 |
1450
|
DarkViper
|
* Remark: HTTP/1.1 requires a qualified URI incl. the scheme, name
|
30 |
|
|
* of the host and absolute path as the argument of location. Some, but
|
31 |
|
|
* not all clients will accept relative URIs also.
|
32 |
1373
|
Luisehahne
|
*/
|
33 |
|
|
$host = $_SERVER['HTTP_HOST'];
|
34 |
1383
|
FrankH
|
$uri = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
|
35 |
1373
|
Luisehahne
|
$file = 'install/index.php';
|
36 |
|
|
$target_url = 'http://'.$host.$uri.'/'.$file;
|
37 |
1450
|
DarkViper
|
$sResponse = $_SERVER['SERVER_PROTOCOL'].' 307 Temporary Redirect';
|
38 |
|
|
header($sResponse);
|
39 |
1373
|
Luisehahne
|
header('Location: '.$target_url);
|
40 |
|
|
exit; // make sure that subsequent code will not be executed
|
41 |
|
|
}
|
42 |
|
|
|
43 |
|
|
require_once(WB_PATH.'/framework/class.frontend.php');
|
44 |
|
|
// Create new frontend object
|
45 |
|
|
$wb = new frontend();
|
46 |
|
|
|
47 |
|
|
// Figure out which page to display
|
48 |
|
|
// Stop processing if intro page was shown
|
49 |
|
|
$wb->page_select() or die();
|
50 |
|
|
|
51 |
|
|
// Collect info about the currently viewed page
|
52 |
|
|
// and check permissions
|
53 |
|
|
$wb->get_page_details();
|
54 |
|
|
|
55 |
|
|
// Collect general website settings
|
56 |
|
|
$wb->get_website_settings();
|
57 |
|
|
|
58 |
|
|
// Load functions available to templates, modules and code sections
|
59 |
|
|
// also, set some aliases for backward compatibility
|
60 |
|
|
require(WB_PATH.'/framework/frontend.functions.php');
|
61 |
|
|
|
62 |
|
|
// redirect menu-link
|
63 |
1696
|
Luisehahne
|
/**
|
64 |
|
|
*
|
65 |
|
|
* Removed the extra handling of menu links in index.php
|
66 |
|
|
* Moved it to the view.php of module menu links.
|
67 |
|
|
* Now the extra functionality of this module is seperated from the
|
68 |
|
|
* core and you can uninstall it if you like.
|
69 |
|
|
* Freeing the core from unnecessary code.
|
70 |
|
|
*
|
71 |
|
|
*
|
72 |
|
|
*/
|
73 |
1373
|
Luisehahne
|
|
74 |
|
|
ob_start();
|
75 |
|
|
require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
|
76 |
|
|
$output = ob_get_contents();
|
77 |
|
|
if(ob_get_length() > 0) { ob_end_clean(); }
|
78 |
1626
|
darkviper
|
// execute frontend output filters
|
79 |
|
|
if(file_exists(WB_PATH .'/modules/output_filter/index.php')) {
|
80 |
|
|
include_once(WB_PATH .'/modules/output_filter/index.php');
|
81 |
1520
|
darkviper
|
if(function_exists('executeFrontendOutputFilter')) {
|
82 |
|
|
$output = executeFrontendOutputFilter($output);
|
83 |
|
|
}
|
84 |
|
|
}
|
85 |
1450
|
DarkViper
|
// now send complete page to the browser
|
86 |
1373
|
Luisehahne
|
echo $output;
|
87 |
|
|
// end of wb-script
|
88 |
|
|
exit;
|