Skip to content

Commit

Permalink
Merge pull request #18473 from owncloud/smb-workgroup
Browse files Browse the repository at this point in the history
Allow domain to be specified for SMB
  • Loading branch information
DeepDiver1975 committed Sep 16, 2015
2 parents e744857 + 0667c43 commit 9d49e04
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apps/files_external/lib/backend/smb.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,22 @@ public function __construct(IL10N $l, Password $legacyAuth) {
(new DefinitionParameter('share', $l->t('Share'))),
(new DefinitionParameter('root', $l->t('Remote subfolder')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
(new DefinitionParameter('domain', $l->t('Domain')))
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
])
->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
->setLegacyAuthMechanism($legacyAuth)
;
}

/**
* @param StorageConfig $storage
*/
public function manipulateStorageConfig(StorageConfig &$storage) {
$user = $storage->getBackendOption('user');
if ($domain = $storage->getBackendOption('domain')) {
$storage->setBackendOption('user', $domain.'\\'.$user);
}
}

}

0 comments on commit 9d49e04

Please sign in to comment.