Project

General

Profile

« Previous | Next » 

Revision 1709

Added by Dietmar about 12 years ago

! update folder framework class.login, admin/login, admin/skel/htt

View differences:

branches/2.8.x/CHANGELOG
13 13

  
14 14

  
15 15

  
16
29 Aug-2012 Build 1709 Dietmar Woellbrink (Luisehahne)
17
! update folder framework class.login, admin/login, admin/skel/htt
16 18
29 Aug-2012 Build 1708 Dietmar Woellbrink (Luisehahne)
17 19
! update folder templates/wb_theme, templates/argos_theme,admin/skel/htt
18 20
! add new icons, recoded css
branches/2.8.x/wb/admin/skel/themes/htt/login_forgot.htt
1
<!-- BEGIN main_block -->
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
<head>
5
<title>Retrieve Login Details</title>
6
<meta http-equiv="content-type" content="text/html; charset={CHARSET}" />
7
<meta http-equiv="content-language" content="{LANGUAGE}" />
8
<meta name="description" content="Retrieve Login Details" />
9
<meta name="keywords" content="Retrieve Login Details" />
10
<link href="{THEME_URL}/theme.css" rel="stylesheet" type="text/css" />
11
</head>
12
<body onload="document.forgot_pass.email.focus();">
13

  
14
<table summary="" cellpadding="0" cellspacing="0" border="0" width="770" align="center">
15
<tr>
16
	<td width="60" valign="top">
17
		<img src="{THEME_URL}/images/logo.png" alt="Logo" />
18
	</td>
19
	<td width="5">&nbsp;</td>
20
	<td>&nbsp;</td>
21
</tr>
22
<tr>
23
	<td colspan="3">&nbsp;</td>
24
</tr>
25
<tr>
26
	<td colspan="3" style="font-size: 20px; text-align: center;">
27
		<font style="color: #003366;">{SECTION_FORGOT}</font>
28
	</td>
29
</tr>
30
</table>
31

  
32
<table summary="" cellpadding="0" cellspacing="0" border="0" width="770" align="center" style="margin-top: 30px;" class="container">
33
<tr>
34
	<td class="content">
35
	
36
	<form name="forgot_pass" action="{ACTION_URL}" method="post">
37
	<input type="hidden" name="url" value="{URL}" />
38
		<table summary="" cellpadding="5" cellspacing="0" border="0" align="center" width="500">
39
		<tr>
40
			<td height="40" align="center" style="color: #{MESSAGE_COLOR}" colspan="2">{MESSAGE}</td>
41
		</tr>
42
		<tr style="{DISPLAY_FORM}">
43
			<td height="10" colspan="2"></td>
44
		</tr>
45
		<tr style="{DISPLAY_FORM}">
46
			<td width="165" height="30" align="right">{TEXT_EMAIL}:</td>
47
			<td><input type="text" maxlength="255" name="email" value="{EMAIL}" style="width: 180px;" /></td>
48
		</tr>
49
		<tr style="{DISPLAY_FORM}" height="30">
50
			<td>&nbsp;</td>
51
			<td><input type="submit" name="submit" value="{TEXT_SEND_DETAILS}" style="width: 180px; font-size: 10px; text-transform: uppercase; color: #003366; border: 1px solid #336699; background-color: #DDDDDD; padding: 3px;"></td>
52
		</tr>
53
		<tr style="{DISPLAY_FORM}">
54
			<td height="10" colspan="2"></td>
55
		</tr>
56
		</table>
57
	</form>
58
	
59
	<center>
60
		<a href="{LOGIN_URL}">{TEXT_NEED_TO_LOGIN}</a>
61
		<br />
62
		<br />
63
		<a href="{WB_URL}/">{TEXT_HOME}</a>
64
	</center>
65

  
66
	</td>
67
</tr>
68
</table>
69

  
70
<table summary="" cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 10px 0px 10px 0px;">
71
<tr>
72
	<td style="font-size:12px;text-align:center;">
73
      <!-- Please note: the below reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
74
      <a href="http://www.websitebaker2.org/" title="external">WebsiteBaker</a> is released under the
75
      <a href="http://www.gnu.org/licenses/gpl.html" title="WebsiteBaker is released under the GNU General Public License">GNU General Public License</a>
76
      <!-- Please note: the above reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
77
	</td>
78
</tr>
79
</table>
80

  
81
</body>
82
</html>
83
<!-- END main_block -->
84 0

  
branches/2.8.x/wb/admin/skel/themes/htt/login.htt
1
<!-- BEGIN mainBlock -->
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
<head>
5
<title>{TEXT_LOGIN}</title>
6
<meta http-equiv="content-type" content="text/html; charset={CHARSET}" />
7
<meta http-equiv="content-language" content="{LANGUAGE}" />
8
<meta name="description" content="{TEXT_LOGIN}" />
9
<meta name="keywords" content="{TEXT_LOGIN}" />
10
<link href="{THEME_URL}/theme.css" rel="stylesheet" type="text/css" />
11
</head>
12
<body onload="document.login.{USERNAME_FIELDNAME}.focus();">
13

  
14
<table summary="" cellpadding="0" cellspacing="0" border="0" width="770" align="center">
15
<tr>
16
	<td width="60" valign="top">
17
		<img src="{THEME_URL}/images/logo.png" alt="Logo" />
18
	</td>
19
	<td width="5">&nbsp;</td>
20
	<td>&nbsp;</td>
21
</tr>
22
<tr>
23
	<td colspan="3">&nbsp;</td>
