Differential D7572 Diff 17093 src/applications/conduit/controller/PhabricatorConduitAPIController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/controller/PhabricatorConduitAPIController.php
Show First 20 Lines • Show All 307 Lines • ▼ Show 20 Lines | return $this->validateAuthenticatedUser( | ||||
$api_request, | $api_request, | ||||
$user); | $user); | ||||
} | } | ||||
private function validateAuthenticatedUser( | private function validateAuthenticatedUser( | ||||
ConduitAPIRequest $request, | ConduitAPIRequest $request, | ||||
PhabricatorUser $user) { | PhabricatorUser $user) { | ||||
if ($user->getIsDisabled()) { | if (!$user->isUserActivated()) { | ||||
return array( | return array( | ||||
'ERR-USER-DISABLED', | 'ERR-USER-DISABLED', | ||||
'User is disabled.'); | pht('User account is not activated.'), | ||||
} | ); | ||||
if (PhabricatorUserEmail::isEmailVerificationRequired()) { | |||||
$email = $user->loadPrimaryEmail(); | |||||
if (!$email) { | |||||
return array( | |||||
'ERR-USER-NOEMAIL', | |||||
'User has no primary email address.'); | |||||
} | |||||
if (!$email->getIsVerified()) { | |||||
return array( | |||||
'ERR-USER-UNVERIFIED', | |||||
'User has unverified email address.'); | |||||
} | |||||
} | } | ||||
$request->setUser($user); | $request->setUser($user); | ||||
return null; | return null; | ||||
} | } | ||||
private function buildHumanReadableResponse( | private function buildHumanReadableResponse( | ||||
$method, | $method, | ||||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |