Project

General

Profile

1 4 ryan
<?php
2
3 17 stefan
// $Id$
4 4 ryan
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 17 stefan
	header('Location: ../pages/index.php');
28 4 ryan
}
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 43 stefan
<input type="hidden" name="redirect" value="<?php echo $thisApp->redirect_url;?>" />
75 4 ryan
76
<table cellpadding="5" cellspacing="0" border="0" width="90%">
77
<tr>
78
	<td width="100"><?php echo $TEXT['USERNAME']; ?>:</td>
79
	<td class="value_input">
80
		<input type="text" name="<?php echo $username_fieldname; ?>" maxlength="30" />
81
		<script type="text/javascript" language="javascript">
82
		document.login.<?php echo $username_fieldname; ?>.focus();
83
		</script>
84
	</td>
85
</tr>
86
<tr>
87
	<td width="100"><?php echo $TEXT['PASSWORD']; ?>:</td>
88
	<td class="value_input">
89
		<input type="password" name="<?php echo $password_fieldname; ?>" maxlength="30" />
90
	</td>
91
</tr>
92
<?php if($username_fieldname != 'username') { ?>
93
<tr>
94
	<td>&nbsp;</td>
95
	<td>
96
		<input type="checkbox" name="remember" id="remember" value="true" />
97
		<font onclick="javascript: toggle_checkbox('remember');" style="cursor: pointer;">
98
			<?php echo $TEXT['REMEMBER_ME']; ?>
99
		</font>
100
	</td>
101
</tr>
102
<?php } ?>
103
<tr>
104
	<td>&nbsp;</td>
105
	<td>
106
		<input type="submit" name="submit" value="<?php echo $TEXT['LOGIN']; ?>" />
107
		<input type="reset" name="reset" value="<?php echo $TEXT['RESET']; ?>" />
108
	</td>
109
</tr>
110
</table>
111
112
</form>
113
114
<br />
115
116 17 stefan
<a href="<?php echo WB_URL; ?>/account/forgot.php"><?php echo $TEXT['FORGOTTEN_DETAILS']; ?></a>