Merge pull request #9788 from nextcloud/notify-credentials-env-13

[13] allow setting notify credentials in environment
This commit is contained in:
Morris Jobke 2018-06-07 16:14:03 +02:00 committed by GitHub
commit 98e9bc33e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -106,9 +106,17 @@ class Notify extends Base {
if ($input->getOption('user')) {
$mount->setBackendOption('user', $input->getOption('user'));
} else if (isset($_ENV['NOTIFY_USER'])) {
$mount->setBackendOption('user', $_ENV['NOTIFY_USER']);
} else if (isset($_SERVER['NOTIFY_USER'])) {
$mount->setBackendOption('user', $_SERVER['NOTIFY_USER']);
}
if ($input->getOption('password')) {
$mount->setBackendOption('password', $input->getOption('password'));
} else if (isset($_ENV['NOTIFY_PASSWORD'])) {
$mount->setBackendOption('password', $_ENV['NOTIFY_PASSWORD']);
} else if (isset($_SERVER['NOTIFY_PASSWORD'])) {
$mount->setBackendOption('password', $_SERVER['NOTIFY_PASSWORD']);
}
try {