Compare commits
2 Commits
6e82e8b343
...
7ae1328238
Author | SHA1 | Date | |
---|---|---|---|
7ae1328238 | |||
3046895dd4 |
@@ -294,6 +294,29 @@ function check_files($dir,$key) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
function check_letsencrypt() {
|
||||
|
||||
global $SHARED_DIR;
|
||||
|
||||
$input_file = $SHARED_DIR."/output/letsencrypt.json";
|
||||
if (file_exists($input_file)) {
|
||||
$json_data = file_get_contents($input_file);
|
||||
$data = json_decode($json_data,true);
|
||||
if ($data === null) {
|
||||
echo "JSON read error...";
|
||||
// TODO json error
|
||||
}
|
||||
else {
|
||||
foreach ($data as $d) {
|
||||
$result[$d["domain"]] = $d;
|
||||
}
|
||||
}
|
||||
}
|
||||
else $result = "";
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
function check_request($key="") {
|
||||
|
||||
global $INTERFACE;
|
||||
|
12
scan.php
12
scan.php
@@ -191,10 +191,20 @@ switch ($_GET["op"]) {
|
||||
if ($key=="deployment") {
|
||||
if ($data["STATUS"]=="0") { // ask
|
||||
$template = json_decode(base64_decode($data["TEMPLATE"]));
|
||||
echo "<fieldset><form action=\"#\" method=\"post\" id=\"deploy_form\"><br>";
|
||||
if ($reinstall) {
|
||||
//var_dump($template);
|
||||
//var_dump($template);
|
||||
$letsencrypt = check_letsencrypt();
|
||||
foreach ($template->fields as $field) {
|
||||
if ($field->key=="DOMAIN") {
|
||||
if (!empty($letsencrypt[$field->value])) {
|
||||
echo "LETSENCRYPT: ".$letsencrypt[$field->value]["status"]." - ".$letsencrypt[$field->value]["date"];
|
||||
echo " - <a href=\"letsencrypt_log.php?domain={$field->value}\" target=\"_blank\">LOG</a><br><br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "<fieldset><form action=\"#\" method=\"post\" id=\"deploy_form\"><br>";
|
||||
foreach ($template->fields as $field) {
|
||||
if (isset($field->generated)) {
|
||||
echo "<input type=\"hidden\" value=\"generated:{$field->generated}\" name=\"{$field->key}\" id=\"{$template->name}_{$field->key}\" class=\"additional_field\">";
|
||||
|
Reference in New Issue
Block a user