Repository navigation
Expand file tree
/
Copy pathindex.php
More file actions
61 lines (56 loc) · 2.71 KB
/
Copy pathindex.php
File metadata and controls
61 lines (56 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
// Apply comprehensive security middleware for login page
require_once __DIR__ . '/back-end/middleware/SecurityMiddleware.php';
// Initialize security for public login page
SecurityMiddleware::initializeSecurity([
'allowed_methods' => ['GET', 'POST'],
'skip_auth' => true, // Skip auth check for login page
'skip_csrf' => true, // Skip CSRF for login page
'apply_rate_limit' => true // Apply rate limiting for login attempts
]);
require_once __DIR__ . '/Database/dbconnect.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login - SOL CRMS</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-100 min-h-screen flex items-center justify-center">
<div class="w-full max-w-sm bg-white rounded-lg shadow-md p-8">
<h2 class="text-2xl font-bold text-center mb-6 text-gray-800">Login</h2>
<?php if (isset($_SESSION['login_error'])): ?>
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4">
<?php echo $_SESSION['login_error']; ?>
</div>
<?php unset($_SESSION['login_error']); ?>
<?php endif; ?>
<?php if (isset($_SESSION['success'])): ?>
<div class="bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4">
<?php echo $_SESSION['success']; ?>
</div>
<?php unset($_SESSION['success']); ?>
<?php endif; ?>
<form action="back-end/login-logout.php" method="post" class="space-y-5">
<div>
<label for="employee_id" class="block text-gray-700 mb-1">Employee ID</label>
<input type="text" id="employee_id" name="employee_id" required
class="w-full px-4 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-400" />
</div>
<div>
<label for="password" class="block text-gray-700 mb-1">Password</label>
<input type="password" id="password" name="password" required
class="w-full px-4 py-2 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-400" />
</div> <button type="submit"
class="w-full py-2 px-4 bg-blue-600 text-white font-semibold rounded hover:bg-blue-700 transition duration-200">
Login
</button>
</form>
<!-- <div class="mt-6 text-center">
<p class="text-gray-600">Don't have an account?</p>
<a href="register.php" class="text-blue-600 hover:text-blue-800 font-medium">Register as Employee</a>
</div> -->
</div>
</body>
</html>