fix a PHP Notice

remotes/origin/stable4
Georg Ehrke 13 years ago
parent 6c908a4cd0
commit 8a3d41c043
  1. 15
      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();
}
Loading…
Cancel
Save