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()) if($this->use_collabora())
{ {
unset($GLOBALS['egw']->sharing);
$ui = new \EGroupware\Collabora\Ui(); $ui = new \EGroupware\Collabora\Ui();
return $ui->editor($this->share['share_path']); return $ui->editor($this->share['share_path']);
} }

View File

@ -65,7 +65,11 @@ class AnonymousList extends filemanager_ui
*/ */
static function get_home_dir() static function get_home_dir()
{ {
return $GLOBALS['egw']->sharing->get_root(); if(isset($GLOBALS['egw']->sharing))
{
return $GLOBALS['egw']->sharing->get_root();
}
return '/';
} }
/** /**
@ -79,7 +83,7 @@ class AnonymousList extends filemanager_ui
$group = 1; $group = 1;
// do not add edit setting action when we are in sharing // do not add edit setting action when we are in sharing
unset($actions['edit']); 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; return $actions;
} }

View File

@ -27,7 +27,7 @@ $GLOBALS['egw_info'] = array(
include('./header.inc.php'); 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 Sharing::create_session(true); // true = mount into existing session
} }