Project

General

Profile

1 1420 Luisehahne
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
6
 * @author          WebsiteBaker Project
7 1719 Luisehahne
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 1420 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 1719 Luisehahne
/* -------------------------------------------------------- */
19
// Must include code to stop this file being accessed directly
20 1792 Luisehahne
if(!defined('WB_PATH')) {
21
require_once(dirname(dirname(__FILE__)).'/framework/globalExceptionHandler.php');
22
throw new IllegalFileException();
23 1719 Luisehahne
}
24
/* -------------------------------------------------------- */
25 1551 Luisehahne
26 1719 Luisehahne
	// Generate username field name
27 1833 Luisehahne
$username_fieldname = 'username_';
28
$password_fieldname = 'password_';
29 1719 Luisehahne
$output = '';
30
msgQueue::clear();
31 1551 Luisehahne
32 1719 Luisehahne
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'true') {
33 1551 Luisehahne
34
	$temp = array_merge(range('a','z'), range(0,9));
35
	shuffle($temp);
36
	for($i=0;$i<=7;$i++) {
37
		$username_fieldname .= $temp[$i];
38
		$password_fieldname .= $temp[$i];
39 1420 Luisehahne
	}
40 1833 Luisehahne
} else {
41
	$username_fieldname = 'username';
42
	$password_fieldname = 'password';
43 1420 Luisehahne
}
44 1508 Luisehahne
45 1599 Luisehahne
$thisApp->redirect_url = (isset($thisApp->redirect_url) && ($thisApp->redirect_url!='')  ? $thisApp->redirect_url : $_SESSION['HTTP_REFERER'] );
46 1833 Luisehahne
//$thisApp->redirect_url = '';
47 1792 Luisehahne
$sIncludeHeadLinkCss = '';
48
if( is_readable(WB_PATH .'/account/frontend.css')) {
49
	$sIncludeHeadLinkCss .= '<link href="'.WB_URL.'/account/frontend.css"';
50
	$sIncludeHeadLinkCss .= ' rel="stylesheet" type="text/css" media="screen" />'."\n";
51
}
52 1728 Luisehahne
53 1719 Luisehahne
// set template file and assign module and template block
54 1742 Luisehahne
	$oTpl = new Template(dirname(__FILE__).'/htt');
55 1719 Luisehahne
	$oTpl->set_file('page', 'login.htt');
56
	$oTpl->debug = false; // false, true
57
	$oTpl->set_block('page', 'main_block', 'main');
58 1551 Luisehahne
59 1719 Luisehahne
	$oTpl->set_block('main_block', 'message_block', 'message');
60
	$oTpl->set_block('message', '');
61 1551 Luisehahne
62 1719 Luisehahne
// generell vars
63
	$oTpl->set_var(array(
64
		'FTAN' => $wb->getFTAN(),
65
		'ACTION_URL' => WB_URL.'/account/login.php',
66
		'FORGOT_URL' => WB_URL.'/account/forgot.php',
67
		'REDIRECT_URL' => $thisApp->redirect_url,
68
		'WB_URL' => WB_URL,
69
		'THEME_URL' => THEME_URL,
70 1742 Luisehahne
		'TEMPLATE_URL' => TEMPLATE_DIR,
71 1833 Luisehahne
		'HTTP_REFERER' => $thisApp->redirect_url,
72 1792 Luisehahne
        'CSS_BLOCK'	=> $sIncludeHeadLinkCss,
73 1719 Luisehahne
		'MESSAGE_VALUE' => '',
74
		'ERROR_VALUE' => '',
75
		'THISAPP_MESSAGE_VALUE' => $thisApp->message,
76
		'TEXT_FORGOTTEN_DETAILS' => $TEXT['FORGOTTEN_DETAILS'],
77
		'TEXT_USERNAME' => $TEXT['USERNAME'],
78
		'TEXT_PASSWORD' => $TEXT['PASSWORD'],
79
		'USER_FIELDNAME' => $username_fieldname,
80
		'PASSWORD_FIELDNAME' => $password_fieldname,
81
		'TEXT_LOGIN' => $TEXT['LOGIN'],
82
		'TEXT_RESET' => $TEXT['RESET'],
83
		'TEXT_CANCEL' => $TEXT['CANCEL'],
84
		)
85
	);
86 1551 Luisehahne
87 1719 Luisehahne
	$oTpl->set_block('main_block', 'show_smart_login_block', 'show_smart_login');
88
//	$oTpl->parse('show_smart_login', '');
89
	if($username_fieldname != 'username') {
90
		$oTpl->set_var(array(
91
		'TEXT_REMEMBER_ME' => $TEXT['REMEMBER_ME'],
92
			)
93
		);
94 1551 Luisehahne
95 1742 Luisehahne
		$oTpl->parse('show_smart_login', 'show_smart_login_block', true);
96 1719 Luisehahne
	} else {
97
		$oTpl->set_block('show_smart_login', '');
98
	}
99
100
	//$oTpl->parse('message', 'message_block', true);
101
	$oTpl->parse('main', 'main_block', false);
102
	$output = $oTpl->finish($oTpl->parse('output', 'page'));
103
	unset($oTpl);
104
	print $output;