-
Notifications
You must be signed in to change notification settings - Fork 1
/
post-env.php
27 lines (27 loc) · 1.17 KB
/
post-env.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
session_start();
include "util.php";
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$data = array();
$data["USERNAME"] = $_POST["username"];
$data["PASSWORD"] = $_POST["password"];
$data["ES_CLUSTER_URL"] = $_POST["cluster_url"];
$data["APPBASE_ID"] = $_POST["appbase_id"];
$data["LOG_FILE_PATH"] = "/reactivesearch-data/es.json";
$data["PIPELINE_LOG_FILE_PATH"] = "/reactivesearch-data/pipeline.json";
if (isset($_POST["set_sniffing"])) {
$data["SET_SNIFFING"] = "true";
} else {
$data["SET_SNIFFING"] = "false";
}
if (isset($_POST["username"]) && isset($_POST["password"]) && isset($_POST["cluster_url"]) && isset($_POST["appbase_id"]) && !empty($_POST["username"]) && !empty($_POST["username"]) && !empty($_POST["cluster_url"]) && !empty($_POST["appbase_id"])) {
upsertEnvVars($data);
upsertLogFile($data);
logout("?success=Data updated successfully");
} else {
header("Location: env.php?error=Invalid parameters");
}
} else {
header("Location: index.php?error=Invalid method");
}
?>