Add option to for domain based provisioning template directory.

Example: provision/domain_name
This commit is contained in:
Mark Crane
2013-04-29 14:45:25 +00:00
parent 96749aa89b
commit 36779b6118
2 changed files with 17 additions and 8 deletions

View File

@@ -294,7 +294,11 @@ require_once "includes/require.php";
echo "<select id='device_template' name='device_template' class='formfld'>\n";
echo "<option value=''></option>\n";
$temp_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision";
if (is_dir($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/".$_SESSION["domain_name"])) {
$temp_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision/".$_SESSION["domain_name"];
} else {
$temp_dir = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/includes/templates/provision";
}
if($dh = opendir($temp_dir)) {
while($dir = readdir($dh)) {
if($file != "." && $dir != ".." && $dir[0] != '.') {