Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/storage/PhabricatorAuthSession.php
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | switch ($session_type) { | ||||
return phutil_units('30 days in seconds'); | return phutil_units('30 days in seconds'); | ||||
case self::TYPE_CONDUIT: | case self::TYPE_CONDUIT: | ||||
return phutil_units('24 hours in seconds'); | return phutil_units('24 hours in seconds'); | ||||
default: | default: | ||||
throw new Exception(pht('Unknown session type "%s".', $session_type)); | throw new Exception(pht('Unknown session type "%s".', $session_type)); | ||||
} | } | ||||
} | } | ||||
public function isHighSecuritySession() { | |||||
$until = $this->getHighSecurityUntil(); | |||||
if (!$until) { | |||||
return false; | |||||
} | |||||
$now = PhabricatorTime::getNow(); | |||||
if ($until < $now) { | |||||
return false; | |||||
} | |||||
return true; | |||||
} | |||||
/* -( PhabricatorPolicyInterface )----------------------------------------- */ | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
public function getCapabilities() { | public function getCapabilities() { | ||||
return array( | return array( | ||||
PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
); | ); | ||||
} | } | ||||
Show All 25 Lines |