Changeset View
Changeset View
Standalone View
Standalone View
src/applications/settings/panel/PhabricatorPasswordSettingsPanel.php
Show All 34 Lines | public function processRequest(AphrontRequest $request) { | ||||
$min_len = PhabricatorEnv::getEnvConfig('account.minimum-password-length'); | $min_len = PhabricatorEnv::getEnvConfig('account.minimum-password-length'); | ||||
$min_len = (int)$min_len; | $min_len = (int)$min_len; | ||||
// NOTE: To change your password, you need to prove you own the account, | // NOTE: To change your password, you need to prove you own the account, | ||||
// either by providing the old password or by carrying a token to | // either by providing the old password or by carrying a token to | ||||
// the workflow from a password reset email. | // the workflow from a password reset email. | ||||
$key = $request->getStr('key'); | $key = $request->getStr('key'); | ||||
$password_type = PhabricatorAuthPasswordResetTemporaryTokenType::TOKENTYPE; | |||||
$token = null; | $token = null; | ||||
if ($key) { | if ($key) { | ||||
$token = id(new PhabricatorAuthTemporaryTokenQuery()) | $token = id(new PhabricatorAuthTemporaryTokenQuery()) | ||||
->setViewer($user) | ->setViewer($user) | ||||
->withObjectPHIDs(array($user->getPHID())) | ->withObjectPHIDs(array($user->getPHID())) | ||||
->withTokenTypes( | ->withTokenTypes(array($password_type)) | ||||
array(PhabricatorAuthSessionEngine::PASSWORD_TEMPORARY_TOKEN_TYPE)) | |||||
->withTokenCodes(array(PhabricatorHash::digest($key))) | ->withTokenCodes(array(PhabricatorHash::digest($key))) | ||||
->withExpired(false) | ->withExpired(false) | ||||
->executeOne(); | ->executeOne(); | ||||
} | } | ||||
$e_old = true; | $e_old = true; | ||||
$e_new = true; | $e_new = true; | ||||
$e_conf = true; | $e_conf = true; | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |