Skip to content

Commit c5c6dcb

Browse files
Merge pull request #53617 from nextcloud/backport/53616/stable30
2 parents 758c905 + 76d375d commit c5c6dcb

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

core/Command/User/Add.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected function configure(): void {
5252
'password-from-env',
5353
null,
5454
InputOption::VALUE_NONE,
55-
'read password from environment variable OC_PASS'
55+
'read password from environment variable NC_PASS/OC_PASS'
5656
)
5757
->addOption(
5858
'generate-password',
@@ -91,10 +91,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9191

9292
// Setup password.
9393
if ($input->getOption('password-from-env')) {
94-
$password = getenv('OC_PASS');
94+
$password = getenv('NC_PASS') ?: getenv('OC_PASS');
9595

9696
if (!$password) {
97-
$output->writeln('<error>--password-from-env given, but OC_PASS is empty!</error>');
97+
$output->writeln('<error>--password-from-env given, but NC_PASS/OC_PASS is empty!</error>');
9898
return 1;
9999
}
100100
} elseif ($input->getOption('generate-password')) {

core/Command/User/AuthTokens/Add.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6262
}
6363

6464
if ($input->getOption('password-from-env')) {
65-
$password = getenv('NC_PASS') ?? getenv('OC_PASS');
65+
$password = getenv('NC_PASS') ?: getenv('OC_PASS');
6666
if (!$password) {
67-
$output->writeln('<error>--password-from-env given, but NC_PASS is empty!</error>');
67+
$output->writeln('<error>--password-from-env given, but NC_PASS/OC_PASS is empty!</error>');
6868
return 1;
6969
}
7070
} elseif ($input->isInteractive()) {

core/Command/User/ResetPassword.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function configure() {
4141
'password-from-env',
4242
null,
4343
InputOption::VALUE_NONE,
44-
'read password from environment variable OC_PASS'
44+
'read password from environment variable NC_PASS/OC_PASS'
4545
)
4646
;
4747
}
@@ -56,9 +56,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5656
}
5757

5858
if ($input->getOption('password-from-env')) {
59-
$password = getenv('OC_PASS');
59+
$password = getenv('NC_PASS') ?: getenv('OC_PASS');
6060
if (!$password) {
61-
$output->writeln('<error>--password-from-env given, but OC_PASS is empty!</error>');
61+
$output->writeln('<error>--password-from-env given, but NC_PASS/OC_PASS is empty!</error>');
6262
return 1;
6363
}
6464
} elseif ($input->isInteractive()) {

0 commit comments

Comments
 (0)