Project

General

Profile

« Previous | Next » 

Revision 259

Added by ratz almost 19 years ago

Creating 2.6.x branch

View differences:

branches/2.6.x/wb/admin/login/forgot/index.php
1
<?php
2

  
3
// $Id$
4

  
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
// Include the configuration file
27
require('../../../config.php');
28
// Include the language file
29
require(WB_PATH.'/languages/'.DEFAULT_LANGUAGE.'.php');
30
// Include the database class file and initiate an object
31
require(WB_PATH.'/framework/class.admin.php');
32
$admin = new admin('Start', 'start', false, false);
33
$database = new database();
34

  
35
// Get the website title
36
$results = $database->query("SELECT value FROM ".TABLE_PREFIX."settings WHERE name = 'title'");
37
$results = $results->fetchRow();
38
$website_title = $results['value'];
39

  
40
// Check if the user has already submitted the form, otherwise show it
41
if(isset($_POST['email']) AND $_POST['email'] != "") {
42
	
43
	$email = $_POST['email'];
44
	
45
	// Check if the email exists in the database
46
	$query = "SELECT user_id,username,display_name,email,last_reset FROM ".TABLE_PREFIX."users WHERE email = '".$admin->add_slashes($_POST['email'])."'";
47
	$results = $database->query($query);
48
	if($results->numRows() > 0) {
49

  
50
		// Get the id, username, email, and last_reset from the above db query
51
		$results_array = $results->fetchRow();
52
		
53
		// Check if the password has been reset in the last 2 hours
54
		$last_reset = $results_array['last_reset'];
55
		$time_diff = mktime()-$last_reset; // Time since last reset in seconds
56
		$time_diff = $time_diff/60/60; // Time since last reset in hours
57
		if($time_diff < 2) {
58
			
59
			// Tell the user that their password cannot be reset more than once per hour
60
			$message = $MESSAGE['FORGOT_PASS']['ALREADY_RESET'];
61
			
62
		} else {
63
			
64
			// Generate a random password then update the database with it
65
			$new_pass = '';
66
			$salt = "abchefghjkmnpqrstuvwxyz0123456789";
67
			srand((double)microtime()*1000000);
68
			$i = 0;
69
			while ($i <= 7) {
70
				$num = rand() % 33;
71
				$tmp = substr($salt, $num, 1);
72
				$new_pass = $new_pass . $tmp;
73
				$i++;
74
			}
75
			
76
			$database->query("UPDATE ".TABLE_PREFIX."users SET password = '".md5($new_pass)."', last_reset = '".mktime()."' WHERE user_id = '".$results_array['user_id']."'");
77
			
78
			if($database->is_error()) {
79
				// Error updating database
80
				$message = $database->get_error();
81
			} else {
82
				// Setup email to send
83
				$mail_subject = 'Your login details...';
84
				$mail_to = $email;
85
				$mail_message = ''.
86
	'Hello '.$results_array["display_name"].', 
87
	
88
	Your '.$website_title.' administration login details are:
89
	Username: '.$results_array["username"].'
90
	Password: '.$new_pass.'
91
	
92
	Your password has been reset to the one above.
93
	This means that your old password will no longer work.
94
	
95
	If you have received this message in error, please delete it immediatly.';
96
				// Try sending the email
97
				if(mail($mail_to, $mail_subject, $mail_message, 'From: '.SERVER_EMAIL)) {
98
					$message = $MESSAGE['FORGOT_PASS']['PASSWORD_RESET'];
99
					$display_form = false;
100
				} else {
101
					$message = $MESSAGE['FORGOT_PASS']['CANNOT_EMAIL'];
102
				}
103
			}
104
		
105
		}
106
		
107
	} else {
108
		// Email doesn't exist, so tell the user
109
		$message = $MESSAGE['FORGOT_PASS']['EMAIL_NOT_FOUND'];
110
	}
111
	
112
} else {
113
	$email = '';
114
}
115

  
116
if(!isset($message)) {
117
	$message = $MESSAGE['FORGOT_PASS']['NO_DATA'];
118
	$message_color = '000000';
119
} else {
120
	$message_color = 'FF0000';
121
}
122
	
123
// Setup the template
124
$template = new Template(ADMIN_PATH.'/login/forgot');
125
$template->set_file('page', 'template.html');
126
$template->set_block('page', 'main_block', 'main');
127
if(defined('FRONTEND')) {
128
	$template->set_var('ACTION_URL', 'forgot.php');
129
} else {
130
	$template->set_var('ACTION_URL', 'index.php');
131
}
132
$template->set_var('EMAIL', $email);
133

  
134
if(isset($display_form)) {
135
	$template->set_var('DISPLAY_FORM', 'none');
136
}
137

  
138
$template->set_var(array(
139
								'SECTION_FORGOT' => $MENU['FORGOT'],
140
								'MESSAGE_COLOR' => $message_color,
141
								'MESSAGE' => $message,
142
								'WB_URL' => WB_URL,
143
								'ADMIN_URL' => ADMIN_URL,
144
								'TEXT_EMAIL' => $TEXT['EMAIL'],
145
								'TEXT_SEND_DETAILS' => $TEXT['SEND_DETAILS'],
146
								'TEXT_HOME' => $TEXT['HOME'],
147
								'TEXT_NEED_TO_LOGIN' => $TEXT['NEED_TO_LOGIN']
148
								)
149
						);
150

  
151
if(defined('FRONTEND')) {
152
	$template->set_var('LOGIN_URL', WB_URL.'/account/login.php');
153
} else {
154
	$template->set_var('LOGIN_URL', ADMIN_URL);
155
}
156
$template->set_var('INTERFACE_URL', ADMIN_URL.'/interface');	
157

  
158
$template->parse('main', 'main_block', false);
159
$template->pparse('output', 'page');
160

  
161
?>
0 162

  
branches/2.6.x/wb/admin/login/forgot/template.html
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
<link href="{INTERFACE_URL}/stylesheet.css" rel="stylesheet" type="text/css">
7
</head>
8
<body onload="document.forgot_pass.email.focus();">
9

  
10
<table cellpadding="0" cellspacing="0" border="0" width="770" align="center">
11
<tr>
12
	<td width="60" valign="top">
13
		<img src="{INTERFACE_URL}/logo.png" width="60" height="60" alt="Logo" />
14
	</td>
15
	<td width="5">&nbsp;</td>
16
	<td style="font-size: 20px;">
17
		<font style="color: #FFFFFF;">Website Baker</font> 
18
		<font style="color: #DDDDDD;">{SECTION_FORGOT}</font>
19
	</td>
20
</tr>
21
</table>
22

  
23
<table cellpadding="0" cellspacing="0" border="0" width="770" align="center" style="margin-top: 30px;">
24
<tr>
25
	<td class="content">
26
	
27
	<form name="forgot_pass" action="{ACTION_URL}" method="post">
28
	<input type="hidden" name="url" value="{URL}" />
29
		<table cellpadding="5" cellspacing="0" border="0" align="center" width="500">
30
		<tr>
31
			<td height="40" align="center" style="color: #{MESSAGE_COLOR};" colspan="2">{MESSAGE}</td>
32
		</tr>
33
		<tr style="display: {DISPLAY_FORM}">
34
			<td height="10" colspan="2"></td>
35
		</tr>
36
		<tr style="display: {DISPLAY_FORM}">
37
			<td width="165" height="30" align="right">{TEXT_EMAIL}:</td>
38
			<td><input type="text" maxlength="30" name="email" value="{EMAIL}" style="width: 180px;" /></td>
39
		</tr>
40
		<tr style="display: {DISPLAY_FORM}" height="30">
41
			<td>&nbsp;</td>
42
			<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>
43
		</tr>
44
		<tr style="display: {DISPLAY_FORM}">
45
			<td height="10" colspan="2"></td>
46
		</tr>
47
		</table>
48
	</form>
49
	
50
	<center>
51
		<a href="{LOGIN_URL}">{TEXT_NEED_TO_LOGIN}</a>
52
		<br />
53
		<br />
54
		<a href="{WB_URL}">{TEXT_HOME}</a>
55
	</center>
56

  
57
	</td>
58
</tr>
59
</table>
60

  
61
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 10px 0px 10px 0px;">
62
<tr>
63
	<td align="center" style="font-size: 10px;">
64
		<!-- 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. -->
65
		<a href="http://www.websitebaker.com/" style="color: #000000;" target="_blank">Website Baker</a>
66
		is	released under the
67
		<a href="http://www.gnu.org/copyleft/gpl.html" style="color: #000000;" target="_blank">GNU General Public License</a>
68
		<!-- 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. -->
69
	</td>
70
</tr>
71
</table>
72

  
73
</body>
74
</html>
75
<!-- END main_block -->
0 76

  
branches/2.6.x/wb/admin/login/template.html
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
<link href="{INTERFACE_DIR_URL}/stylesheet.css" rel="stylesheet" type="text/css">
7
</head>
8
<body onload="document.login.{USERNAME_FIELDNAME}.focus();">
9

  
10
<table cellpadding="0" cellspacing="0" border="0" width="770" align="center">
11
<tr>
12
	<td width="60" valign="top">
13
		<img src="{INTERFACE_DIR_URL}/logo.png" width="60" height="60" alt="Logo" />
14
	</td>
15
	<td width="5">&nbsp;</td>
16
	<td style="font-size: 20px;">
17
		<font style="color: #FFFFFF;">Website Baker</font> 
