]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix a PHP Notice
authorGeorg Ehrke <dev@georgswebsite.de>
Mon, 30 Apr 2012 19:46:33 +0000 (21:46 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Mon, 30 Apr 2012 19:46:33 +0000 (21:46 +0200)
apps/calendar/ajax/settings/timezonedetection.php

index d29c5568e4914a200d104350c590609a087404a2..de3bd6de4fd99a914fc25dd0354482ef695548a0 100644 (file)
@@ -8,10 +8,13 @@
  
 OC_JSON::checkLoggedIn();
 OC_JSON::checkAppEnabled('calendar');
-if($_POST['timezonedetection'] == 'on'){
-       OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezonedetection', 'true');
+if(array_key_exists('timezonedetection', $_POST)){
+       if($_POST['timezonedetection'] == 'on'){
+               OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezonedetection', 'true');
+       }else{
+               OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezonedetection', 'false');
+       }
+       OC_JSON::success();
 }else{
-       OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'timezonedetection', 'false');
-}
-OC_JSON::success();
-
+       OC_JSON::error();
+}
\ No newline at end of file