summaryrefslogtreecommitdiffstats
path: root/apps/calendar/ajax
diff options
context:
space:
mode:
authorGeorg Ehrke <ownclouddev@georgswebsite.de>2012-02-20 11:26:43 +0100
committerGeorg Ehrke <dev@georgswebsite.de>2012-02-23 22:00:46 +0100
commit8cd102721450ce02f41a07bf3473fb9a0582f054 (patch)
treef6d5438ac23a2271d6d3943d6c9e8d16b823a81d /apps/calendar/ajax
parentb7de1850a00b91be34af062957df73424c95469b (diff)
downloadnextcloud-server-8cd102721450ce02f41a07bf3473fb9a0582f054.tar.gz
nextcloud-server-8cd102721450ce02f41a07bf3473fb9a0582f054.zip
better var name in changeview.php
Diffstat (limited to 'apps/calendar/ajax')
-rw-r--r--apps/calendar/ajax/changeview.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/calendar/ajax/changeview.php b/apps/calendar/ajax/changeview.php
index ef05c7cd496..ae48b229b16 100644
--- a/apps/calendar/ajax/changeview.php
+++ b/apps/calendar/ajax/changeview.php
@@ -9,7 +9,16 @@
require_once ("../../../lib/base.php");
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar');
-$currentview = $_GET["v"];
-OC_Preferences::setValue(OC_USER::getUser(), "calendar", "currentview", $currentview);
+$view = $_GET['v'];
+switch($view){
+ case 'agendaWeek':
+ case 'month';
+ case 'list':
+ break;
+ default:
+ OC_JSON::error(array('message'=>'unexspected parameter: ' . $view));
+ exit;
+}
+OC_Preferences::setValue(OC_USER::getUser(), 'calendar', 'currentview', $view);
OC_JSON::success();
?>