18
		<font style="color: #DDDDDD;">{SECTION_LOGIN}</font>
19
	</td>
20
</tr>
21
</table>
22

  
23
<table cellpadding="0" cellspacing="0" border="0" width="770" align="center" style="margin-top: 30px;">
24
<tr>
25
	<td class="content">
26
	
27
	<form name="login" action="{ACTION_URL}" method="post">
28
	<input type="hidden" name="url" value="{URL}" />
29
	<input type="hidden" name="username_fieldname" value="{USERNAME_FIELDNAME}" />
30
	<input type="hidden" name="password_fieldname" value="{PASSWORD_FIELDNAME}" />
31
		<table cellpadding="5" cellspacing="0" border="0" align="center" width="500">
32
		<tr>
33
			<td height="40" align="center" colspan="2">{MESSAGE}</td>
34
		</tr>
35
		<tr>
36
			<td height="10" colspan="2"></td>
37
		</tr>
38
		<tr>
39
			<td width="170" height="30" align="right">{TEXT_USERNAME}:</td>
40
			<td><input type="text" maxlength="{MAX_USERNAME_LEN}" name="{USERNAME_FIELDNAME}" value="{USERNAME}" style="width: 180px;" /></td>
41
		</tr>
42
		<tr>
43
			<td width="170" height="30" align="right">{TEXT_PASSWORD}:</td>
44
			<td><input type="password" maxlength="{MAX_PASSWORD_LEN}" name="{PASSWORD_FIELDNAME}" style="width: 180px;" /></td>
45
		</tr>
46
		<tr height="30" style="display: {DISPLAY_REMEMBER_ME};">
47
			<td>&nbsp;</td>
48
			<td>
49
				<input type="checkbox" name="remember" id="remember" value="true" />
50
				<label for="remember">
51
					{TEXT_REMEMBER_ME}
52
				</label>
53
			</td>
54
		</tr>
55
		<tr height="30">
56
			<td>&nbsp;</td>
57
			<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>
58
		</tr>
59
		<tr>
60
			<td height="10" colspan="2"></td>
61
		</tr>
62
		</table>
63
	</form>
64
	
65
	<center>
66
		<a href="{FORGOTTEN_DETAILS_APP}">{TEXT_FORGOTTEN_DETAILS}</a>
67
		<br />
68
		<br />
69
		<br />
70
		<a href="{WB_URL}{PAGES_DIRECTORY}/">{TEXT_HOME}</a>
71
	</center>
72

  
73
	</td>
74
</tr>
75
</table>
76

  
77
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 10px 0px 10px 0px;">
78
<tr>
79
	<td align="center" style="font-size: 10px;">
80
		<!-- 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. -->
81
		<a href="http://www.websitebaker.com/" style="color: #000000;" target="_blank">Website Baker</a>
82
		is	released under the
83
		<a href="http://www.gnu.org/copyleft/gpl.html" style="color: #000000;" target="_blank">GNU General Public License</a>
84
		<!-- 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. -->
85
	</td>
86
</tr>
87
</table>
88

  
89
</body>
90
</html>
91
<!-- END mainBlock -->
0 92

  
branches/2.6.x/wb/admin/login/warning.html
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
<head>
4
<title>Maximum Invalid Login Attemps Exceeded</title>
5
<style type="text/css"><!--
6
body,td,th {
7
	font-family: Verdana, Arial, Helvetica, sans-serif;
8
	font-size: 12px;
9
	color: #000000;
10
}
11
body {
12
	background-color: #F8F8F8;
13
	margin: 0px;
14
}
15
a:link, a:visited, a:active {
16
	color: #003366;
17
	text-decoration: none;
18
}
19
a:hover {
20
	text-decoration: underline;
21
	color: #336699;
22
}
23
hr {
24
	height: 1px;
25
	color: #336699;
26
	background-color: #336699;
27
	border: 0;
28
}
29
--></style></head>
30
<body>
31

  
32
<center>
33
	<br />
34
	<h1>Excessive Invalid Logins</h1>
35
	You have attempted to login too many times
36
</center>
37

  
38
</body>
39
</html>
0 40

  
branches/2.6.x/wb/admin/login/index.php
1
<?php
2

  
3
// $Id: index.php,v 1.3 2005/03/27 06:54:28 rdjurovich Exp $
4

  
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
require_once("../../config.php");
27
require_once(WB_PATH."/framework/class.login.php");
28

  
29
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
30
	// Generate username field name
31
	$username_fieldname = 'username_';
32
	$password_fieldname = 'password_';
33
	$salt = "abchefghjkmnpqrstuvwxyz0123456789";
34
	srand((double)microtime()*1000000);
35
	$i = 0;
