Sign in to follow this  
Scottbass

User registration - email

Recommended Posts

Hi,

 

As I understand it, IPBWI for WP uses the wp_new_user_notification function in order to get the plaintext password from WP for use in creating the matching account on IPBoard.

 

I need to be able to change the default email that goes out to people in order to remove the plaintext password as there are legimate security concerns over this being sent by email. (I understand that this is the default way WP handle things, so that's not a criticism of your plugin)

 

Since the IPWBI core is encrypted, I'm not able to see how you've used the wp_new_user_notification function, otherwise I'd simply attempt to hook onto that somehow in order to change the email output without interfering with the account creation/syncing that's done.

 

Is there any way that you could shine a light on whether what I'm describing is possible in terms of the way in which you're using the wp_new_user_notification function? Or at least provide an unencrypted copy of the relevant file so I can do a dirty hack on that part of your code for use on my site.

 

As mentioned I literally just need to change the content of the email sent to the user, however am unable to do that through normal means due to IPBWI "hijacking" that function, so to speak.

 

Any help you can provide is appreciated.

Edited by Scottbass

Share this post


Link to post
Share on other sites

Hi,

 

you are completely right :) As the changes from my plugin are quite simple at that point, I'll just quote content of my custom wp_new_user_notification function here. You'll just have to define it by yourself before plugins are loaded;

	// get password when new user registers and create board account	if(!function_exists('wp_new_user_notification')){		function wp_new_user_notification($user_id, $plaintext_pass = '') {			$user = new WP_User($user_id);			$user_login = stripslashes($user->user_login);			$user_email = stripslashes($user->user_email);			// ipbwi create			$GLOBALS['ipbwi']->member->create($user_login,$plaintext_pass,$user_email,false,($GLOBALS['ipbwi']->getBoardVar('reg_auth_type') ? true : false),$user_login,true);			if($GLOBALS['ipbwi']->printSystemMessages()){				add_action('admin_notices', 'ipbwi_warning');			}						// The blogname option is escaped with esc_html on the way into the database in sanitize_option			// we want to reverse this for the plain text arena of emails.			$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);						$headers = 'From: '.$blogname.' <'.get_option('admin_email').'>' . "\r\n";			$message  = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n";			$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";			$message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";			@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message, $headers);			if ( empty($plaintext_pass) )				return;			$message  = sprintf(__('Username: %s'), $user_login) . "\r\n";			$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";			$message .= site_url("wp-login.php", 'login') . "\r\n";			wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message, $headers);		}	}

Share this post


Link to post
Share on other sites
Sign in to follow this