Merge pull request #19316 from nextcloud/backport/19312/stable17

[stable17] do not overwrite global user auth credentials with empty values
This commit is contained in:
Roeland Jago Douma 2020-02-06 16:19:27 +01:00 committed by GitHub
commit 55ccfef48e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,6 +50,11 @@ class UserGlobalAuth extends AuthMechanism {
} }
public function saveBackendOptions(IUser $user, $id, $backendOptions) { public function saveBackendOptions(IUser $user, $id, $backendOptions) {
// backendOptions are set when invoked via Files app
// but they are not set when invoked via ext storage settings
if(!isset($backendOptions['user']) && !isset($backendOptions['password'])) {
return;
}
// make sure we're not setting any unexpected keys // make sure we're not setting any unexpected keys
$credentials = [ $credentials = [
'user' => $backendOptions['user'], 'user' => $backendOptions['user'],