Files
omsorg/omsorgWeb/mitarbeiter-app/index.php
T
Felix KemmlerandClaude Sonnet 5 e9e96a57dc Add facilities, contracts, orders, value lists, audit log, and desktop app modules
Extends omsorgCore with full CRUD for Facility/Contract/Order plus
configurable value lists and an audit trail, and wires the omsorgapp
frontend up to the new facilities, settings, and audit-log modules;
includes a sidebar active-nav-item highlight.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-08 23:29:16 +02:00

87 lines
2.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
require_once __DIR__ . '/lib/auth.php';
if (is_logged_in()) {
header('Location: pages/dashboard.php');
exit;
}
$error = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
verify_csrf();
$username = trim($_POST['username'] ?? '');
$password = $_POST['password'] ?? '';
if ($username !== '' && $password !== '') {
$result = omsorgcore_login(_omsorgcore_config(), $username, $password);
if ($result['ok']) {
session_regenerate_id(true);
_apply_token_pair($result['data']);
_refresh_profile();
header('Location: pages/dashboard.php');
exit;
}
if ($result['status'] === 429) {
$error = 'Zu viele Fehlversuche. Bitte warte ca. 10 Minuten.';
} elseif ($result['status'] === 0) {
$error = 'Server nicht erreichbar. Bitte später erneut versuchen.';
} else {
$error = 'Benutzername oder Passwort falsch.';
}
} else {
$error = 'Benutzername oder Passwort falsch.';
}
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>OMSORG Mitarbeiter-App Login</title>
<link rel="stylesheet" href="app.css">
</head>
<body>
<div class="login-page">
<div class="login-card glass">
<div class="brand" style="text-align:center">
<img src="assets/omsorg-wordmark-new.png" alt="OMSORG" style="width:210px;margin:0 auto 22px">
</div>
<h2 style="font-family:'KindelSerif',Georgia,serif;font-size:1.7rem;margin:0 0 6px">Mitarbeiter-App</h2>
<p class="hint" style="margin:0 0 22px">Melde dich mit deinem Benutzerkonto an.</p>
<?php if ($error): ?>
<div class="error" style="margin-bottom:16px"><?= e($error) ?></div>
<?php elseif (isset($_GET['pwchanged'])): ?>
<div class="hint" style="margin-bottom:16px">Passwort geändert. Bitte melde dich neu an.</div>
<?php endif; ?>
<form method="post">
<?= csrf_field() ?>
<label>
Benutzername
<input type="text" name="username" autocomplete="username" required autofocus
value="<?= e($_POST['username'] ?? '') ?>">
</label>
<label>
Passwort
<input type="password" name="password" autocomplete="current-password" required>
</label>
<button type="submit" class="btn" style="width:100%;margin-top:6px">Anmelden</button>
</form>
<p class="hint" style="text-align:center;margin-top:14px">
<a href="pages/forgot-password.php">Passwort vergessen?</a>
</p>
</div>
</div>
</body>
</html>