24
</tr>
25
<tr>
26
	<td colspan="3" style="font-size: 20px; text-align: center; ">
27
		<span style="color: #003366;">{SECTION_LOGIN}</span>
28
	</td>
29
</tr>
30
</table>
31

  
32
<table summary="" cellpadding="0" cellspacing="0" border="0" width="770" align="center" style="margin-top: 30px;" class="container">
33
<tr>
34
	<td class="content">
35
	<form name="login" action="{ACTION_URL}" method="post">
36
	<input type="hidden" name="url" value="{URL}" />
37
	<input type="hidden" name="username_fieldname" value="{USERNAME_FIELDNAME}" />
38
	<input type="hidden" name="password_fieldname" value="{PASSWORD_FIELDNAME}" />
39
		<table summary="" cellpadding="5" cellspacing="0" border="0" align="center" width="500">
40
		<tr>
41
			<td height="40" align="center" colspan="2">{MESSAGE}</td>
42
		</tr>
43
		<tr>
44
			<td height="10" colspan="2"></td>
45
		</tr>
46
		<tr>
47
			<td width="170" height="30" align="right">{TEXT_USERNAME}:</td>
48
			<td><input type="text" maxlength="{MAX_USERNAME_LEN}" name="{USERNAME_FIELDNAME}" value="{USERNAME}" style="width: 180px;" /></td>
49
		</tr>
50
		<tr>
51
			<td width="170" height="30" align="right">{TEXT_PASSWORD}:</td>
52
			<td><input type="password" maxlength="{MAX_PASSWORD_LEN}" name="{PASSWORD_FIELDNAME}" style="width: 180px;" /></td>
53
		</tr>
54
		<tr style="{DISPLAY_REMEMBER_ME}">
55
			<td>&nbsp;</td>
56
			<td>
57
				<input type="checkbox" name="remember" id="remember" value="true" />
58
				<label for="remember">
59
					{TEXT_REMEMBER_ME}
60
				</label>
61
			</td>
62
		</tr>
63
		<tr>
64
			<td>&nbsp;</td>
65
			<td><input type="submit" name="submit" value="{TEXT_LOGIN}" style="width: 180px; font-size: 10px; text-transform: uppercase; color: #003366; border: 1px solid #336699; background-color: #DDDDDD; padding: 3px;" /></td>
66
		</tr>
67
		<tr>
68
			<td height="10" colspan="2"></td>
69
		</tr>
70
		</table>
71
	</form>
72
	
73
	<center>
74
		<a href="{FORGOTTEN_DETAILS_APP}">{TEXT_FORGOTTEN_DETAILS}</a>
75
		<br />
76
		<br />
77
		<br />
78
		<a href="{WB_URL}/">{TEXT_HOME}</a>
79
	</center>
80

  
81
	</td>
82
</tr>
83
</table>
84

  
85
<table summary="" cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 10px 0px 10px 0px;">
86
<tr>
87
	<td style="font-size:12px;text-align:center;">
88
      <!-- Please note: the below reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
89
      <a href="http://www.websitebaker2.org/" title="external">WebsiteBaker</a> is released under the
90
      <a href="http://www.gnu.org/licenses/gpl.html" title="WebsiteBaker is released under the GNU General Public License">GNU General Public License</a>
91
      <!-- Please note: the above reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
92
	</td>
93
</tr>
94
</table>
95

  
96
</body>
97
</html>
98
<!-- END mainBlock -->
99 0

  
branches/2.8.x/wb/admin/skel/themes/htt/loginBox.htt
1
<!-- BEGIN mainBlock -->
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
<head>
5
<title>{TEXT_LOGIN} - {WB_URL}</title>
6
<meta http-equiv="content-type" content="text/html; charset={CHARSET}" />
7
<meta http-equiv="content-language" content="{LANGUAGE}" />
8
<meta name="description" content="{TEXT_LOGIN}" />
9
<meta name="keywords" content="{TEXT_LOGIN}" />
10
<link href="{THEME_URL}/css/screen.css" rel="stylesheet" type="text/css" />
11
<link href="{THEME_URL}/css/login.css" rel="stylesheet" type="text/css" />
12
</head>
13
<body onload="document.login.{USERNAME_FIELDNAME}.focus();">
14
<div class="main">
15

  
16
	<table class="header layout">
17
	<tr>
18
		<td class="logo">
19
			<a href="{ADMIN_URL}" title="{TITLE_START}"><img src="{THEME_URL}/images/logo.png" alt="Logo" /></a>
20
		</td>
21
		<td></td>
22
		<td class="topnav {LOGIN_DISPLAY_NONE}">
23
			<span><a href="{ADMIN_URL}" title="{TITLE_START}"><img src="{THEME_URL}/images/{START_ICON}.png" alt="{TITLE_START}" /></a></span>
24
			&nbsp;&nbsp;<a href="{URL_VIEW}" target="_blank" title="{TITLE_VIEW}"><img src="{THEME_URL}/images/view.png" alt="{WB_URL}" /></a>
25
			&nbsp; <a href="{URL_HELP}" target="_blank" title="{TITLE_HELP}"><img src="{THEME_URL}/images/help.png" alt="{TITLE_HELP}" /></a>
26
			&nbsp; <a href="{LOGIN_LINK}" title="{TITLE_LOGOUT}"><img src="{THEME_URL}/images/{LOGIN_ICON}.png" alt="{TITLE_LOGOUT}" /></a>
27
		</td>
28
		<td></td>
