Upload via GUI (273 Dateien)

This commit is contained in:
2026-10-22 18:59:36 +00:00
parent 506ba8f7be
commit df19622630
2 changed files with 12 additions and 5 deletions
+8 -5
View File
@@ -27,6 +27,7 @@ if (php_sapi_name() !== 'cli' && !defined('DESKHUB_CRON_RUNNER')) { http_respons
*/ */
require_once __DIR__ . '/../includes/bootstrap.php'; require_once __DIR__ . '/../includes/bootstrap.php';
require_once __DIR__ . '/../includes/mail_text.php';
/** Verarbeitet eine Mail nach dem Einlesen gemäß dem gewählten Modus */ /** Verarbeitet eine Mail nach dem Einlesen gemäß dem gewählten Modus */
function handle_after_fetch(mixed $mbox, int $emailNum, string $mode, string $folder): void function handle_after_fetch(mixed $mbox, int $emailNum, string $mode, string $folder): void
@@ -174,13 +175,15 @@ function fetch_emails_for_account(PDO $pdo, array $account, bool $verbose): arra
// Bei "delete" bleibt die Zuordnung zwar erhalten, die Originalmail ist danach jedoch nicht mehr verschiebbar. // Bei "delete" bleibt die Zuordnung zwar erhalten, die Originalmail ist danach jedoch nicht mehr verschiebbar.
$sourceFolderAfterFetch = $afterFetch === 'archive' ? $archiveFolder : $account['folder']; $sourceFolderAfterFetch = $afterFetch === 'archive' ? $archiveFolder : $account['folder'];
// Nachrichtentext // Nachrichtentext: Text-Teil bevorzugt, bei reinen HTML-Mails (Newsletter) nur der sichtbare Text ohne CSS und Skripte
$body = imap_fetchbody($mbox, $emailNum, '1'); $structure = @imap_fetchstructure($mbox, $emailNum);
$body = quoted_printable_decode($body); $body = $structure ? mail_best_text($structure, fn(string $no) => (string) imap_fetchbody($mbox, $emailNum, $no)) : '';
if (trim($body) === '') { if (trim($body) === '') {
$body = imap_fetchbody($mbox, $emailNum, '1.1') ?: '(kein Inhalt)'; // Unbekannter Aufbau: wie bisher den ersten Teil lesen, aber ebenfalls als Text aufbereiten
$raw = quoted_printable_decode((string) imap_fetchbody($mbox, $emailNum, '1'));
$body = mail_html_to_text($raw !== '' ? $raw : (string) imap_fetchbody($mbox, $emailNum, '1.1'));
} }
$body = trim(strip_tags($body)); if (trim($body) === '') $body = '(kein Inhalt)';
// ── Antwort auf bestehendes Ticket? ────────────────────────────────── // ── Antwort auf bestehendes Ticket? ──────────────────────────────────
if (preg_match('/\[#([0-9]{6}-[0-9]{4})\]/', $subject, $m)) { if (preg_match('/\[#([0-9]{6}-[0-9]{4})\]/', $subject, $m)) {
+4
View File
@@ -735,6 +735,10 @@ function live_chat_locked_by_other(array $ticket, int $staffId, PDO $pdo): ?stri
if (empty($ticket['locked_by']) || (int) $ticket['locked_by'] === $staffId || !$lockFresh) { if (empty($ticket['locked_by']) || (int) $ticket['locked_by'] === $staffId || !$lockFresh) {
return null; return null;
} }
// Administratoren werden nie ausgesperrt: sie dürfen auch einen fremd "besessenen" Chat lesen und beantworten (und übernehmen die Sperre)
$r = $pdo->prepare('SELECT role FROM staff WHERE id = ?');
$r->execute([$staffId]);
if ($r->fetchColumn() === 'admin') return null;
$stmt = $pdo->prepare('SELECT name FROM staff WHERE id = ?'); $stmt = $pdo->prepare('SELECT name FROM staff WHERE id = ?');
$stmt->execute([$ticket['locked_by']]); $stmt->execute([$ticket['locked_by']]);
return $stmt->fetchColumn() ?: 'ein anderer Mitarbeiter'; return $stmt->fetchColumn() ?: 'ein anderer Mitarbeiter';