Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionServeController.php
Show First 20 Lines • Show All 376 Lines • ▼ Show 20 Lines | $user = id(new PhabricatorPeopleQuery()) | ||||
->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
->withUsernames(array($username)) | ->withUsernames(array($username)) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$user) { | if (!$user) { | ||||
// Username doesn't match anything. | // Username doesn't match anything. | ||||
return null; | return null; | ||||
} | } | ||||
if (!$user->isUserActivated()) { | |||||
// User is not activated. | |||||
return null; | |||||
} | |||||
$password_entry = id(new PhabricatorRepositoryVCSPassword()) | $password_entry = id(new PhabricatorRepositoryVCSPassword()) | ||||
->loadOneWhere('userPHID = %s', $user->getPHID()); | ->loadOneWhere('userPHID = %s', $user->getPHID()); | ||||
if (!$password_entry) { | if (!$password_entry) { | ||||
// User doesn't have a password set. | // User doesn't have a password set. | ||||
return null; | return null; | ||||
} | } | ||||
if (!$password_entry->comparePassword($password, $user)) { | if (!$password_entry->comparePassword($password, $user)) { | ||||
// Password doesn't match. | // Password doesn't match. | ||||
return null; | return null; | ||||
} | } | ||||
if ($user->getIsDisabled()) { | |||||
// User is disabled. | |||||
return null; | |||||
} | |||||
return $user; | return $user; | ||||
} | } | ||||
private function serveMercurialRequest(PhabricatorRepository $repository) { | private function serveMercurialRequest(PhabricatorRepository $repository) { | ||||
$request = $this->getRequest(); | $request = $this->getRequest(); | ||||
$bin = Filesystem::resolveBinary('hg'); | $bin = Filesystem::resolveBinary('hg'); | ||||
if (!$bin) { | if (!$bin) { | ||||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |