• Resolved makmerghen

    (@makmerghen)


    hello
    add_filter( ‘um_registration_for_loggedin_users’, ‘__return_true’ );

    I added this filter to let logged in user (userA) able to use UM registration form to add new users (userB)
    but after userA add userB
    the current logged in user (userA) automatically logged out and the new registered user (userB) became logged in

    how to make (userA) still logged in even after he finished the registration of the other new users
    thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @makmerghen

    Is User A has the same role as User B? Have you tried changing the Registration Options in the User Role settings to make the “Registration Status” option use
    the “Require Admin Review”?

    Regards,

    Thread Starter makmerghen

    (@makmerghen)

    hello dear
    user A is admin and user B is customer

    no I didn’t because I didn’t need admin to do review

    • This reply was modified 3 years, 5 months ago by makmerghen.
    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @makmerghen

    You can try adding this code to prevent the registered user from auto login:

    add_action("init","um_062921_prevent_user_login");
    function um_062921_prevent_user_login(){
        if( is_user_logged_in() ){
            remove_action( 'um_registration_complete', 'um_check_user_status', 100, 2 );
            remove_action( 'um_user_login', 'um_user_login', 10 );
        }
    }

    Regards,

    Thread Starter makmerghen

    (@makmerghen)

    one more favor please
    when I did that prevent new user from auto login
    but
    userA after press register key and after page reload he will find the same register page he will not find any thing refer that the registration done
    so I just need him to find message saying registration done or to redirect him to specific page have some message

    thanks a lot dear

    Thread Starter makmerghen

    (@makmerghen)

    also dear another issue
    when user A enter register form page suppose the form fields to be empty
    but in this case the data of userA existed in the field of the form
    as example username and email field it filled with userAusername and [email protected]

    how to make it empty fields
    regards

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @makmerghen

    1. To display a success message, you can try this code snippets:

    add_action( 'um_main_register_fields', function(){
        if( empty( UM()->form()->errors ) ){
            echo '<p class="um-notice success"><i class="um-icon-ios-close-empty" onclick="jQuery(this).parent().fadeOut();"></i>Created a user succesfully.</p>';
        }
    }, 100 );

    2. To clear the register field values, you can try this code snippets:

    add_action( 'um_main_register_fields', function(){
       if( is_user_logged_in() ){
         echo "<script type='text/javascript'>";
         echo "jQuery(document).ready(function(){";
         echo "setTimeout( function(){ jQuery('.um-register:not(.um-err)').find(\"input[type=text],input[type=number], textarea\").val(\"\"); }, 600 );";
         echo "});";
         echo "</script>";
       }
    });

    Regards,

    Thread Starter makmerghen

    (@makmerghen)

    thank you a lot dear you are a hero ??
    I have now question I asked you before and you told me it need some customization
    I asked more than programmer and they couldn’t do it
    so please if you have any idea that can help please provide it
    I am talking about add list field contains affiliatewp affiliate list
    while user register he will select the affiliate he want and continue registration and thus the new user will be down-line of the selected affiliate

    what the programmer did is to add the field that contain the affiliate list in the form
    but he can not be able to link the selected affiliate and the new user
    I mean now I can find this field and select any affiliate but after registration done the new user did not connect to the selected affiliate
    so please if you have any idea help
    best regards

    • This reply was modified 3 years, 5 months ago by makmerghen.
    • This reply was modified 3 years, 5 months ago by makmerghen.
    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @makmerghen

    Please create a new topic for a new issue. I’m marking this as resolved now.

    Regards,

    Thread Starter makmerghen

    (@makmerghen)

    ok will create it now thanks

    Thread Starter makmerghen

    (@makmerghen)

    hello dear
    you provided me with this code

    add_action( 'um_main_register_fields', function(){
        if( empty( UM()->form()->errors ) ){
            echo '<p class="um-notice success"><i class="um-icon-ios-close-empty" onclick="jQuery(this).parent().fadeOut();"></i>Created a user succesfully.</p>';
        }
    }, 100 );

    to show succesfully registration message after doing registration while while user logged in
    this message appear down the form I just need it to be show above the form in visible area
    so please help

    • This reply was modified 3 years, 4 months ago by makmerghen.
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘new registered user take place instead of user who add the new user’ is closed to new replies.