From: Georg Ehrke Date: Mon, 30 Apr 2012 19:46:33 +0000 (+0200) Subject: fix a PHP Notice X-Git-Tag: v4.0.0beta~135 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8a3d41c043c8e605cd72839680230ce597055f81;p=nextcloud-server.git fix a PHP Notice --- 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