Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/query/PhabricatorAuthInviteQuery.php
| Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | if ($this->verificationCodes !== null) { | ||||
| foreach ($invites as $invite) { | foreach ($invites as $invite) { | ||||
| $invite->setViewerHasVerificationCode(true); | $invite->setViewerHasVerificationCode(true); | ||||
| } | } | ||||
| } | } | ||||
| return $invites; | return $invites; | ||||
| } | } | ||||
| protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClause(AphrontDatabaseConnection $conn) { | ||||
| $where = array(); | $where = array(); | ||||
| if ($this->ids !== null) { | if ($this->ids !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'id IN (%Ld)', | 'id IN (%Ld)', | ||||
| $this->ids); | $this->ids); | ||||
| } | } | ||||
| if ($this->phids !== null) { | if ($this->phids !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'phid IN (%Ls)', | 'phid IN (%Ls)', | ||||
| $this->phids); | $this->phids); | ||||
| } | } | ||||
| if ($this->emailAddresses !== null) { | if ($this->emailAddresses !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'emailAddress IN (%Ls)', | 'emailAddress IN (%Ls)', | ||||
| $this->emailAddresses); | $this->emailAddresses); | ||||
| } | } | ||||
| if ($this->verificationCodes !== null) { | if ($this->verificationCodes !== null) { | ||||
| $hashes = array(); | $hashes = array(); | ||||
| foreach ($this->verificationCodes as $code) { | foreach ($this->verificationCodes as $code) { | ||||
| $hashes[] = PhabricatorHash::digestForIndex($code); | $hashes[] = PhabricatorHash::digestForIndex($code); | ||||
| } | } | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'verificationHash IN (%Ls)', | 'verificationHash IN (%Ls)', | ||||
| $hashes); | $hashes); | ||||
| } | } | ||||
| if ($this->authorPHIDs !== null) { | if ($this->authorPHIDs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'authorPHID IN (%Ls)', | 'authorPHID IN (%Ls)', | ||||
| $this->authorPHIDs); | $this->authorPHIDs); | ||||
| } | } | ||||
| $where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn); | ||||
| return $this->formatWhereClause($where); | return $this->formatWhereClause($conn, $where); | ||||
| } | } | ||||
| public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
| // NOTE: This query is issued by logged-out users, who often will not be | // NOTE: This query is issued by logged-out users, who often will not be | ||||
| // able to see applications. They still need to be able to see invites. | // able to see applications. They still need to be able to see invites. | ||||
| return null; | return null; | ||||
| } | } | ||||
| } | } | ||||