From 171b4f72ee5a84d2a67b99aca7df9406e68f60c1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 19 Jun 2008 09:47:10 -0400 Subject: immediate mode for openid darcs-hash:20080619134710-84dde-6086a4ac7bbd72a251fe5ce6fe3156e3270ebd74.gz --- actions/finishopenidlogin.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'actions/finishopenidlogin.php') diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index 2b3616ffa..3a7f9f250 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -104,9 +104,10 @@ class FinishopenidloginAction extends Action { $sreg = $sreg_resp->contents(); } - $user = $this->get_user($canonical); + $user = oid_get_user($canonical); if ($user) { + oid_set_last($display); $this->update_user($user, $sreg); common_set_user($user->nickname); $this->go_home($user->nickname); @@ -123,15 +124,6 @@ class FinishopenidloginAction extends Action { common_show_footer(); } - function get_user($canonical) { - $user = NULL; - $oid = User_openid::staticGet('canonical', $canonical); - if ($oid) { - $user = User::staticGet('id', $oid->user_id); - } - return $user; - } - function update_user($user, $sreg) { $profile = $user->getProfile(); @@ -210,7 +202,7 @@ class FinishopenidloginAction extends Action { # Possible race condition... let's be paranoid - $other = $this->get_user($canonical); + $other = oid_get_user($canonical); if ($other) { common_server_error(_t('Creating new account for OpenID that already has a user.')); @@ -272,6 +264,7 @@ class FinishopenidloginAction extends Action { $profile->delete(); } + oid_set_last($display); common_set_user($user->nickname); common_redirect(common_local_url('showstream', array('nickname' => $user->nickname))); } @@ -305,6 +298,7 @@ class FinishopenidloginAction extends Action { } $this->update_user($user, $sreg); + oid_set_last($display); common_set_user($user->nickname); $this->go_home($user->nickname); } -- cgit v1.2.3-54-g00ecf