Project

General

Profile

1
<?php
2

    
3
// $Id: login_form.php 10 2005-09-04 08:59:31Z ryan $
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: ../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
<script language="javascript" type="text/javascript">
57
function toggle_checkbox(checkbox_id) {
58
	if(document.getElementById(checkbox_id).checked == true) {
59
		document.getElementById(checkbox_id).checked = false;
60
	} else {
61
		document.getElementById(checkbox_id).checked = true;
62
	}
63
}
64
</script>
65

    
66
<h1>&nbsp;Login</h1>
67
&nbsp;<?php echo $thisApp->message; ?>
68
<br />
69
<br />
70

    
71
<form name="login" action="<?php echo WB_URL.'/account/login'.PAGE_EXTENSION; ?>" method="post">
72
<input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" />
73
<input type="hidden" name="password_fieldname" value="<?php echo $password_fieldname; ?>" />
74

    
75
<table cellpadding="5" cellspacing="0" border="0" width="90%">
76
<tr>
77
	<td width="100"><?php echo $TEXT['USERNAME']; ?>:</td>
78
	<td class="value_input">
79
		<input type="text" name="<?php echo $username_fieldname; ?>" maxlength="30" />
80
		<script type="text/javascript" language="javascript">
81
		document.login.<?php echo $username_fieldname; ?>.focus();
82
		</script>
83
	</td>
84
</tr>
85
<tr>
86
	<td width="100"><?php echo $TEXT['PASSWORD']; ?>:</td>
87
	<td class="value_input">
88
		<input type="password" name="<?php echo $password_fieldname; ?>" maxlength="30" />
89
	</td>
90
</tr>
91
<?php if($username_fieldname != 'username') { ?>
92
<tr>
93
	<td>&nbsp;</td>
94
	<td>
95
		<input type="checkbox" name="remember" id="remember" value="true" />
96
		<font onclick="javascript: toggle_checkbox('remember');" style="cursor: pointer;">
97
			<?php echo $TEXT['REMEMBER_ME']; ?>
98
		</font>
99
	</td>
100
</tr>
101
<?php } ?>
102
<tr>
103
	<td>&nbsp;</td>
104
	<td>
105
		<input type="submit" name="submit" value="<?php echo $TEXT['LOGIN']; ?>" />
106
		<input type="reset" name="reset" value="<?php echo $TEXT['RESET']; ?>" />
107
	</td>
108
</tr>
109
</table>
110

    
111
</form>
112

    
113
<br />
114

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