Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/storage/PhabricatorAuthSession.php
Show All 9 Lines | final class PhabricatorAuthSession extends PhabricatorAuthDAO | ||||
protected $type; | protected $type; | ||||
protected $sessionKey; | protected $sessionKey; | ||||
protected $sessionStart; | protected $sessionStart; | ||||
private $identityObject = self::ATTACHABLE; | private $identityObject = self::ATTACHABLE; | ||||
public function getConfiguration() { | public function getConfiguration() { | ||||
return array( | return array( | ||||
self::CONFIG_IDS => self::IDS_MANUAL, | |||||
self::CONFIG_TIMESTAMPS => false, | self::CONFIG_TIMESTAMPS => false, | ||||
) + parent::getConfiguration(); | ) + parent::getConfiguration(); | ||||
} | } | ||||
public function getApplicationName() { | public function getApplicationName() { | ||||
// This table predates the "Auth" application, and really all applications. | // This table predates the "Auth" application, and really all applications. | ||||
return 'user'; | return 'user'; | ||||
} | } | ||||
public function getTableName() { | public function getTableName() { | ||||
// This is a very old table with a nonstandard name. | // This is a very old table with a nonstandard name. | ||||
return PhabricatorUser::SESSION_TABLE; | return PhabricatorUser::SESSION_TABLE; | ||||
} | } | ||||
public function attachIdentityObject($identity_object) { | public function attachIdentityObject($identity_object) { | ||||
$this->identityObject = $identity_object; | $this->identityObject = $identity_object; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getIdentityObject() { | public function getIdentityObject() { | ||||
return $this->assertAttached($this->identityObject); | return $this->assertAttached($this->identityObject); | ||||
} | } | ||||
public function delete() { | |||||
// TODO: We don't have a proper `id` column yet, so make this work as | |||||
// expected until we do. | |||||
queryfx( | |||||
$this->establishConnection('w'), | |||||
'DELETE FROM %T WHERE sessionKey = %s', | |||||
$this->getTableName(), | |||||
$this->getSessionKey()); | |||||
return $this; | |||||
} | |||||
/* -( PhabricatorPolicyInterface )----------------------------------------- */ | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
public function getCapabilities() { | public function getCapabilities() { | ||||
return array( | return array( | ||||
PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
); | ); | ||||
} | } | ||||
Show All 25 Lines |