Skip Navigation

[Resolved] User sign-up not working

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 8 replies, has 2 voices.

Last updated by geoffD 1 year, 4 months ago.

Assigned support staff: Minesh.

Author
Posts
#1390723

Hello

I have a page 'sign-up' which has a user form to create a new user. When filled in and submitted previously the newly created user has been logged in and redirected to the page 'who-needs-a-will'

The problem is that the automatic logging in of the new user has stopped happening so now although the user form creates the new user, it doesn't log them in..

I can't remember how I first achieved this and now can't work out how to recover it..

Please can you help

Best regards
Geoff

#1390831

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I'm not sure what Toolset plugin version you are using currently? Can you please make sure that you are using latest Toolset plugins. If Yes:

I need a problem URL where you added your user form as well as access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1391113

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Thanks for sharing access details.

When I try to access this page: hidden link
- It ask me for password, this page is password protected.

I checked with your theme's functions.php file and I do not see any code added that should be responsible for auto login. Where did you add such code that leads to user auto-login?

Do you mean that, once new user registered, you want to redirect to specific page with user should be auto-logggedin? If yes - to which page you want the user should be redirected?

#1391911

Hi Minesh..

On the user register form that you're working on, as well as logging the user in I also need to add some validation to make sure the user includes their first and last name.. The email seems to be required by default...

Also I need to add validation to the password so that it is at least 8 characters long and uses both letters and numbers...is this possible?

I shall look forward to hearing back from you

Thanks as always for all of your help and support

Best regards

Geoff

New threads created by Minesh and linked to this one are listed below:

https://toolset.com/forums/topic/split-user-sign-up-not-working-validate-user-form/

#1392407

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I checked the ticket history you reported and I do not able to find any ticket that is related to the auto-login user after submitting and registering the new user using the user form.

Have you added any related custom code anywhere to your site as I checked the functions.php file and I do not find any related code? If no: just to double check with you, that once user successfully registered, you want that user should be auto-loggedin and redirected to this page: hidden link - correct?

#1392435

Hi Minesh

Yes this is correct..

Thank you so much for you help

best regards as always

Geoff

#1393283

Hi Minesh

Just wondered how you were getting on with this issue..do you need anything further from me?

Thanks as always for your wonderful support!

Best regards

Geoff

#1394199

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've added the following code to "Custom Code" section offered by Toolset:

The following code will allow you to auto-login after registering the user;

add_action( 'cred_save_data', 'func_auto_login_after_register', 10, 2 );
function func_auto_login_after_register( $post_id, $form_data ){
   
    if ( 1562 == $form_data['id'] ) {
   
        if ( !empty( $_POST['user_email'] ) && !empty( $_POST['user_pass'] ) ) {
   
            $user = get_user_by( "email", $_POST['user_email'] );
 
            $signon = array(
                'user_login'    => $user->user_login,
                'user_password' => $_POST['user_pass'],
                'remember'      => true
            );
 
            $login = wp_signon( $signon, false );
   
            if ( is_wp_error($login) ) {
                error_log( $login->get_error_message() );
            }
        }
    }
}
#1394253

My issue is resolved now. Thank you!