Project

General

Profile

1 1514 Luisehahne
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
6 1773 Luisehahne
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 1514 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 1787 Luisehahne
 * $_SESSION['USED_LANGUAGES']="NL,EN,DE";
17
 * if BROWSER_LANGUAGE is in USED_LANGUAGES then use BROWSER_LANGUAGE
18
 * and provide all other USED_LANGUAGES to choose
19
 * IF BROWSER_LANGUAGE is NOT in USED_LANGUAGES then use const LANGUAGE
20
 * and provide all other USED_LANGUAGES to choose
21
 *
22
 *
23 1514 Luisehahne
 */
24
25 1787 Luisehahne
// Include config file
26 2063 Luisehahne
$config_file = realpath('../framework/initialize.php');
27 1787 Luisehahne
if(file_exists($config_file) && !defined('WB_URL'))
28
{
29 2063 Luisehahne
    $sAutoLanguage = 'EN';
30
// detect client language
31
    if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
32
    	if(preg_match('/([a-z]{2})(?:-[a-z]{2})*/i', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches)) {
33
    		$sAutoLanguage = strtoupper($matches[1]);
34
    	}
35
    }
36
    $sAutoLanguage=( isset($_SESSION['LANGUAGE'] ) ? $_SESSION['LANGUAGE'] : $sAutoLanguage);
37
    if(!defined('LANGUAGE')) { define('LANGUAGE',$sAutoLanguage); }
38
39 1787 Luisehahne
	require_once($config_file);
40
}
41
42 1673 Luisehahne
ini_set('display_errors','0');
43 1514 Luisehahne
44 1787 Luisehahne
if(!class_exists('frontend', false)){ include(WB_PATH.'/framework/class.frontend.php'); }
45 1773 Luisehahne
46 1787 Luisehahne
require_once(WB_PATH.'/framework/functions.php');
47
48 1773 Luisehahne
// Create new frontend object
49 1787 Luisehahne
$wb = new frontend(false);
50 1773 Luisehahne
51
if( ( (intval(FRONTEND_SIGNUP)==0) &&
52
    (  0 == (isset($_SESSION['USER_ID']) ? intval($_SESSION['USER_ID']) : 0) )))
53 1514 Luisehahne
{
54 1773 Luisehahne
	$wb->send_header(WB_URL.'/index.php');
55
//	if(INTRO_PAGE) {
56
//	} else {
57
//		header('Location: '.WB_URL.'/index.php');
58
//		exit(0);
59
//	}
60 1514 Luisehahne
}
61
62 1773 Luisehahne
// form faked? Check the honeypot-fields.
63
if(ENABLED_ASP && isset($_POST['username']) && (
64
	(!isset($_POST['submitted_when']) OR !isset($_SESSION['submitted_when']) ) OR
65
//		($_POST['submitted_when'] != $_SESSION['submitted_when']) OR
66
			(!isset($_POST['email-address']) OR $_POST['email-address']) OR
67
				(!isset($_POST['name']) OR $_POST['name']) OR
68
					(!isset($_POST['full_name']) OR $_POST['full_name'])
69
	))
70
{
71
	$wb->send_header(WB_URL.'/index.php');
72 1514 Luisehahne
}
73
74 2063 Luisehahne
//$langDir = WB_PATH . '/languages/' . LANGUAGE . '.php';
75
//require_once(!file_exists($langDir) ? WB_PATH . '/languages/EN.php' : $langDir );
76 1514 Luisehahne
77 1673 Luisehahne
$_SESSION['display_form'] = true;
78 1514 Luisehahne
79 1787 Luisehahne
$page_id = defined('REFERRER_ID') ? REFERRER_ID : isset($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
80 1773 Luisehahne
81 1787 Luisehahne
// Required page details
82 1514 Luisehahne
$page_description = '';
83
$page_keywords = '';
84 1787 Luisehahne
// Work out level
85
$level = ($page_id > 0 )? level_count($page_id): $page_id;
86
// Work out root parent
87
$root_parent = ($page_id > 0 )? root_parent($page_id): $page_id;
88
89 1514 Luisehahne
define('PAGE_ID', $page_id);
90 1787 Luisehahne
define('ROOT_PARENT', $root_parent);
91 1514 Luisehahne
define('PARENT', 0);
92 1787 Luisehahne
define('LEVEL', $level);
93
94 1514 Luisehahne
define('PAGE_TITLE', $TEXT['SIGNUP']);
95
define('MENU_TITLE', $TEXT['SIGNUP']);
96
define('MODULE', '');
97
define('VISIBILITY', 'public');
98
99 1673 Luisehahne
define('PAGE_CONTENT', WB_PATH.'/account/signup_form.php');
100 1773 Luisehahne
101 1514 Luisehahne
// Set auto authentication to false
102
$auto_auth = false;
103
104
// Include the index (wrapper) file
105
require(WB_PATH.'/index.php');
106 1787 Luisehahne
107
exit();