summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-01-14 16:13:21 +0100
committerGitHub <noreply@github.com>2022-01-14 16:13:21 +0100
commit890af1917edc612552e97c118c5acdf681e649e7 (patch)
treeb8d762e715f55834514dc9e6bd946d7862689fba /apps
parent14c60b10d0d49f007869b2ba73de2a6b20f0a05d (diff)
parent4e65441cb2cfe7f93476d64cb0ce68de722632c6 (diff)
downloadnextcloud-server-890af1917edc612552e97c118c5acdf681e649e7.tar.gz
nextcloud-server-890af1917edc612552e97c118c5acdf681e649e7.zip
Merge pull request #29923 from alacn1/fix_basicauth_must_be_string
Fix users can't login external mount user entered credentials not set
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/Lib/Backend/SMB.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files_external/lib/Lib/Backend/SMB.php b/apps/files_external/lib/Lib/Backend/SMB.php
index 73e6b67614b..867648824ac 100644
--- a/apps/files_external/lib/Lib/Backend/SMB.php
+++ b/apps/files_external/lib/Lib/Backend/SMB.php
@@ -76,6 +76,10 @@ class SMB extends Backend {
public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
$auth = $storage->getAuthMechanism();
if ($auth->getScheme() === AuthMechanism::SCHEME_PASSWORD) {
+ if (!is_string($storage->getBackendOption('user')) || !is_string($storage->getBackendOption('password'))) {
+ throw new \InvalidArgumentException('user or password is not set');
+ }
+
$smbAuth = new BasicAuth(
$storage->getBackendOption('user'),
$storage->getBackendOption('domain'),