36
	while ($i <= 7) {
37
		$num = rand() % 33;
38
		$tmp = substr($salt, $num, 1);
39
		$username_fieldname = $username_fieldname . $tmp;
40
		$password_fieldname = $password_fieldname . $tmp;
41
		$i++;
42
	}
43
} else {
44
	$username_fieldname = 'username';
45
	$password_fieldname = 'password';
46
}
47

  
48
$thisApp = new Login(
49
							array(
50
									'MAX_ATTEMPS' => "50",
51
									'WARNING_URL' => ADMIN_URL."/login/warning.html",
52
									'USERNAME_FIELDNAME' => $username_fieldname,
53
									'PASSWORD_FIELDNAME' => $password_fieldname,
54
									'REMEMBER_ME_OPTION' => SMART_LOGIN,
55
									'MIN_USERNAME_LEN' => "2",
56
									'MIN_PASSWORD_LEN' => "2",
57
									'MAX_USERNAME_LEN' => "30",
58
									'MAX_PASSWORD_LEN' => "30",
59
									'LOGIN_URL' => ADMIN_URL."/login/index.php",
60
									'DEFAULT_URL' => ADMIN_URL."/start/index.php",
61
									'TEMPLATE_DIR' => ADMIN_PATH."/login",
62
									'TEMPLATE_FILE' => "template.html",
63
									'FRONTEND' => false,
64
									'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
65
									'USERS_TABLE' => TABLE_PREFIX."users",
66
									'GROUPS_TABLE' => TABLE_PREFIX."groups",
67
							)
68
					);
69

  
70
?>
0 71

  
branches/2.6.x/wb/admin/interface/charsets.php
1
<?php
2

  
3
// $Id$
4

  
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
/*
27

  
28
Charset list file
29

  
30
This file is used to generate a list of charsets for the user to select
31

  
32
*/
33

  
34
if(!defined('WB_URL')) {
35
	header('Location: ../index.php');
36
}
37

  
38
// Create array
39
$CHARSETS = array();
40
$CHARSETS['utf-8'] = 'Unicode (utf-8)';
41
$CHARSETS['iso-8859-1'] = 'Latin 1 (iso-8859-1)';
42

  
43
?>
0 44

  
branches/2.6.x/wb/admin/interface/header.html
1
<!-- BEGIN header_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>{WEBSITE_TITLE} >> {TEXT_ADMINISTRATION} - {SECTION_NAME}</title>
6
<link href="{INTERFACE_DIR}/stylesheet.css" rel="stylesheet" type="text/css" />
7
<script language="javascript" type="text/javascript">
8
function confirm_link(message, url) {
9
	if(confirm(message)) location.href = url;
10
}</script>
11
</head>
12

  
13
<table cellpadding="0" cellspacing="0" border="0" width="770" align="center">
14
<tr>
15
	<td width="60" valign="top">
16
		<img src="{INTERFACE_DIR}/logo.png" border="0" width="60" height="60" alt="Logo" />
17
	</td>
18
	<td width="5">&nbsp;</td>
19
	<td style="font-size: 20px;">
20
		<font style="color: #FFFFFF;">Website Baker</font>
21
		<font style="color: #DDDDDD;">{TEXT_ADMINISTRATION}</font>
22
	</td>
23
	<td width="100" align="right" style="padding-top: 10px; padding-right: 15px; color: #D0D0D0;">
24
	Version {VERSION}
25
	</td>
26
</tr>
27
</table>
28

  
29
<table cellpadding="0" cellspacing="0" border="0" width="770" align="center">
30
<tr>
31
	<td>
32
		<ul class="menu">
33
			<!-- BEGIN linkBlock -->
34
			<li class="{CLASS}"><a href="{LINK}" target="{TARGET}">{TITLE}</a></li>
35
			<!-- END linkBlock -->
36
		</ul>
37
	</td>
38
</tr>
39
<tr>
40
	<td class="content">
41
<!-- END header_block -->
0 42

  
branches/2.6.x/wb/admin/interface/footer.html
1
<!-- BEGIN footer_block -->
2
	</td>
3
</tr>
4
</table>
5

  
6
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 10px 0px 10px 0px;">
7
<tr>
8
	<td align="center" style="font-size: 10px;">
9
		<!-- 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. -->
10
		<a href="http://www.websitebaker.org/" style="color: #000000;" target="_blank">Website Baker</a>
11
		is	released under the
12
		<a href="http://www.gnu.org/licenses/gpl.html" style="color: #000000;" target="_blank">GNU General Public License</a>
13
		<!-- 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. -->
14
	</td>
