Invite -> Invitation

darcs-hash:20080827010515-84dde-f4dd776209a0aa4f6a7e9d6ac1de46d83ff54650.gz
This commit is contained in:
Evan Prodromou 2008-08-26 21:05:15 -04:00
parent c55e3089c5
commit 79f4469db9

View File

@ -200,8 +200,8 @@ class User extends DB_DataObject
# Users who respond to invite email have proven their ownership of that address # Users who respond to invite email have proven their ownership of that address
if ($code) { if ($code) {
$invite = Invite::staticGet($code); $invite = Invitation::staticGet($code);
if ($invite && $invite->address && $invite->address_type == 'email') { if ($invite && $invite->address && $invite->address_type == 'email' && $invite->address == $email) {
$user->email = $invite->address; $user->email = $invite->address;
} }
} }
@ -230,7 +230,7 @@ class User extends DB_DataObject
return FALSE; return FALSE;
} }
if ($email && !$code) { if ($email && !$user->email) {
$confirm = new Confirm_address(); $confirm = new Confirm_address();
$confirm->code = common_confirmation_code(128); $confirm->code = common_confirmation_code(128);
@ -251,7 +251,7 @@ class User extends DB_DataObject
$profile->query('COMMIT'); $profile->query('COMMIT');
if ($email && !$code) { if ($email && !$user->email) {
mail_confirm_address($confirm->code, mail_confirm_address($confirm->code,
$profile->nickname, $profile->nickname,
$email); $email);