Merge branch 'master' of gitorious.org:statusnet/mainline into testing
This commit is contained in:
@@ -132,12 +132,15 @@ class FinishaddopenidAction extends Action
|
||||
$this->message(_m('Error connecting user.'));
|
||||
return;
|
||||
}
|
||||
if ($sreg) {
|
||||
if (!oid_update_user($cur, $sreg)) {
|
||||
$this->message(_m('Error updating profile'));
|
||||
return;
|
||||
if (Event::handle('StartOpenIDUpdateUser', array($cur, $canonical, &$sreg))) {
|
||||
if ($sreg) {
|
||||
if (!oid_update_user($cur, $sreg)) {
|
||||
$this->message(_m('Error updating profile'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
Event::handle('EndOpenIDUpdateUser', array($cur, $canonical, $sreg));
|
||||
|
||||
// success!
|
||||
|
||||
|
@@ -286,6 +286,8 @@ class FinishopenidloginAction extends Action
|
||||
return;
|
||||
}
|
||||
|
||||
Event::handle('StartOpenIDCreateNewUser', array($canonical, &$sreg));
|
||||
|
||||
$location = '';
|
||||
if (!empty($sreg['country'])) {
|
||||
if ($sreg['postcode']) {
|
||||
@@ -325,6 +327,8 @@ class FinishopenidloginAction extends Action
|
||||
|
||||
$result = oid_link_user($user->id, $canonical, $display);
|
||||
|
||||
Event::handle('EndOpenIDCreateNewUser', array($user, $canonical, $sreg));
|
||||
|
||||
oid_set_last($display);
|
||||
common_set_user($user);
|
||||
common_real_login(true);
|
||||
@@ -364,7 +368,11 @@ class FinishopenidloginAction extends Action
|
||||
return;
|
||||
}
|
||||
|
||||
oid_update_user($user, $sreg);
|
||||
if (Event::handle('StartOpenIDUpdateUser', array($user, $canonical, &$sreg))) {
|
||||
oid_update_user($user, $sreg);
|
||||
}
|
||||
Event::handle('EndOpenIDUpdateUser', array($user, $canonical, $sreg));
|
||||
|
||||
oid_set_last($display);
|
||||
common_set_user($user);
|
||||
common_real_login(true);
|
||||
|
@@ -221,11 +221,14 @@ function _oid_print_instructions()
|
||||
'OpenID provider.'));
|
||||
}
|
||||
|
||||
# update a user from sreg parameters
|
||||
|
||||
function oid_update_user(&$user, &$sreg)
|
||||
/**
|
||||
* Update a user from sreg parameters
|
||||
* @param User $user
|
||||
* @param array $sreg fields from OpenID sreg response
|
||||
* @access private
|
||||
*/
|
||||
function oid_update_user($user, $sreg)
|
||||
{
|
||||
|
||||
$profile = $user->getProfile();
|
||||
|
||||
$orig_profile = clone($profile);
|
||||
|
Reference in New Issue
Block a user