mirror of
https://github.com/michalcz10/USB-RAID-Array.git
synced 2025-12-10 03:22:19 +00:00
Pushed betatest to production
This commit is contained in:
@@ -34,6 +34,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (empty($uname) || empty($pswd)) {
|
||||
$_SESSION['message'] = 'Error: Username and password are required!';
|
||||
$_SESSION['message_type'] = 'error';
|
||||
} else if (!CheckPassword($pswd)) {
|
||||
$_SESSION['message'] = 'Error: Password must be at least 8 characters long, contain at least one number and one uppercase letter!';
|
||||
$_SESSION['message_type'] = 'error';
|
||||
} else {
|
||||
$sql_check = "SELECT * FROM users WHERE uname = ?";
|
||||
$stmt_check = $conn->prepare($sql_check);
|
||||
@@ -117,6 +120,19 @@ $message = $_SESSION['message'] ?? '';
|
||||
$message_type = $_SESSION['message_type'] ?? '';
|
||||
unset($_SESSION['message']);
|
||||
unset($_SESSION['message_type']);
|
||||
|
||||
function CheckPassword($password) {
|
||||
if (strlen($password) < 8) {
|
||||
return false;
|
||||
}
|
||||
if (!preg_match('/[0-9]/', $password)) {
|
||||
return false;
|
||||
}
|
||||
if (!preg_match('/[A-Z]/', $password)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
@@ -151,6 +167,7 @@ unset($_SESSION['message_type']);
|
||||
<a href="logout.php" class="btn btn-danger">Logout</a>
|
||||
<a href="changepassword.php" class="btn btn-warning">Change Password</a>
|
||||
<a href="ftp/index.php" class="btn btn-primary">SFTP</a>
|
||||
<a href="ftp/serverstat.php" class="btn btn-primary">Server Status</a>
|
||||
</div>
|
||||
</header>
|
||||
<section class="row">
|
||||
@@ -228,7 +245,7 @@ unset($_SESSION['message_type']);
|
||||
<footer class="d-flex flex-column justify-content-center align-items-center p-3 border-top gap-3 m-3">
|
||||
<span class="text-muted">Developed by Michal Sedlák</span>
|
||||
<div class="d-flex gap-3">
|
||||
<a href="https://github.com/michalcz10/USB-RAID-pole" class="text-decoration-none" target="_blank" rel="noopener noreferrer">
|
||||
<a href="https://github.com/michalcz10/USB-RAID-Array" class="text-decoration-none" target="_blank" rel="noopener noreferrer">
|
||||
<img src="../img/GitHub_Logo.png" alt="GitHub Logo" class="img-fluid hover-effect light-logo" style="height: 32px;">
|
||||
<img src="../img/GitHub_Logo_White.png" alt="GitHub Logo" class="img-fluid hover-effect dark-logo" style="height: 32px;">
|
||||
</a>
|
||||
@@ -245,4 +262,4 @@ unset($_SESSION['message_type']);
|
||||
</html>
|
||||
<?php
|
||||
$conn->close();
|
||||
?>
|
||||
?>
|
||||
Reference in New Issue
Block a user