29
		<td class="version {LOGIN_DISPLAY_NONE}">
30
			Version {VERSION} {SP}<br />
31
			Revision {REVISION}
32
		</td>
33
	</tr>
34
	</table>
35

  
36
	<div class="table">
37
		<div class="td">
38
		<div class="content">
39
			<div class="login_box">
40
				<form class="settings_table" name="login" action="{ACTION_URL}" method="post">
41
					<input class="none" type="hidden" name="url" value="{URL}" />
42
					<input class="none" type="hidden" name="username_fieldname" value="{USERNAME_FIELDNAME}" />
43
					<input class="none" type="hidden" name="password_fieldname" value="{PASSWORD_FIELDNAME}" />
44
					<input class="none" type="hidden" name="type" value="login" />
45
					<input class="none" type="hidden" name="remember" id="remember" value="true" />
46

  
47
				<fieldset class="center">
48
					<legend>{SECTION_LOGIN} - {WB_URL}</legend>
49
					<div class="sub-row">
50
						<div class="input cleft" >
51
						</div>
52
					</div>
53
					<div class="sub-row">
54
						<h4 class="center">{MESSAGE}</h4>
55
					</div>
56
					<div class="sub-row">
57
						<div class="input cleft" >
58
						</div>
59
					</div>
60
					<div class="sub-row">
61
						<label class="setting_name rBold">{TEXT_USERNAME}:</label>
62
						<div class="input cleft" >
63
						<input type="text" maxlength="{MAX_USERNAME_LEN}" name="{USERNAME_FIELDNAME}" value="{USERNAME}" />
64
						</div>
65
					</div>
66
					<div class="sub-row">
67
						<label class="setting_name rBold">{TEXT_PASSWORD}:</label>
68
						<div class="input cleft" >
69
						<input type="password" maxlength="{MAX_PASSWORD_LEN}" name="{PASSWORD_FIELDNAME}" />
70
						</div>
71
					</div>
72
					<div class="sub-row">
73
						<div class="input" >
74
						<input type="submit" name="submit" value="{TEXT_LOGIN}" />
75
						<input type="reset"  name="submit" value="{TEXT_RESET}" />
76
						</div>
77
					</div>
78
					<br />
79
					<div class="sub-row">
80
						<div class="input" >
81
							<p class="link"><a href="{FORGOTTEN_DETAILS_APP}">{TEXT_FORGOTTEN_DETAILS}</a></p>
82
							<p class="link"><a href="{WB_URL}/" target="_blank">{TEXT_HOME}</a></p>
83
						</div>
84
					</div>
85

  
86
				</fieldset>
87

  
88
				</form>
89
			</div>
90
		</div>
91
		</div>
92
	</div>
93

  
94
	<table class="footer">
95
	<tbody>
96
	<tr>
97
		<td>
98
	      <!-- Please note: the below reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
99
	      <a href="http://www.websitebaker2.org/" title="external">WebsiteBaker</a> is released under the
100
	      <a href="http://www.gnu.org/licenses/gpl.html" title="WebsiteBaker is released under the GNU General Public License">GNU General Public License</a>
101
	      <!-- Please note: the above reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
102
		</td>
103
	</tr>
104
	</tbody>
105
	</table>
106
</div>
107

  
108
</body>
109
</html>
110
<!-- END mainBlock -->
0 111

  
branches/2.8.x/wb/admin/skel/themes/htt/loginForgot.htt
1
<!-- BEGIN main_block -->
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
<head>
5
<title>Retrieve Login Details</title>
6
<meta http-equiv="content-type" content="text/html; charset={CHARSET}" />
7
<meta http-equiv="content-language" content="{LANGUAGE}" />
8
<meta name="description" content="Retrieve Login Details" />
9
<meta name="keywords" content="Retrieve Login Details" />
10
<link href="{THEME_URL}/css/screen.css" rel="stylesheet" type="text/css" />
11
<link href="{THEME_URL}/css/login.css" rel="stylesheet" type="text/css" />
12
</head>
13
<body onload="document.forgot_pass.email.focus();">
14
<div class="main">
15

  
16
	<table class="header layout">
17
	<tr>
18
		<td class="logo">
19
			<a href="{ADMIN_URL}" title="{TITLE_START}"><img src="{THEME_URL}/images/logo.png" alt="Logo" /></a>
20
		</td>
21
		<td></td>
22
		<td class="topnav {LOGIN_DISPLAY_NONE}">
23
			<span><a href="{ADMIN_URL}" title="{TITLE_START}"><img src="{THEME_URL}/images/{START_ICON}.png" alt="{TITLE_START}" /></a></span>
24
			&nbsp;&nbsp;<a href="{URL_VIEW}" target="_blank" title="{TITLE_VIEW}"><img src="{THEME_URL}/images/view.png" alt="{WB_URL}" /></a>
25
			&nbsp; <a href="{URL_HELP}" target="_blank" title="{TITLE_HELP}"><img src="{THEME_URL}/images/help.png" alt="{TITLE_HELP}" /></a>
26
			&nbsp; <a href="{LOGIN_LINK}" title="{TITLE_LOGOUT}"><img src="{THEME_URL}/images/{LOGIN_ICON}.png" alt="{TITLE_LOGOUT}" /></a>
27
		</td>
28
		<td></td>
29
		<td class="version {LOGIN_DISPLAY_NONE}">
30
			Version {VERSION} {SP}<br />
31
			Revision {REVISION}
32
		</td>
33
	</tr>
34
	</table>
35

  
36
	<div class="table">
