Replace the switch with if/elseif/else to fix a problem with accounts -> extensions for php fpm on Ubuntu 14.04 LTS
This commit is contained in:
@@ -109,8 +109,7 @@ include "root.php";
|
|||||||
|
|
||||||
public function get_template_dir() {
|
public function get_template_dir() {
|
||||||
//set the default template directory
|
//set the default template directory
|
||||||
switch (PHP_OS) {
|
if (PHP_OS == "Linux") {
|
||||||
case "Linux":
|
|
||||||
//set the default template dir
|
//set the default template dir
|
||||||
if (strlen($this->template_dir) == 0) {
|
if (strlen($this->template_dir) == 0) {
|
||||||
if (file_exists('/etc/fusionpbx/resources/templates/provision')) {
|
if (file_exists('/etc/fusionpbx/resources/templates/provision')) {
|
||||||
@@ -120,8 +119,7 @@ include "root.php";
|
|||||||
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
|
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
} elseif (PHP_OS == "FreeBSD") {
|
||||||
case "FreeBSD":
|
|
||||||
//if the FreeBSD port is installed use the following paths by default.
|
//if the FreeBSD port is installed use the following paths by default.
|
||||||
if (file_exists('/usr/local/etc/fusionpbx/resources/templates/provision')) {
|
if (file_exists('/usr/local/etc/fusionpbx/resources/templates/provision')) {
|
||||||
if (strlen($this->template_dir) == 0) {
|
if (strlen($this->template_dir) == 0) {
|
||||||
@@ -139,20 +137,17 @@ include "root.php";
|
|||||||
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
|
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
} elseif (PHP_OS == "NetBSD") {
|
||||||
case "NetBSD":
|
|
||||||
//set the default template_dir
|
//set the default template_dir
|
||||||
if (strlen($this->template_dir) == 0) {
|
if (strlen($this->template_dir) == 0) {
|
||||||
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
|
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
|
||||||
}
|
}
|
||||||
break;
|
} elseif (PHP_OS == "OpenBSD") {
|
||||||
case "OpenBSD":
|
|
||||||
//set the default template_dir
|
//set the default template_dir
|
||||||
if (strlen($this->template_dir) == 0) {
|
if (strlen($this->template_dir) == 0) {
|
||||||
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
|
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
|
||||||
}
|
}
|
||||||
break;
|
} else {
|
||||||
default:
|
|
||||||
//set the default template_dir
|
//set the default template_dir
|
||||||
if (strlen($this->template_dir) == 0) {
|
if (strlen($this->template_dir) == 0) {
|
||||||
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
|
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
|
||||||
|
|||||||
Reference in New Issue
Block a user