Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnderson Luiz Alves <alacn1@gmail.com>2021-12-03 16:57:00 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2022-01-14 18:16:18 +0300
commitf71593e3d54bbd022730f3f1622d0735914e7950 (patch)
tree1ed164bb3e3e3f38ae92eafb84282212bf1a362e
parent377336a8f13c987350ebd47be3dd5ad6ad8e14dd (diff)
files_external SMB: throw InvalidArgument when user is not set
Signed-off-by: Anderson Luiz Alves <alacn1@gmail.com>
-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'),