Add name check for webdav configuration options
The webdav_storage addon should check whether it should provide its config options and its instance based on the provided `$data['name']`. Not doing this will override the configuration and instance of another storage add-on.
This commit is contained in:
parent
5c0b20b21f
commit
327bfcb2b5
1 changed files with 7 additions and 3 deletions
|
@ -26,11 +26,15 @@ function webdav_storage_uninstall()
|
|||
|
||||
function webdav_storage_instance(App $a, array &$data)
|
||||
{
|
||||
if ($data['name'] == WebDav::getName()) {
|
||||
$config = new WebDavConfig(DI::l10n(), DI::config(), DI::httpClient());
|
||||
$data['storage'] = new WebDav($config->getUrl(), $config->getAuthOptions(), DI::httpClient(), DI::logger());
|
||||
}
|
||||
}
|
||||
|
||||
function webdav_storage_config(App $a, array &$data)
|
||||
{
|
||||
if ($data['name'] == WebDav::getName()) {
|
||||
$data['storage_config'] = new WebDavConfig(DI::l10n(), DI::config(), DI::httpClient());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue