| 1 |
1386
|
Luisehahne
|
<?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$
|
| 14 |
|
|
* @filesource $HeadURL$
|
| 15 |
|
|
* @lastmodified $Date$
|
| 16 |
|
|
*
|
| 17 |
|
|
*/
|
| 18 |
|
|
|
| 19 |
1420
|
Luisehahne
|
// Must include code to stop this file being access directly
|
| 20 |
|
|
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
|
| 21 |
1386
|
Luisehahne
|
|
| 22 |
1509
|
Luisehahne
|
// 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');
|
| 28 |
1386
|
Luisehahne
|
|
| 29 |
|
|
// Update the database
|
| 30 |
|
|
// $database = new database();
|
| 31 |
1509
|
Luisehahne
|
$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();
|
| 39 |
1386
|
Luisehahne
|
} else {
|
| 40 |
1509
|
Luisehahne
|
$success[] = $MOD_PREFERENCE['DETAILS_SAVED'];
|
| 41 |
|
|
$_SESSION['DISPLAY_NAME'] = $display_name;
|
| 42 |
|
|
$_SESSION['LANGUAGE'] = $language;
|
| 43 |
1386
|
Luisehahne
|
$_SESSION['TIMEZONE'] = $timezone;
|
| 44 |
1599
|
Luisehahne
|
$_SESSION['HTTP_REFERER'] = (($_SESSION['LANGUAGE']== LANGUAGE) ? $_SESSION['HTTP_REFERER'] : WB_URL);
|
| 45 |
1509
|
Luisehahne
|
// Update date format
|
| 46 |
|
|
if($date_format != '') {
|
| 47 |
|
|
$_SESSION['DATE_FORMAT'] = $date_format;
|
| 48 |
|
|
if(isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) { unset($_SESSION['USE_DEFAULT_DATE_FORMAT']); }
|
| 49 |
|
|
} else {
|
| 50 |
|
|
$_SESSION['USE_DEFAULT_DATE_FORMAT'] = true;
|
| 51 |
|
|
if(isset($_SESSION['DATE_FORMAT'])) { unset($_SESSION['DATE_FORMAT']); }
|
| 52 |
|
|
}
|
| 53 |
|
|
// Update time format
|
| 54 |
|
|
if($time_format != '') {
|
| 55 |
|
|
$_SESSION['TIME_FORMAT'] = $time_format;
|
| 56 |
|
|
if(isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) { unset($_SESSION['USE_DEFAULT_TIME_FORMAT']); }
|
| 57 |
|
|
} else {
|
| 58 |
|
|
$_SESSION['USE_DEFAULT_TIME_FORMAT'] = true;
|
| 59 |
|
|
if(isset($_SESSION['TIME_FORMAT'])) { unset($_SESSION['TIME_FORMAT']); }
|
| 60 |
|
|
}
|
| 61 |
1386
|
Luisehahne
|
}
|