X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-logs.php;h=590242e06832b08ad6063c096dc306dd6fb429cb;hb=41792f2d1a2478a284c663c02b2f64ca74b2e3df;hp=829bc839bad52f457e7c92aa847fe296b65bd41a;hpb=04b69ac9f33369cbf654396c4a42cb1fff710ff4;p=mailer.git diff --git a/inc/modules/admin/what-logs.php b/inc/modules/admin/what-logs.php index 829bc839ba..590242e068 100644 --- a/inc/modules/admin/what-logs.php +++ b/inc/modules/admin/what-logs.php @@ -48,33 +48,33 @@ addMenuDescription('admin', __FILE__); if (isGetRequestParameterSet('access')) { // Secure input and construct FQFN $access = SQL_ESCAPE(secureString(getRequestParameter('access'))); - $target = sprintf("%slogs/%s", getConfig('PATH'), $access); + $target = sprintf("%slogs/%s", getPath(), $access); // Is the file valid and readable? if (isFileReadable($target)) { // Load it directly $content = readFromFile($target); - // Save old content - $OUTPUT = ob_get_contents(); - - // Clean content - clearOutputBuffer(); - // Set header if (substr($access, -3, 3) == 'log') { // Output header sendHeader('Content-Type: text/plain'); + + // Clean content + clearOutputBuffer(); } elseif (substr($access, -3, 3) == '.gz') { // @TODO Fix content-type here sendHeader('Content-Type: text/plain'); + + // Clean content + clearOutputBuffer(); } elseif (substr($access, -3, 3) == '.bz2') { // @TODO Fix content-type here sendHeader('Content-Type: text/plain'); - } else { - // Restore old content - outputHtml($OUTPUT); + // Clean content + clearOutputBuffer(); + } else { // Output message loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNKNOWN_LOGFILE_FORMAT', $access)); return; @@ -89,15 +89,12 @@ if (isGetRequestParameterSet('access')) { } } else { // Is the directory there? - if (isDirectory(getConfig('PATH') . getConfig('logs_base'))) { + if (isDirectory(getPath() . getConfig('logs_base'))) { // Logs directory does exist so begin the list outputHtml('
    '); // Read all files - $files = getArrayFromDirectory(getConfig('logs_base'), 'access'); - - // And walk through them - foreach ($files as $file) { + foreach (getArrayFromDirectory(getConfig('logs_base'), 'access') as $file) { // Cut dirname away $file = basename($file);