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:
Felix Kemmler
2026-08-07 14:21:37 +02:00
co-authored by Claude Sonnet 5
parent 8beb0fcf52
commit b6c1389c55
355 changed files with 24348 additions and 361 deletions
+154
View File
@@ -0,0 +1,154 @@
<?php
// OMSORG Formularversand
// Voraussetzung: PHP mit aktivierter mail()-Funktion auf dem Webhosting.
mb_internal_encoding('UTF-8');
$recipient = 'info@omsorg-pflegedienste.de';
$maxFileSize = 10 * 1024 * 1024;
$allowedExtensions = ['pdf','doc','docx','jpg','jpeg','png'];
function clean_text($value) {
$value = is_array($value) ? '' : (string)$value;
$value = str_replace(["\r", "\0"], '', $value);
return trim($value);
}
function h($value) {
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
function field($name) {
return clean_text($_POST[$name] ?? '');
}
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
header('Location: index.html');
exit;
}
$formType = field('form_type');
$name = field('name');
$telefon = field('telefon');
$email = field('email');
$nachricht = field('nachricht');
if ($name === '' || $telefon === '') {
http_response_code(400);
$statusTitle = 'Bitte Pflichtfelder ausfüllen';
$statusText = 'Name und Telefon sind erforderlich.';
include __DIR__ . '/send-status-template.php';
exit;
}
$lines = [];
$subject = '';
if ($formType === 'bewerbung') {
$subject = 'Neue Bewerbung über omsorg-pflegedienste.de';
$lines[] = 'Neue Bewerbung über die Website';
$lines[] = '';
$lines[] = 'Name: ' . $name;
$lines[] = 'Telefon: ' . $telefon;
$lines[] = 'E-Mail: ' . ($email ?: 'nicht angegeben');
$lines[] = '';
$lines[] = 'Nachricht:';
$lines[] = $nachricht ?: 'keine Nachricht angegeben';
} elseif ($formType === 'einrichtung') {
$einrichtung = field('einrichtung');
$qualifikation = field('qualifikation');
$zeitraumVon = field('zeitraum_von');
$zeitraumBis = field('zeitraum_bis');
if ($einrichtung === '' || $qualifikation === '' || $zeitraumVon === '' || $zeitraumBis === '') {
http_response_code(400);
$statusTitle = 'Bitte Pflichtfelder ausfüllen';
$statusText = 'Einrichtung, Qualifikation und Zeitraum sind erforderlich.';
include __DIR__ . '/send-status-template.php';
exit;
}
$subject = 'Neue Personalanfrage über omsorg-pflegedienste.de';
$lines[] = 'Neue Personalanfrage über die Website';
$lines[] = '';
$lines[] = 'Einrichtung / Unternehmen: ' . $einrichtung;
$lines[] = 'Ansprechpartner: ' . $name;
$lines[] = 'Telefon: ' . $telefon;
$lines[] = 'E-Mail: ' . ($email ?: 'nicht angegeben');
$lines[] = 'Benötigte Unterstützung: ' . $qualifikation;
$lines[] = 'Zeitraum: ' . $zeitraumVon . ' bis ' . $zeitraumBis;
$lines[] = '';
$lines[] = 'Weitere Angaben:';
$lines[] = $nachricht ?: 'keine weiteren Angaben';
} else {
http_response_code(400);
$statusTitle = 'Formular nicht erkannt';
$statusText = 'Bitte versuchen Sie es erneut.';
include __DIR__ . '/send-status-template.php';
exit;
}
$bodyText = implode("\n", $lines) . "\n\n---\nGesendet über omsorg-pflegedienste.de";
$from = 'no-reply@omsorg-pflegedienste.de';
$replyTo = filter_var($email, FILTER_VALIDATE_EMAIL) ? $email : $recipient;
$headers = [];
$headers[] = 'From: OMSORG Website <' . $from . '>';
$headers[] = 'Reply-To: ' . $replyTo;
$headers[] = 'MIME-Version: 1.0';
$hasAttachment = isset($_FILES['anlage']) && $_FILES['anlage']['error'] !== UPLOAD_ERR_NO_FILE;
if ($hasAttachment && $formType === 'bewerbung') {
if ($_FILES['anlage']['error'] !== UPLOAD_ERR_OK || $_FILES['anlage']['size'] > $maxFileSize) {
http_response_code(400);
$statusTitle = 'Datei konnte nicht gesendet werden';
$statusText = 'Bitte laden Sie eine Datei bis maximal 10 MB hoch.';
include __DIR__ . '/send-status-template.php';
exit;
}
$originalName = basename($_FILES['anlage']['name']);
$extension = strtolower(pathinfo($originalName, PATHINFO_EXTENSION));
if (!in_array($extension, $allowedExtensions, true)) {
http_response_code(400);
$statusTitle = 'Dateiformat nicht erlaubt';
$statusText = 'Erlaubt sind PDF, DOC, DOCX, JPG und PNG.';
include __DIR__ . '/send-status-template.php';
exit;
}
$boundary = 'omsorg_' . md5(uniqid((string)mt_rand(), true));
$headers[] = 'Content-Type: multipart/mixed; boundary="' . $boundary . '"';
$message = '--' . $boundary . "\r\n";
$message .= "Content-Type: text/plain; charset=UTF-8\r\n";
$message .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
$message .= $bodyText . "\r\n\r\n";
$fileContent = chunk_split(base64_encode(file_get_contents($_FILES['anlage']['tmp_name'])));
$safeFileName = preg_replace('/[^A-Za-z0-9._-]/', '_', $originalName);
$finfo = new finfo(FILEINFO_MIME_TYPE);
$mimeType = $finfo->file($_FILES['anlage']['tmp_name']) ?: 'application/octet-stream';
$message .= '--' . $boundary . "\r\n";
$message .= 'Content-Type: ' . $mimeType . '; name="' . $safeFileName . '"' . "\r\n";
$message .= "Content-Transfer-Encoding: base64\r\n";
$message .= 'Content-Disposition: attachment; filename="' . $safeFileName . '"' . "\r\n\r\n";
$message .= $fileContent . "\r\n";
$message .= '--' . $boundary . '--';
} else {
$headers[] = 'Content-Type: text/plain; charset=UTF-8';
$message = $bodyText;
}
$sent = mail($recipient, '=?UTF-8?B?' . base64_encode($subject) . '?=', $message, implode("\r\n", $headers));
if ($sent) {
$statusTitle = 'Vielen Dank!';
$statusText = 'Ihre Nachricht wurde erfolgreich an OMSORG gesendet. Wir melden uns schnellstmöglich bei Ihnen.';
} else {
http_response_code(500);
$statusTitle = 'Versand nicht möglich';
$statusText = 'Die Nachricht konnte vom Server nicht versendet werden. Bitte kontaktieren Sie uns direkt per E-Mail: info@omsorg-pflegedienste.de';
}
include __DIR__ . '/send-status-template.php';