Changeset 5133
- Timestamp:
- 10/21/2013 08:19:16 PM (12 years ago)
- Location:
- trunk/includes
- Files:
-
- 4 edited
-
admin/admin.php (modified) (3 diffs)
-
admin/functions.php (modified) (2 diffs)
-
admin/tools.php (modified) (1 diff)
-
core/update.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/admin.php
r5092 r5133 488 488 489 489 // Return normal links if not bbPress 490 if ( plugin_basename( bbpress()->file ) !== $file ) 490 if ( plugin_basename( bbpress()->file ) !== $file ) { 491 491 return $links; 492 } 493 494 // New links to merge into existing links 495 $new_links = array(); 496 497 // Settings page link 498 if ( current_user_can( 'bbp_settings_page' ) ) { 499 $new_links['settings'] = '<a href="' . add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) . '">' . esc_html__( 'Settings', 'bbpress' ) . '</a>'; 500 } 501 502 // About page link 503 if ( current_user_can( 'bbp_about_page' ) ) { 504 $new_links['about'] = '<a href="' . add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) . '">' . esc_html__( 'About', 'bbpress' ) . '</a>'; 505 } 492 506 493 507 // Add a few links to the existing links array 494 return array_merge( $links, array( 495 'settings' => '<a href="' . add_query_arg( array( 'page' => 'bbpress' ), admin_url( 'options-general.php' ) ) . '">' . esc_html__( 'Settings', 'bbpress' ) . '</a>', 496 'about' => '<a href="' . add_query_arg( array( 'page' => 'bbp-about' ), admin_url( 'index.php' ) ) . '">' . esc_html__( 'About', 'bbpress' ) . '</a>' 497 ) ); 508 return array_merge( $links, $new_links ); 498 509 } 499 510 … … 1331 1342 public function suggest_topic() { 1332 1343 1333 // T Ry to get some topics1344 // Try to get some topics 1334 1345 $topics = get_posts( array( 1335 1346 's' => like_escape( $_REQUEST['q'] ), … … 1647 1658 <a class="button" href="update-core.php?page=bbpress-update"><?php esc_html_e( 'Go Back', 'bbpress' ); ?></a> 1648 1659 1649 <?php break; ?>1650 1651 1660 <?php 1652 1661 -
trunk/includes/admin/functions.php
r5002 r5133 174 174 175 175 // Bail if no activation redirect 176 if ( ! get_transient( '_bbp_activation_redirect' ) ) 177 return; 176 if ( ! get_transient( '_bbp_activation_redirect' ) ) { 177 return; 178 } 178 179 179 180 // Delete the redirect transient … … 181 182 182 183 // Bail if activating from network, or bulk 183 if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) 184 return; 184 if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { 185 return; 186 } 187 188 // Bail if the current user cannot see the about page 189 if ( ! current_user_can( 'bbp_about_page' ) ) { 190 return; 191 } 185 192 186 193 // Redirect to bbPress about page -
trunk/includes/admin/tools.php
r5064 r5133 1069 1069 1070 1070 <h2 class="nav-tab-wrapper"><?php bbp_tools_admin_tabs( __( 'Reset Forums', 'bbpress' ) ); ?></h2> 1071 <p><?php esc_html_e( 'This will revert your forums back to a brand new installation. This process cannot be undone. <strong>Backup your database before proceeding</strong>.', 'bbpress' ); ?></p> 1071 <p><?php esc_html_e( 'Revert your forums back to a brand new installation. This process cannot be undone.', 'bbpress' ); ?></p> 1072 <p><strong><?php esc_html_e( 'Backup your database before proceeding.', 'bbpress' ); ?></strong></p> 1072 1073 1073 1074 <form class="settings" method="post" action=""> -
trunk/includes/core/update.php
r5076 r5133 338 338 339 339 // Bail if the current user can't activate plugins since previous pageload 340 if ( ! current_user_can( 'activate_plugins' ) ) 341 return; 340 if ( ! current_user_can( 'activate_plugins' ) ) { 341 return; 342 } 342 343 343 344 // Get the current user ID … … 346 347 347 348 // Bail if user is not actually a member of this site 348 if ( ! is_user_member_of_blog( $user_id, $blog_id ) ) 349 return; 350 351 // Bail if the current user is already a keymaster 352 if ( bbp_is_user_keymaster( $user_id ) ) 353 return; 349 if ( ! is_user_member_of_blog( $user_id, $blog_id ) ) { 350 return; 351 } 352 353 // Bail if the current user already has a forum role to prevent 354 // unexpected role and capability escalation. 355 if ( bbp_get_user_role( $user_id ) ) { 356 return; 357 } 354 358 355 359 // Make the current user a keymaster 356 360 bbp_set_user_role( $user_id, bbp_get_keymaster_role() ); 357 } 361 362 // Reload the current user so caps apply immediately 363 wp_get_current_user(); 364 }
Note: See TracChangeset
for help on using the changeset viewer.