Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/query/PhabricatorAuthSessionQuery.php
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | foreach ($sessions as $key => $session) { | ||||
} else { | } else { | ||||
$session->attachIdentityObject($identity_object); | $session->attachIdentityObject($identity_object); | ||||
} | } | ||||
} | } | ||||
return $sessions; | return $sessions; | ||||
} | } | ||||
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClause(AphrontDatabaseConnection $conn) { | ||||
$where = array(); | $where = array(); | ||||
if ($this->ids) { | if ($this->ids !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'id IN (%Ld)', | 'id IN (%Ld)', | ||||
$this->ids); | $this->ids); | ||||
} | } | ||||
if ($this->identityPHIDs) { | if ($this->identityPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'userPHID IN (%Ls)', | 'userPHID IN (%Ls)', | ||||
$this->identityPHIDs); | $this->identityPHIDs); | ||||
} | } | ||||
if ($this->sessionKeys) { | if ($this->sessionKeys !== null) { | ||||
$hashes = array(); | $hashes = array(); | ||||
foreach ($this->sessionKeys as $session_key) { | foreach ($this->sessionKeys as $session_key) { | ||||
$hashes[] = PhabricatorHash::weakDigest($session_key); | $hashes[] = PhabricatorHash::weakDigest($session_key); | ||||
} | } | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'sessionKey IN (%Ls)', | 'sessionKey IN (%Ls)', | ||||
$hashes); | $hashes); | ||||
} | } | ||||
if ($this->sessionTypes) { | if ($this->sessionTypes !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'type IN (%Ls)', | 'type IN (%Ls)', | ||||
$this->sessionTypes); | $this->sessionTypes); | ||||
} | } | ||||
$where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn); | ||||
return $this->formatWhereClause($where); | return $this->formatWhereClause($conn, $where); | ||||
} | } | ||||
public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
return 'PhabricatorAuthApplication'; | return 'PhabricatorAuthApplication'; | ||||
} | } | ||||
} | } |