Reorganize into monorepo layout, move mitarbeiter-app to legacy reference
Consolidates the previously separate omsorgapp and omsorgCore repos (each had their own nested .git with GitHub history) plus the old root-level website/mitarbeiter-app into a single monorepo, matching the structure already documented in the root CLAUDE.md. Also moves the PHP employee app aside as omsorgWeb/mitarbeiter-app-legacy/ to serve as a template for a ground-up rewrite. Fixes .gitignore in the same pass: the config-secrets/uploads/data patterns were unanchored (relative to repo root, not depth-agnostic), so they silently stopped matching once the app moved under omsorgWeb/. Patterns are now **/-prefixed and cover both mitarbeiter-app and mitarbeiter-app-legacy, keeping DB/SMTP credentials and uploaded employee documents out of version control. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
8beb0fcf52
commit
b6c1389c55
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../lib/auth.php';
|
||||
require_login();
|
||||
|
||||
$config = _omsorgcore_config();
|
||||
$token = $_SESSION['omsorgcore_access_token'];
|
||||
$action = $_POST['action'] ?? '';
|
||||
$employeeId = $_SESSION['omsorgcore_profile']['employeeId'] ?? null;
|
||||
|
||||
if ($action === 'profile') {
|
||||
$email = trim($_POST['email'] ?? '');
|
||||
$telefon = trim($_POST['telefon'] ?? '');
|
||||
|
||||
if ($email !== '' && !filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
header('Location: ../pages/settings.php?error=' . urlencode('Ungültige E-Mail-Adresse.'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$employeeId) {
|
||||
header('Location: ../pages/settings.php?error=' . urlencode('Kein verknüpfter Mitarbeiter-Datensatz gefunden.'));
|
||||
exit;
|
||||
}
|
||||
|
||||
$current = omsorgcore_employees_get($config, $token, $employeeId);
|
||||
if (!$current['ok']) {
|
||||
header('Location: ../pages/settings.php?error=' . urlencode('Profil konnte nicht geladen werden.'));
|
||||
exit;
|
||||
}
|
||||
|
||||
$payload = $current['data'];
|
||||
$payload['email'] = $email;
|
||||
$payload['phoneNumber'] = $telefon;
|
||||
unset($payload['id']);
|
||||
|
||||
$result = omsorgcore_employees_update($config, $token, $employeeId, $payload);
|
||||
if (!$result['ok']) {
|
||||
header('Location: ../pages/settings.php?error=' . urlencode('Profil konnte nicht gespeichert werden.'));
|
||||
exit;
|
||||
}
|
||||
|
||||
_refresh_profile();
|
||||
header('Location: ../pages/settings.php?saved=1');
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action === 'password') {
|
||||
$old = $_POST['old_password'] ?? '';
|
||||
$new = $_POST['new_password'] ?? '';
|
||||
$repeat = $_POST['new_password_repeat'] ?? '';
|
||||
|
||||
if (mb_strlen($new) < 8) {
|
||||
header('Location: ../pages/settings.php?error=' . urlencode('Neues Passwort muss mindestens 8 Zeichen haben.'));
|
||||
exit;
|
||||
}
|
||||
if ($new !== $repeat) {
|
||||
header('Location: ../pages/settings.php?error=' . urlencode('Die neuen Passwörter stimmen nicht überein.'));
|
||||
exit;
|
||||
}
|
||||
|
||||
$result = omsorgcore_change_password($config, $token, $old, $new);
|
||||
if (!$result['ok']) {
|
||||
$message = $result['status'] === 401 ? 'Aktuelles Passwort ist falsch.' : 'Passwort konnte nicht geändert werden.';
|
||||
header('Location: ../pages/settings.php?error=' . urlencode($message));
|
||||
exit;
|
||||
}
|
||||
|
||||
// Serverseitig wurden alle Sessions widerrufen - neuer Login mit dem neuen Passwort ist nötig.
|
||||
_clear_omsorgcore_session();
|
||||
header('Location: ../index.php?pwchanged=1');
|
||||
exit;
|
||||
}
|
||||
|
||||
header('Location: ../pages/settings.php');
|
||||
exit;
|
||||
Reference in New Issue
Block a user