mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
merge in default context / Vfs::$user, otherwise we have to fix all code already using context
This commit is contained in:
parent
7cc46f04e1
commit
73e2e71e9a
@ -393,11 +393,11 @@ class Vfs extends Vfs\Base
|
||||
}
|
||||
|
||||
// make all find options available as stream context option "find", to allow plugins to use them
|
||||
$context = stream_context_create(array_merge_recursive(stream_context_get_options(stream_context_get_default()), [
|
||||
$context = stream_context_create([
|
||||
self::SCHEME => [
|
||||
'find' => $options,
|
||||
],
|
||||
]));
|
||||
]);
|
||||
|
||||
$url = $options['url'];
|
||||
|
||||
|
@ -48,8 +48,13 @@ trait UserContextTrait
|
||||
{
|
||||
$this->context = stream_context_get_default();
|
||||
}
|
||||
// if context set by PHP contains no user, set user from our default context (Vfs::$user)
|
||||
elseif (empty(stream_context_get_options($this->context)[Vfs::SCHEME]['user']))
|
||||
{
|
||||
stream_context_set_option($this->context, stream_context_get_options(stream_context_get_default()));
|
||||
}
|
||||
|
||||
if(is_string($url_or_context))
|
||||
if (is_string($url_or_context))
|
||||
{
|
||||
$this->check_set_context($url_or_context, true);
|
||||
}
|
||||
@ -167,7 +172,7 @@ trait UserContextTrait
|
||||
switch($name)
|
||||
{
|
||||
case 'user':
|
||||
return $this->context ? stream_context_get_options($this->context)[Vfs::SCHEME]['user'] : null;
|
||||
return $this->context ? stream_context_get_options($this->context)[Vfs::SCHEME]['user'] : Vfs::$user;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user