registration errors dont prevent registration
-
if a new user is trying to register and misses a required field or other such issue, the user is still added to the approval queue. Even if they try to fix the issues on registration they are given a new error saying their email is already in the system.
-
then at the end of user-reg-aide-registrationForm before the end of the class add the following:
/**
* Bypasses new user approve register post action
* @since 1.5.1.0
* @updated 1.5.1.0
* @Filters ‘registration_errors’ line 219 user-registration-aide.php (Priority: 1 – Params: 3)
* @access public
* @accepts WordPress Object $errors
* @accepts string $username
* @accepts string $email
* @author Brian Novotny
* @website http://creative-software-design-solutions.com
*/function handle_new_user_approve_errors( $user_login, $user_email, $errors ){
$errors = $this->csds_userRegAide_checkFields( $errors, $user_login, $user_email );
if( empty( $errors ) ){// create the user
$user_pass = wp_generate_password( 12, false );
$user_id = wp_create_user( $user_login, $user_pass, $user_email );
if ( !$user_id ) {
$errors->add( ‘registerfail’, sprintf( __( ‘ERROR: Couldn’t register you… please contact the webmaster !’ ), get_option( ‘admin_email’ ) ) );
}
}else{}
}that worked for mine he should not have used register post, that is a bad idea. The only thing is when it shows an error for an empty field it shows it twice but when I make this into the next release I will fix that too.
excellent! looks like it worked a treat, thank you so much!
whoops, mighta spoke too soon. The registration works, or at least looks like it does, but the new user is not anywhere in the system that i can see. neither approved or denied or pending.
ok did you add the code at the right places? I checked it again and I get a user pending when I register a new user.
And check to make sure it is all formatted properly, this forum destroys formatting so the lines may have been separated due to that so check thaat too.
You know what, I just tried something for giggles and found out you can eliminate the register_post action altogether, if the user registers without any errors wordpress creates the user which is all he is doing with his create new user. So we skip that and that eliminates the double errors on the registration form as well.
The only code you should need is this on user-registration-aide.php after the last action and before the last unset around line 210 and 233
just insert this instead
// new for new_user_approve
if( class_exists( ‘pw_new_user_approve’ ) ){
$pw_nua = pw_new_user_approve::instance();
remove_action( ‘register_post’, array( &$pw_nua, ‘create_new_user’ ), 10, 3 );
unset( $pw_nua );
}But then it circumvents his email process so never mind until I add a fix for that too which I will do tomorrow morning. Time to get some rest unless you need more help tonight.
I just released an new version to include all the updates I gave you and modified it a bit and updated his new user registration so it uses the new WordPress registration and doesn’t send the plain text password over the email and instead uses the new WordPress reset password option and sends the link instead with a key.
well i take that back, i rolled back the changes and have to look at them again because they worked on test machine but not on my site so I will look into that when I get back. Have to go out for awhile.
I got the fix, stupid test machine got stuck again, anywho I changed something in the new user approve plugin to make it work and forgot about it then changed it back but it never changed on my test site so I thought it was good to go. I now have got it fixed and will release it shortly, sorry about that mate!
This update, 1.5.1.3 should work now
Checked it on another site and it works now, so you should be good to go, sorry about that.
dude! you are friggin amazing. The author of the other plugin owes you a beer.
lol thanxs
The topic ‘registration errors dont prevent registration’ is closed to new replies.