Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Same problem for me, when i checked on database, user’s password hash is changed.

    What is wrong?

    Thanks in advance

    Hi,

    The plugin force reset password of new approved users, you can comment the code responsible of this action :

    file: wp-content/plugins/new-user-approve/includes/email-tags.php
    line 370

    replace this function

    function nua_email_tag_password( $attributes ) {
    
    	$user = $attributes['user'];
    
    	if ( pw_new_user_approve()->do_password_reset( $user->ID ) ) {
    		// reset password to know what to send the user
    		$new_pass = wp_generate_password( 12, false );
    
    		// store the password
    		global $wpdb;
    		$data = array( 'user_pass' => md5( $new_pass ), 'user_activation_key' => '', );
    		$where = array( 'ID' => $user->ID, );
    		$wpdb->update( $wpdb->users, $data, $where, array( '%s', '%s' ), array( '%d' ) );
    
    		// Set up the Password change nag.
    		update_user_option( $user->ID, 'default_password_nag', true, true );
    
    		// Set this meta field to track that the password has been reset by
    		// the plugin. Don't reset it again unless doing a password reset.
    		update_user_meta( $user->ID, 'pw_user_approve_password_reset', time() );
    
    		return sprintf( __( 'Password: %s', 'new-user-approve' ), $new_pass );
    	} else {
    		return '';
    	}
    }

    By this :

    function nua_email_tag_password( $attributes ) {
    	return '';
    }
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘can't login’ is closed to new replies.