rosa-build/app/controllers/downloads_controller.rb

22 lines
596 B
Ruby
Raw Normal View History

2011-10-14 07:35:25 +01:00
class DownloadsController < ApplicationController
2011-10-24 14:01:15 +01:00
before_filter :authenticate_user!
load_and_authorize_resource
2011-10-24 14:01:15 +01:00
2011-10-14 07:35:25 +01:00
def index
@downloads = Download.paginate :page => params[:page], :per_page => 30
end
def refresh
Download.rotate_nginx_log
2011-10-31 16:18:55 +00:00
Download.parse_and_remove_nginx_log
redirect_to downloads_path, :notice => t('flash.downloads.statistics_refreshed')
end
2011-11-03 10:32:56 +00:00
def test_sudo
system('sudo touch /home/rosa/test_sudo1.txt')
system('/usr/bin/sudo /bin/touch /home/rosa/test_sudo2.txt')
2011-11-03 11:16:17 +00:00
redirect_to downloads_path, :notice => 'Sudo tested!'
2011-11-03 10:32:56 +00:00
end
2011-10-14 07:35:25 +01:00
end