summaryrefslogtreecommitdiff
path: root/actions/finishopenidlogin.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-06-19 09:47:10 -0400
committerEvan Prodromou <evan@prodromou.name>2008-06-19 09:47:10 -0400
commit171b4f72ee5a84d2a67b99aca7df9406e68f60c1 (patch)
tree89d7a8cffb534fad758df3812a197801d54783d6 /actions/finishopenidlogin.php
parent7258969cd48d9e11e500db56665e190d05d1e4c0 (diff)
immediate mode for openid
darcs-hash:20080619134710-84dde-6086a4ac7bbd72a251fe5ce6fe3156e3270ebd74.gz
Diffstat (limited to 'actions/finishopenidlogin.php')
-rw-r--r--actions/finishopenidlogin.php16
1 files changed, 5 insertions, 11 deletions
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);
}