Project

General

Profile

How could I log usernames of downloads from the "Files" section?

Added by Matt Henderson over 12 years ago

Hello everyone,

I was just wondering if there was a way to log downloads from the "Files" section? I would like to log the Redmine username on download. Would this be possible through a Plugin, or the log functionality of Redmine?

I tried to do a comprehensive search and didn't find much on this topic, although using search terms involving things like "log" and "download" tended to get washed out by many other unrelated topics.

The closest I could get was to filter through the Apache access.log, giving me the ip address. I thought I should ask on here before trying a somewhat complicated solution involving matching up Redmine usernames to ip addresses depending on the time of the GET - assuming I can even figure out how to log username-ip address logins :).

Thank you for your time.

Matt


Replies (1)

RE: How could I log usernames of downloads from the "Files" section? - Added by Matt Henderson over 12 years ago

For a short-term fix, I set up a new log in Apache and filtered for the Redmine Files directory (one of my Google searches turned up how to access the Redmine username in the Apache log format).

I would really like to get this logging to show up in the corresponding Redmine Project pages though, and so I have started researching writing a Plugin. I have a basic Plugin started, it is showing up in the menu, permissions, etc. as in the tutorial - but with no actual functionality.

So I was wondering:

Would I be able to log this info when a file from the File tab is downloaded?

Would I use alias_method_chain to add in the data logging to this download method? I'm having trouble finding out how I should do this - I'm not sure even where this download code is in Redmine.

Can I get details such as username, filename/id, project, etc.?

I'm guessing that once I have this method, I can log these into the SQL database and then display it (in a similar way to the Plugin tutorial).

This would be my first Ruby/Ruby on Rails project and I would just like to know which direction to start looking in and if it is a realistic thing to try.

Any help is very much appreciated :) Thank you.

Matt

    (1-1/1)