15
</tr>
16
</table>
17

  
18
</body>
19
</html>
20
<!-- END footer_block -->
0 21

  
branches/2.6.x/wb/admin/interface/time_formats.php
1
<?php
2

  
3
// $Id$
4

  
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
/*
27

  
28
Time format list file
29

  
30
This file is used to generate a list of time formats for the user to select
31

  
32
*/
33

  
34
if(!defined('WB_URL')) {
35
	header('Location: ../index.php');
36
}
37

  
38
// Define that this file is loaded
39
if(!defined('TIME_FORMATS_LOADED')) {
40
	define('TIME_FORMATS_LOADED', true);
41
}
42

  
43
// Create array
44
$TIME_FORMATS = array();
45

  
46
// Get the current time (in the users timezone if required)
47
if(isset($user_time) AND $user_time == true) {
48
	$mktime = mktime()+TIMEZONE;
49
} else {
50
	$mktime = mktime()+DEFAULT_TIMEZONE;
51
}
52

  
53
// Add values to list
54
$TIME_FORMATS['g:i|A'] = gmdate('g:i A', $mktime);
55
$TIME_FORMATS['g:i|a'] = gmdate('g:i a', $mktime);
56
$TIME_FORMATS['H:i:s'] = gmdate('H:i:s', $mktime);
57
$TIME_FORMATS['H:i'] = gmdate('H:i', $mktime);
58

  
59
// Add "System Default" to list (if we need to)
60
if(isset($user_time) AND $user_time == true) {
61
	if(isset($TEXT['SYSTEM_DEFAULT'])) {
62
		$TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $mktime).' ('.$TEXT['SYSTEM_DEFAULT'].')';
63
	} else {
64
		$TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $mktime).' (System Default)';
65
	}
66
}
67

  
68
// Reverse array so "System Default" is at the top
69
$TIME_FORMATS = array_reverse($TIME_FORMATS, true);
70

  
71
?>
0 72

  
branches/2.6.x/wb/admin/interface/timezones.php
1
<?php
2

  
3
// $Id$
4

  
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
/*
27

  
28
Timezone list file
29

  
30
This file is used to generate a list of timezones for the user to select
31

  
32
*/
33

  
34
if(!defined('WB_URL')) {
35
	header('Location: ../index.php');
36
}
37

  
38
// Create array
39
$TIMEZONES = array();
40

  
41
// Add "System Default" to top of list
42
if(isset($TEXT['SYSTEM_DEFAULT'])) {
43
	$TIMEZONES['-20'] = $TEXT['SYSTEM_DEFAULT'];
44
} else {
45
	$TIMEZONES['-20'] = 'System Default';
46
}
47

  
48
$TIMEZONES['-12'] = 'GMT - 12 Hours';
49
$TIMEZONES['-11'] = 'GMT -11 Hours';
50
$TIMEZONES['-10'] = 'GMT -10 Hours';
51
$TIMEZONES['-9'] = 'GMT -9 Hours';
52
$TIMEZONES['-8'] = 'GMT -8 Hours';
53
$TIMEZONES['-7'] = 'GMT -7 Hours';
54
$TIMEZONES['-6'] = 'GMT -6 Hours';
55
$TIMEZONES['-5'] = 'GMT -5 Hours';
56
$TIMEZONES['-4'] = 'GMT -4 Hours';
57
$TIMEZONES['-3.5'] = 'GMT -3.5 Hours';
58
$TIMEZONES['-3'] = 'GMT -3 Hours';
59
$TIMEZONES['-2'] = 'GMT -2 Hours';
60
$TIMEZONES['-1'] = 'GMT -1 Hour';
61
$TIMEZONES['0'] = 'GMT';
62
$TIMEZONES['1'] = 'GMT +1 Hour';
63
$TIMEZONES['2'] = 'GMT +2 Hours';
64
$TIMEZONES['3'] = 'GMT +3 Hours';
65
$TIMEZONES['3.5'] = 'GMT +3.5 Hours';
66
$TIMEZONES['4'] = 'GMT +4 Hours';
67
$TIMEZONES['4.5'] = 'GMT +4.5 Hours';
68
$TIMEZONES['5'] = 'GMT +5 Hours';
69
$TIMEZONES['5.5'] = 'GMT +5.5 Hours';
70
$TIMEZONES['6'] = 'GMT +6 Hours';
71
$TIMEZONES['6.5'] = 'GMT +6.5 Hours';
72
$TIMEZONES['7'] = 'GMT +7 Hours';
73
$TIMEZONES['8'] = 'GMT +8 Hours';
74
$TIMEZONES['9'] = 'GMT +9 Hours';
75
$TIMEZONES['9.5'] = 'GMT +9.5 Hours';
76
$TIMEZONES['10'] = 'GMT +10 Hours';
77
$TIMEZONES['11'] = 'GMT +11 Hours';
78
$TIMEZONES['12'] = 'GMT +12 Hours';
79
$TIMEZONES['13'] = 'GMT +13 Hours';
80

  
81
?>
0 82

  
branches/2.6.x/wb/admin/interface/er_levels.php
1
<?php
2

  
3
// $Id$
4

  
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
/*
27

  
28
Error Reporting Level's list file
29

  
30
This file is used to generate a list of PHP
31
Error Reporting Level's for the user to select
32

  
33
*/
34

  
35
if(!defined('WB_URL')) {
36
	header('Location: ../index.php');
37
}
38

  
39
// Define that this file is loaded
40
if(!defined('ERROR_REPORTING_LEVELS_LOADED')) {
41
	define('ERROR_REPORTING_LEVELS_LOADED', true);
42
}
43

  
44
// Create array
45
$ER_LEVELS = array();
46

  
47
// Add values to list
48
if(isset($TEXT['SYSTEM_DEFAULT'])) {
49
	$ER_LEVELS[''] = $TEXT['SYSTEM_DEFAULT'];
50
} else {
51
	$ER_LEVELS[''] = 'System Default';
52
}
53
$ER_LEVELS['E_ERROR'] = 'E_ERROR';
54
$ER_LEVELS['E_WARNING'] = 'E_WARNING';
55
$ER_LEVELS['E_PARSE'] = 'E_PARSE';
56
$ER_LEVELS['E_NOTICE'] = 'E_NOTICE';
57
$ER_LEVELS['E_CORE_ERROR'] = 'E_CORE_ERROR';
58
$ER_LEVELS['E_CORE_WARNING'] = 'E_CORE_WARNING';
59
$ER_LEVELS['E_COMPILE_ERROR'] = 'E_COMPILE_ERROR';
60
$ER_LEVELS['E_COMPILE_WARNING'] = 'E_COMPILE_WARNING';
61
$ER_LEVELS['E_USER_ERROR'] = 'E_USER_ERROR';
62
$ER_LEVELS['E_USER_WARNING'] = 'E_USER_WARNING';
63
$ER_LEVELS['E_USER_NOTICE'] = 'E_USER_NOTICE';
64
$ER_LEVELS['E_ALL'] = 'E_ALL';
65
$ER_LEVELS['E_STRICT'] = 'E_STRICT';
66

  
67
?>
0 68

  
branches/2.6.x/wb/admin/interface/version.php
1
<?php
2

  
3
// $Id$
4

  
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
/*
27

  
28
Version file
29

  
30
This file is where the WB release version is stored.
31

  
32
*/
33

  
34
if(!defined('WB_URL')) {
35
	header('Location: ../index.php');
36
}
37

  
38
define('VERSION', '2.6.0');
39

  
40
?>
0 41

  
branches/2.6.x/wb/admin/interface/date_formats.php
1
<?php
2

  
3
// $Id$
4

  
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
/*
27

  
28
Date format list file
29

  
30
This file is used to generate a list of date formats for the user to select
31

  
32
*/
33

  
34
if(!defined('WB_URL')) {
35
	header('Location: ../index.php');
36
}
37

  
38
// Define that this file is loaded
39
if(!defined('DATE_FORMATS_LOADED')) {
40
	define('DATE_FORMATS_LOADED', true);
41
}
42

  
43
// Create array
44
$DATE_FORMATS = array();
45

  
46
// Get the current time (in the users timezone if required)
47
if(isset($user_time) AND $user_time == true) {
48
	$mktime = mktime()+TIMEZONE;
49
} else {
50
	$mktime = mktime()+DEFAULT_TIMEZONE;
51
}
52

  
53
// Add values to list
54
$DATE_FORMATS['l,|jS|F,|Y'] = gmdate('l, jS F, Y', $mktime);
55
$DATE_FORMATS['jS|F,|Y'] = gmdate('jS F, Y', $mktime);
56
$DATE_FORMATS['d|M|Y'] = gmdate('d M Y', $mktime);
57
$DATE_FORMATS['M|d|Y'] = gmdate('M d Y', $mktime);
58
$DATE_FORMATS['D|M|d,|Y'] = gmdate('D M d, Y', $mktime);
59
$DATE_FORMATS['d-m-Y'] = gmdate('d-m-Y', $mktime).' (D-M-Y)';
60
$DATE_FORMATS['m-d-Y'] = gmdate('m-d-Y', $mktime).' (M-D-Y)';
61
$DATE_FORMATS['d.m.Y'] = gmdate('d.m.Y', $mktime).' (D.M.Y)';
62
$DATE_FORMATS['m.d.Y'] = gmdate('m.d.Y', $mktime).' (M.D.Y)';
63
$DATE_FORMATS['d/m/Y'] = gmdate('d/m/Y', $mktime).' (D/M/Y)';
64
$DATE_FORMATS['m/d/Y'] = gmdate('m/d/Y', $mktime).' (M/D/Y)';
65

  
66
// Add "System Default" to list (if we need to)
67
if(isset($user_time) AND $user_time == true) {
68
	if(isset($TEXT['SYSTEM_DEFAULT'])) {
69
		$DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $mktime).' ('.$TEXT['SYSTEM_DEFAULT'].')';
70
	} else {
71
		$DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $mktime).' (System Default)';
72
	}
73
}
74

  
75
// Reverse array so "System Default" is at the top
76
$DATE_FORMATS = array_reverse($DATE_FORMATS, true);
77

  
78
?>
0 79

  
branches/2.6.x/wb/admin/interface/stylesheet.css
1
body,td,th,input,textarea {
2
	font-family: Verdana, Arial, Helvetica, sans-serif;
3
	font-size: 12px;
4
	color: #000000;
5
}
6
body {
7
	background-color: #557799;
8
	background-image: url(../interface/background.png);
9
	background-repeat: repeat-x;
10
	margin: 0px;
11
}
12
form {
13
	margin: 0;
14
}
15
hr {
16
	margin: 15px 0px 15px 0px;
17
	color: #003366;
18
	height: 1px;
19
}
20
h1 {
21
	text-align: center;
22
	font-size: 20px;
23
	color: #003366;
24
	text-transform: uppercase;
25
}
26
h2 {
27
	font-size: 15px;
28
	color: #336699;
29
	margin: 5px 0px 5px 0px;
30
}
31
a:link, a:visited, a:active {
32
	color: #003366;
33
	text-decoration: none;
34
}
35
a:hover {
36
	text-decoration: none;
37
	color: #336699;
38
}
39
.note {
40
	color: #666666;
41
	font-size: 10px;
42
}
43
label {
44
	cursor: pointer;
45
}
46
.menu {
47
	margin: 0;
48
	padding: 0;
49
	padding-top: 10px;
50
	padding-bottom: 4px;
51
	padding-left: 8px;
52
}
53
.menu li {
54
	list-style-type: none;
55
	display: inline;
56
	padding-right: 1px;
57
}
58
.menu a, .menu a:link, .menu a:active, .menu a:visited {
59
	border-bottom: 0;
60
	padding: 4px 3px 4px 3px;
61
	color: #003366;
62
}
63
.menu a:hover {
64
	text-decoration: none;
65
	color: #336699;
66
}
67
.current a, .current a:link, .current a:active, .current a:visited {
68
	background-color: #FFFFFF;
69
	color: #000000;
70
}
71
.content {
72
	background-color: #FFFFFF;
73
	padding: 20px;
74
	height: 280px;
75
	width: 750px;
76
	text-align: left;
77
	vertical-align: top;
78
}
79
.row_a {
80
	background-color: #EEEEEE;
81
}
82
.row_b {
83
	background-color: #DDDDDD;
84
}
85
.hide {
86
	display: none;
87
}
0 88

  
branches/2.6.x/wb/admin/interface/success.html
1
<!-- BEGIN main_block -->
2
<center>
3
	
4
	{MESSAGE}
5
	
6
	<script language="javascript" type="text/javascript">
7
		setTimeout("location.href='{REDIRECT}'", 0);
8
	</script>
9
	
10
	<noscript>
11
		<br /><br />
12
		<a href="{REDIRECT}">{NEXT}</a>
13
	</noscript>
14
	
15
</center>
16
<!-- END main_block -->
0 17

  
branches/2.6.x/wb/admin/interface/error.html
1
<!-- BEGIN main_block -->
2
<center>
3
	
4
	{MESSAGE}
5
	
6
	<br /><br />
7
	<a href="{LINK}">{BACK}</a>
8
	
9
</center>
10
<!-- END main_block -->
0 11

  
branches/2.6.x/wb/admin/interface/index.php
1
<?php
2

  
3
// $Id: index.php,v 1.2 2005/06/22 05:28:39 rdjurovich Exp $
4

  
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
require('../../config.php');
27
header('Location: '.ADMIN_URL.'/start/index.php');
28

  
29
?>
0 30

  
branches/2.6.x/wb/admin/settings/index.php
1
<?php
2

  
3
// $Id$
4

  
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
require('../../config.php');
27
require_once(WB_PATH.'/framework/class.admin.php');
28
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
29
	$admin = new admin('Settings', 'settings_advanced');
