Project

General

Profile

« Previous | Next » 

Revision 1190

Added by Dietmar over 14 years ago

validate some output files

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
// $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')) die(header('Location: ../../index.php'));
27

  
28
$username_fieldname = 'username';
29
$password_fieldname = 'password';
30
	
31
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
32
	// Generate username field name
33
	$username_fieldname = 'username_';
34
	$password_fieldname = 'password_';
35

  
36
	$temp = array_merge(range('a','z'), range(0,9));
37
	shuffle($temp);
38
	for($i=0;$i<=7;$i++) {
39
		$username_fieldname .= $temp[$i];
40
		$password_fieldname .= $temp[$i];
41
	}
42
}
43
?>
44
<h1>&nbsp;Login</h1>
45
&nbsp;<?php echo $thisApp->message; ?>
46
<br />
47
<br />
48

  
49
<form action="<?php echo WB_URL.'/account/login.php'; ?>" method="post">
50
<p style="display:none;"><input type="hidden" name="username_fieldname" value="<?php echo $username_fieldname; ?>" /></p>
51
<p style="display:none;"><input type="hidden" name="password_fieldname" value="<?php echo $password_fieldname; ?>" /></p>
52
<p style="display:none;"><input type="hidden" name="redirect" value="<?php echo $thisApp->redirect_url;?>" /></p>
53

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

  
88
</form>
89

  
90
<br />
91

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

Also available in: Unified diff