rosa-build/app/controllers/downloads_controller.rb

22 lines
596 B
Ruby

class DownloadsController < ApplicationController
before_filter :authenticate_user!
load_and_authorize_resource
def index
@downloads = Download.paginate :page => params[:page], :per_page => 30
end
def refresh
Download.rotate_nginx_log
Download.parse_and_remove_nginx_log
redirect_to downloads_path, :notice => t('flash.downloads.statistics_refreshed')
end
def test_sudo
system('sudo touch /home/rosa/test_sudo1.txt')
system('/usr/bin/sudo /bin/touch /home/rosa/test_sudo2.txt')
redirect_to downloads_path, :notice => 'Sudo tested!'
end
end