log of users who download documents or files
Added by Schollii Tron over 11 years ago
What would be easiest way of generating a log of [username, IP_address, date, filename] for a particular project? All of this information must already be available to redmine at the moment the user requests a document or file. Any plugin expert who could provide me with 10 second skeleton for a plugin that would do this, then I could figure out the rest (add missing code etc); or if the data is already available in some log files, I can easily create some scripts, just don't know where to look to start. Any guidance would be much appreciated.
Replies (2)
RE: log of users who download documents or files - Added by Paresh Patel over 11 years ago
hi,
Installing a plugin¶
1. Copy your plugin directory into #{RAILS_ROOT}/plugins (Redmine 2.x) or #{RAILS_ROOT}/vendor/plugins (Redmine 1.x). If you are downloading the plugin directly from GitHub, you can do so by changing into your plugin directory and issuing a command like git clone git://github.com/user_name/name_of_the_plugin.git.
2. If the plugin requires a migration, run the following command to upgrade your database (make a db backup before).
2.1. For Redmine 1.x:
rake db:migrate_plugins RAILS_ENV=production
2.2. For Redmine 2.x:
rake redmine:plugins:migrate RAILS_ENV=production
3. Restart Redmine
You should now be able to see the plugin list in Administration -> Plugins and configure the newly installed plugin (if the plugin requires to be configured).
Edit
Uninstalling a plugin
1. If the plugin required a migration, run the following command to downgrade your database (make a db backup before):
1.1. For Redmine 1.x:
rake db:migrate:plugin NAME=plugin_name VERSION=0 RAILS_ENV=production
1.2. For Redmine 2.x:
rake redmine:plugins:migrate NAME=plugin_name VERSION=0 RAILS_ENV=production
2. Remove your plugin from the plugins folder: #{RAILS_ROOT}/plugins (Redmine 2.x) or #{RAILS_ROOT}/vendor/plugins (Redmine 1.x)..
3. Restart Redmine
-----------------------------------------------------------------------------------------
or
follow this link : http://www.redmine.org/projects/redmine/wiki/Plugin_Tutorial
any problem then reply me
Form : Paresh.Patel
Email Id : pareshsabva@gmail.com
RE: log of users who download documents or files - Added by Schollii Tron over 11 years ago
Thanks Paresh for the info. Currently I have a block of custom code in the AttachmentsController itself, the custom code just logs information from User.current, request and @attachment to log.info. But it would be nice to hook into the controller via a redmine- or rails- supported mechanism, rather than modify the .rb file. So I believe what I need is not a plugin, but a hook into the AttachmentsController. Unfortunately on the Plugin_Tutorial page the one section that has TODO is the "hook into controller" section :( Any info you know that might get me started on controller hooks?