Create database_settings.php
This commit is contained in:
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
// Check if the user is logged in
|
||||||
|
if (!isset($_SESSION['username']) or !isset($_SESSION["login"])) {
|
||||||
|
// Redirect to the login page or handle unauthorized access
|
||||||
|
header("Location: /login.php");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = $_SESSION['username'];
|
||||||
|
$perms = $_SESSION["perms"];
|
||||||
|
$email = $_SESSION["email"];
|
||||||
|
if($perms[6]!=="1"){
|
||||||
|
header("location:/system/insecure_zone/php/no_access.php");
|
||||||
|
$block=1;
|
||||||
|
exit();
|
||||||
|
}else{
|
||||||
|
$block=0;
|
||||||
|
}
|
||||||
|
//for the get_perms_str() function
|
||||||
|
include "perms_functions.php";
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
|
||||||
|
<title>Database Settings</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script>
|
||||||
|
function async update_database(){
|
||||||
|
var loader=document.getElementById("loader");
|
||||||
|
loader.style.display="block";
|
||||||
|
await fetch('/api/php/database/compile_database.php);
|
||||||
|
loader.style.display="none";
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<div class="container mt-5">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h4>Database Settings</h4>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<button class="btn-primary btn-dark" onclick="update_db();">Update / regenerate Database (!this can take very long ~1h)</button>
|
||||||
|
<div style="display:none" id="loader">
|
||||||
|
<p>Database update is running, please do not close this tab / do not navigate away!</p>
|
||||||
|
<div class="spinner-border" role="status">
|
||||||
|
<span class="sr-only">Loading...</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user