You are here

protected function ContributeManager::getUserPicture in Contribute 8

Get a user account's picture from Drupal.org.

Return value

string A user account's picture from Drupal.org.

1 call to ContributeManager::getUserPicture()
ContributeManager::getAccount in src/ContributeManager.php
Get account status.

File

src/ContributeManager.php, line 508

Class

ContributeManager
Class ContributeManager.

Namespace

Drupal\contribute

Code

protected function getUserPicture() {
  $account_id = $this
    ->getAccountId();
  $body = $this
    ->get('https://www.drupal.org/u/' . urlencode($account_id));
  if (preg_match('#(/user-pictures/picture-[^\\.]+.[a-z]+)#', $body, $match)) {
    return 'https://www.drupal.org/files' . $match[1];
  }
  else {
    return '';
  }
}