From fb6e38548b0ccbe25be9d8c31fb9e8583ac60a94 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 13 Nov 2013 11:25:43 -0800 Subject: [PATCH] Respect "can edit username" in registration UI Summary: Fixes T3741. The flag is respected in terms of actually creating the account, but the UI is a bit unclear. This can never occur naturally, but installs can register an event which locks it. Test Plan: Artificially locked it, verified I got more reasonable UI; {F81282} Reviewers: btrahan, datr Reviewed By: datr CC: aran Maniphest Tasks: T3741 Differential Revision: https://secure.phabricator.com/D7577 --- .../controller/PhabricatorAuthRegisterController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/applications/auth/controller/PhabricatorAuthRegisterController.php b/src/applications/auth/controller/PhabricatorAuthRegisterController.php index b1dcd8b19c..868aa1e304 100644 --- a/src/applications/auth/controller/PhabricatorAuthRegisterController.php +++ b/src/applications/auth/controller/PhabricatorAuthRegisterController.php @@ -326,13 +326,20 @@ final class PhabricatorAuthRegisterController } - $form - ->appendChild( + if ($can_edit_username) { + $form->appendChild( id(new AphrontFormTextControl()) ->setLabel(pht('Phabricator Username')) ->setName('username') ->setValue($value_username) ->setError($e_username)); + } else { + $form->appendChild( + id(new AphrontFormMarkupControl()) + ->setLabel(pht('Phabricator Username')) + ->setValue($value_username) + ->setError($e_username)); + } if ($must_set_password) { $form->appendChild(