check permission check in share function

This commit is contained in:
Georg Ehrke 2012-04-13 17:16:28 -04:00
parent afcb0aee40
commit 1e0364baa8
1 changed files with 8 additions and 0 deletions

View File

@ -16,6 +16,14 @@ switch($idtype){
OC_JSON::error(array('message'=>'unexspected parameter')); OC_JSON::error(array('message'=>'unexspected parameter'));
exit; exit;
} }
if($idtype == 'calendar' && !OC_Calendar_App::getCalendar($id)){
OC_JSON::error(array('message'=>'permission denied'));
exit;
}
if($idtype == 'event' && !OC_Calendar_App::getEventObject($id)){
OC_JSON::error(array('message'=>'permission denied'));
exit;
}
$sharewith = $_GET['sharewith']; $sharewith = $_GET['sharewith'];
$sharetype = strip_tags($_GET['sharetype']); $sharetype = strip_tags($_GET['sharetype']);
switch($sharetype){ switch($sharetype){