]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-logs.php
Moved language strings, more EL in templates
[mailer.git] / inc / modules / admin / what-logs.php
index bc0c597d0894348b21859ef0aa8eaf2d839fcf4b..590242e06832b08ad6063c096dc306dd6fb429cb 100644 (file)
@@ -55,26 +55,26 @@ if (isGetRequestParameterSet('access')) {
                // 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;
@@ -94,10 +94,7 @@ if (isGetRequestParameterSet('access')) {
                outputHtml('<ol>');
 
                // 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);