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
// Check if the config file has been set-up
28 1450 DarkViper
if(!defined('TABLE_PREFIX'))
29 1373 Luisehahne
{
30
/*
31 1450 DarkViper
 * Remark:  HTTP/1.1 requires a qualified URI incl. the scheme, name
32
 * of the host and absolute path as the argument of location. Some, but
33
 * not all clients will accept relative URIs also.
34 1373 Luisehahne
 */
35
	$host       = $_SERVER['HTTP_HOST'];
36 1383 FrankH
	$uri        = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
37 1373 Luisehahne
	$file       = 'install/index.php';
38
	$target_url = 'http://'.$host.$uri.'/'.$file;
39 1450 DarkViper
	$sResponse  = $_SERVER['SERVER_PROTOCOL'].' 307 Temporary Redirect';
40
	header($sResponse);
41 1373 Luisehahne
	header('Location: '.$target_url);
42
	exit;	// make sure that subsequent code will not be executed
43
}
44
45 1782 Luisehahne
//require_once(WB_PATH.'/framework/class.frontend.php');
46
47
if(!class_exists('frontend', false)){ include(WB_PATH.'/framework/class.frontend.php'); }
48
49 1373 Luisehahne
// Create new frontend object
50 1848 darkviper
if (!isset($wb) || !($wb instanceof frontend)) {
51 1782 Luisehahne
    $wb = new frontend();
52
}
53 1373 Luisehahne
54
// Figure out which page to display
55
// Stop processing if intro page was shown
56
$wb->page_select() or die();
57
58
// Collect info about the currently viewed page
59
// and check permissions
60
$wb->get_page_details();
61
62
// Collect general website settings
63
$wb->get_website_settings();
64
65
// Load functions available to templates, modules and code sections
66
// also, set some aliases for backward compatibility
67
require(WB_PATH.'/framework/frontend.functions.php');
68 2011 darkviper
// reload all of the already defined global constants
69
WbAdaptor::getInstance()->getWbConstants();
70 1373 Luisehahne
// 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;