fix registration bug - fatal error when sending email confirmation
darcs-hash:20081209082750-7b5ce-6d06a7b1cda2a9afb6ce8ea64d65df81cc063139.gz
This commit is contained in:
		@@ -229,9 +229,7 @@ class EmailsettingsAction extends SettingsAction {
 | 
				
			|||||||
			return;
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		mail_confirm_address($confirm->code,
 | 
							mail_confirm_address($user, $confirm->code, $user->nickname, $email);
 | 
				
			||||||
							 $user->nickname,
 | 
					 | 
				
			||||||
							 $email);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		$msg = _('A confirmation code was sent to the email address you added. Check your inbox (and spam box!) for the code and instructions on how to use it.');
 | 
							$msg = _('A confirmation code was sent to the email address you added. Check your inbox (and spam box!) for the code and instructions on how to use it.');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -263,9 +263,7 @@ class User extends Memcached_DataObject
 | 
				
			|||||||
		$profile->query('COMMIT');
 | 
							$profile->query('COMMIT');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if ($email && !$user->email) {
 | 
							if ($email && !$user->email) {
 | 
				
			||||||
			mail_confirm_address($confirm->code,
 | 
								mail_confirm_address($user, $confirm->code, $profile->nickname, $email);
 | 
				
			||||||
								 $profile->nickname,
 | 
					 | 
				
			||||||
								 $email);
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		return $user;
 | 
							return $user;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -85,8 +85,8 @@ function mail_to_user(&$user, $subject, $body, $address=NULL) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# For confirming a Jabber address
 | 
					# For confirming a Jabber address
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function mail_confirm_address($code, $nickname, $address) {
 | 
					function mail_confirm_address($user, $code, $nickname, $address) {
 | 
				
			||||||
    $user = common_current_user();
 | 
					
 | 
				
			||||||
	$subject = _('Email address confirmation');
 | 
						$subject = _('Email address confirmation');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $body = sprintf(_("Hey, %s.\n\nSomeone just entered this email address on %s.\n\n" .
 | 
					    $body = sprintf(_("Hey, %s.\n\nSomeone just entered this email address on %s.\n\n" .
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user