Revision 1509
Added by Dietmar about 13 years ago
branches/2.8.x/CHANGELOG | ||
---|---|---|
12 | 12 |
|
13 | 13 |
=============================== FEATURES FREEZE ================================ |
14 | 14 |
----------------------------------- Fixes 2.8.2 -------------------------------- |
15 |
07 Sep-2011 Build 1509 Dietmar Woellbrink (Luisehahne) |
|
16 |
# continue fixing frontend account |
|
15 | 17 |
07 Sep-2011 Build 1508 Dietmar Woellbrink (Luisehahne) |
16 | 18 |
# fixed print_error exit in frontend account |
17 | 19 |
06 Sep-2011 Build 1507 Dietmar Woellbrink (Luisehahne) |
branches/2.8.x/wb/admin/interface/version.php | ||
---|---|---|
52 | 52 |
|
53 | 53 |
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled) |
54 | 54 |
if(!defined('VERSION')) define('VERSION', '2.8.2'); |
55 |
if(!defined('REVISION')) define('REVISION', '1508'); |
|
55 |
if(!defined('REVISION')) define('REVISION', '1509'); |
branches/2.8.x/wb/admin/preferences/index.php | ||
---|---|---|
108 | 108 |
// assign systemvars to template |
109 | 109 |
$template->set_var(array( 'ADMIN_URL' => ADMIN_URL, |
110 | 110 |
'WB_URL' => WB_URL, |
111 |
'WB_PATH' => WB_PATH, |
|
112 | 111 |
'THEME_URL' => THEME_URL, |
113 | 112 |
'ACTION_URL' => ADMIN_URL.'/preferences/save.php' |
114 | 113 |
) |
branches/2.8.x/wb/account/frontend.css | ||
---|---|---|
1 |
/* <![CDATA[ */ |
|
2 |
/* |
|
3 |
CSS definition for Website Baker module: WB-Preferences |
|
4 |
Copyright (C) 2008, Werner von der Decken |
|
5 |
Contact me: wkl(at)isteam.de, http://isteam.de |
|
6 |
|
|
7 |
This CSS file is free software. You can redistribute it and/or modify it |
|
8 |
under the terms of the GNU General Public License - version 2 or later, |
|
9 |
as published by the Free Software Foundation: http://www.gnu.org/licenses/gpl.html. |
|
10 |
|
|
11 |
This CSS file is distributed in the hope that it will be useful, |
|
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
GNU General Public License for more details. |
|
15 |
*/ |
|
16 |
.mod_preferences_error { |
|
17 |
background-color:#ffb0b0; |
|
18 |
padding:5px; |
|
19 |
border:dotted 1px #ff0000; |
|
20 |
color:#ff0000; |
|
21 |
} |
|
22 |
.mod_preferences_success { |
|
23 |
background-color:#b0ffb0; |
|
24 |
padding:5px; |
|
25 |
border:dotted 1px #303030; |
|
26 |
color:#303030; |
|
27 |
} |
|
28 |
/* ]]> */ |
|
0 | 29 |
branches/2.8.x/wb/account/forgot_form.php | ||
---|---|---|
101 | 101 |
} else { |
102 | 102 |
$message_color = 'FF0000'; |
103 | 103 |
} |
104 |
|
|
105 |
$_SESSION['PAGE_LINK'] = get_page_link( $_SESSION['PAGE_ID'] ); |
|
106 |
$_SESSION['HTTP_REFERER'] = page_link($_SESSION['PAGE_LINK']); |
|
104 | 107 |
|
105 | 108 |
?> |
109 |
<div style="margin: 1em auto;"> |
|
110 |
<button type="button" value="cancel" onClick="javascript: window.location = '<?php print $_SESSION['HTTP_REFERER'] ?>';"><?php print $TEXT['CANCEL'] ?></button> |
|
111 |
</div> |
|
106 | 112 |
<h1 style="text-align: center;"><?php echo $MENU['FORGOT']; ?></h1> |
107 | 113 |
|
108 | 114 |
<form name="forgot_pass" action="<?php echo WB_URL.'/account/forgot.php'; ?>" method="post"> |
branches/2.8.x/wb/account/preferences_form.php | ||
---|---|---|
73 | 73 |
$template->set_var('DISPLAY_NAME', $row['display_name']); |
74 | 74 |
$template->set_var('EMAIL', $row['email']); |
75 | 75 |
|
76 |
// Insert language values |
|
77 |
$template->set_block('main_block', 'language_list_block', 'language_list'); |
|
78 |
$sql = "SELECT * FROM ".TABLE_PREFIX."addons WHERE type = 'language' order by name"; |
|
79 |
$rowset = $database->query($sql); |
|
80 |
if($rowset->numRows() > 0) { |
|
81 |
while($row = $rowset->fetchRow()) { |
|
82 |
$l_codes[$row['name']] = $row['directory']; |
|
83 |
$l_names[$row['name']] = entities_to_7bit($row['name']); // sorting-problem workaround |
|
84 |
} |
|
85 |
asort($l_names); |
|
86 |
foreach($l_names as $l_name=>$v) { |
|
87 |
// Insert code and name |
|
88 |
$template->set_var(array( 'CODE' => $l_codes[$l_name], 'NAME' => $l_name )); |
|
89 |
// Check if it is selected |
|
90 |
if(LANGUAGE == $l_codes[$l_name]) { |
|
91 |
$template->set_var('SELECTED', ' selected="selected"'); |
|
92 |
} else { |
|
93 |
$template->set_var('SELECTED', ''); |
|
94 |
} |
|
76 |
// read available languages from table addons and assign it to the template |
|
77 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'addons` '; |
|
78 |
$sql .= 'WHERE `type` = \'language\' ORDER BY `directory`'; |
|
79 |
if( $res_lang = $database->query($sql) ) |
|
80 |
{ |
|
81 |
$template->set_block('main_block', 'language_list_block', 'language_list'); |
|
82 |
while( $rec_lang = $res_lang->fetchRow() ) |
|
83 |
{ |
|
84 |
$langIcons = (empty($rec_lang['directory'])) ? 'none' : strtolower($rec_lang['directory']); |
|
85 |
$template->set_var('CODE', $rec_lang['directory']); |
|
86 |
$template->set_var('NAME', $rec_lang['name']); |
|
87 |
$template->set_var('FLAG', THEME_URL.'/images/flags/'.$langIcons); |
|
88 |
$template->set_var('SELECTED', (LANGUAGE == $rec_lang['directory'] ? ' selected="selected"' : '') ); |
|
95 | 89 |
$template->parse('language_list', 'language_list_block', true); |
96 | 90 |
} |
97 | 91 |
} |
98 |
|
|
99 | 92 |
// Insert default timezone values |
100 | 93 |
$template->set_block('main_block', 'timezone_list_block', 'timezone_list'); |
101 | 94 |
foreach($TIMEZONES AS $hour_offset => $title) { |
branches/2.8.x/wb/account/details.php | ||
---|---|---|
19 | 19 |
// Must include code to stop this file being access directly |
20 | 20 |
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); } |
21 | 21 |
|
22 |
// Create a javascript back link |
|
23 |
$js_back = WB_URL.'/account/preferences.php'; |
|
24 |
/* |
|
25 |
if (!$wb->checkFTAN()) |
|
26 |
{ |
|
27 |
$wb->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back); |
|
28 |
exit(); |
|
29 |
} |
|
30 |
*/ |
|
31 |
// Get and sanitize entered values |
|
32 |
$display_name = $wb->add_slashes(strip_tags($wb->get_post('display_name'))); |
|
33 |
$language = strtoupper($wb->get_post('language')); |
|
34 |
$language = (preg_match('/^[A-Z]{2}$/', $language) ? $language : DEFAULT_LANGUAGE); |
|
35 |
$timezone = (int) $wb->get_post_escaped('timezone')*60*60; |
|
22 |
// Get entered values |
|
23 |
$display_name = $wb->add_slashes(strip_tags($admin->get_post('display_name'))); |
|
24 |
$language = $wb->get_post('language'); |
|
25 |
$timezone = $wb->get_post('timezone')*60*60; |
|
26 |
$date_format = $wb->get_post('date_format'); |
|
27 |
$time_format = $wb->get_post('time_format'); |
|
36 | 28 |
|
37 |
// date_format must be a key from /interface/date_formats |
|
38 |
$date_format = $wb->get_post('date_format'); |
|
39 |
$date_format_key = str_replace(' ', '|', $date_format); |
|
40 |
$user_time = true; |
|
41 |
include( ADMIN_PATH.'/interface/date_formats.php' ); |
|
42 |
$date_format = (array_key_exists($date_format_key, $DATE_FORMATS) ? $date_format : 'system_default'); |
|
43 |
$date_format = ($date_format == 'system_default' ? '' : $date_format); |
|
44 |
unset($DATE_FORMATS); |
|
45 |
|
|
46 |
// time_format must be a key from /interface/time_formats |
|
47 |
$time_format = $wb->get_post('time_format'); |
|
48 |
$time_format_key = str_replace(' ', '|', $time_format); |
|
49 |
$user_time = true; |
|
50 |
include( ADMIN_PATH.'/interface/time_formats.php' ); |
|
51 |
$time_format = (array_key_exists($time_format_key, $TIME_FORMATS) ? $time_format : 'system_default'); |
|
52 |
$time_format = ($time_format == 'system_default' ? '' : $time_format); |
|
53 |
unset($TIME_FORMATS); |
|
54 |
|
|
55 | 29 |
// Update the database |
56 | 30 |
// $database = new database(); |
57 |
$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 = '".$wb->get_user_id()."'"; |
|
58 |
$database->query($query); |
|
59 |
if($database->is_error()) { |
|
60 |
$wb->print_error($database->get_error,$js_back,false); |
|
61 |
} else { |
|
62 |
$wb->print_success($MESSAGE['PREFERENCES']['DETAILS_SAVED'] ); |
|
63 |
$_SESSION['DISPLAY_NAME'] = $display_name; |
|
64 |
$_SESSION['LANGUAGE'] = $language; |
|
65 |
// Update date format |
|
66 |
if($date_format != '') { |
|
67 |
$_SESSION['DATE_FORMAT'] = $date_format; |
|
68 |
if(isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) { unset($_SESSION['USE_DEFAULT_DATE_FORMAT']); } |
|
31 |
$sql = "UPDATE `".TABLE_PREFIX."users` SET "; |
|
32 |
$sql .= "`display_name` = '".$display_name."', `language` = '".$language."', "; |
|
33 |
$sql .= "`timezone` = '".$timezone."', `date_format` = '".$date_format."', "; |
|
34 |
$sql .= "`time_format` = '".$time_format."' "; |
|
35 |
$sql .= "WHERE `user_id` = '".$wb->get_user_id()."'"; |
|
36 |
$database->query($sql); |
|
37 |
if($database->is_error()) { |
|
38 |
$error[] = $database->get_error(); |
|
69 | 39 |
} else { |
70 |
$_SESSION['USE_DEFAULT_DATE_FORMAT'] = true; |
|
71 |
if(isset($_SESSION['DATE_FORMAT'])) { unset($_SESSION['DATE_FORMAT']); } |
|
72 |
} |
|
73 |
// Update time format |
|
74 |
if($time_format != '') { |
|
75 |
$_SESSION['TIME_FORMAT'] = $time_format; |
|
76 |
if(isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) { unset($_SESSION['USE_DEFAULT_TIME_FORMAT']); } |
|
77 |
} else { |
|
78 |
$_SESSION['USE_DEFAULT_TIME_FORMAT'] = true; |
|
79 |
if(isset($_SESSION['TIME_FORMAT'])) { unset($_SESSION['TIME_FORMAT']); } |
|
80 |
} |
|
81 |
// Update timezone |
|
82 |
if($timezone != '-72000') { |
|
40 |
$success[] = $MOD_PREFERENCE['DETAILS_SAVED']; |
|
41 |
$_SESSION['DISPLAY_NAME'] = $display_name; |
|
42 |
$_SESSION['LANGUAGE'] = $language; |
|
83 | 43 |
$_SESSION['TIMEZONE'] = $timezone; |
84 |
if(isset($_SESSION['USE_DEFAULT_TIMEZONE'])) { unset($_SESSION['USE_DEFAULT_TIMEZONE']); } |
|
85 |
} else { |
|
86 |
$_SESSION['USE_DEFAULT_TIMEZONE'] = true; |
|
87 |
if(isset($_SESSION['TIMEZONE'])) { unset($_SESSION['TIMEZONE']); } |
|
44 |
// Update date format |
|
45 |
if($date_format != '') { |
|
46 |
$_SESSION['DATE_FORMAT'] = $date_format; |
|
47 |
if(isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) { unset($_SESSION['USE_DEFAULT_DATE_FORMAT']); } |
|
48 |
} else { |
|
49 |
$_SESSION['USE_DEFAULT_DATE_FORMAT'] = true; |
|
50 |
if(isset($_SESSION['DATE_FORMAT'])) { unset($_SESSION['DATE_FORMAT']); } |
|
51 |
} |
|
52 |
// Update time format |
|
53 |
if($time_format != '') { |
|
54 |
$_SESSION['TIME_FORMAT'] = $time_format; |
|
55 |
if(isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) { unset($_SESSION['USE_DEFAULT_TIME_FORMAT']); } |
|
56 |
} else { |
|
57 |
$_SESSION['USE_DEFAULT_TIME_FORMAT'] = true; |
|
58 |
if(isset($_SESSION['TIME_FORMAT'])) { unset($_SESSION['TIME_FORMAT']); } |
|
59 |
} |
|
88 | 60 |
} |
89 |
} |
branches/2.8.x/wb/account/email.php | ||
---|---|---|
19 | 19 |
// Must include code to stop this file being access directly |
20 | 20 |
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); } |
21 | 21 |
|
22 |
// Get the values entered |
|
23 |
$current_password = $wb->get_post('current_password'); |
|
24 |
$email = $wb->get_post('email'); |
|
25 |
|
|
26 |
// Create a javascript back link |
|
27 |
$js_back = WB_URL.'/account/preferences.php'; |
|
28 |
/* |
|
29 |
if (!$wb->checkFTAN()) |
|
30 |
{ |
|
31 |
$wb->print_error($MESSAGE['GENERIC_SECURITY_ACCESS'], $js_back, false); |
|
32 |
exit(); |
|
33 |
} |
|
34 |
*/ |
|
35 |
// Get existing password |
|
36 |
// $database = new database(); |
|
37 |
$query = "SELECT user_id FROM ".TABLE_PREFIX."users WHERE user_id = '".$wb->get_user_id()."' AND password = '".md5($current_password)."'"; |
|
38 |
$results = $database->query($query); |
|
39 |
|
|
22 |
// Get entered values |
|
23 |
$password = $wb->get_post('current_password'); |
|
24 |
$email = $wb->get_post('email'); |
|
25 |
// validate password |
|
26 |
$sql = "SELECT `user_id` FROM `".TABLE_PREFIX."users` "; |
|
27 |
$sql .= "WHERE `user_id` = ".$wb->get_user_id()." AND `password` = '".md5($password)."'"; |
|
28 |
$rowset = $database->query($sql); |
|
40 | 29 |
// Validate values |
41 |
if($results->numRows() == 0) { |
|
42 |
$wb->print_error($MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT'], $js_back, false); |
|
43 |
} |
|
44 |
// Validate values |
|
45 |
if(!$wb->validate_email($email)) { |
|
46 |
$wb->print_error($MESSAGE['USERS']['INVALID_EMAIL'], $js_back, false); |
|
47 |
} |
|
48 |
|
|
49 |
$email = $wb->add_slashes($email); |
|
50 |
|
|
30 |
if($rowset->numRows() == 0) { |
|
31 |
$error[] = $MESSAGE['PREFERENCES']['CURRENT_PASSWORD_INCORRECT']; |
|
32 |
}else { |
|
33 |
if(!$wb->validate_email($email)) { |
|
34 |
$error[] = $MESSAGE['USERS']['INVALID_EMAIL']; |
|
35 |
}else { |
|
36 |
$email = $wb->add_slashes($email); |
|
51 | 37 |
// Update the database |
52 |
// $database = new database(); |
|
53 |
$query = "UPDATE ".TABLE_PREFIX."users SET email = '$email' WHERE user_id = '".$wb->get_user_id()."' AND password = '".md5($current_password)."'"; |
|
54 |
$database->query($query); |
|
55 |
if($database->is_error()) { |
|
56 |
$wb->print_error($database->get_error,$js_back, false); |
|
57 |
} else { |
|
58 |
$wb->print_success($MESSAGE['PREFERENCES']['EMAIL_UPDATED']); |
|
59 |
$_SESSION['EMAIL'] = $email; |
|
60 |
} |
|
38 |
$sql = "UPDATE `".TABLE_PREFIX."users` SET `email` = '".$email."' WHERE `user_id` = ".$wb->get_user_id(); |
|
39 |
$database->query($sql); |
|
40 |
if($database->is_error()) { |
|
41 |
$error[] = $database->get_error(); |
|
42 |
} else { |
|
43 |
$success[] = $MESSAGE['PREFERENCES']['EMAIL_UPDATED']; |
|
44 |
$_SESSION['EMAIL'] = $email; |
|
45 |
} |
|
46 |
} |
|
47 |
} |
branches/2.8.x/wb/account/template.html | ||
---|---|---|
26 | 26 |
<tr> |
27 | 27 |
<td>{TEXT_LANGUAGE}:</td> |
28 | 28 |
<td> |
29 |
<select name="language" style="width: 98%;">
|
|
30 |
<!-- BEGIN language_list_block --> |
|
31 |
<option value="{CODE}"{SELECTED}>{NAME} ({CODE})</option>
|
|
32 |
<!-- END language_list_block --> |
|
29 |
<select name="language" id="language">
|
|
30 |
<!-- BEGIN language_list_block -->
|
|
31 |
<option value="{CODE}"{SELECTED} style="background: url({FLAG}.png) no-repeat center left; padding-left: 20px;">{NAME} ({CODE})</option>
|
|
32 |
<!-- END language_list_block -->
|
|
33 | 33 |
</select> |
34 | 34 |
</td> |
35 | 35 |
</tr> |
Also available in: Unified diff
continue fixing frontend account