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):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
*/
|
|
|
|
|
|
2014-07-10 08:05:22 +02:00
|
|
|
// set included, if not
|
|
|
|
|
if (!isset($included)) { $included = false; }
|
|
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//check the permission
|
|
|
|
|
if(defined('STDIN')) {
|
|
|
|
|
$document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]);
|
|
|
|
|
preg_match("/^(.*)\/core\/.*$/", $document_root, $matches);
|
|
|
|
|
$document_root = $matches[1];
|
|
|
|
|
set_include_path($document_root);
|
2013-07-06 08:03:27 +02:00
|
|
|
require_once "resources/require.php";
|
2012-06-04 16:58:40 +02:00
|
|
|
$_SERVER["DOCUMENT_ROOT"] = $document_root;
|
2014-07-16 06:30:49 +02:00
|
|
|
$format = 'text'; //html, text
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2014-07-10 08:05:22 +02:00
|
|
|
else if (!$included) {
|
2012-06-04 16:58:40 +02:00
|
|
|
include "root.php";
|
2013-07-06 08:03:27 +02:00
|
|
|
require_once "resources/require.php";
|
2013-07-06 07:50:55 +02:00
|
|
|
require_once "resources/check_auth.php";
|
2014-07-10 11:20:11 +02:00
|
|
|
if (permission_exists('upgrade_apps') || if_group("superadmin")) {
|
2012-06-04 16:58:40 +02:00
|
|
|
//echo "access granted";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
2014-07-16 06:30:49 +02:00
|
|
|
$format = 'html'; //html, text
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
|
2014-07-15 12:30:31 +02:00
|
|
|
//run all app_defaults.php files
|
2016-04-26 04:26:26 +02:00
|
|
|
require_once "resources/classes/config.php";
|
2014-07-15 12:30:31 +02:00
|
|
|
require_once "resources/classes/domains.php";
|
|
|
|
|
$domain = new domains;
|
|
|
|
|
$domain->upgrade();
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
?>
|