Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/auth/management/PhabricatorAuthManagementLockWorkflow.php
12256 views
1
<?php
2
3
final 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
}
33
34