30
} else {
31
	$admin = new admin('Settings', 'settings_basic');
32
}
33

  
34
// Include the WB functions file
35
require_once(WB_PATH.'/framework/functions.php');
36

  
37
// Create new template object
38
$template = new Template(ADMIN_PATH.'/settings');
39
$template->set_file('page', 'template.html');
40
$template->set_block('page', 'main_block', 'main');
41

  
42
// Query current settings in the db, then loop through them and print them
43
$query = "SELECT * FROM ".TABLE_PREFIX."settings";
44
$results = $database->query($query);
45
while($setting = $results->fetchRow()) {
46
	$setting_name = $setting['name'];
47
	$setting_value = htmlspecialchars($setting['value']);
48
	$template->set_var(strtoupper($setting_name),$setting_value);
49
}
50

  
51
// Query current settings in the db, then loop through them and print them
52
$query = "SELECT * FROM ".TABLE_PREFIX."search WHERE extra = ''";
53
$results = $database->query($query);
54
while($setting = $results->fetchRow()) {
55
	$setting_name = $setting['name'];
56
	$setting_value = htmlspecialchars(($setting['value']));
57
	switch($setting_name) {
58
		// Search header
59
		case 'header':
60
			$template->set_var('SEARCH_HEADER', $setting_value);
61
		break;
62
		// Search results header
63
		case 'results_header':
64
			$template->set_var('SEARCH_RESULTS_HEADER', $setting_value);
65
		break;
66
		// Search results loop
67
		case 'results_loop':
68
			$template->set_var('SEARCH_RESULTS_LOOP', $setting_value);
69
		break;
70
		// Search results footer
71
		case 'results_footer':
72
			$template->set_var('SEARCH_RESULTS_FOOTER', $setting_value);
73
		break;
74
		// Search no results
75
		case 'no_results':
76
			$template->set_var('SEARCH_NO_RESULTS', $setting_value);
77
		break;
78
		// Search footer
79
		case 'footer':
80
			$template->set_var('SEARCH_FOOTER', $setting_value);
81
		break;
82
		// Search template
83
		case 'template':
84
			$search_template = $setting_value;
85
		break;
86
	}
87
}
88

  
89
// Do the same for settings stored in config file as with ones in db
90
$database_type = '';
91

  
92
// Tell the browser whether or not to show advanced options
93
if(isset($_GET['advanced']) AND $_GET['advanced'] == 'yes') {
94
	$template->set_var('DISPLAY_ADVANCED', '');
95
	$template->set_var('ADVANCED', 'yes');
96
	$template->set_var('ADVANCED_BUTTON', '<< '.$TEXT['HIDE_ADVANCED']);
97
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=no');
98
	$template->set_var('BASIC_FILE_PERMS_ID', 'hide');
99
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
100
} else {
101
	$template->set_var('DISPLAY_ADVANCED', 'none');
102
	$template->set_var('ADVANCED', 'no');
103
	$template->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' >>');
104
	$template->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
105
	$template->set_var('BASIC_FILE_PERMS_ID', 'file_perms_box');
106
	$template->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
107
}
108

  
109
$template->set_var(array(	
110
									'PAGES_DIRECTORY' => PAGES_DIRECTORY,
111
									'MEDIA_DIRECTORY' => MEDIA_DIRECTORY,
112
									'PAGE_EXTENSION' => PAGE_EXTENSION,
113
									'PAGE_SPACER' => PAGE_SPACER,
114
									'WB_PATH' => WB_PATH,
115
									'WB_URL' => WB_URL,
116
									'ADMIN_PATH' => ADMIN_PATH,
117
									'ADMIN_URL' => ADMIN_URL,
118
									'DATABASE_TYPE' => DB_TYPE,
119
									'DATABASE_HOST' => DB_HOST,
120
									'DATABASE_USERNAME' => DB_USERNAME,
121
									'DATABASE_NAME' => DB_NAME,
122
									'TABLE_PREFIX' => TABLE_PREFIX
123
								 )
124
						 );
125

  
126
// Insert tools into tool list
127
$template->set_block('main_block', 'tool_list_block', 'tool_list');
128
$results = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'module' AND function = 'tool'");
129
if($results->numRows() > 0) {
130
	while($tool = $results->fetchRow()) {
131
		$template->set_var('TOOL_NAME', $tool['name']);
132
		$template->set_var('TOOL_DIR', $tool['directory']);
133
		$template->set_var('TOOL_DESCRIPTION', $tool['description']);
134
		$template->parse('tool_list', 'tool_list_block', true);
135
	}
136
} else {
137
	$template->set_var('TOOL_LIST', $TEXT['NONE_FOUND']);	
138
}
139

  
140
// Insert language values
141
$template->set_block('main_block', 'language_list_block', 'language_list');
142
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language'");
143
if($result->numRows() > 0) {
144
	while ($addon = $result->fetchRow()) {
145
		// Insert code and name
146
		$template->set_var(array(
147
								'CODE' => $addon['directory'],
148
								'NAME' => $addon['name']
149
								));
150
		// Check if it is selected
151
		if(DEFAULT_LANGUAGE == $addon['directory']) {
152
			$template->set_var('SELECTED', ' selected');
153
		} else {
154
			$template->set_var('SELECTED', '');
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff