X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/f547127c637332119b42329ca78d0e1a659d9739..da2d6e5537e9fdcd6f424ea1cc8ab6ef8f45727e:/mail/index.php diff --git a/mail/index.php b/mail/index.php index 8fb49c7..ee7365a 100644 --- a/mail/index.php +++ b/mail/index.php @@ -2,6 +2,7 @@ $mailbox = 'mail/inbox'; @list ($msgid) = explode('/', ltrim($Page->path, '/')); +if (!function_exists('parsemailhead')) { function parsemailhead($headerdata) { $headlist = iconv_mime_decode_headers($headerdata, ICONV_MIME_DECODE_CONTINUE_ON_ERROR); @@ -12,9 +13,14 @@ function parsemailhead($headerdata) }); return $headlist; } +} if ($msgid) { $filename = "$mailbox/$msgid"; + if (!is_readable($filename)) { + return TRUE; + } + list ($headerdata, $rawbody) = explode("\n\n", file_get_contents($filename), 2); $head = parsemailhead($headerdata); $head['date']->setTimezone(new DateTimeZone(date_default_timezone_get())); @@ -49,6 +55,9 @@ if ($msgid) { return; } +if ($Page->api) { + return; +} if (!$User->admin('user')) { http_response_code(403); $Page->place['warn'] = "Geen gebruikersrechten om e-mails in te zien.";