No Unauthorized Message for profiles

This topic contains 2 reply and 2 voices, and was last updated by ForestNation 10 years, 11 months ago
Viewing 2 Posts - 1 through 2 (of 2 total)
Author Posts
May 16, 2013 at 4:59 pm 3704
ForestNation 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
May 16, 2013 at 5:36 pm 3708
Tareq Hasan Tareq Hasan

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]

May 16, 2013 at 5:48 pm 3710
ForestNation ForestNation

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 2 Posts - 1 through 2 (of 2 total)