diff --git a/classes/Logging.php b/classes/Logging.php index bed091b..93c669d 100644 --- a/classes/Logging.php +++ b/classes/Logging.php @@ -1,11 +1,10 @@ filename = $filename; + $this->filename = $filename; } /** @@ -61,13 +60,13 @@ class Logging { if (LOG_FILE) { - $h = @fopen($this -> filename, 'ab'); + $h = @fopen($this->filename, 'ab'); if ($h === false) { throw new ExceptionDisplay('Could not open log file for writing.' . ' Make sure PHP has write permission to this file.'); } - global $dir, $ip, $host; - $referrer = (!empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'N/A'); + global $dir, $ip, $host, $request; + $referrer = (!$request->server('HTTP_REFERER') ? $request->server('HTTP_REFERER') : 'N/A'); fwrite($h, date(DATE_FORMAT) . "\t" . date('H:i:s') . "\t$ip\t$host\t$referrer\t$dir\t$extra\n"); fclose($h); } @@ -78,23 +77,27 @@ class Logging */ public function display($max_num_to_display) { - if (!@is_file($this -> filename)) + if (!@is_file($this->filename)) { throw new ExceptionDisplay('There are no entries in the log file.'); } - $file_array = @file($this -> filename); + $file_array = @file($this->filename); if ($file_array === false) { throw new ExceptionDisplay('Could not open log file for reading.'); } $count_log = count($file_array); $num = (($max_num_to_display == 0) ? $count_log : min($max_num_to_display, $count_log)); - $out = "

Viewing $num (of $count_log) entries.

\n" - . '' - . '' - . '' - . '' - . ''; + $out = "

Viewing $num (of $count_log) entries.

\n" . ' +
#DateTimeIP addressHostnameReferrerDirectoryFile downloaded or other info
+ ' . ' + ' . ' + + ' . ' + + ' . ' + + '; for ($i = 0; $i < $num; $i++) { $class = (($i % 2) ? 'dark_row' : 'light_row'); @@ -112,18 +115,14 @@ class Logging { $cell = "$cell"; } - $out .= '' : "$cell"); + $out .= '' : "$cell"); } $out .= "\n"; } - global $words; - $out .= '
#DateTimeIP addressHostnameReferrerDirectoryFile downloaded or other info
' . (($cell == '') ? ' ' . (($cell == '') ? ' 

' . $words -> __get('continue') - . '.

'; + global $words, $request; + $out .= '

' . $words->__get('continue') . '.

'; echo new Display($out); die(); } } - -?> \ No newline at end of file +?>