1
|
<?php
|
2
|
|
3
|
// $Id: login_form.php 915 2009-01-21 19:27:01Z Ruebenwurzel $
|
4
|
|
5
|
/*
|
6
|
|
7
|
Website Baker Project <http://www.websitebaker.org/>
|
8
|
Copyright (C) 2004-2009, 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
|
exit(0);
|
29
|
}
|
30
|
|
31
|
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
|
32
|
// Generate username field name
|
33
|
$username_fieldname = 'username_';
|
34
|
$password_fieldname = 'password_';
|
35
|
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
|
36
|
srand((double)microtime()*1000000);
|
37
|
$i = 0;
|
38
|
while ($i <= 7) {
|
39
|
$num = rand() % 33;
|
40
|
$tmp = substr($salt, $num, 1);
|
41
|
$username_fieldname = $username_fieldname . $tmp;
|
42
|
$password_fieldname = $password_fieldname . $tmp;
|
43
|
$i++;
|
44
|
}
|
45
|
} else {
|
46
|
$username_fieldname = 'username';
|
47
|
$password_fieldname = 'password';
|
48
|
}
|
49
|
|
50
|
?>
|
51
|
<style>
|
52
|
.value_input input, .value_input text, .value_input select {
|
53
|
width: 220px;
|
54
|
}
|
55
|
</style>
|
56
|
|
57
|
<h1> Login</h1>
|
58
|
<?php echo $thisApp->message; ?>
|
59
|
<br />
|
60
|
<br />
|
61
|
|
62
|
<form name="login" action="<?php echo WB_URL.'/account/login.php'; ?>" method="post">
|
63
|
<input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" />
|
64
|
<input type="hidden" name="password_fieldname" value="<?php echo $password_fieldname; ?>" />
|
65
|
<input type="hidden" name="redirect" value="<?php echo $thisApp->redirect_url;?>" />
|
66
|
|
67
|
<table cellpadding="5" cellspacing="0" border="0" width="90%">
|
68
|
<tr>
|
69
|
<td width="100"><?php echo $TEXT['USERNAME']; ?>:</td>
|
70
|
<td class="value_input">
|
71
|
<input type="text" name="<?php echo $username_fieldname; ?>" maxlength="30" />
|
72
|
<script type="text/javascript" language="javascript">
|
73
|
document.login.<?php echo $username_fieldname; ?>.focus();
|
74
|
</script>
|
75
|
</td>
|
76
|
</tr>
|
77
|
<tr>
|
78
|
<td width="100"><?php echo $TEXT['PASSWORD']; ?>:</td>
|
79
|
<td class="value_input">
|
80
|
<input type="password" name="<?php echo $password_fieldname; ?>" maxlength="30" />
|
81
|
</td>
|
82
|
</tr>
|
83
|
<?php if($username_fieldname != 'username') { ?>
|
84
|
<tr>
|
85
|
<td> </td>
|
86
|
<td>
|
87
|
<input type="checkbox" name="remember" id="remember" value="true" />
|
88
|
<label for="remember">
|
89
|
<?php echo $TEXT['REMEMBER_ME']; ?>
|
90
|
</label>
|
91
|
</td>
|
92
|
</tr>
|
93
|
<?php } ?>
|
94
|
<tr>
|
95
|
<td> </td>
|
96
|
<td>
|
97
|
<input type="submit" name="submit" value="<?php echo $TEXT['LOGIN']; ?>" />
|
98
|
<input type="reset" name="reset" value="<?php echo $TEXT['RESET']; ?>" />
|
99
|
</td>
|
100
|
</tr>
|
101
|
</table>
|
102
|
|
103
|
</form>
|
104
|
|
105
|
<br />
|
106
|
|
107
|
<a href="<?php echo WB_URL; ?>/account/forgot.php"><?php echo $TEXT['FORGOTTEN_DETAILS']; ?></a>
|