clip_delete.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <[email protected]>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2023
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. James Rose <[email protected]>
  21. */
  22. //includes files
  23. require_once dirname(__DIR__, 2) . "/resources/require.php";
  24. require_once "resources/check_auth.php";
  25. //check permissions
  26. if (permission_exists('clip_delete')) {
  27. //access granted
  28. }
  29. else {
  30. echo "access denied";
  31. exit;
  32. }
  33. //add multi-lingual support
  34. $language = new text;
  35. $text = $language->get();
  36. //get the uuid from http values
  37. $clip_uuid = $_GET["id"];
  38. //delete the clip
  39. if (is_uuid($clip_uuid)) {
  40. $array['clips'][0]['clip_uuid'] = $clip_uuid;
  41. $p = permissions::new();
  42. $p->add('clip_delete', 'temp');
  43. $database = new database;
  44. $database->app_name = 'edit';
  45. $database->app_uuid = '17e628ee-ccfa-49c0-29ca-9894a0384b9b';
  46. $database->delete($array);
  47. unset($array);
  48. $p->delete('clip_delete', 'temp');
  49. }
  50. //redirect the browser
  51. header("Location: clip_options.php");