diff --git a/src/applications/people/controller/settings/panels/oauth/PhabricatorUserOAuthSettingsPanelController.php b/src/applications/people/controller/settings/panels/oauth/PhabricatorUserOAuthSettingsPanelController.php
index df735b9e02..0b6c88226d 100644
--- a/src/applications/people/controller/settings/panels/oauth/PhabricatorUserOAuthSettingsPanelController.php
+++ b/src/applications/people/controller/settings/panels/oauth/PhabricatorUserOAuthSettingsPanelController.php
@@ -27,24 +27,24 @@ final class PhabricatorUserOAuthSettingsPanelController
}
public function processRequest() {
-
- $request = $this->getRequest();
- $user = $request->getUser();
- $provider = $this->provider;
-
- $notice = null;
-
+ $request = $this->getRequest();
+ $user = $request->getUser();
+ $provider = $this->provider;
+ $notice = null;
$provider_name = $provider->getProviderName();
- $provider_key = $provider->getProviderKey();
+ $provider_key = $provider->getProviderKey();
$oauth_info = id(new PhabricatorUserOAuthInfo())->loadOneWhere(
'userID = %d AND oauthProvider = %s',
$user->getID(),
$provider->getProviderKey());
+ if ($request->isFormPost() && $oauth_info) {
+ $notice = $this->refreshProfileImage($oauth_info);
+ }
+
$form = new AphrontFormView();
- $form
- ->setUser($user);
+ $form->setUser($user);
$forms = array();
$forms[] = $form;
@@ -86,15 +86,22 @@ final class PhabricatorUserOAuthSettingsPanelController
->appendChild(
id(new AphrontFormStaticControl())
->setLabel($provider_name.' ID')
- ->setValue($oauth_info->getOAuthUID()))
+ ->setValue($oauth_info->getOAuthUID())
+ )
->appendChild(
id(new AphrontFormStaticControl())
->setLabel($provider_name.' Name')
- ->setValue($oauth_info->getAccountName()))
+ ->setValue($oauth_info->getAccountName())
+ )
->appendChild(
id(new AphrontFormStaticControl())
->setLabel($provider_name.' URI')
- ->setValue($oauth_info->getAccountURI()));
+ ->setValue($oauth_info->getAccountURI())
+ )
+ ->appendChild(
+ id(new AphrontFormSubmitControl())
+ ->setValue('Refresh Profile Image from '.$provider_name)
+ );
if (!$provider->isProviderLinkPermanent()) {
$unlink = 'Unlink '.$provider_name.' Account';
@@ -157,7 +164,7 @@ final class PhabricatorUserOAuthSettingsPanelController
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
foreach ($forms as $name => $form) {
if ($name) {
- $panel->appendChild('