summaryrefslogtreecommitdiff
path: root/app/controllers/forumthreads_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/forumthreads_controller.rb')
-rw-r--r--app/controllers/forumthreads_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/forumthreads_controller.rb b/app/controllers/forumthreads_controller.rb
index d40ce58..4a3a5c1 100644
--- a/app/controllers/forumthreads_controller.rb
+++ b/app/controllers/forumthreads_controller.rb
@@ -10,6 +10,7 @@ class ForumthreadsController < ApplicationController
@threads = Forumthread.filter(current_user, params[:title].try(:slice, 0..255), params[:content].try(:slice, 0..255), params[:reply].try(:slice, 0..255), params[:label], User.find_by(ign: params[:author].to_s.strip) || params[:author], params[:query].try(:slice, 0..255), Forum.find_by(id: params[:forum]))
.page(params[:page]).per(30)
end
+
def show
if params[:reverse] == "true"
@replies = @thread.replies.order(id: :desc).page(params[:page])
@@ -72,7 +73,7 @@ class ForumthreadsController < ApplicationController
end
def destroy
- if mod? || @thread.author.is?(current_user)
+ if mod? || (@thread.author.is?(current_user) && !@thread.forum.disable_deletion)
if @thread.destroy
flash[:notice] = "Thread deleted!"
else