delete.php 519 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. OCP\JSON::checkLoggedIn();
  9. OCP\JSON::checkAppEnabled('calendar');
  10. $id = $_POST['id'];
  11. $access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);
  12. if($access != 'owner' && $access != 'rw'){
  13. OCP\JSON::error(array('message'=>'permission denied'));
  14. exit;
  15. }
  16. $result = OC_Calendar_Object::delete($id);
  17. OCP\JSON::success();