• Resolved habitudeenglishapi

    (@habitudeenglishapi)


    Hi

    we have set this option “Turn on?require admin review”

    but we want user “should be able to login the site” but cant access the site content there should be common message we will display over homepage this functionality we want…currently what happen user can able to login.

    so when admin will approved the given user request then they can able to view the site content and pages ..

Viewing 4 replies - 1 through 4 (of 4 total)
  • Delana

    (@mstayloronline)

    My work around was a pending role with admin review and no options selected. They can’t log in or do anything, however you could allow them to log in and go to a specific page once they have.

    For me, it’s a no access role pending review and then I move them to the regular role thereafter or delete it if it doesn’t pass the review.

    Steps:

    In the Role editor create a role like “Pending Authorization” and set the role to Admin Review.

    Then create a page with some info or whatever content you want, a message that their registration is pending review. Put the link to this page in the field asking where to direct them to after they log in. Usually it is profile but you can add this page to it as well as adding this page to where they go once they finished their registration.

    That basically prevents them from doing anything, no profile, no uploading, nothing. They’re just stuck until the reviewer moves them to the role.

    • This reply was modified 1 year, 6 months ago by Delana.
    Plugin Support andrewshu

    (@andrewshu)

    Hello @habitudeenglishapi

    Unfortunately, this functionality does not exist in our basic plugin at this time.

    Thank you

    @habitudeenglishapi

    You can try this code snippet for users with account status awaiting_admin_review to be able to login to their account.

    add_action( 'um_submit_form_errors_hook_logincheck', 'bypass_submit_form_errors_hook_logincheck', 999, 2 );
    function bypass_submit_form_errors_hook_logincheck( $submitted_data, $form_data  ) {
    
        if ( ! is_user_logged_in() ) {
            $user_id = ( isset( UM()->login()->auth_id ) ) ? UM()->login()->auth_id : '';
            um_fetch_user( $user_id );
        
            $status = um_user( 'account_status' );
            if ( $status == 'awaiting_admin_review' ) {
                remove_action( 'um_submit_form_errors_hook_logincheck', 'um_submit_form_errors_hook_logincheck', 9999, 2 );
                if ( isset( $form_data['form_id'] ) && absint( $form_data['form_id'] ) === absint( UM()->shortcodes()->core_login_form() ) && UM()->form()->errors && ! isset( $_POST[ UM()->honeypot ] ) ) {
                    wp_safe_redirect( um_get_core_page( 'login' ) );
                    exit;
                }
            }
        }
    }

    Install the code snippet into your active theme’s functions.php file
    or use the “Code Snippets” plugin.

    https://www.ads-software.com/plugins/code-snippets/

    Plugin Support andrewshu

    (@andrewshu)

    Hi @habitudeenglishapi

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Ultimate member “Turn on require admin review” user should able to login’ is closed to new replies.