Blocking of file uploads by admin
This commit is contained in:
parent
6c020342a3
commit
b747b611b3
2 changed files with 23 additions and 0 deletions
|
@ -5,6 +5,8 @@ require 'instiki_errors'
|
|||
class FileController < ApplicationController
|
||||
|
||||
layout 'default'
|
||||
|
||||
before_filter :check_allow_uploads
|
||||
|
||||
def file
|
||||
check_path
|
||||
|
@ -43,6 +45,17 @@ class FileController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
protected
|
||||
|
||||
def check_allow_uploads
|
||||
unless @web.allow_uploads
|
||||
render_text 'File uploads are blocked by the webmaster', '403 Forbidden'
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def check_path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue