Api: Improve handling of accessing multiple shares (Collabora or directory) in new tabs while logged in

This commit is contained in:
nathangray 2021-03-11 09:50:12 -07:00
parent 657119b389
commit ba84d3170d
3 changed files with 8 additions and 3 deletions

View File

@ -526,6 +526,7 @@ class Sharing
}*/
if($this->use_collabora())
{
unset($GLOBALS['egw']->sharing);
$ui = new \EGroupware\Collabora\Ui();
return $ui->editor($this->share['share_path']);
}

View File

@ -64,9 +64,13 @@ class AnonymousList extends filemanager_ui
* @return string
*/
static function get_home_dir()
{
if(isset($GLOBALS['egw']->sharing))
{
return $GLOBALS['egw']->sharing->get_root();
}
return '/';
}
/**
* Context menu
@ -79,7 +83,7 @@ class AnonymousList extends filemanager_ui
$group = 1;
// do not add edit setting action when we are in sharing
unset($actions['edit']);
if (Vfs::is_writable($GLOBALS['egw']->sharing->get_root()))
if (isset($GLOBALS['egw']->sharing) && Vfs::is_writable($GLOBALS['egw']->sharing->get_root()))
{
return $actions;
}

View File

@ -27,7 +27,7 @@ $GLOBALS['egw_info'] = array(
include('./header.inc.php');
if (!isset($GLOBALS['egw']->sharing))
if (!isset($GLOBALS['egw']->sharing) || \EGroupware\Api\Sharing::get_token() !== $GLOBALS['egw']->sharing->get_token())
{
Sharing::create_session(true); // true = mount into existing session
}