Page MenuHomePhabricator

D20827.diff
No OneTemporary

D20827.diff

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

Mime Type
text/plain
Expires
Fri, May 24, 4:26 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6289775
Default Alt Text
D20827.diff (1 KB)

Event Timeline