37
		<div class="td">
38
		<div class="content">
39
			<div class="login_box">
40
				<form class="settings_table" name="forgot_pass" action="{ACTION_URL}" method="post">
41
				<fieldset class="center">
42
					<legend>{SECTION_FORGOT}</legend>
43
					<div class="sub-row">
44
						<div class="input cleft" >
45
						</div>
46
					</div>
47
					<div class="sub-row">
48
						<h4 class="center">{MESSAGE}</h4>
49
					</div>
50
					<div class="sub-row">
51
						<div class="input cleft" >
52
						</div>
53
					</div>
54
					<div class="sub-row">
55
						<label class="setting_name rBold">{TEXT_EMAIL}:</label>
56
						<div class="input cleft" >
57
						<input type="text" maxlength="255" name="email" value="{EMAIL}" />
58
						</div>
59
					</div>
60
					<br class="clear" />
61
					<br />
62
					<br />
63
					<div class="sub-row center">
64
						<div class="input" >
65
						<input type="submit" name="submit" value="{TEXT_SEND_DETAILS}" />
66
						<input type="reset"  name="submit" value="{TEXT_RESET}" />
67
						</div>
68
					</div>
69
					<br />
70
					<div class="sub-row">
71
						<div class="input center" >
72
							<p class="link"><a href="{LOGIN_URL}">{TEXT_NEED_TO_LOGIN}</a></p>
73
							<p class="link"><a href="{WB_URL}/" target="_blank">{TEXT_HOME}</a></p>
74
						</div>
75
					</div>
76
				</fieldset>
77
				</form>
78
			</div>
79
		</div>
80
		</div>
81
	</div>
82

  
83
	<table class="footer">
84
	<tbody>
85
	<tr>
86
		<td>
87
	      <!-- Please note: the below reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
88
	      <a href="http://www.websitebaker2.org/" title="external">WebsiteBaker</a> is released under the
89
	      <a href="http://www.gnu.org/licenses/gpl.html" title="WebsiteBaker is released under the GNU General Public License">GNU General Public License</a>
90
	      <!-- Please note: the above reference to the GNU GPL should not be removed, as it provides a link for users to read about warranty, etc. -->
91
		</td>
92
	</tr>
93
	</tbody>
94
	</table>
95
</div>
96

  
97
</body>
98
</html>
99
<!-- END main_block -->
0 100

  
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '1708');
54
if(!defined('REVISION')) define('REVISION', '1709');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/admin/login/forgot/index.php
4 4
 * @category        admin
5 5
 * @package         login
6 6
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2011, Website Baker Org. e.V.
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8 8
 * @link			http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.x
......
16 16
*/
17 17

  
18 18
// Include the configuration file
19
require('../../../config.php');
19
if(!defined('WB_URL') && file_exists(realpath('../../../config.php'))) {
20
	require('../../../config.php');
21
}
20 22
// Include the language file
21 23
require(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php');
22 24
// Include the database class file and initiate an object
......
25 27

  
26 28
// Get the website title
27 29
$results = $database->query("SELECT value FROM ".TABLE_PREFIX."settings WHERE name = 'title'");
28
$results = $results->fetchRow();
30
$results = $results->fetchRow(MYSQL_ASSOC);
29 31
$website_title = $results['value'];
30 32

  
31 33
// Check if the user has already submitted the form, otherwise show it
32 34
if(isset($_POST['email']) AND $_POST['email'] != "") {
33
	
35

  
34 36
	$email = htmlspecialchars($_POST['email'],ENT_QUOTES);
35
	
37

  
36 38
	// Check if the email exists in the database
37 39
	$query = "SELECT user_id,username,display_name,email,last_reset,password FROM ".TABLE_PREFIX."users WHERE email = '".$admin->add_slashes($_POST['email'])."'";
38 40
	$results = $database->query($query);
39 41
	if($results->numRows() > 0) {
40 42

  
41 43
		// Get the id, username, email, and last_reset from the above db query
42
		$results_array = $results->fetchRow();
43
		
44
		$results_array = $results->fetchRow(MYSQL_ASSOC);
45

  
44 46
		// Check if the password has been reset in the last 2 hours
45 47
		$last_reset = $results_array['last_reset'];
46 48
		$time_diff = time()-$last_reset; // Time since last reset in seconds
47 49
		$time_diff = $time_diff/60/60; // Time since last reset in hours
48 50
		if($time_diff < 2) {
49
			
51

  
50 52
			// Tell the user that their password cannot be reset more than once per hour
51 53
			$message = $MESSAGE['FORGOT_PASS']['ALREADY_RESET'];
52
			
54

  
53 55
		} else {
54
			
56

  
55 57
			$old_pass = $results_array['password'];
56
			
58

  
57 59
			// Generate a random password then update the database with it
58 60
			$new_pass = '';
59 61
			$salt = "abchefghjkmnpqrstuvwxyz0123456789";
......
65 67
				$new_pass = $new_pass . $tmp;
66 68
				$i++;
67 69
			}
68
			
70

  
69 71
			$database->query("UPDATE ".TABLE_PREFIX."users SET password = '".md5($new_pass)."', last_reset = '".time()."' WHERE user_id = '".$results_array['user_id']."'");
70
			
72

  
71 73
			if($database->is_error()) {
72 74
				// Error updating database
73 75
				$message = $database->get_error();
......
78 80

  
79 81
				// Replace placeholders from language variable with values
80 82
				$search = array('{LOGIN_DISPLAY_NAME}', '{LOGIN_WEBSITE_TITLE}', '{LOGIN_NAME}', '{LOGIN_PASSWORD}');
81
				$replace = array($results_array['display_name'], WEBSITE_TITLE, $results_array['username'], $new_pass); 
83
				$replace = array($results_array['display_name'], WEBSITE_TITLE, $results_array['username'], $new_pass);
82 84
				$mail_message = str_replace($search, $replace, $MESSAGE['SIGNUP2']['BODY_LOGIN_FORGOT']);
83 85

  
84 86
				// Try sending the email
85
				if($admin->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) { 
87
				if($admin->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) {
86 88
					$message = $MESSAGE['FORGOT_PASS']['PASSWORD_RESET'];
87 89
					$display_form = false;
88 90
				} else {
......
90 92
					$message = $MESSAGE['FORGOT_PASS']['CANNOT_EMAIL'];
91 93
				}
92 94
			}
93
		
95

  
94 96
		}
95
		
97

  
96 98
	} else {
97 99
		// Email doesn't exist, so tell the user
98 100
		$message = $MESSAGE['FORGOT_PASS']['EMAIL_NOT_FOUND'];
99 101
		// and delete the wrong Email
100 102
		$email = '';
101 103
	}
102
	
104

  
103 105
} else {
104 106
	$email = '';
105 107
}
......
110 112
} else {
111 113
	$message_color = 'FF0000';
112 114
}
113
	
