fix a PHP Notice

This commit is contained in:
Georg Ehrke 2012-04-30 21:46:33 +02:00
parent 6c908a4cd0
commit 8a3d41c043
1 changed files with 9 additions and 6 deletions

View 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();
}