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

View File

@ -152,22 +152,19 @@ require_once "resources/require.php";
//add or update the database
if ($_POST["persistformvar"] != "true") {
//add domain_uuid to the array
if (!isset($_POST["domain_uuid"])) {
$_POST["domain_uuid"] = $_SESSION["domain_uuid"];
}
foreach ($_POST as $key => $value) {
if (is_array($value)) {
$y = 0;
foreach ($value as $k => $v) {
if (!isset($v["domain_uuid"])) {
$_POST[$key][$y]["domain_uuid"] = $_SESSION["domain_uuid"];
$_POST[$key][$y]["domain_uuid"] = $_POST["domain_uuid"];
}
$y++;
}
}
}
//array cleanup
$x = 0;
foreach ($_POST["device_lines"] as $row) {
@ -240,7 +237,9 @@ require_once "resources/require.php";
}
//write the provision files
if (strlen($_SESSION['switch']['provision']['dir'])) {
require_once "app/provision/provision_write.php";
}
//set the message
if (!isset($_SESSION['message'])) {