Skip to:
Content

bbPress.org

Opened 13 years ago

Closed 13 years ago

#1684 closed defect (bug) (fixed)

More robust template redirect needed

Reported by: johnjamesjacoby's profile johnjamesjacoby Owned by:
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.0
Component: Component - Users Keywords:
Cc:

Description

bbPress uses WordPress's capabilities API to ensure that only authorized users are able to perform certain tasks. What it doesn't have currently is a way to consistently redirect unauthorized users away from pages they might not belong at.

Right now some code is in a pre_get_posts filter, while some other are littered around their specific template loaders. This makes it difficult to see what's redirecting when, and why.

Change History (2)

#1 @johnjamesjacoby
13 years ago

(In [3605]) Introduce bbp_template_redirect() and use for checking various edit screens:

  • Introduce bbp_check_topic_edit() to check for topic edit
  • Introduce bbp_check_reply_edit() to check for reply edit
  • Introduce bbp_check_topic_tag_edit() to check for topic tag edit
  • Introduce bbp_check_user_edit() to check for user edit
  • Remove these checks from bbp_pre_get_posts() and only use it to setup query vars
  • See #1684
  • For 2.0 branch

#2 @johnjamesjacoby
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3607]) Introduce bbp_template_redirect() and use for checking various edit screens:

  • Introduce bbp_check_forum_edit() to check for forum edit
  • Introduce bbp_check_topic_edit() to check for topic edit
  • Introduce bbp_check_reply_edit() to check for reply edit
  • Introduce bbp_check_topic_tag_edit() to check for topic tag edit
  • Introduce bbp_check_user_edit() to check for user edit
  • Remove these checks from bbp_pre_get_posts() and only use it to setup query vars
  • Fixes #1684, r3605
  • For 2.1 (plugin) branch
Note: See TracTickets for help on using tickets.