115

  
114 116
// Setup template object, parse vars to it, then parse it
115 117
// Create new template object
116
$template = new Template(dirname($admin->correct_theme_source('login_forgot.htt')));
117
$template->set_file('page', 'login_forgot.htt');
118
$template = new Template(dirname($admin->correct_theme_source('loginForgot.htt')));
119
$template->set_file('page', 'loginForgot.htt');
118 120
$template->set_block('page', 'main_block', 'main');
119 121
if(defined('FRONTEND')) {
120 122
	$template->set_var('ACTION_URL', 'forgot.php');
......
128 130
}
129 131

  
130 132
$template->set_var(array(
131
								'SECTION_FORGOT' => $MENU['FORGOT'],
132
								'MESSAGE_COLOR' => $message_color,
133
								'MESSAGE' => $message,
134
								'WB_URL' => WB_URL,
135
								'ADMIN_URL' => ADMIN_URL,
136
								'THEME_URL' => THEME_URL,
137
								'LANGUAGE' => strtolower(LANGUAGE),
138
								'TEXT_EMAIL' => $TEXT['EMAIL'],
139
								'TEXT_SEND_DETAILS' => $TEXT['SEND_DETAILS'],
140
								'TEXT_HOME' => $TEXT['HOME'],
141
								'TEXT_NEED_TO_LOGIN' => $TEXT['NEED_TO_LOGIN']
142
								)
143
						);
133
				'SECTION_FORGOT' => $MENU['FORGOT'],
134
				'MESSAGE_COLOR' => $message_color,
135
				'MESSAGE' => $message,
136
				'WEBSITE_TITLE' => WEBSITE_TITLE,
137
				'TEXT_ADMINISTRATION' => $TEXT['ADMINISTRATION'],
138
				'ADMIN_URL' => ADMIN_URL,
139
				'WB_URL' => WB_URL,
140
				'URL_VIEW' => WB_URL,
141
				'THEME_URL' => THEME_URL,
142
				'VERSION' => VERSION,
143
				'SP' => (defined('SP') ? SP : ''),
144
				'REVISION' => REVISION,
145
				'LANGUAGE' => strtolower(LANGUAGE),
146
				'TEXT_EMAIL' => $TEXT['EMAIL'],
147
				'TEXT_SEND_DETAILS' => $TEXT['SEND_DETAILS'],
148
				'TEXT_LOGIN' => $TEXT['LOGIN'],
149
				'TITLE_LOGOUT' => $MENU['LOGIN'],
150
				'TEXT_RESET' => $TEXT['RESET'],
151
				'TEXT_HOME' => $TEXT['HOME'],
152
				'TITLE_VIEW' => $TEXT['WEBSITE'],
153
				'LOGIN_ICON' => 'login',
154
				'LOGIN_LINK' => $_SERVER['SCRIPT_NAME'],
155
				'START_ICON' => 'blank',
156
				'LOGIN_DISPLAY_HIDDEN' => !$admin->is_authenticated() ? 'hidden' : '',
157
				'LOGIN_DISPLAY_NONE' => !$admin->is_authenticated() ? 'none' : '',
158
				'URL_HELP' => 'http://www.websitebaker.org/',
159
				'TEXT_NEED_TO_LOGIN' => $TEXT['NEED_TO_LOGIN']
160
				)
161
		);
144 162

  
145 163
if(defined('FRONTEND')) {
146 164
	$template->set_var('LOGIN_URL', WB_URL.'/account/login.php');
147 165
} else {
148 166
	$template->set_var('LOGIN_URL', ADMIN_URL);
149 167
}
150
$template->set_var('INTERFACE_URL', ADMIN_URL.'/interface');	
168
$template->set_var('INTERFACE_URL', ADMIN_URL.'/interface');
151 169

  
152 170
if(defined('DEFAULT_CHARSET')) {
153 171
	$charset=DEFAULT_CHARSET;
......
155 173
	$charset='utf-8';
156 174
}
157 175

  
158
$template->set_var('CHARSET', $charset);	
176
$template->set_var('CHARSET', $charset);
159 177

  
160 178
$template->parse('main', 'main_block', false);
161 179
$template->pparse('output', 'page');
180

  
181
//$admin->print_footer();
branches/2.8.x/wb/admin/login/index.php
4 4
 * @category        admin
5 5
 * @package         login
6 6
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2011, Website Baker Org. e.V.
7
 * @copyright       2009-2012, Website Baker Org. e.V.
8 8
 * @link			http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.x
......
13 13
 * @filesource		$HeadURL$
14 14
 * @lastmodified    $Date$
15 15
 *
16
*/
16
 */
17 17

  
18
require_once("../../config.php");
18
	require('../../config.php');
19
// Include the configuration file
20
if(!defined('WB_URL') && file_exists(realpath('../../config.php'))) {
21
}
19 22
require_once(WB_PATH."/framework/class.login.php");
20 23

  
21 24
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
......
40 43
$admin = new admin('Start', '', false, false);
41 44

  
42 45
$WarnUrl = str_replace(WB_PATH,WB_URL,$admin->correct_theme_source('warning.html'));
43
// Setup template object, parse vars to it, then parse it
44
$ThemePath = dirname($admin->correct_theme_source('login.htt'));
45 46

  
47
$LoginTpl = 'loginBox.htt';
48
$ThemePath = dirname($admin->correct_theme_source('loginBox.htt'));
49

  
46 50
$thisApp = new Login( array(
47
						'MAX_ATTEMPS' => "3",
48
						'WARNING_URL' => $WarnUrl,
49
						'USERNAME_FIELDNAME' => $username_fieldname,
50
						'PASSWORD_FIELDNAME' => $password_fieldname,
51
						'REMEMBER_ME_OPTION' => SMART_LOGIN,
52
						'MIN_USERNAME_LEN' => "2",
53
						'MIN_PASSWORD_LEN' => "2",
54
						'MAX_USERNAME_LEN' => "30",
55
						'MAX_PASSWORD_LEN' => "30",
56
						'LOGIN_URL' => ADMIN_URL."/login/index.php",
57
						'DEFAULT_URL' => ADMIN_URL."/start/index.php",
58
						'TEMPLATE_DIR' => $ThemePath,
59
						'TEMPLATE_FILE' => "login.htt",
60
						'FRONTEND' => false,
61
						'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
62
						'USERS_TABLE' => TABLE_PREFIX."users",
63
						'GROUPS_TABLE' => TABLE_PREFIX."groups",
64
				)
51
					'MAX_ATTEMPS' => "3",
52
					'WARNING_URL' => $WarnUrl,
53
					'INFO_URL' => '##',
54
					'INFO_TEXT' => 'News',
55
					'USERNAME_FIELDNAME' => $username_fieldname,
56
					'PASSWORD_FIELDNAME' => $password_fieldname,
57
					'REMEMBER_ME_OPTION' => SMART_LOGIN,
58
					'MIN_USERNAME_LEN' => "2",
59
					'MIN_PASSWORD_LEN' => "2",
60
					'MAX_USERNAME_LEN' => "30",
61
					'MAX_PASSWORD_LEN' => "30",
62
					'LOGIN_URL' => ADMIN_URL."/login/index.php",
63
					'DEFAULT_URL' => ADMIN_URL."/start/index.php",
64
					'TEMPLATE_DIR' => $ThemePath,
65
					'TEMPLATE_FILE' => $LoginTpl,
66
					'FRONTEND' => false,
67
					'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
68
					'USERS_TABLE' => TABLE_PREFIX."users",
69
					'GROUPS_TABLE' => TABLE_PREFIX."groups",
70
			)
65 71
		);
72
//$admin->print_footer();
branches/2.8.x/wb/framework/msgQueue.php
50 50
	{
51 51
		return (sizeof(self::handle()->_success) == 0 && sizeof(self::handle()->_error) == 0 );
52 52
	}
53
	
53

  
54 54
	public static function getError($retval_type = self::RETVAL_STRING)
55 55
	{
56 56
		if(sizeof(self::handle()->_error))
......
81 81

  
82 82

  
83 83
}
84
?>
branches/2.8.x/wb/framework/class.login.php
4 4
 * @category        framework
5 5
 * @package         backend login
6 6
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2011, Website Baker Org. e.V.
7
 * @copyright       2009-2012, Website Baker Org. e.V.
8 8
 * @link			http://www.websitebaker2.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.x
......
70 70
		}
