Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/adapter/PhutilJIRAAuthAdapter.php
Show All 16 Lines | public function setJIRABaseURI($jira_base_uri) { | ||||
$this->jiraBaseURI = $jira_base_uri; | $this->jiraBaseURI = $jira_base_uri; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getJIRABaseURI() { | public function getJIRABaseURI() { | ||||
return $this->jiraBaseURI; | return $this->jiraBaseURI; | ||||
} | } | ||||
public function getAccountID() { | protected function newAccountIdentifiers() { | ||||
// Make sure the handshake is finished; this method is used for its | // Make sure the handshake is finished; this method is used for its | ||||
// side effect by Auth providers. | // side effect by Auth providers. | ||||
$this->getHandshakeData(); | $this->getHandshakeData(); | ||||
return idx($this->getUserInfo(), 'key'); | $info = $this->getUserInfo(); | ||||
// See T13493. Older versions of JIRA provide a "key" with a username or | |||||
// email address. Newer versions of JIRA provide a GUID "accountId". | |||||
// Intermediate versions of JIRA provide both. | |||||
$identifiers = array(); | |||||
$account_key = idx($info, 'key'); | |||||
if ($account_key !== null) { | |||||
$identifiers[] = $this->newAccountIdentifier($account_key); | |||||
} | |||||
$account_id = idx($info, 'accountId'); | |||||
if ($account_id !== null) { | |||||
$identifiers[] = $this->newAccountIdentifier( | |||||
sprintf( | |||||
'accountId(%s)', | |||||
$account_id)); | |||||
} | |||||
return $identifiers; | |||||
} | } | ||||
public function getAccountName() { | public function getAccountName() { | ||||
return idx($this->getUserInfo(), 'name'); | return idx($this->getUserInfo(), 'name'); | ||||
} | } | ||||
public function getAccountImageURI() { | public function getAccountImageURI() { | ||||
$avatars = idx($this->getUserInfo(), 'avatarUrls'); | $avatars = idx($this->getUserInfo(), 'avatarUrls'); | ||||
▲ Show 20 Lines • Show All 126 Lines • Show Last 20 Lines |