Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
6
 * @author          WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8
 * @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: login_form.php 1833 2012-12-10 04:05:38Z Luisehahne $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/account/login_form.php $
14
 * @lastmodified    $Date: 2012-12-10 05:05:38 +0100 (Mon, 10 Dec 2012) $
15
 *
16
 */
17

    
18
/* -------------------------------------------------------- */
19
// Must include code to stop this file being accessed directly
20
if(!defined('WB_PATH')) {
21
require_once(dirname(dirname(__FILE__)).'/framework/globalExceptionHandler.php');
22
throw new IllegalFileException();
23
}
24
/* -------------------------------------------------------- */
25

    
26
	// Generate username field name
27
$username_fieldname = 'username_';
28
$password_fieldname = 'password_';
29
$output = '';
30
msgQueue::clear();
31

    
32
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'true') {
33

    
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
	}
40
} else {
41
	$username_fieldname = 'username';
42
	$password_fieldname = 'password';
43
}
44

    
45
$thisApp->redirect_url = (isset($thisApp->redirect_url) && ($thisApp->redirect_url!='')  ? $thisApp->redirect_url : $_SESSION['HTTP_REFERER'] );
46
//$thisApp->redirect_url = '';
47
$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

    
53
// set template file and assign module and template block
54
	$oTpl = new Template(dirname(__FILE__).'/htt');
55
	$oTpl->set_file('page', 'login.htt');
56
	$oTpl->debug = false; // false, true
57
	$oTpl->set_block('page', 'main_block', 'main');
58

    
59
	$oTpl->set_block('main_block', 'message_block', 'message');
60
	$oTpl->set_block('message', '');
61

    
62
// 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
		'TEMPLATE_URL' => TEMPLATE_DIR,
71
		'HTTP_REFERER' => $thisApp->redirect_url,
72
        'CSS_BLOCK'	=> $sIncludeHeadLinkCss,
73
		'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

    
87
	$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

    
95
		$oTpl->parse('show_smart_login', 'show_smart_login_block', true);
96
	} 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;
105

    
(13-13/22)