71 71
		if($this->is_authenticated() == true) {
72 72
			// User already logged-in, so redirect to default url
73
			header('Location: '.$this->url);
74
			exit();
73
//				header("Location: ".$this->url);
74
//				exit(0);
75
				$this->send_header($this->url);
75 76
		} elseif($this->is_remembered() == true) {
76 77
			// User has been "remembered"
77 78
			// Get the users password
......
85 86
			// Check if the user exists (authenticate them)
86 87
			if($this->authenticate()) {
87 88
				// Authentication successful
88
				header("Location: ".$this->url);
89
				exit(0);
89
//				header("Location: ".$this->url);
90
//				exit(0);
91
				$this->send_header($this->url);
90 92
			} else {
91
				$this->message = $MESSAGE['LOGIN']['AUTHENTICATION_FAILED'];
93
				$this->message = $MESSAGE['LOGIN_AUTHENTICATION_FAILED'];
92 94
				$this->increase_attemps();
93 95
			}
94 96
		} elseif($this->username == '' AND $this->password == '') {
95
			$this->message = $MESSAGE['LOGIN']['BOTH_BLANK'];
97
			$this->message = $MESSAGE['LOGIN_BOTH_BLANK'];
96 98
			$this->display_login();
97 99
		} elseif($this->username == '') {
98
			$this->message = $MESSAGE['LOGIN']['USERNAME_BLANK'];
100
			$this->message = $MESSAGE['LOGIN_USERNAME_BLANK'];
99 101
			$this->increase_attemps();
100 102
		} elseif($this->password == '') {
101
			$this->message = $MESSAGE['LOGIN']['PASSWORD_BLANK'];
103
			$this->message = $MESSAGE['LOGIN_PASSWORD_BLANK'];
102 104
			$this->increase_attemps();
103 105
		} elseif($this->username_len < $config_array['MIN_USERNAME_LEN']) {
104
			$this->message = $MESSAGE['LOGIN']['USERNAME_TOO_SHORT'];
106
			$this->message = $MESSAGE['LOGIN_USERNAME_TOO_SHORT'];
105 107
			$this->increase_attemps();
106 108
		} elseif($this->password_len < $config_array['MIN_PASSWORD_LEN']) {
107
			$this->message = $MESSAGE['LOGIN']['PASSWORD_TOO_SHORT'];
109
			$this->message = $MESSAGE['LOGIN_PASSWORD_TOO_SHORT'];
108 110
			$this->increase_attemps();
109 111
		} elseif($this->username_len > $config_array['MAX_USERNAME_LEN']) {
110
			$this->message = $MESSAGE['LOGIN']['USERNAME_TOO_LONG'];
112
			$this->message = $MESSAGE['LOGIN_USERNAME_TOO_LONG'];
111 113
			$this->increase_attemps();
112 114
		} elseif($this->password_len > $config_array['MAX_PASSWORD_LEN']) {
113
			$this->message = $MESSAGE['LOGIN']['PASSWORD_TOO_LONG'];
115
			$this->message = $MESSAGE['LOGIN_PASSWORD_TOO_LONG'];
114 116
			$this->increase_attemps();
115 117
		} else {
116 118
			// Check if the user exists (authenticate them)
117 119
			$this->password = md5($this->password);
118 120
			if($this->authenticate()) {
119 121
				// Authentication successful
120
				//echo $this->url;exit();
121
				header("Location: ".$this->url);
122
				exit(0);
122
// 				echo $this->url;exit();
123
// 				header("Location: ".$this->url);
124
// 				exit(0);
125
				$this->send_header($this->url);
123 126
			} else {
124
				$this->message = $MESSAGE['LOGIN']['AUTHENTICATION_FAILED'];
127
				$this->message = $MESSAGE['LOGIN_AUTHENTICATION_FAILED'];
125 128
				$this->increase_attemps();
126 129
			}
127 130
		}
......
213 216
					}
214 217
				}
215 218
				$first_group = false;
216
			}	
219
			}
217 220

  
218 221
			// Update the users table with current ip and timestamp
219 222
			$get_ts = time();
......
238 241
		}
239 242
		$this->display_login();
240 243
	}
241
	
242
	// Function to set a "remembering" cookie for the user
244

  
245
	// Function to set a "remembering" cookie for the user - removed
243 246
	function remember($user_id) {
244 247
		return true;
245
//		global $database;
246
//		$remember_key = '';
247
//		// Generate user id to append to the remember key
248
//		$length = 11-strlen($user_id);
249
//		if($length > 0) {
250
//			for($i = 1; $i <= $length; $i++) {
251
//				$remember_key .= '0';
252
//			}
253
//		}
254
//		// Generate remember key
255
//		$remember_key .= $user_id.'_';
256
//		$salt = "abchefghjkmnpqrstuvwxyz0123456789";
257
//		srand((double)microtime()*1000000);
258
//		$i = 0;
259
//		while ($i <= 10) {
260
//			$num = rand() % 33;
261
//			$tmp = substr($salt, $num, 1);
262
//			$remember_key = $remember_key . $tmp;
263
//			$i++;
264
//		}
265
//		$remember_key = $remember_key;
266
//		// Update the remember key in the db
267
//		// $database = new database();
268
//		$database->query("UPDATE ".$this->users_table." SET remember_key = '$remember_key' WHERE user_id = '$user_id' LIMIT 1");
269
//		if($database->is_error()) {
270
//			return false;
271
//		} else {
272
//			// Workout options for the cookie
273
//			$cookie_name = 'REMEMBER_KEY';
274
//			$cookie_value = $remember_key;
275
//			$cookie_expire = time()+60*60*24*30;
276
//			// Set the cookie
277
//			if(setcookie($cookie_name, $cookie_value, $cookie_expire, '/')) {
278
//				return true;
279
//			} else {
280
//				return false;
281
//			}
282
//		}
283 248
	}
284
	
285
	// Function to check if a user has been remembered
249

  
250
	// Function to check if a user has been remembered - removed
286 251
	function is_remembered()
