2012-06-04 16:58:40 +02:00
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
FusionPBX
|
|
|
|
|
Version: MPL 1.1
|
|
|
|
|
|
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
for the specific language governing rights and limitations under the
|
|
|
|
|
License.
|
|
|
|
|
|
|
|
|
|
The Original Code is FusionPBX
|
|
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
|
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
2014-07-27 02:13:52 +02:00
|
|
|
Mark J. Crane <markjcrane@fusionpbx.com>
|
2012-06-04 16:58:40 +02:00
|
|
|
*/
|
2017-06-10 16:47:44 +02:00
|
|
|
//includes
|
2016-12-12 06:09:27 +01:00
|
|
|
include "root.php";
|
2017-06-10 16:47:44 +02:00
|
|
|
require_once "resources/require.php";
|
2013-07-06 09:38:14 +02:00
|
|
|
|
2015-04-14 03:36:01 +02:00
|
|
|
//start session
|
2016-12-12 06:54:39 +01:00
|
|
|
if (!isset($_SESSION)) { session_start(); }
|
2015-04-14 03:36:01 +02:00
|
|
|
|
2013-07-06 09:38:14 +02:00
|
|
|
//if config.php file does not exist then redirect to the install page
|
2016-01-17 08:01:13 +01:00
|
|
|
if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
|
2013-07-06 10:03:14 +02:00
|
|
|
//original directory
|
2015-04-14 03:36:01 +02:00
|
|
|
}
|
2016-01-17 08:01:13 +01:00
|
|
|
else if (file_exists($_SERVER["PROJECT_ROOT"]."/includes/config.php")) {
|
2014-07-27 02:13:52 +02:00
|
|
|
//move config.php from the includes to resources directory.
|
2016-01-17 08:01:13 +01:00
|
|
|
rename($_SERVER["PROJECT_ROOT"]."/includes/config.php", $_SERVER["PROJECT_ROOT"]."/resources/config.php");
|
2015-04-14 03:36:01 +02:00
|
|
|
}
|
2019-12-28 08:59:11 +01:00
|
|
|
else if (file_exists("/etc/fusionpbx/config.php")) {
|
2013-07-06 09:38:14 +02:00
|
|
|
//linux
|
2015-04-14 03:36:01 +02:00
|
|
|
}
|
2019-12-28 08:59:11 +01:00
|
|
|
else if (file_exists("/usr/local/etc/fusionpbx/config.php")) {
|
2013-07-06 09:38:14 +02:00
|
|
|
//bsd
|
2015-04-14 03:36:01 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2016-04-16 02:40:23 +02:00
|
|
|
header("Location: ".PROJECT_PATH."/core/install/install.php");
|
2013-01-05 10:44:18 +01:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-27 02:13:52 +02:00
|
|
|
//use custom login, if present, otherwise use default login
|
2019-12-28 08:59:11 +01:00
|
|
|
if (file_exists($_SERVER["PROJECT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/login.php")) {
|
2013-02-10 03:12:23 +01:00
|
|
|
require_once "themes/".$_SESSION['domain']['template']['name']."/login.php";
|
2013-01-05 10:33:49 +01:00
|
|
|
}
|
2013-02-10 03:12:23 +01:00
|
|
|
else {
|
|
|
|
|
require_once "resources/login.php";
|
2012-12-18 15:57:44 +01:00
|
|
|
}
|
2013-01-05 05:34:45 +01:00
|
|
|
|
2016-12-12 06:09:27 +01:00
|
|
|
?>
|