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 1742 2012-09-07 00:50:09Z Luisehahne $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/account/login_form.php $
14
 * @lastmodified    $Date: 2012-09-07 02:50:09 +0200 (Fri, 07 Sep 2012) $
15
 *
16
 */
17

    
18
/* -------------------------------------------------------- */
19
// Must include code to stop this file being accessed directly
20
if(defined('WB_PATH') == false)
21
{
22
	// Stop this file being access directly
23
		die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>');
24
}
25
/* -------------------------------------------------------- */
26

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

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

    
35
	$temp = array_merge(range('a','z'), range(0,9));
36
	shuffle($temp);
37
	for($i=0;$i<=7;$i++) {
38
		$username_fieldname .= $temp[$i];
39
		$password_fieldname .= $temp[$i];
40
	}
41
}
42

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

    
45
//print '<pre style="text-align: left;"><strong>function '.__FUNCTION__.'( '.''.' );</strong>  basename: '.basename(__FILE__).'  line: '.__LINE__.' -> <br />';
46
//print_r( $thisApp->redirect_url ); print '</pre>';
47

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

    
54
	$oTpl->set_block('main_block', 'message_block', 'message');
55
	$oTpl->set_block('message', '');
56

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

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

    
89
		$oTpl->parse('show_smart_login', 'show_smart_login_block', true);
90
	} else {
91
		$oTpl->set_block('show_smart_login', '');
92
	}
93

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

    
(13-13/22)