diff --git a/app/devices/resources/classes/device.php b/app/devices/resources/classes/device.php index 5dc52061eb..2532f283b4 100644 --- a/app/devices/resources/classes/device.php +++ b/app/devices/resources/classes/device.php @@ -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';