2012-01-30 20:39:34 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2011-10-14 07:35:25 +01:00
|
|
|
class DownloadsController < ApplicationController
|
2011-10-24 14:01:15 +01:00
|
|
|
before_filter :authenticate_user!
|
2011-11-24 21:46:19 +00:00
|
|
|
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
|
2011-10-31 15:57:44 +00:00
|
|
|
|
|
|
|
def refresh
|
|
|
|
Download.rotate_nginx_log
|
2011-10-31 16:18:55 +00:00
|
|
|
Download.parse_and_remove_nginx_log
|
2011-10-31 15:57:44 +00:00
|
|
|
|
|
|
|
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
|