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
+4 -5
View File
@@ -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
if (strlen($_SESSION['switch']['provision']['dir'])) {
require_once "app/provision/provision_write.php"; require_once "app/provision/provision_write.php";
}
//set the message //set the message
if (!isset($_SESSION['message'])) { if (!isset($_SESSION['message'])) {