• Resolved tcumpston

    (@tcumpston)


    I’m using Gravity Forms for my registration duties. I then have a custom script to automatically log in a user once they have successfully registered. With your plug in installed I get the following:

    1. New user not associated with any other sub site
    a. the functionality is as expected.
    2. Existing user on another sub site
    a. I get a message that the user name is (email address) and that I’m now associated with “x” number of other sites and the custom log in script stops working.

    How do I restore the custom redirect script? See below for script details.

    // Automatically Log User After Registration
    add_action( 'gform_user_registered', 'vc_gf_registration_autologin',  10, 4 );
    function vc_gf_registration_autologin( $user_id, $user_config, $entry, $password ) {
    	$user = get_userdata( $user_id );
    	$user_login = $user->user_login;
    	$user_password = $password;
     
        wp_signon( array(
    		'user_login' => $user_login,
    		'user_password' =>  $user_password,
    		'remember' => false
     
        ) );
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Justin Fletcher

    (@justinticktock)

    The functionality you are seeing is expected. If users are not logged into the Network but already registered with the Network then we add them to this new site after a few checks and drop out after return a list of sites that they belong to. Since we drop out the code stops.

    I could add an action before dropping out for you to inject some code through a hook, but it might be better if I get hold of the gravity forms plugin and addon to test things. I’ll approach gravity to see if I can get a copy to test with.

    Thread Starter tcumpston

    (@tcumpston)

    So I ended up doing the following:

    // Automatically Log User After Registration
    add_action( 'gform_user_registered', 'vc_gf_registration_autologin',  10, 4 );
    function vc_gf_registration_autologin( $user_id, $user_config, $entry, $password ) {
    	$user = get_userdata( $user_id );
    	$user_login = $user->user_login;
    	$user_password = $password;
     
        wp_signon( array(
    		'user_login' => $user_login,
    		'user_password' =>  $user_password,
    		'remember' => false
     
        ) );
    	// wp_redirect( '/registration_complete' );
        // exit;
    }

    and then created my own page with information I want them to have.

    Plugin Author Justin Fletcher

    (@justinticktock)

    well done!
    I’ll mark as resolved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Page Redirect’ is closed to new replies.