Even more Bugfixes

This commit is contained in:
Roman Hergenreder 2020-04-02 22:25:13 +02:00
parent 2f004dd4c8
commit 9de6b22a90
7 changed files with 17 additions and 6 deletions

0
core/Configuration/.gitignore vendored Normal file → Executable file

0
core/Configuration/.htaccess Normal file → Executable file

0
core/Configuration/Configuration.class.php Normal file → Executable file

0
core/Configuration/CreateDatabase.class.php Normal file → Executable file

@ -153,6 +153,7 @@ namespace Documents\Install {
if(!$success) { if(!$success) {
$msg = "The following requirements failed the check:<br>" . $msg = "The following requirements failed the check:<br>" .
$this->createUnorderedList($failedRequirements); $this->createUnorderedList($failedRequirements);
$this->errorString = $msg;
} }
return array("success" => $success, "msg" => $msg); return array("success" => $success, "msg" => $msg);
@ -632,7 +633,7 @@ namespace Documents\Install {
if(isset($currentView["progressText"])) { if(isset($currentView["progressText"])) {
$progressText = $currentView["progressText"]; $progressText = $currentView["progressText"];
$html .= "<div id=\"progressText\" class=\"my-3\">$progressText$spinnerIcon</i></div>"; $html .= "<div id=\"progressText\" style=\"display:none\" class=\"my-3\">$progressText$spinnerIcon</i></div>";
} }
if(isset($currentView["form"])) { if(isset($currentView["form"])) {
@ -660,7 +661,11 @@ namespace Documents\Install {
); );
if($this->currentStep != self::FINISH_INSTALLATION) { if($this->currentStep != self::FINISH_INSTALLATION) {
$buttons[] = array("title" => "Submit", "type" => "success", "id" => "btnSubmit", "float" => "right"); if ($this->currentStep == self::CHECKING_REQUIRMENTS) {
$buttons[] = array("title" => "Retry", "type" => "success", "id" => "btnRetry", "float" => "right");
} else {
$buttons[] = array("title" => "Submit", "type" => "success", "id" => "btnSubmit", "float" => "right");
}
} else { } else {
$buttons[] = array("title" => "Finish", "type" => "success", "id" => "btnFinish", "float" => "right"); $buttons[] = array("title" => "Finish", "type" => "success", "id" => "btnFinish", "float" => "right");
} }
@ -703,7 +708,7 @@ namespace Documents\Install {
$this->steps = array( $this->steps = array(
self::CHECKING_REQUIRMENTS => array( self::CHECKING_REQUIRMENTS => array(
"title" => "Checking requirements", "title" => "Checking requirements",
"status" => self::NOT_STARTED "status" => self::ERROR
), ),
self::DATABASE_CONFIGURATION => array( self::DATABASE_CONFIGURATION => array(
"title" => "Database configuration", "title" => "Database configuration",
@ -737,6 +742,7 @@ namespace Documents\Install {
// POST // POST
if($_SERVER['REQUEST_METHOD'] == 'POST') { if($_SERVER['REQUEST_METHOD'] == 'POST') {
$response = $this->performStep(); $response = $this->performStep();
$response["step"] = $this->currentStep;
die(json_encode($response)); die(json_encode($response));
} }

@ -66,6 +66,7 @@ if(isset($_GET["api"]) && is_string($_GET["api"])) {
header("Location: /"); header("Location: /");
} else { } else {
$document = new Documents\Install($user); $document = new Documents\Install($user);
$response = $document->getCode();
} }
} else { } else {
if(empty($documentName) || strcasecmp($documentName, "install") === 0) { if(empty($documentName) || strcasecmp($documentName, "install") === 0) {
@ -83,9 +84,9 @@ if(isset($_GET["api"]) && is_string($_GET["api"])) {
} else { } else {
$document = new $class($user); $document = new $class($user);
} }
}
$response = $document->getCode(); $response = $document->getCode();
}
} }
$user->sendCookies(); $user->sendCookies();

@ -38,12 +38,16 @@ function setState(state) {
li.find("i").removeClass().addClass(icon); li.find("i").removeClass().addClass(icon);
} }
function getCurrentStep() {
return $("#currentStep").index() + 1;
}
function sendRequest(params, done) { function sendRequest(params, done) {
setState(PENDING); setState(PENDING);
var success = false; var success = false;
$("#status").hide(); $("#status").hide();
$.post("/index.php", params, function(data) { $.post("/index.php", params, function(data) {
if(data.success) { if(data.success || data.step != getCurrentStep()) {
success = true; success = true;
window.location.reload(); window.location.reload();
} else { } else {