Changeset 8432 for trunk/src/bp-members/bp-members-admin.php
- Timestamp:
- 05/20/2014 03:33:49 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-members/bp-members-admin.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-admin.php
r8318 r8432 318 318 } ?> 319 319 320 < ulid="profile-nav" class="nav-tab-wrapper">320 <h2 id="profile-nav" class="nav-tab-wrapper"> 321 321 <?php 322 322 /** … … 326 326 */ 327 327 ?> 328 <?php if ( current_user_can( 'edit_user' ) ) :?> 329 <li class="nav-tab<?php echo esc_attr( $wp_active ); ?>"><a href="<?php echo esc_url( $wordpress_url );?>"><?php _e( 'Profile', 'buddypress' ); ?></a></li> 330 <?php endif ;?> 331 <li class="nav-tab<?php echo esc_attr( $bp_active ); ?>"><a href="<?php echo esc_url( $community_url );?>"><?php _e( 'Extended Profile', 'buddypress' ); ?></a></li> 332 333 <?php do_action( 'bp_members_admin_profile_nav', $active, $user ); ?> 334 </ul> 328 <?php if ( current_user_can( 'edit_user' ) ) : ?> 329 <a class="nav-tab<?php echo esc_attr( $wp_active ); ?>" href="<?php echo esc_url( $wordpress_url );?>"><?php _e( 'Profile', 'buddypress' ); ?></a> 330 <?php endif; ?> 331 <a class="nav-tab<?php echo esc_attr( $bp_active ); ?>" href="<?php echo esc_url( $community_url );?>"><?php _e( 'Extended Profile', 'buddypress' ); ?></a> 332 </h2> 335 333 336 334 <?php … … 351 349 if ( ! $user_id = intval( $_GET['user_id'] ) ) { 352 350 wp_die( __( 'No users were found', 'buddypress' ) ); 353 }354 355 // only edit others profile356 if ( get_current_user_id() == $user_id ) {357 bp_core_redirect( get_edit_user_link( $user_id ) );358 351 } 359 352 … … 632 625 <div id="misc-publishing-actions"> 633 626 <?php 627 628 // Get the spam status once here to compare against below 629 $is_spammer = bp_is_user_spammer( $user->ID ); 630 634 631 /** 635 * In configs where BuddyPress is not network activated, regular admins 636 * cannot mark a user as a spammer on front end. This prevent them to do 637 * it in backend. 632 * In configs where BuddyPress is not network activated, 633 * regular admins cannot mark a user as a spammer on front 634 * end. This prevent them to do it in backend. 635 * 636 * Also prevent admins from marking themselves or other 637 * admins as spammers. 638 638 */ 639 ?> 640 <?php if ( empty( $this->subsite_activated ) || ( ! empty( $this->subsite_activated ) && current_user_can( 'manage_network_users' ) ) ) : ?> 639 if ( ( get_current_user_id() !== $user->ID ) && ( ! in_array( $user->user_login, get_super_admins() ) ) && empty( $this->subsite_activated ) || ( ! empty( $this->subsite_activated ) && current_user_can( 'manage_network_users' ) ) ) : ?> 641 640 <div class="misc-pub-section" id="comment-status-radio"> 642 <label class="approved"><input type="radio" name="user_status" value="ham" <?php checked( bp_is_user_spammer( $user->ID ), false ); ?>><?php esc_html_e( 'Active', 'buddypress' ); ?></label><br />643 <label class="spam"><input type="radio" name="user_status" value="spam" <?php checked( bp_is_user_spammer( $user->ID ), true ); ?>><?php esc_html_e( 'Spammer', 'buddypress' ); ?></label>641 <label class="approved"><input type="radio" name="user_status" value="ham" <?php checked( $is_spammer, false ); ?>><?php esc_html_e( 'Active', 'buddypress' ); ?></label><br /> 642 <label class="spam"><input type="radio" name="user_status" value="spam" <?php checked( $is_spammer, true ); ?>><?php esc_html_e( 'Spammer', 'buddypress' ); ?></label> 644 643 </div> 645 644 <?php endif ;?> … … 737 736 */ 738 737 public function row_actions( $actions = '', $user = null ) { 739 // only edit others profile740 if ( get_current_user_id() == $user->ID ) {741 return $actions;742 }743 744 // Prevent a regular admin to edit a super admin745 if( in_array( $user->user_login, get_super_admins() ) ) {746 return $actions;747 }748 738 749 739 $edit_profile = add_query_arg( array( … … 752 742 ), $this->edit_profile_url ); 753 743 754 $edit_profile_link = '<a href="' . esc_url( $edit_profile ) . '">' . esc_html__( 'Extended Profile', 'buddypress' ) . '</a>';744 $edit_profile_link = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $edit_profile ), esc_html__( 'Extended', 'buddypress' ) ); 755 745 756 746 /**
Note: See TracChangeset
for help on using the changeset viewer.