287 252
	{
288 253
		return false;
289
//		global $database;
290
//		// add if get_safe_remember_key not empty
291
//		if(isset($_COOKIE['REMEMBER_KEY']) && ($_COOKIE['REMEMBER_KEY'] != '') && ($this->get_safe_remember_key() <> '' ) )
292
//		{
293
//			// Check if the remember key is correct
294
//			// $database = new database();
295
//			$sql = "SELECT `user_id` FROM `" . $this->users_table . "` WHERE `remember_key` = '";
296
//			$sql .= $this->get_safe_remember_key() . "' LIMIT 1";
297
//			$check_query = $database->query($sql);
298
//
299
//			if($check_query->numRows() > 0)
300
//			{
301
//				$check_fetch = $check_query->fetchRow();
302
//				$user_id = $check_fetch['user_id'];
303
//				// Check the remember key prefix
304
//				$remember_key_prefix = '';
305
//				$length = 11-strlen($user_id);
306
//				if($length > 0)
307
//				{
308
//					for($i = 1; $i <= $length; $i++)
309
//					{
310
//						$remember_key_prefix .= '0';
311
//					}
312
//				}
313
//				$remember_key_prefix .= $user_id.'_';
314
//				$length = strlen($remember_key_prefix);
315
//				if(substr($_COOKIE['REMEMBER_KEY'], 0, $length) == $remember_key_prefix)
316
//				{
317
//					return true;
318
//				} else {
319
//					return false;
320
//				}
321
//			} else {
322
//				return false;
323
//			}
324
//		} else {
325
//			return false;
326
//		}
327 254
	}
328 255

  
329 256
	// Display the login screen
330 257
	function display_login() {
331 258
		// Get language vars
332
		global $MESSAGE;
333
		global $MENU;
334
		global $TEXT;
259
		global $MESSAGE, $MENU, $TEXT;
335 260
		// If attemps more than allowed, warn the user
336 261
		if($this->get_session('ATTEMPS') > $this->max_attemps) {
337 262
			$this->warn();
338 263
		}
339 264
		// Show the login form
340 265
		if($this->frontend != true) {
341
			require_once(WB_PATH.'/include/phplib/template.inc');
266
			//require_once(WB_PATH.'/include/phplib/template.inc');
342 267
			// $template = new Template($this->template_dir);
343 268
			// Setup template object, parse vars to it, then parse it
344 269
			$template = new Template(dirname($this->correct_theme_source($this->template_file)));
......
356 281
				'USERNAME_FIELDNAME' => $this->username_fieldname,
357 282
				'PASSWORD_FIELDNAME' => $this->password_fieldname,
358 283
				'MESSAGE' => $this->message,
284
				'WEBSITE_TITLE' => WEBSITE_TITLE,
285
				'TEXT_ADMINISTRATION' => $TEXT['ADMINISTRATION'],
359 286
				'INTERFACE_DIR_URL' =>  ADMIN_URL.'/interface',
360 287
				'MAX_USERNAME_LEN' => $this->max_username_len,
361 288
				'MAX_PASSWORD_LEN' => $this->max_password_len,
289
				'ADMIN_URL' => ADMIN_URL,
362 290
				'WB_URL' => WB_URL,
291
				'URL_VIEW' => WB_URL,
363 292
				'THEME_URL' => THEME_URL,
364 293
				'VERSION' => VERSION,
294
				'SP' => (defined('SP') ? SP : ''),
365 295
				'REVISION' => REVISION,
366 296
				'LANGUAGE' => strtolower(LANGUAGE),
367 297
				'FORGOTTEN_DETAILS_APP' => $this->forgotten_details_app,
......
370 300
				'TEXT_PASSWORD' => $TEXT['PASSWORD'],
371 301
				'TEXT_REMEMBER_ME' => $TEXT['REMEMBER_ME'],
372 302
				'TEXT_LOGIN' => $TEXT['LOGIN'],
303
				'TITLE_LOGOUT' => $MENU['LOGIN'],
304
				'TEXT_RESET' => $TEXT['RESET'],
373 305
				'TEXT_HOME' => $TEXT['HOME'],
306
				'TITLE_VIEW' => $TEXT['WEBSITE'],
374 307
				'PAGES_DIRECTORY' => PAGES_DIRECTORY,
375
				'SECTION_LOGIN' => $MENU['LOGIN']
308
				'SECTION_NAME' => $MENU['LOGIN'],
309
				'SECTION_LOGIN' => $MENU['LOGIN'],
310
				'LOGIN_DISPLAY_HIDDEN' => !$this->is_authenticated() ? 'hidden' : '',
311
				'LOGIN_DISPLAY_NONE' => !$this->is_authenticated() ? 'none' : '',
312
				'LOGIN_LINK' => $_SERVER['SCRIPT_NAME'],
313
				'LOGIN_ICON' => 'login',
314
				'START_ICON' => 'blank',
315
				'URL_HELP' => 'http://www.websitebaker.org/',
376 316
				)
377 317
			);
378 318
			if(defined('DEFAULT_CHARSET')) {
......
380 320
			} else {
381 321
				$charset='utf-8';
382 322
			}
383
			
384
			$template->set_var('CHARSET', $charset);	
385 323

  
324
			$template->set_var('CHARSET', $charset);
325

  
386 326
			$template->parse('main', 'mainBlock', false);
387 327
			$template->pparse('output', 'page');
388 328
		}
......
395 335
		$clean_cookie = sprintf('%011d', (int) substr($_COOKIE['REMEMBER_KEY'], 0, 11)) . substr($_COOKIE['REMEMBER_KEY'], 11);
396 336
		return ($clean_cookie == $_COOKIE['REMEMBER_KEY']) ? $this->add_slashes($clean_cookie) : '';
397 337
	}
398
	
338

  
399 339
	// Warn user that they have had to many login attemps
400 340
	function warn() {
401
		header('Location: '.$this->warning_url);
341
//		header('Location: '.$this->warning_url);
342
		$this->send_header($this->warning_url);
402 343
		exit(0);
403 344
	}
404
	
345

  
405 346
}
406

  
407
?>

Also available in: Unified diff