fixes #1508
This commit is contained in:
@@ -48,11 +48,11 @@ class AdvertisementsController < ApplicationController
|
||||
redirect_to advertisements_path, :notice => "Advertisement destroyed"
|
||||
end
|
||||
|
||||
private
|
||||
def advertiser_only
|
||||
if !Danbooru.config.is_user_advertiser?(CurrentUser.user)
|
||||
redirect_to "/static/access_denied"
|
||||
return false
|
||||
end
|
||||
private
|
||||
def advertiser_only
|
||||
if !Danbooru.config.is_user_advertiser?(CurrentUser.user)
|
||||
raise User::PrivilegeError
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class CommentsController < ApplicationController
|
||||
respond_to :html, :xml, :json
|
||||
before_filter :member_only, :only => [:update, :create, :edit, :destroy]
|
||||
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
||||
rescue_from ActiveRecord::StatementInvalid, :with => :search_error
|
||||
|
||||
def index
|
||||
@@ -106,7 +105,6 @@ private
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def search_error(e)
|
||||
if e.message =~ /syntax error in tsquery/
|
||||
@error_message = "Meta-tags are not supported in comment searches by tag"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class ForumPostsController < ApplicationController
|
||||
respond_to :html, :xml, :json, :js
|
||||
before_filter :member_only, :except => [:index, :show]
|
||||
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
||||
|
||||
def new
|
||||
@forum_topic = ForumTopic.find(params[:topic_id]) if params[:topic_id]
|
||||
|
||||
@@ -3,7 +3,6 @@ class ForumTopicsController < ApplicationController
|
||||
before_filter :member_only, :except => [:index, :show]
|
||||
before_filter :normalize_search, :only => :index
|
||||
after_filter :update_last_forum_read_at, :only => [:show]
|
||||
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
||||
|
||||
def new
|
||||
@forum_topic = ForumTopic.new
|
||||
|
||||
@@ -2,7 +2,6 @@ class PoolsController < ApplicationController
|
||||
respond_to :html, :xml, :json, :js
|
||||
before_filter :member_only, :except => [:index, :show]
|
||||
before_filter :moderator_only, :only => [:destroy]
|
||||
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
||||
|
||||
def new
|
||||
@pool = Pool.new
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class PostAppealsController < ApplicationController
|
||||
before_filter :member_only
|
||||
respond_to :html, :xml, :json, :js
|
||||
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
||||
|
||||
def new
|
||||
@post_appeal = PostAppeal.new
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class PostFlagsController < ApplicationController
|
||||
before_filter :member_only
|
||||
respond_to :html, :xml, :json, :js
|
||||
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
||||
|
||||
def new
|
||||
@post_flag = PostFlag.new
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class TagSubscriptionsController < ApplicationController
|
||||
before_filter :member_only, :only => [:new, :edit, :create, :update, :destroy]
|
||||
respond_to :html, :xml, :json
|
||||
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
||||
|
||||
def new
|
||||
@tag_subscription = TagSubscription.new
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
class UserFeedbacksController < ApplicationController
|
||||
before_filter :gold_only, :only => [:new, :edit, :create, :update, :destroy]
|
||||
respond_to :html, :xml, :json
|
||||
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
||||
|
||||
def new
|
||||
@user_feedback = UserFeedback.new(params[:user_feedback])
|
||||
|
||||
Reference in New Issue
Block a user