Project

General

Profile

1
<?php
2

    
3
// $Id: login_form.php 240 2005-11-23 15:17:50Z stefan $
4

    
5
/*
6

    
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2005, Ryan Djurovich
9

    
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

    
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

    
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

    
24
*/
25

    
26
if(!defined('WB_URL')) {
27
	header('Location: ../pages/index.php');
28
}
29

    
30
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
31
	// Generate username field name
32
	$username_fieldname = 'username_';
33
	$password_fieldname = 'password_';
34
	$salt = "abchefghjkmnpqrstuvwxyz0123456789";
35
	srand((double)microtime()*1000000);
36
	$i = 0;
37
	while ($i <= 7) {
38
		$num = rand() % 33;
39
		$tmp = substr($salt, $num, 1);
40
		$username_fieldname = $username_fieldname . $tmp;
41
		$password_fieldname = $password_fieldname . $tmp;
42
		$i++;
43
	}
44
} else {
45
	$username_fieldname = 'username';
46
	$password_fieldname = 'password';
47
}
48

    
49
?>
50
<style>
51
.value_input input, .value_input text, .value_input select {
52
	width: 220px;
53
}
54
</style>
55

    
56
<h1>&nbsp;Login</h1>
57
&nbsp;<?php echo $thisApp->message; ?>
58
<br />
59
<br />
60

    
61
<form name="login" action="<?php echo WB_URL.'/account/login'.PAGE_EXTENSION; ?>" method="post">
62
<input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" />
63
<input type="hidden" name="password_fieldname" value="<?php echo $password_fieldname; ?>" />
64
<input type="hidden" name="redirect" value="<?php echo $thisApp->redirect_url;?>" />
65

    
66
<table cellpadding="5" cellspacing="0" border="0" width="90%">
67
<tr>
68
	<td width="100"><?php echo $TEXT['USERNAME']; ?>:</td>
69
	<td class="value_input">
70
		<input type="text" name="<?php echo $username_fieldname; ?>" maxlength="30" />
71
		<script type="text/javascript" language="javascript">
72
		document.login.<?php echo $username_fieldname; ?>.focus();
73
		</script>
74
	</td>
75
</tr>
76
<tr>
77
	<td width="100"><?php echo $TEXT['PASSWORD']; ?>:</td>
78
	<td class="value_input">
79
		<input type="password" name="<?php echo $password_fieldname; ?>" maxlength="30" />
80
	</td>
81
</tr>
82
<?php if($username_fieldname != 'username') { ?>
83
<tr>
84
	<td>&nbsp;</td>
85
	<td>
86
		<input type="checkbox" name="remember" id="remember" value="true" />
87
		<label for="remember">
88
			<?php echo $TEXT['REMEMBER_ME']; ?>
89
		</label>
90
	</td>
91
</tr>
92
<?php } ?>
93
<tr>
94
	<td>&nbsp;</td>
95
	<td>
96
		<input type="submit" name="submit" value="<?php echo $TEXT['LOGIN']; ?>" />
97
		<input type="reset" name="reset" value="<?php echo $TEXT['RESET']; ?>" />
98
	</td>
99
</tr>
100
</table>
101

    
102
</form>
103

    
104
<br />
105

    
106
<a href="<?php echo WB_URL; ?>/account/forgot.php"><?php echo $TEXT['FORGOTTEN_DETAILS']; ?></a>
(7-7/15)