summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-04-30 21:46:33 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-04-30 21:46:33 +0200
commit8a3d41c043c8e605cd72839680230ce597055f81 (patch)
tree9e95f4402dc20b9d51fd78ce3606b547a7e666dc /apps
parent6c908a4cd0b9ab14a834a1e0220d48097fa23ca4 (diff)
downloadnextcloud-server-8a3d41c043c8e605cd72839680230ce597055f81.tar.gz
nextcloud-server-8a3d41c043c8e605cd72839680230ce597055f81.zip
fix a PHP Notice
Diffstat (limited to 'apps')
-rw-r--r--apps/calendar/ajax/settings/timezonedetection.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/calendar/ajax/settings/timezonedetection.php b/apps/calendar/ajax/settings/timezonedetection.php
index d29c5568e49..de3bd6de4fd 100644
--- a/apps/calendar/ajax/settings/timezonedetection.php
+++ b/apps/calendar/ajax/settings/timezonedetection.php
@@ -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