From: Evan Prodromou Date: Mon, 23 May 2011 21:25:00 +0000 (-0400) Subject: note converted user id on registration X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c85eeb868e86cf5e0f7cb3885656d8620a8fc8ba;p=quix0rs-gnu-social.git note converted user id on registration --- diff --git a/classes/Invitation.php b/classes/Invitation.php index 83625b3932..27ff400883 100644 --- a/classes/Invitation.php +++ b/classes/Invitation.php @@ -23,4 +23,11 @@ class Invitation extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE + + function convert($user) + { + $orig = clone($this); + $this->registered_user_id = $user->id; + return $this->update($orig); + } } diff --git a/classes/User.php b/classes/User.php index 8642c78c27..9f79549327 100644 --- a/classes/User.php +++ b/classes/User.php @@ -263,6 +263,8 @@ class User extends Memcached_DataObject $user->nickname = $nickname; + $invite = null; + // Users who respond to invite email have proven their ownership of that address if (!empty($code)) { @@ -353,6 +355,12 @@ class User extends Memcached_DataObject return false; } + // Mark that this invite was converted + + if (!empty($invite)) { + $invite->convert($user); + } + if (!empty($email) && !$user->email) { $confirm = new Confirm_address();