Project

General

Profile

1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
6
 * @author          WebsiteBaker Project
7
 * @copyright       WebsiteBaker Org. e.V.
8
 * @link			http://websitebaker.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 2125 2015-06-17 18:42:26Z darkviper $
13
 * @filesource		$HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/account/login_form.php $
14
 * @lastmodified    $Date: 2015-06-17 20:42:26 +0200 (Wed, 17 Jun 2015) $
15
 *
16
 */
17

    
18
/* -------------------------------------------------------- */
19
// Must include code to stop this file being accessed directly
20
if(!defined('SYSTEM_RUN')) {
21
    throw new Exception('illegal file access [account/login_form.php]');
22
}
23
/* -------------------------------------------------------- */
24

    
25
// Generate username field name
26
$username_fieldname = 'username';
27
$password_fieldname = 'password';
28
if(isset($oReg->SmartLogin) && $oReg->SmartLogin == 'true') {
29
    $sTmp = '_'.substr(md5(microtime()), -8);
30
    $username_fieldname .= $sTmp;
31
    $password_fieldname .= $sTmp;
32
}
33
$output = '';
34
msgQueue::clear();
35

    
36
$thisApp->redirect_url = (isset($thisApp->redirect_url) && ($thisApp->redirect_url!='')  ? $thisApp->redirect_url : $_SESSION['HTTP_REFERER'] );
37
//$thisApp->redirect_url = '';
38
$sIncludeHeadLinkCss = '';
39
if( is_readable($oReg->AppPath.'account/frontend.css')) {
40
    $sIncludeHeadLinkCss .= '<link href="'.$oReg->AppUrl.'account/frontend.css"';
41
    $sIncludeHeadLinkCss .= ' rel="stylesheet" type="text/css" media="screen" />'."\n";
42
}
43

    
44
// set template file and assign module and template block
45
    $oTpl = new Template(__DIR__.'/htt');
46
    $oTpl->set_file('page', 'login.htt');
47
    $oTpl->debug = false;
48
    $oTpl->set_block('page', 'main_block', 'main');
49

    
50
    $oTpl->set_block('main_block', 'message_block', 'message');
51
    $oTpl->set_block('message', '');
52
// language vars
53
    $oTpl->set_var($oReg->Trans->getLangArray());
54
// generell vars
55
    $oTpl->set_var(array(
56
        'FTAN'                  => $wb->getFTAN(),
57
        'ACTION_URL'            => $oReg->AppUrl.'account/login.php',
58
        'FORGOT_URL'            => $oReg->AppUrl.'account/forgot.php',
59
        'REDIRECT_URL'          => $thisApp->redirect_url,
60
        'WB_URL'                => $oReg->AppUrl,
61
        'THEME_URL'             => $oReg->ThemeUrl,
62
        'TEMPLATE_URL'          => $oReg->TemplateDir,
63
        'HTTP_REFERER'          => $thisApp->redirect_url,
64
        'CSS_BLOCK'             => $sIncludeHeadLinkCss,
65
        'MESSAGE_VALUE'         => '',
66
        'ERROR_VALUE'           => '',
67
        'THISAPP_MESSAGE_VALUE' => $thisApp->message,
68
        'USER_FIELDNAME'        => $username_fieldname,
69
        'PASSWORD_FIELDNAME'    => $password_fieldname,
70
        )
71
    );
72

    
73
    $oTpl->set_block('main_block', 'show_smart_login_block', 'show_smart_login');
74
// $oTpl->parse('show_smart_login', '');
75
    if($username_fieldname != 'username') {
76
        $oTpl->parse('show_smart_login', 'show_smart_login_block', true);
77
    } else {
78
        $oTpl->set_block('show_smart_login', '');
79
    }
80

    
81
    //$oTpl->parse('message', 'message_block', true);
82
    $oTpl->parse('main', 'main_block', false);
83
    $output = $oTpl->finish($oTpl->parse('output', 'page'));
84
    unset($oTpl);
85
    print $output;
86

    
(13-13/22)