";
endif;
if (!$admin_add_user_error) :
$user_login = $_POST['user_login'];
$user_email = $_POST['user_email'];
$user_url = bb_fix_link( $_POST['user_url'] );
$password = $_POST['pass1'];
if ( $user_id = bb_new_user( $user_login, $user_email, $user_url ) ) {
bb_update_user_password( $user_id, $password );
bb_update_usermeta( $user_id, $bbdb->prefix . 'capabilities', array('member' => true) );
if ($_POST['user_send_email']) :
/**
* Sending a mail again is bad, but if we don't do this,
* the user gets a wrong password sent.
* The bb_new_user() function can't be prevented from sending the first mail.
*/
$message = __("PLEASE IGNORE THE FIRST MAIL!\n\nYour username is: %1\$s \nYour new password is: %2\$s \nYou can now log in: %3\$s \n\nEnjoy!");
bb_mail(
$user_email,
bb_get_option('name') . ': ' . __('Password'),
sprintf( $message, $user_login, $password, bb_get_option('uri') )
);
endif;
do_action('bb_admin_new_user', $user_id, $password);
}
$admin_add_user_success['user_login'] = "