mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
files_external SMB: throw InvalidArgument when user is not set
Signed-off-by: Anderson Luiz Alves <alacn1@gmail.com>
This commit is contained in:
parent
b067ae78c5
commit
4e65441cb2
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Reference in a new issue