Skip to:
Content

BuddyPress.org

Changeset 4414


Ignore:
Timestamp:
05/22/2011 10:59:20 AM (11 years ago)
Author:
djpaul
Message:

If registration page is set to display on the home page, and user registration is disabled, show message to non-logged in users rather than redirect.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-signup.php

    r4325 r4414  
    1515
    1616    if ( !bp_is_current_component( 'register' ) )
    17         return false;
     17        return;
    1818
    1919    // Not a directory
    2020    bp_update_is_directory( false, 'register' );
    2121
    22     if ( bp_is_component_front_page( 'register' ) && ( is_user_logged_in() || !bp_get_signup_allowed() ) )
    23         bp_core_redirect( bp_get_root_domain() . '/' . bp_get_members_root_slug() );
    24 
    2522    // If the user is logged in, redirect away from here
    26     if ( is_user_logged_in() )
    27         bp_core_redirect( bp_get_root_domain() );
    28 
    29     // If signups are disabled, just re-direct
    30     if ( !bp_get_signup_allowed() )
    31         bp_core_redirect( bp_get_root_domain() );
     23    if ( is_user_logged_in() ) {
     24        if ( bp_is_component_front_page( 'register' ) )
     25            bp_core_redirect( bp_get_root_domain() . '/' . bp_get_members_root_slug() );
     26        else
     27            bp_core_redirect( bp_get_root_domain() );
     28
     29        return;
     30    }
    3231
    3332    $bp->signup->step = 'request-details';
    3433
     34    if ( !bp_get_signup_allowed() ) {
     35        $bp->signup->step = 'registration-disabled';
     36    }
     37
    3538    // If the signup page is submitted, validate and save
    36     if ( isset( $_POST['signup_submit'] ) ) {
     39    elseif ( isset( $_POST['signup_submit'] ) ) {
    3740
    3841        // Check the nonce
  • trunk/bp-themes/bp-default/registration/register.php

    r4389 r4414  
    99
    1010            <form action="" name="signup_form" id="signup_form" class="standard-form" method="post" enctype="multipart/form-data">
     11
     12            <?php if ( 'registration-disabled' == bp_get_current_signup_step() ) : ?>
     13                <?php do_action( 'template_notices' ) ?>
     14                <?php do_action( 'bp_before_registration_disabled' ) ?>
     15
     16                    <p><?php _e( 'User registration is currently not allowed.', 'buddypress' ); ?></p>
     17
     18                <?php do_action( 'bp_after_registration_disabled' ); ?>
     19            <?php endif; // registration-disabled signup setp ?>
    1120
    1221            <?php if ( 'request-details' == bp_get_current_signup_step() ) : ?>
Note: See TracChangeset for help on using the changeset viewer.