Differential D19915 Diff 47537 src/applications/auth/controller/PhabricatorAuthRegisterController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/PhabricatorAuthRegisterController.php
| Show First 20 Lines • Show All 410 Lines • ▼ Show 20 Lines | if ($try_register) { | ||||
| $account_type); | $account_type); | ||||
| $password_object | $password_object | ||||
| ->setPassword($password_envelope, $user) | ->setPassword($password_envelope, $user) | ||||
| ->save(); | ->save(); | ||||
| } | } | ||||
| if ($is_setup) { | if ($is_setup) { | ||||
| $editor->makeAdminUser($user, true); | $xactions = array(); | ||||
| $xactions[] = id(new PhabricatorUserTransaction()) | |||||
| ->setTransactionType( | |||||
| PhabricatorUserEmpowerTransaction::TRANSACTIONTYPE) | |||||
| ->setNewValue(true); | |||||
| $actor = PhabricatorUser::getOmnipotentUser(); | |||||
| $content_source = PhabricatorContentSource::newFromRequest( | |||||
| $request); | |||||
epriestley: This should probably be `PhabricatorContentSource::newFromRequest($request)` instead of a… | |||||
| $people_application_phid = id(new PhabricatorPeopleApplication()) | |||||
| ->getPHID(); | |||||
| $transaction_editor = id(new PhabricatorUserTransactionEditor()) | |||||
| ->setActor($actor) | |||||
| ->setActingAsPHID($people_application_phid) | |||||
| ->setContentSource($content_source) | |||||
| ->setContinueOnMissingFields(true); | |||||
| $transaction_editor->applyTransactions($user, $xactions); | |||||
| } | } | ||||
| $account->setUserPHID($user->getPHID()); | $account->setUserPHID($user->getPHID()); | ||||
| $provider->willRegisterAccount($account); | $provider->willRegisterAccount($account); | ||||
| $account->save(); | $account->save(); | ||||
| $user->saveTransaction(); | $user->saveTransaction(); | ||||
| ▲ Show 20 Lines • Show All 297 Lines • Show Last 20 Lines | |||||
This should probably be PhabricatorContentSource::newFromRequest($request) instead of a console source, although this is a minor bookkeeping issue.