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:
Mark Crane 2014-09-29 07:29:44 +00:00
parent 5e67869394
commit f00814b1b1
1 changed files with 5 additions and 10 deletions

View File

@ -109,8 +109,7 @@ include "root.php";
public function get_template_dir() {
//set the default template directory
switch (PHP_OS) {
case "Linux":
if (PHP_OS == "Linux") {
//set the default template dir
if (strlen($this->template_dir) == 0) {
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';
}
}
break;
case "FreeBSD":
} elseif (PHP_OS == "FreeBSD") {
//if the FreeBSD port is installed use the following paths by default.
if (file_exists('/usr/local/etc/fusionpbx/resources/templates/provision')) {
if (strlen($this->template_dir) == 0) {
@ -139,20 +137,17 @@ include "root.php";
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
}
}
break;
case "NetBSD":
} elseif (PHP_OS == "NetBSD") {
//set the default template_dir
if (strlen($this->template_dir) == 0) {
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
}
break;
case "OpenBSD":
} elseif (PHP_OS == "OpenBSD") {
//set the default template_dir
if (strlen($this->template_dir) == 0) {
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';
}
break;
default:
} else {
//set the default template_dir
if (strlen($this->template_dir) == 0) {
$this->template_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/templates/provision';