Fork of FusionPBX but with LDAP kinda working
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.8 KiB

2 years ago
  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 <markjcrane@fusionpbx.com>
  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 <markjcrane@fusionpbx.com>
  20. */
  21. //includes
  22. include "root.php";
  23. require_once "resources/require.php";
  24. //start session
  25. if (!isset($_SESSION)) { session_start(); }
  26. //if config.php file does not exist then redirect to the install page
  27. if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
  28. //original directory
  29. }
  30. else if (file_exists($_SERVER["PROJECT_ROOT"]."/includes/config.php")) {
  31. //move config.php from the includes to resources directory.
  32. rename($_SERVER["PROJECT_ROOT"]."/includes/config.php", $_SERVER["PROJECT_ROOT"]."/resources/config.php");
  33. }
  34. else if (file_exists("/etc/fusionpbx/config.php")) {
  35. //linux
  36. }
  37. else if (file_exists("/usr/local/etc/fusionpbx/config.php")) {
  38. //bsd
  39. }
  40. else {
  41. header("Location: ".PROJECT_PATH."/core/install/install.php");
  42. exit;
  43. }
  44. //use custom login, if present, otherwise use default login
  45. if (file_exists($_SERVER["PROJECT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/login.php")) {
  46. require_once "themes/".$_SESSION['domain']['template']['name']."/login.php";
  47. }
  48. else {
  49. require_once "resources/login.php";
  50. }
  51. ?>