Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/calendar/ajax/settings/timezonedetection.php')
-rwxr-xr-x[-rw-r--r--]apps/calendar/ajax/settings/timezonedetection.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/calendar/ajax/settings/timezonedetection.php b/apps/calendar/ajax/settings/timezonedetection.php
index f67bab901e7..ba5f2af5fd9 100644..100755
--- a/apps/calendar/ajax/settings/timezonedetection.php
+++ b/apps/calendar/ajax/settings/timezonedetection.php
@@ -5,13 +5,16 @@
* later.
* See the COPYING-README file.
*/
-require_once('../../../../lib/base.php');
-OC_JSON::checkLoggedIn();
-OC_JSON::checkAppEnabled('calendar');
-if($_POST['timezonedetection'] == 'on'){
- OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezonedetection', 'true');
+
+OCP\JSON::checkLoggedIn();
+OCP\JSON::checkAppEnabled('calendar');
+if(array_key_exists('timezonedetection', $_POST)){
+ if($_POST['timezonedetection'] == 'on'){
+ OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'true');
+ }else{
+ OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timezonedetection', 'false');
+ }
+ OCP\JSON::success();
}else{
- OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezonedetection', 'false');
-}
-OC_JSON::success();
-
+ OCP\JSON::error();
+} \ No newline at end of file