2011-08-31 22:20:46 +04:00
|
|
|
<?php
|
2011-09-24 00:59:24 +04:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
2011-08-31 22:20:46 +04:00
|
|
|
|
|
|
|
// Init owncloud
|
|
|
|
require_once('../../../lib/base.php');
|
|
|
|
|
|
|
|
$l=new OC_L10N('calendar');
|
|
|
|
|
|
|
|
// Check if we are a user
|
2011-09-24 00:22:59 +04:00
|
|
|
OC_JSON::checkLoggedIn();
|
2011-10-01 01:05:10 +04:00
|
|
|
OC_JSON::checkAppEnabled('calendar');
|
2011-08-31 22:20:46 +04:00
|
|
|
|
|
|
|
// Get data
|
|
|
|
if( isset( $_POST['timezone'] ) ){
|
|
|
|
$timezone=$_POST['timezone'];
|
|
|
|
OC_Preferences::setValue( OC_User::getUser(), 'calendar', 'timezone', $timezone );
|
2011-09-24 00:22:59 +04:00
|
|
|
OC_JSON::success(array('data' => array( 'message' => $l->t('Timezone changed') )));
|
2011-08-31 22:20:46 +04:00
|
|
|
}else{
|
2011-09-24 00:22:59 +04:00
|
|
|
OC_JSON::error(array('data' => array( 'message' => $l->t('Invalid request') )));
|
2011-08-31 22:20:46 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|