Changeset 3607 for branches/plugin/bbp-includes/bbp-user-functions.php
- Timestamp:
- 11/14/2011 03:50:25 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-user-functions.php
r3505 r3607 1249 1249 } 1250 1250 1251 /** Premissions ***************************************************************/ 1252 1253 /** 1254 * Redirect if unathorized user is attempting to edit a topic 1255 * 1256 * @since bbPress (r3605) 1257 * 1258 * @uses bbp_is_topic_edit() 1259 * @uses current_user_can() 1260 * @uses bbp_get_topic_id() 1261 * @uses wp_safe_redirect() 1262 * @uses bbp_get_topic_permalink() 1263 */ 1264 function bbp_check_user_edit() { 1265 1266 // Bail if not editing a topic 1267 if ( !bbp_is_single_user_edit() ) 1268 return; 1269 1270 // Only allow super admins on multisite to edit every user. 1271 if ( !is_user_logged_in() || ( is_multisite() && !current_user_can( 'manage_network_users' ) && bbp_is_user_home() && !apply_filters( 'enable_edit_any_user_configuration', true ) ) || !current_user_can( 'edit_user', bbp_get_displayed_user_id() ) ) { 1272 wp_safe_redirect( bbp_get_user_profile_url( bbp_get_displayed_user_id() ) ); 1273 exit(); 1274 } 1275 } 1276 1251 1277 ?>
Note: See TracChangeset
for help on using the changeset viewer.