Home Forums Plugin Support WP User Frontend Pro No Unauthorized Message for profiles

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  ForestNation 6 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3704

    ForestNation
    Participant
    Post count: 27

    Hi,
    On Forms there is an option to show an Unauthorized Message when posts can only be made to logged in users.

    But this is not available on registrations forms. The profile page is therefore just a blank page when you are not logged in. An Unauthorized Message for registration forms would enable us to give clear instructions to the user to log in or register…

    Any ideas would be great.

    Thanks

    #3708

    Tareq Hasan
    Keymaster
    Post count: 2831

    Thanks for the input. Currently there is no way to change this without change some code. Change the codes in /class/frontend-form-profile.php, line 36 to 55 with the code below. I'll add this in later version.

    [php]
    if ( $type == ‘profile' ) {

    if ( is_user_logged_in() ) {
    if ( isset( $_GET[‘msg'] ) && $_GET[‘msg'] == ‘profile_update' ) {
    echo ‘<div class="wpuf-success">';
    echo $form_settings[‘update_message'];
    echo ‘</div>';
    }

    $this->profile_edit( $id, $form_vars, $form_settings );
    } else {
    echo ‘<div class="wpuf-info">' . __( ‘Please login to update your profile!', ‘wpuf' ) . ‘</div>';
    }
    } elseif ( $type == ‘registration' ) {

    if ( is_user_logged_in() ) {
    echo ‘<div class="wpuf-info">' . __( ‘You are already logged in!', ‘wpuf' ) . ‘</div>';
    } else {

    if ( get_option( ‘users_can_register' ) != ‘1' ) {
    echo ‘<div class="wpuf-info">';
    _e( ‘User registration is currently not allowed.' );
    echo ‘</div>';
    return;
    }

    $this->profile_edit( $id, $form_vars, $form_settings );
    }
    }
    [/php]

    #3710

    ForestNation
    Participant
    Post count: 27

    Excellent, it works.
    I added a link to the log in message so it's more user-friendly:
    Please Log in to update your profile!

    Thanks for the help.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘No Unauthorized Message for profiles’ is closed to new replies.