Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15464347
D20827.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D20827.diff
View Options
diff --git a/src/applications/people/controller/PhabricatorPeopleRenameController.php b/src/applications/people/controller/PhabricatorPeopleRenameController.php
--- a/src/applications/people/controller/PhabricatorPeopleRenameController.php
+++ b/src/applications/people/controller/PhabricatorPeopleRenameController.php
@@ -3,8 +3,13 @@
final class PhabricatorPeopleRenameController
extends PhabricatorPeopleController {
+ public function shouldRequireAdmin() {
+ return false;
+ }
+
public function handleRequest(AphrontRequest $request) {
$viewer = $this->getViewer();
+
$id = $request->getURIData('id');
$user = id(new PhabricatorPeopleQuery())
@@ -17,6 +22,16 @@
$done_uri = $this->getApplicationURI("manage/{$id}/");
+ if (!$viewer->getIsAdmin()) {
+ return $this->newDialog()
+ ->setTitle(pht('Change Username'))
+ ->appendParagraph(
+ pht(
+ 'You can not change usernames because you are not an '.
+ 'administrator. Only administrators can change usernames.'))
+ ->addCancelButton($done_uri, pht('Okay'));
+ }
+
$validation_exception = null;
$username = $user->getUsername();
if ($request->isFormOrHisecPost()) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 3, 8:41 AM (3 w, 12 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7666248
Default Alt Text
D20827.diff (1 KB)
Attached To
Mode
D20827: When non-administrators click "Change Username", explain why they can't continue
Attached
Detach File
Event Timeline
Log In to Comment