Enhance payment processing by adding VAT number handling and updating transaction retrieval logic. Refactor user role migration script for improved role assignments and streamline software tool functionality with maintenance mode checks and UI updates.

This commit is contained in:
“VeLiTi”
2026-01-29 19:25:13 +01:00
parent 0723df4516
commit 90472e3673
10 changed files with 154 additions and 150 deletions

104
login.php
View File

@@ -56,6 +56,11 @@ $retry = 0;
// Process submitted form data
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Check maintenance mode exception
if (maintenance_mode && trim($_POST['username']) != maintenance_mode_user) {
$username_err = maintenance_mode_text ?? 'System in maintenance';
} else {
// Check if username is empty
if(empty(trim($_POST['username']))){
$username_err = $username_enter ?? 'Please enter username' ;
@@ -106,6 +111,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Display an error for passord mismatch
$password_err = $password_err_3 ?? 'Not authorized';
}
} // Close maintenance mode check
}
echo'
<!DOCTYPE html>
@@ -115,6 +121,63 @@ echo'
<title>'.site_title.'</title>
<link rel="shortcut icon" href="'.icon_image.'" type="image/x-icon" />
<link href="'.$custom_css.'" rel="stylesheet" type="text/css">
<style>
.maintenance-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
box-sizing: border-box;
}
.maintenance-modal.hidden {
display: none !important;
}
.maintenance-modal-content {
background: white;
padding: 30px;
border-radius: 4px;
text-align: center;
max-width: 500px;
width: 100%;
margin: auto;
position: relative;
}
.maintenance-modal-content p {
margin-bottom: 20px;
font-size: 16px;
color: #333;
line-height: 1.5;
}
.modal-close {
position: absolute;
top: 10px;
right: 15px;
font-size: 28px;
font-weight: bold;
color: #999;
cursor: pointer;
transition: color 0.3s;
}
.modal-close:hover {
color: #333;
}
@media (max-width: 768px) {
.maintenance-modal-content {
padding: 20px;
max-width: 90%;
}
.maintenance-modal-content p {
font-size: 14px;
}
}
</style>
</head>
<body>
';
@@ -125,18 +188,20 @@ echo'
<div class="login-form">
<div class="logo"></div>
<a href="register.php" class="register-link">'.strtolower($account_create ?? 'create account').'</a>';
if (maintenance_mode)
{
//Maintenance mode is on => Show maintenance mode text
echo '
<div class="message">
<p>'.maintenance_mode_text.'</p>
</div>
';
} else {
//Maintenance mode is off => Show login
if (maintenance_mode) {
echo '
<div id="maintenanceModal" class="maintenance-modal">
<div class="maintenance-modal-content">
<span class="modal-close" onclick="dismissMaintenanceModal()">&times;</span>
<p>'.maintenance_mode_text.'</p>
<p style="text-align: center;">
<small>'.maintenance_mode_notification.'</small>
</p>
</div>
</div>';
}
echo '
<div class="header">
<h1>'.($login_h1 ?? 'Login to your account').'</h1>
@@ -158,7 +223,6 @@ echo'
<button type="submit" class="login-btn">'.($button1 ?? 'Login').'</button>
</form>';
}
if($password_err !='' || $username_err != ''){
echo'
@@ -194,13 +258,17 @@ echo'
</div>
</body>
<script>
document.getElementById(\'language-selector\').addEventListener(\'change\', function() {
function dismissMaintenanceModal() {
var modal = document.getElementById("maintenanceModal");
if (modal) {
modal.classList.add("hidden");
}
}
document.getElementById("language-selector").addEventListener("change", function() {
if (this.value) {
// Get the current URL
let currentUrl = window.location.pathname;
// Append the selected value as a query parameter
window.location.href = `${currentUrl}?language=${this.value}`;
var currentUrl = window.location.pathname;
window.location.href = currentUrl + "?language=" + this.value;
}
});
</script>