@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhabricatorPeopleDeleteController
4 extends PhabricatorPeopleController {
5
6 public function handleRequest(AphrontRequest $request) {
7 $viewer = $request->getUser();
8 $id = $request->getURIData('id');
9
10 $user = id(new PhabricatorPeopleQuery())
11 ->setViewer($viewer)
12 ->withIDs(array($id))
13 ->executeOne();
14 if (!$user) {
15 return new Aphront404Response();
16 }
17
18 $manage_uri = $this->getApplicationURI("manage/{$id}/");
19
20 $doc_uri = PhabricatorEnv::getDoclink(
21 'Permanently Destroying Data');
22
23 return $this->newDialog()
24 ->setTitle(pht('Delete User'))
25 ->appendParagraph(
26 pht(
27 'To permanently destroy this user, run this command from the '.
28 'command line:'))
29 ->appendCommand(
30 hsprintf(
31 '<samp>%s $</samp><kbd>%s</kbd>',
32 PlatformSymbols::getPlatformServerPath(),
33 csprintf(
34 './bin/remove destroy %R',
35 $user->getMonogram())))
36 ->appendParagraph(
37 pht(
38 'Unless you have a very good reason to delete this user, consider '.
39 'disabling them instead.'))
40 ->appendParagraph(
41 pht(
42 'Users can not be permanently destroyed from the web interface. '.
43 'See %s in the documentation for more information.',
44 phutil_tag(
45 'a',
46 array(
47 'href' => $doc_uri,
48 'target' => '_blank',
49 ),
50 pht('Permanently Destroying Data'))))
51 ->addCancelButton($manage_uri, pht('Close'));
52 }
53
54}