forked from GNUsocial/gnu-social
slightly better rememberme logic in finishopenidlogin
darcs-hash:20081209180330-84dde-ba48eed8a9a557bac90d3869d60b24a4b9683e61.gz
This commit is contained in:
parent
60a43519b9
commit
3909544f9e
@ -132,12 +132,12 @@ class FinishopenidloginAction extends Action {
|
|||||||
# XXX: commented out at @edd's request until better
|
# XXX: commented out at @edd's request until better
|
||||||
# control over how data flows from OpenID provider.
|
# control over how data flows from OpenID provider.
|
||||||
# oid_update_user($user, $sreg);
|
# oid_update_user($user, $sreg);
|
||||||
common_set_user($user->nickname);
|
common_set_user($user);
|
||||||
common_real_login(true);
|
common_real_login(true);
|
||||||
if ($_SESSION['openid_rememberme']) {
|
if (isset($_SESSION['openid_rememberme']) && $_SESSION['openid_rememberme']) {
|
||||||
common_rememberme($user);
|
common_rememberme($user);
|
||||||
}
|
}
|
||||||
unset($_SESSION['openid_rememberme']);
|
unset($_SESSION['openid_rememberme']);
|
||||||
$this->go_home($user->nickname);
|
$this->go_home($user->nickname);
|
||||||
} else {
|
} else {
|
||||||
$this->save_values($display, $canonical, $sreg);
|
$this->save_values($display, $canonical, $sreg);
|
||||||
@ -211,32 +211,32 @@ class FinishopenidloginAction extends Action {
|
|||||||
$location = $sreg['country'];
|
$location = $sreg['country'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sreg['fullname'] && strlen($sreg['fullname']) <= 255) {
|
if ($sreg['fullname'] && strlen($sreg['fullname']) <= 255) {
|
||||||
$fullname = $sreg['fullname'];
|
$fullname = $sreg['fullname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sreg['email'] && Validate::email($sreg['email'], true)) {
|
if ($sreg['email'] && Validate::email($sreg['email'], true)) {
|
||||||
$email = $sreg['email'];
|
$email = $sreg['email'];
|
||||||
}
|
}
|
||||||
|
|
||||||
# XXX: add language
|
# XXX: add language
|
||||||
# XXX: add timezone
|
# XXX: add timezone
|
||||||
|
|
||||||
$user = User::register(array('nickname' => $nickname,
|
$user = User::register(array('nickname' => $nickname,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
'fullname' => $fullname,
|
'fullname' => $fullname,
|
||||||
'location' => $location));
|
'location' => $location));
|
||||||
|
|
||||||
$result = oid_link_user($user->id, $canonical, $display);
|
$result = oid_link_user($user->id, $canonical, $display);
|
||||||
|
|
||||||
oid_set_last($display);
|
oid_set_last($display);
|
||||||
common_set_user($user->nickname);
|
common_set_user($user);
|
||||||
common_real_login(true);
|
common_real_login(true);
|
||||||
if ($_SESSION['openid_rememberme']) {
|
if (isset($_SESSION['openid_rememberme']) && $_SESSION['openid_rememberme']) {
|
||||||
common_rememberme($user);
|
common_rememberme($user);
|
||||||
}
|
}
|
||||||
unset($_SESSION['openid_rememberme']);
|
unset($_SESSION['openid_rememberme']);
|
||||||
common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)));
|
common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,9 +270,9 @@ class FinishopenidloginAction extends Action {
|
|||||||
|
|
||||||
oid_update_user($user, $sreg);
|
oid_update_user($user, $sreg);
|
||||||
oid_set_last($display);
|
oid_set_last($display);
|
||||||
common_set_user($user->nickname);
|
common_set_user($user);
|
||||||
common_real_login(true);
|
common_real_login(true);
|
||||||
if ($_SESSION['openid_rememberme']) {
|
if (isset($_SESSION['openid_rememberme']) && $_SESSION['openid_rememberme']) {
|
||||||
common_rememberme($user);
|
common_rememberme($user);
|
||||||
}
|
}
|
||||||
unset($_SESSION['openid_rememberme']);
|
unset($_SESSION['openid_rememberme']);
|
||||||
@ -296,7 +296,6 @@ class FinishopenidloginAction extends Action {
|
|||||||
|
|
||||||
# Try the passed-in nickname
|
# Try the passed-in nickname
|
||||||
|
|
||||||
|
|
||||||
if ($sreg['nickname']) {
|
if ($sreg['nickname']) {
|
||||||
$nickname = $this->nicknamize($sreg['nickname']);
|
$nickname = $this->nicknamize($sreg['nickname']);
|
||||||
if ($this->is_new_nickname($nickname)) {
|
if ($this->is_new_nickname($nickname)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user