Project

General

Profile

1 1420 Luisehahne
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
6
 * @author          WebsiteBaker Project
7 1551 Luisehahne
 * @copyright       2004-2009, Ryan Djurovich
8 1420 Luisehahne
 * @copyright       2009-2011, Website Baker Org. e.V.
9
 * @link			http://www.websitebaker2.org/
10
 * @license         http://www.gnu.org/licenses/gpl.html
11
 * @platform        WebsiteBaker 2.8.x
12
 * @requirements    PHP 5.2.2 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18
19
// Must include code to stop this file being access directly
20
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
21 1551 Luisehahne
22
$username_fieldname = 'username';
23
$password_fieldname = 'password';
24
25
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
26
	// Generate username field name
27
	$username_fieldname = 'username_';
28
	$password_fieldname = 'password_';
29
30
	$temp = array_merge(range('a','z'), range(0,9));
31
	shuffle($temp);
32
	for($i=0;$i<=7;$i++) {
33
		$username_fieldname .= $temp[$i];
34
		$password_fieldname .= $temp[$i];
35 1420 Luisehahne
	}
36
}
37 1508 Luisehahne
38 1551 Luisehahne
$page_id = !empty($_SESSION['PAGE_ID']) ? $_SESSION['PAGE_ID'] : 0;
39
$_SESSION['PAGE_LINK'] = get_page_link( $page_id );
40
if(!file_exists($_SESSION['PAGE_LINK'])) {$_SESSION['PAGE_LINK'] = WB_URL.'/'; }
41
$_SESSION['HTTP_REFERER'] = $_SESSION['PAGE_LINK'];
42
$thisApp->redirect_url = (isset($thisApp->redirect_url) ? $thisApp->redirect_url : $_SESSION['PAGE_LINK'])
43 1420 Luisehahne
?>
44 1508 Luisehahne
<div style="margin: 1em auto;">
45
	<button type="button" value="cancel" onClick="javascript: window.location = '<?php print $_SESSION['HTTP_REFERER'] ?>';"><?php print $TEXT['CANCEL'] ?></button>
46
</div>
47 1551 Luisehahne
<h1>&nbsp;Login</h1>
48
&nbsp;<?php echo $thisApp->message; ?>
49
<br />
50
<br />
51
52
<form class="login-box" action="<?php echo WB_URL.'/account/login.php'; ?>" method="post">
53
<input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" />
54
<input type="hidden" name="password_fieldname" value="<?php echo $password_fieldname; ?>" />
55
<input type="hidden" name="redirect" value="<?php echo $thisApp->redirect_url;?>" />
56
57
<table cellpadding="5" cellspacing="0" border="0" width="90%">
58
<tr>
59
	<td style="width:100px"><?php echo $TEXT['USERNAME']; ?>:</td>
60
	<td class="value_input">
61
		<input type="text" name="<?php echo $username_fieldname; ?>" maxlength="30" style="width:220px;"/>
62
    	<script type="text/javascript">
63
    	// document.login.<?php echo $username_fieldname; ?>.focus();
64
    	var ref= document.getElementById("<?php echo $username_fieldname; ?>");
65
    	if (ref) ref.focus();
66
    	</script>
67
	</td>
68
</tr>
69
<tr>
70
	<td style="width:100px"><?php echo $TEXT['PASSWORD']; ?>:</td>
71
	<td class="value_input">
72
		<input type="password" name="<?php echo $password_fieldname; ?>" maxlength="30" style="width:220px;"/>
73
	</td>
74
</tr>
75
<?php if($username_fieldname != 'username') { ?>
76
<tr>
77
	<td>&nbsp;</td>
78
	<td>
79
		<input type="checkbox" name="remember" id="remember" value="true"/>
80
		<label for="remember"><?php echo $TEXT['REMEMBER_ME']; ?></label>
81
	</td>
82
</tr>
83 1420 Luisehahne
<?php } ?>
84 1551 Luisehahne
<tr>
85
	<td>&nbsp;</td>
86
	<td>
87
		<input type="submit" name="submit" value="<?php echo $TEXT['LOGIN']; ?>"  />
88
		<input type="reset" name="reset" value="<?php echo $TEXT['RESET']; ?>"  />
89
	</td>
90
</tr>
91
</table>
92
93
</form>
94
95
<br />
96
97
<a href="<?php echo WB_URL; ?>/account/forgot.php"><?php echo $TEXT['FORGOTTEN_DETAILS']; ?></a>