Ticket #3741: 3741.register.01.patch
| File 3741.register.01.patch, 9.4 KB (added by , 14 years ago) |
|---|
-
bp-core/bp-core-catchuri.php
function bp_core_load_template( $templates ) { 375 375 376 376 // Filter the template locations so that plugins can alter where they are located 377 377 $located_template = apply_filters( 'bp_located_template', locate_template( (array) $filtered_templates, false ), $filtered_templates ); 378 378 379 if ( !empty( $located_template ) ) { 379 380 380 381 // Template was located, lets set this as a valid page and not a 404. … … function bp_core_no_access( $args = '' ) { 458 459 $redirect_url .= $_SERVER['REQUEST_URI']; 459 460 460 461 $defaults = array( 461 'mode' => '1',// 1 = $root, 2 = wp-login.php462 'redirect' => $redirect_url, // the URL you get redirected to when a user successfully logs in463 'root' => bp_get_root_domain(), // the landing page you get redirected to when a user doesn't have access462 'mode' => bp_is_theme_compat() ? 2 : 1, // 1 = $root, 2 = wp-login.php 463 'redirect' => $redirect_url, // the URL you get redirected to when a user successfully logs in 464 'root' => bp_get_root_domain(), // the landing page you get redirected to when a user doesn't have access 464 465 'message' => __( 'You must log in to access the page you requested.', 'buddypress' ) 465 466 ); 466 467 … … function bp_core_no_access( $args = '' ) { 471 472 /** 472 473 * @ignore Ignore these filters and use 'bp_core_no_access' above 473 474 */ 474 $mode = apply_filters( 'bp_no_access_mode', $mode, $root, $redirect, $message );475 $redirect = apply_filters( 'bp_no_access_redirect', $redirect, $root, $message, $mode );476 $root = apply_filters( 'bp_no_access_root', $root, $redirect, $message, $mode );477 $message = apply_filters( 'bp_no_access_message', $message, $root, $redirect, $mode );478 $root = trailingslashit( $root );475 $mode = apply_filters( 'bp_no_access_mode', $mode, $root, $redirect, $message ); 476 $redirect = apply_filters( 'bp_no_access_redirect', $redirect, $root, $message, $mode ); 477 $root = apply_filters( 'bp_no_access_root', $root, $redirect, $message, $mode ); 478 $message = apply_filters( 'bp_no_access_message', $message, $root, $redirect, $mode ); 479 $root = trailingslashit( $root ); 479 480 480 481 switch ( $mode ) { 481 482 -
bp-core/bp-core-theme-compatibility.php
function bp_get_theme_compat_url() { 175 175 } 176 176 177 177 /** 178 * Gets true/false if theme compatibility is on. 179 * 180 * @since BuddyPress (1.7) 181 * @return bool 182 */ 183 function bp_is_theme_compat() { 184 if ( empty( buddypress()->theme_compat->theme ) ) { 185 return false; 186 } 187 188 return true; 189 } 190 191 /** 178 192 * Gets true/false if page is currently inside theme compatibility 179 193 * 180 194 * @since BuddyPress (1.7) -
bp-members/bp-members-functions.php
function bp_core_wpsignup_redirect() { 1396 1396 return; 1397 1397 1398 1398 // Redirect to sign-up page 1399 if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false ) ) 1400 bp_core_redirect( bp_get_signup_page() ); 1399 bp_core_redirect( bp_get_signup_page() ); 1401 1400 } 1402 1401 add_action( 'bp_init', 'bp_core_wpsignup_redirect' ); -
bp-members/bp-members-screens.php
function bp_core_screen_signup() { 178 178 179 179 if ( !empty( $_POST['field_' . $field_id] ) ) 180 180 $usermeta['field_' . $field_id] = $_POST['field_' . $field_id]; 181 181 182 182 if ( !empty( $_POST['field_' . $field_id . '_visibility'] ) ) 183 183 $usermeta['field_' . $field_id . '_visibility'] = $_POST['field_' . $field_id . '_visibility']; 184 184 } … … function bp_core_screen_signup() { 203 203 204 204 if ( is_wp_error( $wp_user_id ) ) { 205 205 $bp->signup->step = 'request-details'; 206 bp_core_add_message( $wp_user_id->get_error_message(), 'error' ); 206 bp_core_add_message( $wp_user_id->get_error_message(), 'error' ); 207 207 } else { 208 208 $bp->signup->step = 'completed-confirmation'; 209 209 } … … class BP_Members_Theme_Compat { 334 334 } 335 335 } 336 336 new BP_Members_Theme_Compat(); 337 338 /** 339 * The main theme compat class for BuddyPress Registration 340 * 341 * This class sets up the necessary theme compatability actions to safely output 342 * registration template parts to the_title and the_content areas of a theme. 343 * 344 * @since BuddyPress (1.7) 345 */ 346 class BP_Registration_Theme_Compat { 347 348 /** 349 * Setup the groups component theme compatibility 350 * 351 * @since BuddyPress (1.7) 352 */ 353 public function __construct() { 354 add_action( 'bp_setup_theme_compat', array( $this, 'is_registration' ) ); 355 } 356 357 /** 358 * Are we looking at either the registration or activation pages? 359 * 360 * @since BuddyPress (1.7) 361 */ 362 public function is_registration() { 363 364 // Bail if not looking at the registration or activation page 365 if ( ! bp_is_register_page() && ! bp_is_activation_page() ) { 366 return; 367 } 368 369 // Not a directory 370 bp_update_is_directory( false, 'register' ); 371 372 // Setup actions 373 add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'dummy_post' ) ); 374 add_filter( 'bp_replace_the_content', array( $this, 'dummy_content' ) ); 375 } 376 377 /** Template ***********************************************************/ 378 379 /** 380 * Update the global $post with dummy data 381 * 382 * @since BuddyPress (1.7) 383 */ 384 public function dummy_post() { 385 // Registration page 386 if ( bp_is_register_page() ) { 387 $title = __( 'Create an Account', 'buddypress' ); 388 389 if ( 'completed-confirmation' == bp_get_current_signup_step() ) { 390 $title = __( 'Sign Up Complete!', 'buddypress' ); 391 } 392 393 // Activation page 394 } else { 395 $title = __( 'Activate your Account', 'buddypress' ); 396 397 if ( bp_account_was_activated() ) { 398 $title = __( 'Account Activated', 'buddypress' ); 399 } 400 } 401 402 $post_type = bp_is_register_page() ? 'bp_register' : 'bp_activate'; 403 404 bp_theme_compat_reset_post( array( 405 'ID' => 0, 406 'post_title' => $title, 407 'post_author' => 0, 408 'post_date' => 0, 409 'post_content' => '', 410 'post_type' => $post_type, 411 'post_status' => 'publish', 412 'is_archive' => true, 413 'comment_status' => 'closed' 414 ) ); 415 } 416 417 /** 418 * Filter the_content with either the register or activate templates. 419 * 420 * @since BuddyPress (1.7) 421 */ 422 public function dummy_content() { 423 if ( bp_is_register_page() ) { 424 bp_buffer_template_part( 'members/register' ); 425 } else { 426 bp_buffer_template_part( 'members/activate' ); 427 } 428 } 429 } 430 new BP_Registration_Theme_Compat(); -
bp-members/bp-members-template.php
function bp_loggedin_user_username() { 926 926 /** Signup Form ***************************************************************/ 927 927 928 928 function bp_has_custom_signup_page() { 929 if ( locate_template( array( 'register.php' ), false ) || locate_template( array( '/registration/register.php' ), false ) ) 929 // if we're using theme compat, we're using our own templates, return true 930 if ( bp_is_theme_compat() ) { 930 931 return true; 932 } 933 934 // look in parent / child theme for custom template 935 if ( locate_template( array( 'register.php' ), false ) || locate_template( array( '/registration/register.php' ), false ) ) { 936 return true; 937 } 931 938 932 939 return false; 933 940 } -
bp-themes/bp-legacy/buddypress/members/activate.php
6 6 7 7 <?php if ( bp_account_was_activated() ) : ?> 8 8 9 <h2 class="widgettitle"><?php _e( 'Account Activated', 'buddypress' ); ?></h2>10 11 9 <?php do_action( 'bp_before_activate_content' ); ?> 12 10 13 11 <?php if ( isset( $_GET['e'] ) ) : ?> … … 18 16 19 17 <?php else : ?> 20 18 21 <h3><?php _e( 'Activate your Account', 'buddypress' ); ?></h3>22 23 19 <?php do_action( 'bp_before_activate_content' ); ?> 24 20 25 21 <p><?php _e( 'Please provide a valid activation key.', 'buddypress' ); ?></p> -
bp-themes/bp-legacy/buddypress/members/register.php
17 17 18 18 <?php if ( 'request-details' == bp_get_current_signup_step() ) : ?> 19 19 20 <h2><?php _e( 'Create an Account', 'buddypress' ); ?></h2>21 22 20 <?php do_action( 'template_notices' ); ?> 23 21 24 22 <p><?php _e( 'Registering for this site is easy, just fill in the fields below and we\'ll get a new account set up for you in no time.', 'buddypress' ); ?></p> … … 246 244 247 245 <?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?> 248 246 249 <h2><?php _e( 'Sign Up Complete!', 'buddypress' ); ?></h2>250 251 247 <?php do_action( 'template_notices' ); ?> 252 248 <?php do_action( 'bp_before_registration_confirmed' ); ?> 253 249