Project

General

Profile

« Previous | Next » 

Revision 1289

Added by kweitzel almost 15 years ago

Branch 2.8.1 merged back into Trunk

View differences:

login_form.php
1
<?php
2

  
3
// $Id$
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>&nbsp;Login</h1>
58
&nbsp;<?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>&nbsp;</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>&nbsp;</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

  
1
<?php
2
/**
3
 *
4
 * @category        frontend
5
 * @package         account
6
 * @author          WebsiteBaker Project
7
 * @copyright       2004-2009, Ryan Djurovich
8
 * @copyright       2009-2010, 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 4.3.4 and higher
13
 * @version         $Id$
14
 * @filesource		$HeadURL$
15
 * @lastmodified    $Date$
16
 *
17
 */
18

  
19
if(!defined('WB_URL')) die(header('Location: ../../index.php'));
20

  
21
$username_fieldname = 'username';
22
$password_fieldname = 'password';
23
	
24
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
25
	// Generate username field name
26
	$username_fieldname = 'username_';
27
	$password_fieldname = 'password_';
28

  
29
	$temp = array_merge(range('a','z'), range(0,9));
30
	shuffle($temp);
31
	for($i=0;$i<=7;$i++) {
32
		$username_fieldname .= $temp[$i];
33
		$password_fieldname .= $temp[$i];
34
	}
35
}
36
?>
37
<h1>&nbsp;Login</h1>
38
&nbsp;<?php echo $thisApp->message; ?>
39
<br />
40
<br />
41

  
42
<form action="<?php echo WB_URL.'/account/login.php'; ?>" method="post">
43
<p style="display:none;"><input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" /></p>
44
<p style="display:none;"><input type="hidden" name="password_fieldname" value="<?php echo $password_fieldname; ?>" /></p>
45
<p style="display:none;"><input type="hidden" name="redirect" value="<?php echo $thisApp->redirect_url;?>" /></p>
46

  
47
<table cellpadding="5" cellspacing="0" border="0" width="90%">
48
<tr>
49
	<td style="width:100px"><?php echo $TEXT['USERNAME']; ?>:</td>
50
	<td class="value_input">
51
		<input type="text" name="<?php echo $username_fieldname; ?>" maxlength="30" style="width:220px;"/>
52
    	<script type="text/javascript">
53
    	// document.login.<?php echo $username_fieldname; ?>.focus();
54
    	var ref= document.getElementById("<?php echo $username_fieldname; ?>");
55
    	if (ref) ref.focus();
56
    	</script>
57
	</td>
58
</tr>
59
<tr>
60
	<td style="width:100px"><?php echo $TEXT['PASSWORD']; ?>:</td>
61
	<td class="value_input">
62
		<input type="password" name="<?php echo $password_fieldname; ?>" maxlength="30" style="width:220px;"/>
63
	</td>
64
</tr>
65
<?php if($username_fieldname != 'username') { ?>
66
<tr>
67
	<td>&nbsp;</td>
68
	<td>
69
		<input type="checkbox" name="remember" id="remember" value="true"/>
70
		<label for="remember"><?php echo $TEXT['REMEMBER_ME']; ?></label>
71
	</td>
72
</tr>
73
<?php } ?>
74
<tr>
75
	<td>&nbsp;</td>
76
	<td>
77
		<input type="submit" name="submit" value="<?php echo $TEXT['LOGIN']; ?>"  />
78
		<input type="reset" name="reset" value="<?php echo $TEXT['RESET']; ?>"  />
79
	</td>
80
</tr>
81
</table>
82

  
83
</form>
84

  
85
<br />
86

  
107 87
<a href="<?php echo WB_URL; ?>/account/forgot.php"><?php echo $TEXT['FORGOTTEN_DETAILS']; ?></a>
108 88

  

Also available in: Unified diff