- $res = send_register_open_eml(
- $user['email'],
- $a->config['sitename'],
- $a->get_baseurl(),
- $user['username'],
- $result['password']);
-
- if($res) {
- info( t('Registration successful. Please check your email for further instructions.') . EOL ) ;
+ // Only send a password mail when the password wasn't manually provided
+ if (!x($_POST,'password1') OR !x($_POST,'confirm')) {
+ $res = send_register_open_eml(
+ $user['email'],
+ $a->config['sitename'],
+ $a->get_baseurl(),
+ $user['username'],
+ $result['password']);
+
+ if($res) {
+ info( t('Registration successful. Please check your email for further instructions.') . EOL ) ;
+ goaway(z_root());
+ } else {
+ notice(
+ sprintf(
+ t('Failed to send email message. Here your accout details:<br> login: %s<br> password: %s<br><br>You can change your password after login.'),
+ $user['email'],
+ $result['password']
+ ). EOL
+ );
+ }
+ } else {
+ info( t('Registration successful.') . EOL ) ;