files_external SMB: throw InvalidArgument when user is not set

Signed-off-by: Anderson Luiz Alves <alacn1@gmail.com>
pull/29923/head
Anderson Luiz Alves 4 years ago
parent b067ae78c5
commit 4e65441cb2
  1. 4
      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'),

Loading…
Cancel
Save