permissions_default.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. */
  21. //check permisions
  22. if (empty($included) || !$included) {
  23. //set the include path
  24. $conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
  25. set_include_path(parse_ini_file($conf[0])['document.root']);
  26. //includes files
  27. require_once dirname(__DIR__, 2) . "/resources/require.php";
  28. require_once "resources/check_auth.php";
  29. if (permission_exists('group_edit')) {
  30. //access granted
  31. }
  32. else {
  33. echo "access denied";
  34. return;
  35. }
  36. }
  37. //add multi-lingual support
  38. $language = new text;
  39. $text = $language->get();
  40. //permission restore default
  41. require_once "core/groups/resources/classes/permission.php";
  42. $permission = new permission;
  43. $permission->restore();
  44. //redirect the users
  45. if (empty($included) || !$included) {
  46. //show a message to the user
  47. message::add($text['message-restore']);
  48. header("Location: groups.php");
  49. return;
  50. }
  51. ?>