Update file permissions and enhance error handling in login template and setup scripts

This commit is contained in:
admin committed 2026-10-09 21:21:44 +02:00
1 parent c94122c9fd
commit 313ffec92c
7 files changed
+36 -1

No files matched your search

Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
+8
View File
@@ -29,6 +29,14 @@ if (is_file(APP_PATH . "database.db")) {
]);
}
// Check PDO drivers
if (!extension_loaded("pdo_sqlite") || !extension_loaded("sqlite3")) {
$api->answer(500, [
"error" => "missing_drives",
"error_text" => "Please install the extensions pdo_sqlite and sqlite3."
]);
}
$username = $input["username"];
$password = $input["password"];
$password_repeat = $input["password_repeat"];
+24
View File
@@ -36,6 +36,7 @@
<div class="center">
<h1 class="md-typescale-display-large">%appname%</h1>
<h3 class="md-typescale-display-medium">Admin Panel Login</h3><br><br>
<p class="md-typescale-body-medium" id="error_msg" style="display: none;"></p>
<md-filled-text-field type="text" id="login_username" placeholder="Username"></md-filled-text-field><br><br>
<md-filled-text-field type="password" id="login_password" placeholder="Password"></md-filled-text-field><br><br>
<md-filled-button id="login_button">Login</md-filled-button>
@@ -46,6 +47,29 @@
var username = document.getElementById("login_username").value;
var password = document.getElementById("login_password").value;
fetch("/api/auth/login.php", {
method:"POST",
body: JSON.stringify({
username: username,
password: password
}),
headers: {
"Content-type": "application/json; charset=UTF-8"
}
})
.then(response => response.json())
.then(data => {
if (data.status == 200) {
window.location.reload();
}else{
document.getElementById("error_msg").innerHTML = data.error_text;
document.getElementById("error_msg").style.display = "block";
}
})
.catch(error => {
document.getElementById("error_msg").innerHTML = error;
document.getElementById("error_msg").style.display = "block";
})
});
</script>
</body>
+4 -1
View File
@@ -17,4 +17,7 @@
//print_r(json_decode('{"entrys":[{"name":"marc"}]}', true));
print_r(explode(".", "jakob.stinkt"));
//print_r(explode(".", "jakob.stinkt"));
var_dump(extension_loaded("pdo_sqlite"));
var_dump(extension_loaded("sqlite3"));