@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 PhabricatorAuthManagementLockWorkflow
4 extends PhabricatorAuthManagementWorkflow {
5
6 protected function didConstruct() {
7 $this
8 ->setName('lock')
9 ->setExamples('**lock**')
10 ->setSynopsis(
11 pht(
12 'Lock authentication provider config, to prevent changes to '.
13 'the config without doing **bin/auth unlock**.'));
14 }
15
16 public function execute(PhutilArgumentParser $args) {
17 $console = PhutilConsole::getConsole();
18
19 $key = 'auth.lock-config';
20 $config_entry = PhabricatorConfigEntry::loadConfigEntry($key);
21 $config_entry->setValue(true);
22
23 // If the entry has been deleted, resurrect it.
24 $config_entry->setIsDeleted(0);
25
26 $config_entry->save();
27
28 echo tsprintf(
29 "%s\n",
30 pht('Locked the authentication provider configuration.'));
31 }
32}