1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category frontend
|
5
|
* @package account
|
6
|
* @author WebsiteBaker Project
|
7
|
* @copyright 2004-2009, Ryan Djurovich
|
8
|
* @copyright 2009-2011, Website Baker Org. e.V.
|
9
|
* @link http://www.websitebaker2.org/
|
10
|
* @license http://www.gnu.org/licenses/gpl.html
|
11
|
* @platform WebsiteBaker 2.8.x
|
12
|
* @requirements PHP 5.2.2 and higher
|
13
|
* @version $Id: details.php 1792 2012-10-24 00:43:00Z Luisehahne $
|
14
|
* @filesource $HeadURL: svn://isteam.dynxs.de/wb-archiv/branches/2.8.x/wb/account/details.php $
|
15
|
* @lastmodified $Date: 2012-10-24 02:43:00 +0200 (Wed, 24 Oct 2012) $
|
16
|
*
|
17
|
*/
|
18
|
|
19
|
/* -------------------------------------------------------- */
|
20
|
// Must include code to stop this file being accessed directly
|
21
|
if(!defined('WB_PATH')) {
|
22
|
require_once(dirname(dirname(__FILE__)).'/framework/globalExceptionHandler.php');
|
23
|
throw new IllegalFileException();
|
24
|
}
|
25
|
/* -------------------------------------------------------- */
|
26
|
|
27
|
// Get entered values
|
28
|
$display_name = strip_tags($wb->StripCodeFromText($wb->get_post('display_name')));
|
29
|
$sUserLanguage = strip_tags($wb->StripCodeFromText($wb->get_post('language')));
|
30
|
$timezone = intval($wb->StripCodeFromText($wb->get_post('timezone')))*60*60;
|
31
|
$date_format = strip_tags($wb->StripCodeFromText($wb->get_post('date_format')));
|
32
|
$time_format = strip_tags($wb->StripCodeFromText($wb->get_post('time_format')));
|
33
|
|
34
|
// Update the database
|
35
|
$sql = "UPDATE `".TABLE_PREFIX."users` SET ";
|
36
|
$sql .= "`display_name` = '".$display_name."', `language` = '".$sUserLanguage."', ";
|
37
|
$sql .= "`timezone` = '".$timezone."', `date_format` = '".$date_format."', ";
|
38
|
$sql .= "`time_format` = '".$time_format."' ";
|
39
|
$sql .= "WHERE `user_id` = '".$wb->get_user_id()."'";
|
40
|
$database->query($sql);
|
41
|
if($database->is_error()) {
|
42
|
$error[] = $database->get_error();
|
43
|
} else {
|
44
|
$success[] = $MOD_PREFERENCE['DETAILS_SAVED'];
|
45
|
$_SESSION['DISPLAY_NAME'] = $display_name;
|
46
|
$_SESSION['LANGUAGE'] = $sUserLanguage;
|
47
|
$_SESSION['TIME_FORMAT'] = $time_format;
|
48
|
$_SESSION['DATE_FORMAT'] = $date_format;
|
49
|
$_SESSION['TIMEZONE'] = $timezone;
|
50
|
// Update date format
|
51
|
if($date_format != '') {
|
52
|
$_SESSION['DATE_FORMAT'] = $date_format;
|
53
|
if(isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) { unset($_SESSION['USE_DEFAULT_DATE_FORMAT']); }
|
54
|
} else {
|
55
|
$_SESSION['USE_DEFAULT_DATE_FORMAT'] = true;
|
56
|
if(isset($_SESSION['DATE_FORMAT'])) { unset($_SESSION['DATE_FORMAT']); }
|
57
|
}
|
58
|
// Update time format
|
59
|
if($time_format != '') {
|
60
|
$_SESSION['TIME_FORMAT'] = $time_format;
|
61
|
if(isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) { unset($_SESSION['USE_DEFAULT_TIME_FORMAT']); }
|
62
|
} else {
|
63
|
$_SESSION['USE_DEFAULT_TIME_FORMAT'] = true;
|
64
|
if(isset($_SESSION['TIME_FORMAT'])) { unset($_SESSION['TIME_FORMAT']); }
|
65
|
}
|
66
|
}
|