Upload via GUI (273 Dateien)
This commit is contained in:
@@ -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/mail_text.php';
|
||||
|
||||
/** Verarbeitet eine Mail nach dem Einlesen gemäß dem gewählten Modus */
|
||||
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.
|
||||
$sourceFolderAfterFetch = $afterFetch === 'archive' ? $archiveFolder : $account['folder'];
|
||||
|
||||
// Nachrichtentext
|
||||
$body = imap_fetchbody($mbox, $emailNum, '1');
|
||||
$body = quoted_printable_decode($body);
|
||||
// Nachrichtentext: Text-Teil bevorzugt, bei reinen HTML-Mails (Newsletter) nur der sichtbare Text ohne CSS und Skripte
|
||||
$structure = @imap_fetchstructure($mbox, $emailNum);
|
||||
$body = $structure ? mail_best_text($structure, fn(string $no) => (string) imap_fetchbody($mbox, $emailNum, $no)) : '';
|
||||
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? ──────────────────────────────────
|
||||
if (preg_match('/\[#([0-9]{6}-[0-9]{4})\]/', $subject, $m)) {
|
||||
|
||||
@@ -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) {
|
||||
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->execute([$ticket['locked_by']]);
|
||||
return $stmt->fetchColumn() ?: 'ein anderer Mitarbeiter';
|
||||
|
||||
Reference in New Issue
Block a user