Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/storage/PhabricatorUser.php
Show All 36 Lines | final class PhabricatorUser | ||||
private $profileImage = self::ATTACHABLE; | private $profileImage = self::ATTACHABLE; | ||||
private $profile = null; | private $profile = null; | ||||
private $status = self::ATTACHABLE; | private $status = self::ATTACHABLE; | ||||
private $preferences = null; | private $preferences = null; | ||||
private $omnipotent = false; | private $omnipotent = false; | ||||
private $customFields = self::ATTACHABLE; | private $customFields = self::ATTACHABLE; | ||||
private $alternateCSRFString = self::ATTACHABLE; | private $alternateCSRFString = self::ATTACHABLE; | ||||
private $session = self::ATTACHABLE; | |||||
protected function readField($field) { | protected function readField($field) { | ||||
switch ($field) { | switch ($field) { | ||||
case 'timezoneIdentifier': | case 'timezoneIdentifier': | ||||
// If the user hasn't set one, guess the server's time. | // If the user hasn't set one, guess the server's time. | ||||
return nonempty( | return nonempty( | ||||
$this->timezoneIdentifier, | $this->timezoneIdentifier, | ||||
date_default_timezone_get()); | date_default_timezone_get()); | ||||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | public function save() { | ||||
$this->updateNameTokens(); | $this->updateNameTokens(); | ||||
id(new PhabricatorSearchIndexer()) | id(new PhabricatorSearchIndexer()) | ||||
->queueDocumentForIndexing($this->getPHID()); | ->queueDocumentForIndexing($this->getPHID()); | ||||
return $result; | return $result; | ||||
} | } | ||||
public function attachSession(PhabricatorAuthSession $session) { | |||||
$this->session = $session; | |||||
return $this; | |||||
} | |||||
public function getSession() { | |||||
return $this->assertAttached($this->session); | |||||
} | |||||
public function hasSession() { | |||||
return ($this->session !== self::ATTACHABLE); | |||||
} | |||||
private function generateConduitCertificate() { | private function generateConduitCertificate() { | ||||
return Filesystem::readRandomCharacters(255); | return Filesystem::readRandomCharacters(255); | ||||
} | } | ||||
public function comparePassword(PhutilOpaqueEnvelope $envelope) { | public function comparePassword(PhutilOpaqueEnvelope $envelope) { | ||||
if (!strlen($envelope->openEnvelope())) { | if (!strlen($envelope->openEnvelope())) { | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 615 Lines • Show Last 20 Lines |