Fix provisioning templates ignoring domain specific templates (#2960)

* Moved multi-tenant template directory statement to before the templating engine initialisation.

* Revert "Moved multi-tenant template directory statement to before the templating engine initialisation." Formatting issue, needless diffs.

This reverts commit 04547a1337.

* Moved multi-tenant template directory statement to before the template
This commit is contained in:
Harry Foster 2018-01-22 16:53:30 +00:00 committed by FusionPBX
parent 7a6bfcec41
commit fcd29eafe5
1 changed files with 9 additions and 10 deletions

View File

@ -812,6 +812,15 @@ include "root.php";
}
unset ($prep_statement);
}
//set the template directory
if (strlen($provision["template_dir"]) > 0) {
$template_dir = $provision["template_dir"];
}
//if the domain name directory exists then only use templates from it
if (is_dir($template_dir.'/'.$domain_name)) {
$device_template = $domain_name.'/'.$device_template;
}
//initialize a template object
$view = new template();
@ -1238,16 +1247,6 @@ include "root.php";
}
}
//set the template directory
if (strlen($provision["template_dir"]) > 0) {
$template_dir = $provision["template_dir"];
}
//if the domain name directory exists then only use templates from it
if (is_dir($template_dir.'/'.$domain_name)) {
$device_template = $domain_name.'/'.$device_template;
}
//if $file is not provided then look for a default file that exists
if (strlen($file) == 0) {
if (file_exists($template_dir."/".$device_template ."/{\$mac}")) {