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