Project

General

Profile

1 1373 Luisehahne
<?php
2
/**
3
 *
4 1848 darkviper
 * @category        Core
5
 * @package         Core_sys
6 1373 Luisehahne
 * @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 1948 darkviper
// compatibility between old and new access file format
19
if (isset($iPageId)) { $page_id = $iPageId; }
20
if (isset($page_id) && !isset($iPageId)) { $iPageId = $page_id; }
21 1373 Luisehahne
// Include config file
22
$config_file = dirname(__FILE__).'/config.php';
23 1782 Luisehahne
if(file_exists($config_file) && !defined('WB_URL'))
24 1373 Luisehahne
{
25
	require_once($config_file);
26
}
27
28
// Check if the config file has been set-up
29 1450 DarkViper
if(!defined('TABLE_PREFIX'))
30 1373 Luisehahne
{
31
/*
32 1450 DarkViper
 * 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 1373 Luisehahne
 */
36
	$host       = $_SERVER['HTTP_HOST'];
37 1383 FrankH
	$uri        = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
38 1373 Luisehahne
	$file       = 'install/index.php';
39
	$target_url = 'http://'.$host.$uri.'/'.$file;
40 1450 DarkViper
	$sResponse  = $_SERVER['SERVER_PROTOCOL'].' 307 Temporary Redirect';
41
	header($sResponse);
42 1373 Luisehahne
	header('Location: '.$target_url);
43
	exit;	// make sure that subsequent code will not be executed
44
}
45
46 1782 Luisehahne
//require_once(WB_PATH.'/framework/class.frontend.php');
47
48
if(!class_exists('frontend', false)){ include(WB_PATH.'/framework/class.frontend.php'); }
49
50 1373 Luisehahne
// Create new frontend object
51 1848 darkviper
if (!isset($wb) || !($wb instanceof frontend)) {
52 1782 Luisehahne
    $wb = new frontend();
53
}
54 1373 Luisehahne
55
// Figure out which page to display
56
// Stop processing if intro page was shown
57
$wb->page_select() or die();
58
59
// Collect info about the currently viewed page
60
// and check permissions
61
$wb->get_page_details();
62
63
// Collect general website settings
64
$wb->get_website_settings();
65
66
// Load functions available to templates, modules and code sections
67
// also, set some aliases for backward compatibility
68
require(WB_PATH.'/framework/frontend.functions.php');
69
70
// redirect menu-link
71 1696 Luisehahne
/**
72
 *
73
 * Removed the extra handling of menu links in index.php
74
 * Moved it to the view.php of module menu links.
75
 * Now the extra functionality of this module is seperated from the
76
 * core and you can uninstall it if you like.
77
 * Freeing the core from unnecessary code.
78
 *
79
 *
80
 */
81 1373 Luisehahne
82
ob_start();
83
require(WB_PATH.'/templates/'.TEMPLATE.'/index.php');
84
$output = ob_get_contents();
85
if(ob_get_length() > 0) { ob_end_clean(); }
86 1626 darkviper
// execute frontend output filters
87
	if(file_exists(WB_PATH .'/modules/output_filter/index.php')) {
88
		include_once(WB_PATH .'/modules/output_filter/index.php');
89 1520 darkviper
		if(function_exists('executeFrontendOutputFilter')) {
90
			$output = executeFrontendOutputFilter($output);
91
		}
92
	}
93 1450 DarkViper
// now send complete page to the browser
94 1373 Luisehahne
echo $output;
95
// end of wb-script
96
exit;