Revision 361
Added by ryan over 18 years ago
branches/2.6.x/wb/admin/preferences/details.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
6 |
|
|
7 |
Website Baker Project <http://www.websitebaker.org/> |
|
8 |
Copyright (C) 2004-2006, 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 |
// Print admin header |
|
27 |
require('../../config.php'); |
|
28 |
require_once(WB_PATH.'/framework/class.admin.php'); |
|
29 |
$admin = new admin('Preferences'); |
|
30 |
|
|
31 |
// Get entered values |
|
32 |
$display_name = $admin->add_slashes(strip_tags($admin->get_post('display_name'))); |
|
33 |
$language = $admin->get_post('language'); |
|
34 |
$timezone = $admin->get_post('timezone')*60*60; |
|
35 |
$date_format = $admin->get_post('date_format'); |
|
36 |
$time_format = $admin->get_post('time_format'); |
|
37 |
|
|
38 |
// Update the database |
|
39 |
$database = new database(); |
|
40 |
$query = "UPDATE ".TABLE_PREFIX."users SET display_name = '$display_name', language = '$language', timezone = '$timezone', date_format = '$date_format', time_format = '$time_format' WHERE user_id = '".$admin->get_user_id()."'"; |
|
41 |
$database->query($query); |
|
42 |
if($database->is_error()) { |
|
43 |
$admin->print_error($database->get_error()); |
|
44 |
} else { |
|
45 |
$admin->print_success($MESSAGE['PREFERENCES']['DETAILS_SAVED']); |
|
46 |
$_SESSION['DISPLAY_NAME'] = $display_name; |
|
47 |
$_SESSION['LANGUAGE'] = $language; |
|
48 |
$_SESSION['TIMEZONE'] = $timezone; |
|
49 |
// Update date format |
|
50 |
if($date_format != '') { |
|
51 |
$_SESSION['DATE_FORMAT'] = $date_format; |
|
52 |
if(isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) { unset($_SESSION['USE_DEFAULT_DATE_FORMAT']); } |
|
53 |
} else { |
|
54 |
$_SESSION['USE_DEFAULT_DATE_FORMAT'] = true; |
|
55 |
if(isset($_SESSION['DATE_FORMAT'])) { unset($_SESSION['DATE_FORMAT']); } |
|
56 |
} |
|
57 |
// Update time format |
|
58 |
if($time_format != '') { |
|
59 |
$_SESSION['TIME_FORMAT'] = $time_format; |
|
60 |
if(isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) { unset($_SESSION['USE_DEFAULT_TIME_FORMAT']); } |
|
61 |
} else { |
|
62 |
$_SESSION['USE_DEFAULT_TIME_FORMAT'] = true; |
|
63 |
if(isset($_SESSION['TIME_FORMAT'])) { unset($_SESSION['TIME_FORMAT']); } |
|
64 |
} |
|
65 |
} |
|
66 |
|
|
67 |
// Print admin footer |
|
68 |
$admin->print_footer(); |
|
69 |
|
|
70 |
?> |
|
0 | 71 |
branches/2.6.x/wb/admin/preferences/email.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
6 |
|
|
7 |
Website Baker Project <http://www.websitebaker.org/> |
|
8 |
Copyright (C) 2004-2006, 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 |
// Print admin header |
|
27 |
require('../../config.php'); |
|
28 |
require_once(WB_PATH.'/framework/class.admin.php'); |
|
29 |
$admin = new admin('Preferences'); |
|
30 |
|
|
31 |
// Get entered values |
|
32 |
$password = $admin->get_post('current_password'); |
|
33 |
$email = $admin->get_post('email'); |
|
34 |
|
|
35 |
// Create a javascript back link |
|
36 |
$js_back = "javascript: history.go(-1);"; |
|
37 |
|
|
38 |
// Get password |
|
39 |
$database = new database(); |
|
40 |
$query = "SELECT user_id FROM ".TABLE_PREFIX."users WHERE user_id = '".$admin->get_user_id()."' AND password = '".md5($password)."'"; |
|
41 |
$results = $database->query($query); |
|
42 |
|
|
43 |
// Validate values |
|
44 |
if($results->numRows() == 0) { |
|
45 |
$admin->print_error($MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT']); |
|
46 |
} |
|
47 |
if(!$admin->validate_email($email)) { |
|
48 |
$admin->print_error($MESSAGE['USERS']['INVALID_EMAIL']); |
|
49 |
} |
|
50 |
|
|
51 |
$email = $admin->add_slashes($email); |
|
52 |
|
|
53 |
// Update the database |
|
54 |
$database = new database(); |
|
55 |
$query = "UPDATE ".TABLE_PREFIX."users SET email = '$email' WHERE user_id = '".$admin->get_user_id()."'"; |
|
56 |
$database->query($query); |
|
57 |
if($database->is_error()) { |
|
58 |
$admin->print_error($database->get_error); |
|
59 |
} else { |
|
60 |
$admin->print_success($MESSAGE['PREFERENCES']['EMAIL_UPDATED']); |
|
61 |
$_SESSION['EMAIL'] = $email; |
|
62 |
} |
|
63 |
|
|
64 |
// Print admin footer |
|
65 |
$admin->print_footer(); |
|
66 |
|
|
67 |
?> |
|
0 | 68 |
branches/2.6.x/wb/admin/preferences/password.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
6 |
|
|
7 |
Website Baker Project <http://www.websitebaker.org/> |
|
8 |
Copyright (C) 2004-2006, 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 |
// Print admin header |
|
27 |
require('../../config.php'); |
|
28 |
require_once(WB_PATH.'/framework/class.admin.php'); |
|
29 |
$admin = new admin('Preferences'); |
|
30 |
|
|
31 |
// Get entered values |
|
32 |
$current_password = $admin->get_post('current_password'); |
|
33 |
$new_password = $admin->get_post('new_password'); |
|
34 |
$new_password2 = $admin->get_post('new_password2'); |
|
35 |
|
|
36 |
// Create a javascript back link |
|
37 |
$js_back = "javascript: history.go(-1);"; |
|
38 |
|
|
39 |
// Get existing password |
|
40 |
$database = new database(); |
|
41 |
$query = "SELECT user_id FROM ".TABLE_PREFIX."users WHERE user_id = '".$admin->get_user_id()."' AND password = '".md5($current_password)."'"; |
|
42 |
$results = $database->query($query); |
|
43 |
|
|
44 |
// Validate values |
|
45 |
if($results->numRows() == 0) { |
|
46 |
$admin->print_error($MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT']); |
|
47 |
} |
|
48 |
if(strlen($new_password) < 3) { |
|
49 |
$admin->print_error($MESSAGE['USERS']['PASSWORD_TOO_SHORT'], $js_back); |
|
50 |
} |
|
51 |
if($new_password != $new_password2) { |
|
52 |
$admin->print_error($MESSAGE['USERS']['PASSWORD_MISMATCH'], $js_back); |
|
53 |
} |
|
54 |
|
|
55 |
// MD5 the password |
|
56 |
$md5_password = md5($new_password); |
|
57 |
|
|
58 |
// Update the database |
|
59 |
$database = new database(); |
|
60 |
$query = "UPDATE ".TABLE_PREFIX."users SET password = '$md5_password' WHERE user_id = '".$admin->get_user_id()."'"; |
|
61 |
$database->query($query); |
|
62 |
if($database->is_error()) { |
|
63 |
$admin->print_error($database->get_error); |
|
64 |
} else { |
|
65 |
$admin->print_success($MESSAGE['PREFERENCES']['PASSWORD_CHANGED']); |
|
66 |
} |
|
67 |
|
|
68 |
// Print admin footer |
|
69 |
$admin->print_footer(); |
|
70 |
|
|
71 |
?> |
|
0 | 72 |
branches/2.6.x/wb/admin/preferences/index.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
/* |
|
4 |
|
|
5 |
Website Baker Project <http://www.websitebaker.org/> |
|
6 |
Copyright (C) 2004-2006, Ryan Djurovich |
|
7 |
|
|
8 |
Website Baker is free software; you can redistribute it and/or modify |
|
9 |
it under the terms of the GNU General Public License as published by |
|
10 |
the Free Software Foundation; either version 2 of the License, or |
|
11 |
(at your option) any later version. |
|
12 |
|
|
13 |
Website Baker is distributed in the hope that it will be useful, |
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
GNU General Public License for more details. |
|
17 |
|
|
18 |
You should have received a copy of the GNU General Public License |
|
19 |
along with Website Baker; if not, write to the Free Software |
|
20 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
21 |
|
|
22 |
*/ |
|
23 |
|
|
24 |
require('../../config.php'); |
|
25 |
require_once(WB_PATH.'/framework/class.admin.php'); |
|
26 |
$admin = new admin('Preferences'); |
|
27 |
|
|
28 |
// Create new template object for the preferences form |
|
29 |
$template = new Template(ADMIN_PATH.'/preferences'); |
|
30 |
$template->set_file('page', 'template.html'); |
|
31 |
$template->set_block('page', 'main_block', 'main'); |
|
32 |
|
|
33 |
// Get existing value from database |
|
34 |
$database = new database(); |
|
35 |
$query = "SELECT display_name,email FROM ".TABLE_PREFIX."users WHERE user_id = '".$admin->get_user_id()."'"; |
|
36 |
$results = $database->query($query); |
|
37 |
if($database->is_error()) { |
|
38 |
$admin->print_error($database->get_error(), 'index.php'); |
|
39 |
} |
|
40 |
$details = $results->fetchRow(); |
|
41 |
|
|
42 |
// Insert values into form |
|
43 |
$template->set_var('DISPLAY_NAME', $details['display_name']); |
|
44 |
$template->set_var('EMAIL', $details['email']); |
|
45 |
|
|
46 |
// Insert language values |
|
47 |
$template->set_block('main_block', 'language_list_block', 'language_list'); |
|
48 |
$result = $database->query("SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language'"); |
|
49 |
if($result->numRows() > 0) { |
|
50 |
while($addon = $result->fetchRow()) { |
|
51 |
// Insert code and name |
|
52 |
$template->set_var(array( |
|
53 |
'CODE' => $addon['directory'], |
|
54 |
'NAME' => $addon['name'] |
|
55 |
)); |
|
56 |
// Check if it is selected |
|
57 |
if(LANGUAGE == $addon['directory']) { |
|
58 |
$template->set_var('SELECTED', ' selected'); |
|
59 |
} else { |
|
60 |
$template->set_var('SELECTED', ''); |
|
61 |
} |
|
62 |
$template->parse('language_list', 'language_list_block', true); |
|
63 |
} |
|
64 |
} |
|
65 |
|
|
66 |
// Insert default timezone values |
|
67 |
require(ADMIN_PATH.'/interface/timezones.php'); |
|
68 |
$template->set_block('main_block', 'timezone_list_block', 'timezone_list'); |
|
69 |
foreach($TIMEZONES AS $hour_offset => $title) { |
|
70 |
$template->set_var('VALUE', $hour_offset); |
|
71 |
$template->set_var('NAME', $title); |
|
72 |
if($admin->get_timezone() == $hour_offset*60*60) { |
|
73 |
$template->set_var('SELECTED', 'selected'); |
|
74 |
} else { |
|
75 |
$template->set_var('SELECTED', ''); |
|
76 |
} |
|
77 |
$template->parse('timezone_list', 'timezone_list_block', true); |
|
78 |
} |
|
79 |
|
|
80 |
// Insert date format list |
|
81 |
$user_time = true; |
|
82 |
require(ADMIN_PATH.'/interface/date_formats.php'); |
|
83 |
$template->set_block('main_block', 'date_format_list_block', 'date_format_list'); |
|
84 |
foreach($DATE_FORMATS AS $format => $title) { |
|
85 |
$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key) |
|
86 |
if($format != 'system_default') { |
|
87 |
$template->set_var('VALUE', $format); |
|
88 |
} else { |
|
89 |
$template->set_var('VALUE', ''); |
|
90 |
} |
|
91 |
$template->set_var('NAME', $title); |
|
92 |
if(DATE_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) { |
|
93 |
$template->set_var('SELECTED', 'selected'); |
|
94 |
} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) { |
|
95 |
$template->set_var('SELECTED', 'selected'); |
|
96 |
} else { |
|
97 |
$template->set_var('SELECTED', ''); |
|
98 |
} |
|
99 |
$template->parse('date_format_list', 'date_format_list_block', true); |
|
100 |
} |
|
101 |
|
|
102 |
// Insert time format list |
|
103 |
require(ADMIN_PATH.'/interface/time_formats.php'); |
|
104 |
$template->set_block('main_block', 'time_format_list_block', 'time_format_list'); |
|
105 |
foreach($TIME_FORMATS AS $format => $title) { |
|
106 |
$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key) |
|
107 |
if($format != 'system_default') { |
|
108 |
$template->set_var('VALUE', $format); |
|
109 |
} else { |
|
110 |
$template->set_var('VALUE', ''); |
|
111 |
} |
|
112 |
$template->set_var('NAME', $title); |
|
113 |
if(TIME_FORMAT == $format AND !isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) { |
|
114 |
$template->set_var('SELECTED', 'selected'); |
|
115 |
} elseif($format == 'system_default' AND isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) { |
|
116 |
$template->set_var('SELECTED', 'selected'); |
|
117 |
} else { |
|
118 |
$template->set_var('SELECTED', ''); |
|
119 |
} |
|
120 |
$template->parse('time_format_list', 'time_format_list_block', true); |
|
121 |
} |
|
122 |
|
|
123 |
// Insert language headings |
|
124 |
$template->set_var(array( |
|
125 |
'HEADING_MY_SETTINGS' => $HEADING['MY_SETTINGS'], |
|
126 |
'HEADING_MY_EMAIL' => $HEADING['MY_EMAIL'], |
|
127 |
'HEADING_MY_PASSWORD' => $HEADING['MY_PASSWORD'] |
|
128 |
) |
|
129 |
); |
|
130 |
// Insert language text and messages |
|
131 |
$template->set_var(array( |
|
132 |
'TEXT_SAVE' => $TEXT['SAVE'], |
|
133 |
'TEXT_RESET' => $TEXT['RESET'], |
|
134 |
'TEXT_DISPLAY_NAME' => $TEXT['DISPLAY_NAME'], |
|
135 |
'TEXT_EMAIL' => $TEXT['EMAIL'], |
|
136 |
'TEXT_LANGUAGE' => $TEXT['LANGUAGE'], |
|
137 |
'TEXT_TIMEZONE' => $TEXT['TIMEZONE'], |
|
138 |
'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'], |
|
139 |
'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'], |
|
140 |
'TEXT_CURRENT_PASSWORD' => $TEXT['CURRENT_PASSWORD'], |
|
141 |
'TEXT_NEW_PASSWORD' => $TEXT['NEW_PASSWORD'], |
|
142 |
'TEXT_RETYPE_NEW_PASSWORD' => $TEXT['RETYPE_NEW_PASSWORD'] |
|
143 |
) |
|
144 |
); |
|
145 |
|
|
146 |
// Parse template for preferences form |
|
147 |
$template->parse('main', 'main_block', false); |
|
148 |
$template->pparse('output', 'page'); |
|
149 |
|
|
150 |
$admin->print_footer(); |
|
151 |
|
|
152 |
?> |
|
0 | 153 |
branches/2.6.x/wb/admin/preferences/template.html | ||
---|---|---|
1 |
<!-- BEGIN main_block --> |
|
2 |
|
|
3 |
<form name="details" action="details.php" method="post"> |
|
4 |
|
|
5 |
<h2>{HEADING_MY_SETTINGS}</h2> |
|
6 |
|
|
7 |
<table cellpadding="5" cellspacing="0" border="0" width="100%"> |
|
8 |
<tr> |
|
9 |
<td width="160">{TEXT_DISPLAY_NAME}:</td> |
|
10 |
<td> |
|
11 |
<input type="text" name="display_name" value="{DISPLAY_NAME}" style="width: 98%;" /> |
|
12 |
<script language="javascript" type="text/javascript"> |
|
13 |
document.details.display_name.focus(); |
|
14 |
</script> |
|
15 |
</td> |
|
16 |
</tr> |
|
17 |
<tr> |
|
18 |
<td>{TEXT_LANGUAGE}:</td> |
|
19 |
<td> |
|
20 |
<select name="language" style="width: 98%;"> |
|
21 |
<!-- BEGIN language_list_block --> |
|
22 |
<option value="{CODE}"{SELECTED}>{NAME} ({CODE})</option> |
|
23 |
<!-- END language_list_block --> |
|
24 |
</select> |
|
25 |
</td> |
|
26 |
</tr> |
|
27 |
<tr> |
|
28 |
<td>{TEXT_TIMEZONE}:</td> |
|
29 |
<td> |
|
30 |
<select name="timezone" style="width: 98%;"> |
|
31 |
<option value="-20">Please select...</option> |
|
32 |
<!-- BEGIN timezone_list_block --> |
|
33 |
<option value="{VALUE}" {SELECTED}>{NAME}</option> |
|
34 |
<!-- END timezone_list_block --> |
|
35 |
</select> |
|
36 |
</td> |
|
37 |
</tr> |
|
38 |
<tr> |
|
39 |
<td>{TEXT_DATE_FORMAT}:</td> |
|
40 |
<td> |
|
41 |
<select name="date_format" style="width: 98%;"> |
|
42 |
<option value="">Please select...</option> |
|
43 |
<!-- BEGIN date_format_list_block --> |
|
44 |
<option value="{VALUE}" {SELECTED}>{NAME}</option> |
|
45 |
<!-- END date_format_list_block --> |
|
46 |
</select> |
|
47 |
</td> |
|
48 |
</tr> |
|
49 |
<tr> |
|
50 |
<td>{TEXT_TIME_FORMAT}:</td> |
|
51 |
<td> |
|
52 |
<select name="time_format" style="width: 98%;"> |
|
53 |
<option value="">Please select...</option> |
|
54 |
<!-- BEGIN time_format_list_block --> |
|
55 |
<option value="{VALUE}" {SELECTED}>{NAME}</option> |
|
56 |
<!-- END time_format_list_block --> |
|
57 |
</select> |
|
58 |
</td> |
|
59 |
</tr> |
|
60 |
<tr> |
|
61 |
<td> </td> |
|
62 |
<td> |
|
63 |
<input type="submit" name="submit" value="{TEXT_SAVE}" /> |
|
64 |
<input type="reset" name="reset" value="{TEXT_RESET}" /> |
|
65 |
</td> |
|
66 |
</tr> |
|
67 |
</table> |
|
68 |
|
|
69 |
</form> |
|
70 |
|
|
71 |
<form name="email" action="email.php" method="post"> |
|
72 |
|
|
73 |
<h2>{HEADING_MY_EMAIL}</h2> |
|
74 |
|
|
75 |
<table cellpadding="5" cellspacing="0" border="0" width="100%"> |
|
76 |
<tr> |
|
77 |
<td width="160">{TEXT_CURRENT_PASSWORD}:</td> |
|
78 |
<td> |
|
79 |
<input type="password" name="current_password" style="width: 98%;" /> |
|
80 |
</td> |
|
81 |
</tr> |
|
82 |
<tr> |
|
83 |
<td>{TEXT_EMAIL}:</td> |
|
84 |
<td> |
|
85 |
<input type="text" name="email" value="{EMAIL}" style="width: 98%;" /> |
|
86 |
</td> |
|
87 |
</tr> |
|
88 |
<tr> |
|
89 |
<td> </td> |
|
90 |
<td> |
|
91 |
<input type="submit" name="submit" value="{TEXT_SAVE}" /> |
|
92 |
<input type="reset" name="reset" value="{TEXT_RESET}" /> |
|
93 |
</td> |
|
94 |
</tr> |
|
95 |
</table> |
|
96 |
|
|
97 |
</form> |
|
98 |
|
|
99 |
<form name="password" action="password.php" method="post"> |
|
100 |
|
|
101 |
<h2 style="margin-top: 20px;">{HEADING_MY_PASSWORD}</h2> |
|
102 |
|
|
103 |
<table cellpadding="5" cellspacing="0" border="0" width="100%"> |
|
104 |
<tr> |
|
105 |
<td width="160">{TEXT_CURRENT_PASSWORD}:</td> |
|
106 |
<td> |
|
107 |
<input type="password" name="current_password" style="width: 98%;" /> |
|
108 |
</td> |
|
109 |
</tr> |
|
110 |
<tr> |
|
111 |
<td width="160">{TEXT_NEW_PASSWORD}:</td> |
|
112 |
<td> |
|
113 |
<input type="password" name="new_password" style="width: 98%;" /> |
|
114 |
</td> |
|
115 |
</tr> |
|
116 |
<tr> |
|
117 |
<td width="160">{TEXT_RETYPE_NEW_PASSWORD}:</td> |
|
118 |
<td> |
|
119 |
<input type="password" name="new_password2" style="width: 98%;" /> |
|
120 |
</td> |
|
121 |
</tr> |
|
122 |
</tr> |
|
123 |
<tr> |
|
124 |
<td> </td> |
|
125 |
<td> |
|
126 |
<input type="submit" name="submit" value="{TEXT_SAVE}" /> |
|
127 |
<input type="reset" name="reset" value="{TEXT_RESET}" /> |
|
128 |
</td> |
|
129 |
</tr> |
|
130 |
</table> |
|
131 |
|
|
132 |
</form> |
|
133 |
|
|
134 |
<!-- END main_block --> |
|
0 | 135 |
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,password 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 |
$old_pass = $results_array['password']; |
|
65 |
|
|
66 |
// Generate a random password then update the database with it |
|
67 |
$new_pass = ''; |
|
68 |
$salt = "abchefghjkmnpqrstuvwxyz0123456789"; |
|
69 |
srand((double)microtime()*1000000); |
|
70 |
$i = 0; |
|
71 |
while ($i <= 7) { |
|
72 |
$num = rand() % 33; |
|
73 |
$tmp = substr($salt, $num, 1); |
|
74 |
$new_pass = $new_pass . $tmp; |
|
75 |
$i++; |
|
76 |
} |
|
77 |
|
|
78 |
$database->query("UPDATE ".TABLE_PREFIX."users SET password = '".md5($new_pass)."', last_reset = '".mktime()."' WHERE user_id = '".$results_array['user_id']."'"); |
|
79 |
|
|
80 |
if($database->is_error()) { |
|
81 |
// Error updating database |
|
82 |
$message = $database->get_error(); |
|
83 |
} else { |
|
84 |
// Setup email to send |
|
85 |
$mail_subject = 'Your login details...'; |
|
86 |
$mail_to = $email; |
|
87 |
$mail_message = ''. |
|
88 |
'Hello '.$results_array["display_name"].', |
|
89 |
|
|
90 |
Your '.$website_title.' administration login details are: |
|
91 |
Username: '.$results_array["username"].' |
|
92 |
Password: '.$new_pass.' |
|
93 |
|
|
94 |
Your password has been reset to the one above. |
|
95 |
This means that your old password will no longer work. |
|
96 |
|
|
97 |
If you have received this message in error, please delete it immediately.'; |
|
98 |
// Try sending the email |
|
99 |
if($admin->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) { |
|
100 |
$message = $MESSAGE['FORGOT_PASS']['PASSWORD_RESET']; |
|
101 |
$display_form = false; |
|
102 |
} else { |
|
103 |
$database->query("UPDATE ".TABLE_PREFIX."users SET password = '".$old_pass."' WHERE user_id = '".$results_array['user_id']."'"); |
|
104 |
$message = $MESSAGE['FORGOT_PASS']['CANNOT_EMAIL']; |
|
105 |
} |
|
106 |
} |
|
107 |
|
|
108 |
} |
|
109 |
|
|
110 |
} else { |
|
111 |
// Email doesn't exist, so tell the user |
|
112 |
$message = $MESSAGE['FORGOT_PASS']['EMAIL_NOT_FOUND']; |
|
113 |
} |
|
114 |
|
|
115 |
} else { |
|
116 |
$email = ''; |
|
117 |
} |
|
118 |
|
|
119 |
if(!isset($message)) { |
|
120 |
$message = $MESSAGE['FORGOT_PASS']['NO_DATA']; |
|
121 |
$message_color = '000000'; |
|
122 |
} else { |
|
123 |
$message_color = 'FF0000'; |
|
124 |
} |
|
125 |
|
|
126 |
// Setup the template |
|
127 |
$template = new Template(ADMIN_PATH.'/login/forgot'); |
|
128 |
$template->set_file('page', 'template.html'); |
|
129 |
$template->set_block('page', 'main_block', 'main'); |
|
130 |
if(defined('FRONTEND')) { |
|
131 |
$template->set_var('ACTION_URL', 'forgot.php'); |
|
132 |
} else { |
|
133 |
$template->set_var('ACTION_URL', 'index.php'); |
|
134 |
} |
|
135 |
$template->set_var('EMAIL', $email); |
|
136 |
|
|
137 |
if(isset($display_form)) { |
|
138 |
$template->set_var('DISPLAY_FORM', 'none'); |
|
139 |
} |
|
140 |
|
|
141 |
$template->set_var(array( |
|
142 |
'SECTION_FORGOT' => $MENU['FORGOT'], |
|
143 |
'MESSAGE_COLOR' => $message_color, |
|
144 |
'MESSAGE' => $message, |
|
145 |
'WB_URL' => WB_URL, |
|
146 |
'ADMIN_URL' => ADMIN_URL, |
|
147 |
'TEXT_EMAIL' => $TEXT['EMAIL'], |
|
148 |
'TEXT_SEND_DETAILS' => $TEXT['SEND_DETAILS'], |
|
149 |
'TEXT_HOME' => $TEXT['HOME'], |
|
150 |
'TEXT_NEED_TO_LOGIN' => $TEXT['NEED_TO_LOGIN'] |
|
151 |
) |
|
152 |
); |
|
153 |
|
|
154 |
if(defined('FRONTEND')) { |
|
155 |
$template->set_var('LOGIN_URL', WB_URL.'/account/login.php'); |
|
156 |
} else { |
|
157 |
$template->set_var('LOGIN_URL', ADMIN_URL); |
|
158 |
} |
|
159 |
$template->set_var('INTERFACE_URL', ADMIN_URL.'/interface'); |
|
160 |
|
|
161 |
if(defined('DEFAULT_CHARSET')) { |
|
162 |
$charset=DEFAULT_CHARSET; |
|
163 |
} else { |
|
164 |
$charset='utf-8'; |
|
165 |
} |
|
166 |
|
|
167 |
$template->set_var('CHARSET', $charset); |
|
168 |
|
|
169 |
$template->parse('main', 'main_block', false); |
|
170 |
$template->pparse('output', 'page'); |
|
171 |
|
|
172 |
?> |
|
0 | 173 |
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 |
<meta http-equiv="content-type" content="text/html; charset={CHARSET}" /> |
|
7 |
<link href="{INTERFACE_URL}/stylesheet.css" rel="stylesheet" type="text/css"> |
|
8 |
</head> |
|
9 |
<body onload="document.forgot_pass.email.focus();"> |
|
10 |
|
|
11 |
<table cellpadding="0" cellspacing="0" border="0" width="770" align="center"> |
|
12 |
<tr> |
|
13 |
<td width="60" valign="top"> |
|
14 |
<img src="{INTERFACE_URL}/logo.png" width="60" height="60" alt="Logo" /> |
|
15 |
</td> |
|
16 |
<td width="5"> </td> |
|
17 |
<td style="font-size: 20px;"> |
|
18 |
<font style="color: #FFFFFF;">Website Baker</font> |
|
19 |
<font style="color: #DDDDDD;">{SECTION_FORGOT}</font> |
|
20 |
</td> |
|
21 |
</tr> |
|
22 |
</table> |
|
23 |
|
|
24 |
<table cellpadding="0" cellspacing="0" border="0" width="770" align="center" style="margin-top: 30px;"> |
|
25 |
<tr> |
|
26 |
<td class="content"> |
|
27 |
|
|
28 |
<form name="forgot_pass" action="{ACTION_URL}" method="post"> |
|
29 |
<input type="hidden" name="url" value="{URL}" /> |
|
30 |
<table cellpadding="5" cellspacing="0" border="0" align="center" width="500"> |
|
31 |
<tr> |
|
32 |
<td height="40" align="center" style="color: #{MESSAGE_COLOR};" colspan="2">{MESSAGE}</td> |
|
33 |
</tr> |
|
34 |
<tr style="display: {DISPLAY_FORM}"> |
|
35 |
<td height="10" colspan="2"></td> |
|
36 |
</tr> |
|
37 |
<tr style="display: {DISPLAY_FORM}"> |
|
38 |
<td width="165" height="30" align="right">{TEXT_EMAIL}:</td> |
|
39 |
<td><input type="text" maxlength="255" name="email" value="{EMAIL}" style="width: 180px;" /></td> |
|
40 |
</tr> |
|
41 |
<tr style="display: {DISPLAY_FORM}" height="30"> |
|
42 |
<td> </td> |
|
43 |
<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> |
|
44 |
</tr> |
|
45 |
<tr style="display: {DISPLAY_FORM}"> |
|
46 |
<td height="10" colspan="2"></td> |
|
47 |
</tr> |
|
48 |
</table> |
|
49 |
</form> |
|
50 |
|
|
51 |
<center> |
|
52 |
<a href="{LOGIN_URL}">{TEXT_NEED_TO_LOGIN}</a> |
|
53 |
<br /> |
|
54 |
<br /> |
|
55 |
<a href="{WB_URL}">{TEXT_HOME}</a> |
|
56 |
</center> |
|
57 |
|
|
58 |
</td> |
|
59 |
</tr> |
|
60 |
</table> |
|
61 |
|
|
62 |
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 10px 0px 10px 0px;"> |
|
63 |
<tr> |
|
64 |
<td align="center" style="font-size: 10px;"> |
|
65 |
<!-- 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. --> |
|
66 |
<a href="http://www.websitebaker.com/" style="color: #000000;" target="_blank">Website Baker</a> |
|
67 |
is released under the |
|
68 |
<a href="http://www.gnu.org/copyleft/gpl.html" style="color: #000000;" target="_blank">GNU General Public License</a> |
|
69 |
<!-- 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. --> |
|
70 |
</td> |
|
71 |
</tr> |
|
72 |
</table> |
|
73 |
|
|
74 |
</body> |
|
75 |
</html> |
|
76 |
<!-- END main_block --> |
|
0 | 77 |
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 |
<meta http-equiv="content-type" content="text/html; charset={CHARSET}" /> |
|
7 |
<link href="{INTERFACE_DIR_URL}/stylesheet.css" rel="stylesheet" type="text/css"> |
|
8 |
</head> |
|
9 |
<body onload="document.login.{USERNAME_FIELDNAME}.focus();"> |
|
10 |
|
|
11 |
<table cellpadding="0" cellspacing="0" border="0" width="770" align="center"> |
|
12 |
<tr> |
|
13 |
<td width="60" valign="top"> |
|
14 |
<img src="{INTERFACE_DIR_URL}/logo.png" width="60" height="60" alt="Logo" /> |
|
15 |
</td> |
|
16 |
<td width="5"> </td> |
|
17 |
<td style="font-size: 20px;"> |
|
18 |
<font style="color: #FFFFFF;">Website Baker</font> |
|
19 |
<font style="color: #DDDDDD;">{SECTION_LOGIN}</font> |
|
20 |
</td> |
|
21 |
</tr> |
|
22 |
</table> |
|
23 |
|
|
24 |
<table cellpadding="0" cellspacing="0" border="0" width="770" align="center" style="margin-top: 30px;"> |
|
25 |
<tr> |
|
26 |
<td class="content"> |
|
27 |
|
|
28 |
<form name="login" action="{ACTION_URL}" method="post"> |
|
29 |
<input type="hidden" name="url" value="{URL}" /> |
|
30 |
<input type="hidden" name="username_fieldname" value="{USERNAME_FIELDNAME}" /> |
|
31 |
<input type="hidden" name="password_fieldname" value="{PASSWORD_FIELDNAME}" /> |
|
32 |
<table cellpadding="5" cellspacing="0" border="0" align="center" width="500"> |
|
33 |
<tr> |
|
34 |
<td height="40" align="center" colspan="2">{MESSAGE}</td> |
|
35 |
</tr> |
|
36 |
<tr> |
|
37 |
<td height="10" colspan="2"></td> |
|
38 |
</tr> |
|
39 |
<tr> |
|
40 |
<td width="170" height="30" align="right">{TEXT_USERNAME}:</td> |
|
41 |
<td><input type="text" maxlength="{MAX_USERNAME_LEN}" name="{USERNAME_FIELDNAME}" value="{USERNAME}" style="width: 180px;" /></td> |
|
42 |
</tr> |
|
43 |
<tr> |
|
44 |
<td width="170" height="30" align="right">{TEXT_PASSWORD}:</td> |
|
45 |
<td><input type="password" maxlength="{MAX_PASSWORD_LEN}" name="{PASSWORD_FIELDNAME}" style="width: 180px;" /></td> |
|
46 |
</tr> |
|
47 |
<tr height="30" style="display: {DISPLAY_REMEMBER_ME};"> |
|
48 |
<td> </td> |
|
49 |
<td> |
|
50 |
<input type="checkbox" name="remember" id="remember" value="true" /> |
|
51 |
<label for="remember"> |
|
52 |
{TEXT_REMEMBER_ME} |
|
53 |
</label> |
|
54 |
</td> |
|
55 |
</tr> |
|
56 |
<tr height="30"> |
|
57 |
<td> </td> |
|
58 |
<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> |
|
59 |
</tr> |
|
60 |
<tr> |
|
61 |
<td height="10" colspan="2"></td> |
|
62 |
</tr> |
|
63 |
</table> |
|
64 |
</form> |
|
65 |
|
|
66 |
<center> |
|
67 |
<a href="{FORGOTTEN_DETAILS_APP}">{TEXT_FORGOTTEN_DETAILS}</a> |
|
68 |
<br /> |
|
69 |
<br /> |
|
70 |
<br /> |
|
71 |
<a href="{WB_URL}{PAGES_DIRECTORY}/">{TEXT_HOME}</a> |
|
72 |
</center> |
|
73 |
|
|
74 |
</td> |
|
75 |
</tr> |
|
76 |
</table> |
|
77 |
|
|
78 |
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding: 10px 0px 10px 0px;"> |
|
79 |
<tr> |
|
80 |
<td align="center" style="font-size: 10px;"> |
|
81 |
<!-- 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. --> |
|
82 |
<a href="http://www.websitebaker.com/" style="color: #000000;" target="_blank">Website Baker</a> |
|
83 |
is released under the |
|
84 |
<a href="http://www.gnu.org/copyleft/gpl.html" style="color: #000000;" target="_blank">GNU General Public License</a> |
|
85 |
<!-- 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. --> |
|
86 |
</td> |
|
87 |
</tr> |
|
88 |
</table> |
|
89 |
|
|
90 |
</body> |
|
91 |
</html> |
|
92 |
<!-- END mainBlock --> |
|
0 | 93 |
branches/2.6.x/wb/admin/login/index.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
6 |
|
|
7 |
Website Baker Project <http://www.websitebaker.org/> |
|
8 |
Copyright (C) 2004-2006, 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/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/interface/version.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
// $Id$ |
|
4 |
|
|
5 |
/* |
|
6 |
|
|
7 |
Website Baker Project <http://www.websitebaker.org/> |
|
8 |
Copyright (C) 2004-2006, 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 |
exit(0); |
|
37 |
} |
|
38 |
|
|
39 |
define('VERSION', '2.6.4'); |
|
40 |
|
|
41 |
?> |
|
0 | 42 |
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-2006, 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 |
exit(0); |
|
37 |
} |
|
38 |
|
|
39 |
// Define that this file is loaded |
|
40 |
if(!defined('TIME_FORMATS_LOADED')) { |
|
41 |
define('TIME_FORMATS_LOADED', true); |
|
42 |
} |
|
43 |
|
|
44 |
// Create array |
|
45 |
$TIME_FORMATS = array(); |
|
46 |
|
|
47 |
// Get the current time (in the users timezone if required) |
|
48 |
if(isset($user_time) AND $user_time == true) { |
|
49 |
$mktime = mktime()+TIMEZONE; |
|
50 |
} else { |
|
51 |
$mktime = mktime()+DEFAULT_TIMEZONE; |
|
52 |
} |
|
53 |
|
|
54 |
// Add values to list |
|
55 |
$TIME_FORMATS['g:i|A'] = gmdate('g:i A', $mktime); |
|
56 |
$TIME_FORMATS['g:i|a'] = gmdate('g:i a', $mktime); |
|
57 |
$TIME_FORMATS['H:i:s'] = gmdate('H:i:s', $mktime); |
|
58 |
$TIME_FORMATS['H:i'] = gmdate('H:i', $mktime); |
|
59 |
|
|
60 |
// Add "System Default" to list (if we need to) |
|
61 |
if(isset($user_time) AND $user_time == true) { |
|
62 |
if(isset($TEXT['SYSTEM_DEFAULT'])) { |
|
63 |
$TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $mktime).' ('.$TEXT['SYSTEM_DEFAULT'].')'; |
|
64 |
} else { |
|
65 |
$TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $mktime).' (System Default)'; |
|
66 |
} |
|
67 |
} |
|
68 |
|
|
69 |
// Reverse array so "System Default" is at the top |
|
70 |
$TIME_FORMATS = array_reverse($TIME_FORMATS, true); |
|
71 |
|
|
72 |
?> |
|
0 | 73 |
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-2006, 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 |
exit(0); |
|
37 |
} |
|
38 |
|
|
39 |
// Create array |
|
40 |
$CHARSETS = array(); |
|
41 |
$CHARSETS['utf-8'] = 'Unicode (utf-8)'; |
|
42 |
$CHARSETS['iso-8859-1'] = 'Latin-1 Western European (iso-8859-1)'; |
|
43 |
$CHARSETS['iso-8859-2'] = 'Latin-2 Central European (iso-8859-2)'; |
|
44 |
$CHARSETS['iso-8859-3'] = 'Latin-3 Southern European (iso-8859-3)'; |
|
45 |
$CHARSETS['iso-8859-4'] = 'Latin-4 Baltic (iso-8859-4)'; |
|
46 |
$CHARSETS['iso-8859-5'] = 'Cyrillic (iso-8859-5)'; |
|
47 |
$CHARSETS['iso-8859-6'] = 'Arabic (iso-8859-6)'; |
|
48 |
$CHARSETS['iso-8859-7'] = 'Greek (iso-8859-7)'; |
|
49 |
$CHARSETS['iso-8859-8'] = 'Hebrew (iso-8859-8)'; |
|
50 |
$CHARSETS['iso-8859-9'] = 'Latin-5 Turkish (iso-8859-9)'; |
|
51 |
$CHARSETS['iso-8859-10'] = 'Latin-6 Nordic (iso-8859-10)'; |
|
52 |
$CHARSETS['iso-8859-11'] = 'Thai (iso-8859-11)'; |
|
53 |
$CHARSETS['gb2312'] = 'Chinese Simplified (gb2312)'; |
|
54 |
$CHARSETS['big5'] = 'Chinese Traditional (big5)'; |
|
55 |
$CHARSETS['iso-2022-jp'] = 'Japanese (iso-2022-jp)'; |
|
56 |
$CHARSETS['iso-2022-kr'] = 'Korean (iso-2022-kr)'; |
|
57 |
|
|
58 |
?> |
|
0 | 59 |
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-2006, 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 |
exit(0); |
|
37 |
} |
|
38 |
|
|
39 |
// Create array |
|
40 |
$TIMEZONES = array(); |
|
41 |
|
|
42 |
// Add "System Default" to top of list |
|
43 |
if(isset($TEXT['SYSTEM_DEFAULT'])) { |
|
44 |
$TIMEZONES['-20'] = $TEXT['SYSTEM_DEFAULT']; |
|
45 |
} else { |
|
46 |
$TIMEZONES['-20'] = 'System Default'; |
|
47 |
} |
|
48 |
|
|
49 |
$TIMEZONES['-12'] = 'GMT - 12 Hours'; |
|
50 |
$TIMEZONES['-11'] = 'GMT -11 Hours'; |
|
51 |
$TIMEZONES['-10'] = 'GMT -10 Hours'; |
|
52 |
$TIMEZONES['-9'] = 'GMT -9 Hours'; |
|
53 |
$TIMEZONES['-8'] = 'GMT -8 Hours'; |
|
54 |
$TIMEZONES['-7'] = 'GMT -7 Hours'; |
|
55 |
$TIMEZONES['-6'] = 'GMT -6 Hours'; |
|
56 |
$TIMEZONES['-5'] = 'GMT -5 Hours'; |
|
57 |
$TIMEZONES['-4'] = 'GMT -4 Hours'; |
|
58 |
$TIMEZONES['-3.5'] = 'GMT -3.5 Hours'; |
|
59 |
$TIMEZONES['-3'] = 'GMT -3 Hours'; |
|
60 |
$TIMEZONES['-2'] = 'GMT -2 Hours'; |
|
61 |
$TIMEZONES['-1'] = 'GMT -1 Hour'; |
|
62 |
$TIMEZONES['0'] = 'GMT'; |
|
63 |
$TIMEZONES['1'] = 'GMT +1 Hour'; |
|
64 |
$TIMEZONES['2'] = 'GMT +2 Hours'; |
|
65 |
$TIMEZONES['3'] = 'GMT +3 Hours'; |
|
66 |
$TIMEZONES['3.5'] = 'GMT +3.5 Hours'; |
|
67 |
$TIMEZONES['4'] = 'GMT +4 Hours'; |
|
68 |
$TIMEZONES['4.5'] = 'GMT +4.5 Hours'; |
|
69 |
$TIMEZONES['5'] = 'GMT +5 Hours'; |
|
70 |
$TIMEZONES['5.5'] = 'GMT +5.5 Hours'; |
|
71 |
$TIMEZONES['6'] = 'GMT +6 Hours'; |
|
72 |
$TIMEZONES['6.5'] = 'GMT +6.5 Hours'; |
|
73 |
$TIMEZONES['7'] = 'GMT +7 Hours'; |
|
74 |
$TIMEZONES['8'] = 'GMT +8 Hours'; |
|
75 |
$TIMEZONES['9'] = 'GMT +9 Hours'; |
|
76 |
$TIMEZONES['9.5'] = 'GMT +9.5 Hours'; |
|
77 |
$TIMEZONES['10'] = 'GMT +10 Hours'; |
|
78 |
$TIMEZONES['11'] = 'GMT +11 Hours'; |
|
79 |
$TIMEZONES['12'] = 'GMT +12 Hours'; |
|
80 |
$TIMEZONES['13'] = 'GMT +13 Hours'; |
|
81 |
|
|
82 |
?> |
|
0 | 83 |
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-2006, 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 |
exit(0); |
|
38 |
} |
|
39 |
|
|
40 |
// Define that this file is loaded |
|
41 |
if(!defined('ERROR_REPORTING_LEVELS_LOADED')) { |
|
42 |
define('ERROR_REPORTING_LEVELS_LOADED', true); |
|
43 |
} |
|
44 |
|
|
45 |
// Create array |
|
46 |
$ER_LEVELS = array(); |
|
47 |
|
|
48 |
// Add values to list |
|
49 |
if(isset($TEXT['SYSTEM_DEFAULT'])) { |
|
50 |
$ER_LEVELS[''] = $TEXT['SYSTEM_DEFAULT']; |
|
51 |
} else { |
|
52 |
$ER_LEVELS[''] = 'System Default'; |
|
53 |
} |
|
54 |
$ER_LEVELS['E_ERROR'] = 'E_ERROR'; |
|
55 |
$ER_LEVELS['E_WARNING'] = 'E_WARNING'; |
|
56 |
$ER_LEVELS['E_PARSE'] = 'E_PARSE'; |
|
57 |
$ER_LEVELS['E_NOTICE'] = 'E_NOTICE'; |
|
58 |
$ER_LEVELS['E_CORE_ERROR'] = 'E_CORE_ERROR'; |
|
59 |
$ER_LEVELS['E_CORE_WARNING'] = 'E_CORE_WARNING'; |
|
60 |
$ER_LEVELS['E_COMPILE_ERROR'] = 'E_COMPILE_ERROR'; |
|
61 |
$ER_LEVELS['E_COMPILE_WARNING'] = 'E_COMPILE_WARNING'; |
|
62 |
$ER_LEVELS['E_USER_ERROR'] = 'E_USER_ERROR'; |
|
63 |
$ER_LEVELS['E_USER_WARNING'] = 'E_USER_WARNING'; |
|
64 |
$ER_LEVELS['E_USER_NOTICE'] = 'E_USER_NOTICE'; |
|
65 |
$ER_LEVELS['E_ALL'] = 'E_ALL'; |
|
66 |
$ER_LEVELS['E_STRICT'] = 'E_STRICT'; |
|
67 |
|
Also available in: Unified diff
Creating 2.6.x branch