Skip to content

Commit

Permalink
Item8767: log viewfile
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@6890 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
WillNorris authored and WillNorris committed Mar 25, 2010
1 parent 7f3833b commit ec1b4c1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/lib/Foswiki.spec
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,9 @@ $Foswiki::cfg{Log}{Action} = {
attach => 1,
rename => 1,
register => 1,
rest => 1 };
rest => 1,
viewfile => 1,
};
# **NUMBER**
# Number of top viewed topics to show in statistics topic
Expand Down
6 changes: 6 additions & 0 deletions core/lib/Foswiki/UI/Viewfile.pm
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ sub viewfile {

Foswiki::UI::checkAccess( $session, 'VIEW', $topicObject );

my $logEntry = $fileName;
$logEntry .= ", r$rev" if $rev;
if ($Foswiki::cfg{Log}{Action}{viewfile}) {
$session->writeLog( 'viewfile', $web.'.'.$topic, $logEntry );
}

my $fh = $topicObject->openAttachment( $fileName, '<', version => $rev );

my $type = _suffixToMimeType($fileName);
Expand Down

0 comments on commit ec1b4c1

Please sign in to comment.