Ticket #2389: 2389.patch
| File 2389.patch, 2.8 KB (added by , 13 years ago) |
|---|
-
includes/admin/forums.php
40 40 */ 41 41 public function __construct() { 42 42 $this->setup_globals(); 43 $this->check_admin_cap(); 43 44 $this->setup_actions(); 44 45 } 45 46 … … 94 95 } 95 96 96 97 /** 98 * Check if the current user have the capability to view the forums admin. 99 * 100 * @since bbPress (rX) 101 */ 102 public function check_admin_cap() { 103 global $pagenow; 104 105 if ( 'post.php' === $pagenow && ! empty( $_GET['post'] ) ) { 106 107 if ( bbp_is_forum( (int) $_GET['post'] ) && ! current_user_can( 'bbp_forums_admin' ) ) 108 wp_die( __( 'You are not allowed to view the forums admin.', 'bbpress' ) ); 109 110 } 111 } 112 113 /** 97 114 * Admin globals 98 115 * 99 116 * @since bbPress (r2646) -
includes/admin/replies.php
40 40 */ 41 41 public function __construct() { 42 42 $this->setup_globals(); 43 $this->check_admin_cap(); 43 44 $this->setup_actions(); 44 45 } 45 46 … … 105 106 } 106 107 107 108 /** 109 * Check if the current user have the capability to view the replies admin. 110 * 111 * @since bbPress (rX) 112 */ 113 public function check_admin_cap() { 114 global $pagenow; 115 116 if ( 'post.php' === $pagenow && ! empty( $_GET['post'] ) ) { 117 118 if ( bbp_is_reply( (int) $_GET['post'] ) && ! current_user_can( 'bbp_replies_admin' ) ) 119 wp_die( __( 'You are not allowed to view the replies admin.', 'bbpress' ) ); 120 121 } 122 } 123 124 /** 108 125 * Admin globals 109 126 * 110 127 * @since bbPress (r2646) -
includes/admin/topics.php
40 40 */ 41 41 public function __construct() { 42 42 $this->setup_globals(); 43 $this->check_admin_cap(); 43 44 $this->setup_actions(); 44 45 } 45 46 … … 105 106 } 106 107 107 108 /** 109 * Check if the current user have the capability to view the topics admin. 110 * 111 * @since bbPress (rX) 112 */ 113 public function check_admin_cap() { 114 global $pagenow; 115 116 if ( 'post.php' === $pagenow && ! empty( $_GET['post'] ) ) { 117 118 if ( bbp_is_topic( (int) $_GET['post'] ) && ! current_user_can( 'bbp_topics_admin' ) ) 119 wp_die( __( 'You are not allowed to view the topics admin.', 'bbpress' ) ); 120 121 } 122 } 123 124 /** 108 125 * Admin globals 109 126 * 110 127 * @since bbPress (r2646)