Only write the provisioning files if switch provision dir path is set.

This commit is contained in:
Mark Crane
2015-01-10 01:02:39 +00:00
parent 5a8ba17b57
commit cc4a4ab8d2
2 changed files with 8 additions and 9 deletions
+7 -8
View File
@@ -41,7 +41,7 @@ require_once "resources/require.php";
$text[$key] = $value[$_SESSION['domain']['language']['code']]; $text[$key] = $value[$_SESSION['domain']['language']['code']];
} }
// check duplicate mac address //check duplicate mac address
if ($_GET["mac"] != '' && $_GET["mac"] != "000000000000") { if ($_GET["mac"] != '' && $_GET["mac"] != "000000000000") {
$sql = "select "; $sql = "select ";
$sql .= "d2.domain_name "; $sql .= "d2.domain_name ";
@@ -152,22 +152,19 @@ require_once "resources/require.php";
//add or update the database //add or update the database
if ($_POST["persistformvar"] != "true") { if ($_POST["persistformvar"] != "true") {
//add domain_uuid to the array //add domain_uuid to the array
if (!isset($_POST["domain_uuid"])) {
$_POST["domain_uuid"] = $_SESSION["domain_uuid"];
}
foreach ($_POST as $key => $value) { foreach ($_POST as $key => $value) {
if (is_array($value)) { if (is_array($value)) {
$y = 0; $y = 0;
foreach ($value as $k => $v) { foreach ($value as $k => $v) {
if (!isset($v["domain_uuid"])) { if (!isset($v["domain_uuid"])) {
$_POST[$key][$y]["domain_uuid"] = $_SESSION["domain_uuid"]; $_POST[$key][$y]["domain_uuid"] = $_POST["domain_uuid"];
} }
$y++; $y++;
} }
} }
} }
//array cleanup //array cleanup
$x = 0; $x = 0;
foreach ($_POST["device_lines"] as $row) { foreach ($_POST["device_lines"] as $row) {
@@ -240,7 +237,9 @@ require_once "resources/require.php";
} }
//write the provision files //write the provision files
require_once "app/provision/provision_write.php"; if (strlen($_SESSION['switch']['provision']['dir'])) {
require_once "app/provision/provision_write.php";
}
//set the message //set the message
if (!isset($_SESSION['message'])) { if (!isset($_SESSION['message'])) {
@@ -1139,4 +1138,4 @@ require_once "resources/require.php";
//show the footer //show the footer
require_once "resources/footer.php"; require_once "resources/footer.php";
?> ?>
@@ -650,4 +650,4 @@ include "root.php";
} //end write function } //end write function
} //end provision class } //end provision class
?> ?>