upgrade_domains.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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-2012
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. */
  21. //check the permission
  22. if(defined('STDIN')) {
  23. //includes files
  24. require_once dirname(__DIR__, 2) . "/resources/require.php";
  25. $_SERVER["DOCUMENT_ROOT"] = $document_root;
  26. $display_type = 'text'; //html, text
  27. }
  28. else if (!$included) {
  29. //includes files
  30. require_once dirname(__DIR__, 2) . "/resources/require.php";
  31. require_once "resources/check_auth.php";
  32. if (permission_exists('upgrade_apps') || if_group("superadmin")) {
  33. //echo "access granted";
  34. }
  35. else {
  36. echo "access denied";
  37. exit;
  38. }
  39. $display_type = 'html'; //html, text
  40. }
  41. //run all app_defaults.php files
  42. require_once "resources/classes/config.php";
  43. require_once "resources/classes/domains.php";
  44. $domain = new domains;
  45. $domain->display_type = $display_type;
  46. $domain->upgrade();
  47. ?>