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 1792 2012-10-24 00:43:00Z Luisehahne $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/account/login_form.php $
14
 * @lastmodified    $Date: 2012-10-24 02:43:00 +0200 (Wed, 24 Oct 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
}
41

    
42
$thisApp->redirect_url = (isset($thisApp->redirect_url) && ($thisApp->redirect_url!='')  ? $thisApp->redirect_url : $_SESSION['HTTP_REFERER'] );
43

    
44
$sIncludeHeadLinkCss = '';
45
if( is_readable(WB_PATH .'/account/frontend.css')) {
46
	$sIncludeHeadLinkCss .= '<link href="'.WB_URL.'/account/frontend.css"';
47
	$sIncludeHeadLinkCss .= ' rel="stylesheet" type="text/css" media="screen" />'."\n";
48
}
49

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

    
56
	$oTpl->set_block('main_block', 'message_block', 'message');
57
	$oTpl->set_block('message', '');
58

    
59
// generell vars
60
	$oTpl->set_var(array(
61
		'FTAN' => $wb->getFTAN(),
62
		'ACTION_URL' => WB_URL.'/account/login.php',
63
		'FORGOT_URL' => WB_URL.'/account/forgot.php',
64
		'REDIRECT_URL' => $thisApp->redirect_url,
65
		'WB_URL' => WB_URL,
66
		'THEME_URL' => THEME_URL,
67
		'TEMPLATE_URL' => TEMPLATE_DIR,
68
		'HTTP_REFERER' => $_SESSION['HTTP_REFERER'],
69
        'CSS_BLOCK'	=> $sIncludeHeadLinkCss,
70
		'MESSAGE_VALUE' => '',
71
		'ERROR_VALUE' => '',
72
		'THISAPP_MESSAGE_VALUE' => $thisApp->message,
73
		'TEXT_FORGOTTEN_DETAILS' => $TEXT['FORGOTTEN_DETAILS'],
74
		'TEXT_USERNAME' => $TEXT['USERNAME'],
75
		'TEXT_PASSWORD' => $TEXT['PASSWORD'],
76
		'USER_FIELDNAME' => $username_fieldname,
77
		'PASSWORD_FIELDNAME' => $password_fieldname,
78
		'TEXT_LOGIN' => $TEXT['LOGIN'],
79
		'TEXT_RESET' => $TEXT['RESET'],
80
		'TEXT_CANCEL' => $TEXT['CANCEL'],
81
		)
82
	);
83

    
84
	$oTpl->set_block('main_block', 'show_smart_login_block', 'show_smart_login');
85
//	$oTpl->parse('show_smart_login', '');
86
	if($username_fieldname != 'username') {
87
		$oTpl->set_var(array(
88
		'TEXT_REMEMBER_ME' => $TEXT['REMEMBER_ME'],
89
			)
90
		);
91

    
92
		$oTpl->parse('show_smart_login', 'show_smart_login_block', true);
93
	} else {
94
		$oTpl->set_block('show_smart_login', '');
95
	}
96

    
97
	//$oTpl->parse('message', 'message_block', true);
98
	$oTpl->parse('main', 'main_block', false);
99
	$output = $oTpl->finish($oTpl->parse('output', 'page'));
100
	unset($oTpl);
101
	print $output;
102

    
(13-13/22)