2012-02-20 14:26:22 +04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Copyright (c) 2011, 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or
|
|
|
|
* later.
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*/
|
2012-04-17 21:31:29 +04:00
|
|
|
|
2012-02-26 16:45:51 +04:00
|
|
|
|
2012-02-20 14:26:22 +04:00
|
|
|
OC_JSON::checkLoggedIn();
|
|
|
|
OC_JSON::checkAppEnabled('calendar');
|
2012-02-26 16:45:51 +04:00
|
|
|
|
2012-04-14 18:44:15 +04:00
|
|
|
$l = OC_L10N::get('calendar');
|
2012-02-26 16:45:51 +04:00
|
|
|
|
2012-02-20 14:26:22 +04:00
|
|
|
$lat = $_GET['lat'];
|
2012-02-26 16:45:51 +04:00
|
|
|
$lng = $_GET['long'];
|
|
|
|
|
|
|
|
$timezone = OC_Geo::timezone($lat, $lng);
|
|
|
|
|
|
|
|
if($timezone == OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone')){
|
2012-02-20 14:26:22 +04:00
|
|
|
OC_JSON::success();
|
|
|
|
exit;
|
|
|
|
}
|
2012-02-26 16:45:51 +04:00
|
|
|
OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezone', $timezone);
|
|
|
|
$message = array('message'=> $l->t('New Timezone:') . $timezone);
|
|
|
|
OC_JSON::success($message);
|
|
|
|
?>
|