]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fix registration bug - fatal error when sending email confirmation
authorZach Copley <zach@controlyourself.ca>
Tue, 9 Dec 2008 08:27:50 +0000 (03:27 -0500)
committerZach Copley <zach@controlyourself.ca>
Tue, 9 Dec 2008 08:27:50 +0000 (03:27 -0500)
darcs-hash:20081209082750-7b5ce-6d06a7b1cda2a9afb6ce8ea64d65df81cc063139.gz

actions/emailsettings.php
classes/User.php
lib/mail.php

index 61e59e4db122a68f78fd690829d958d72aeb1005..b35b4d28ee1a28c66b82e46454522c50332e5882 100644 (file)
@@ -229,9 +229,7 @@ class EmailsettingsAction extends SettingsAction {
                        return;
                }
 
-               mail_confirm_address($confirm->code,
-                                                        $user->nickname,
-                                                        $email);
+               mail_confirm_address($user, $confirm->code, $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.');
 
index 7ac975007ca8f960064e7834c0d15d0357843abd..11b010a8363ecf340f41c7bce09949e84dcec910 100644 (file)
@@ -263,9 +263,7 @@ class User extends Memcached_DataObject
                $profile->query('COMMIT');
 
                if ($email && !$user->email) {
-                       mail_confirm_address($confirm->code,
-                                                                $profile->nickname,
-                                                                $email);
+                       mail_confirm_address($user, $confirm->code, $profile->nickname, $email);
                }
 
                return $user;
index e627730a7a6169945eb34ccc5eacdb0fd19e8e7a..313040ca252987792c2a4fe9be06df30426058db 100644 (file)
@@ -85,8 +85,8 @@ function mail_to_user(&$user, $subject, $body, $address=NULL) {
 
 # For confirming a Jabber address
 
-function mail_confirm_address($code, $nickname, $address) {
-    $user = common_current_user();
+function mail_confirm_address($user, $code, $nickname, $address) {
+
        $subject = _('Email address confirmation');
 
     $body = sprintf(_("Hey, %s.\n\nSomeone just entered this email address on %s.\n\n" .