98 lines
3.8 KiB
Plaintext
98 lines
3.8 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Login - Stundenerfassung</title>
|
|
<link rel="icon" type="image/png" href="/images/favicon.png">
|
|
<link rel="stylesheet" href="/css/style.css">
|
|
<%- include('header') %>
|
|
</head>
|
|
<body>
|
|
<div class="login-container">
|
|
<div class="login-box">
|
|
<h1>Stundenerfassung</h1>
|
|
<h2>Anmeldung</h2>
|
|
|
|
<% if (error) { %>
|
|
<div class="error-message"><%= error %></div>
|
|
<% } %>
|
|
|
|
<form method="POST" action="/login" accept-charset="UTF-8" id="loginForm">
|
|
<div class="form-group">
|
|
<label for="username">Benutzername</label>
|
|
<input type="text" id="username" name="username" required autofocus>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="password">Passwort</label>
|
|
<input type="password" id="password" name="password" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label style="display: flex; align-items: flex-start; cursor: pointer;">
|
|
<input type="checkbox" name="remember_me" id="remember_me" style="margin-right: 8px; margin-top: 2px;">
|
|
<span style="display: flex; flex-direction: column;">
|
|
<span>Angemeldet bleiben</span>
|
|
<span style="font-size: 0.9em; color: #666;">(30 Tage)</span>
|
|
</span>
|
|
</label>
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-primary">Anmelden</button>
|
|
</form>
|
|
|
|
<script>
|
|
// Debug-Logging für LDAP-Authentifizierung mit UTF-8-Zeichen
|
|
document.getElementById('loginForm').addEventListener('submit', function(e) {
|
|
const usernameInput = document.getElementById('username');
|
|
const username = usernameInput.value;
|
|
|
|
console.group('🔍 LDAP Login Debug - Browser Console');
|
|
console.log('=== Username Analysis ===');
|
|
console.log('Original Input:', username);
|
|
console.log('String Length:', username.length);
|
|
console.log('Type:', typeof username);
|
|
|
|
// UTF-8 Byte-Repräsentation
|
|
const encoder = new TextEncoder();
|
|
const utf8Bytes = encoder.encode(username);
|
|
console.log('UTF-8 Bytes:', Array.from(utf8Bytes));
|
|
console.log('UTF-8 Bytes (Hex):', Array.from(utf8Bytes).map(b => '0x' + b.toString(16).padStart(2, '0')).join(' '));
|
|
|
|
// Einzelne Zeichen analysieren
|
|
console.log('=== Character Analysis ===');
|
|
for (let i = 0; i < username.length; i++) {
|
|
const char = username[i];
|
|
const codePoint = char.codePointAt(0);
|
|
const utf8BytesForChar = encoder.encode(char);
|
|
console.log(`Position ${i}: "${char}" | CodePoint: U+${codePoint.toString(16).toUpperCase().padStart(4, '0')} (${codePoint}) | UTF-8 Bytes: [${Array.from(utf8BytesForChar).join(', ')}]`);
|
|
}
|
|
|
|
// Form-Daten, die gesendet werden
|
|
console.log('=== Form Data ===');
|
|
const formData = new FormData(this);
|
|
const formDataObj = {};
|
|
for (let [key, value] of formData.entries()) {
|
|
if (key === 'password') {
|
|
formDataObj[key] = '***hidden***';
|
|
} else {
|
|
formDataObj[key] = value;
|
|
}
|
|
}
|
|
console.log('Form Data Object:', formDataObj);
|
|
console.log('Username in FormData:', formData.get('username'));
|
|
|
|
// URL-Encoding Test
|
|
console.log('=== URL Encoding Test ===');
|
|
console.log('encodeURIComponent(username):', encodeURIComponent(username));
|
|
console.log('encodeURI(username):', encodeURI(username));
|
|
|
|
console.groupEnd();
|
|
});
|
|
</script>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|