Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix tmp_repository_id mechanism, was broken.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed May 21, 2016
1 parent 5c330cc commit dabc448
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions core/src/core/src/pydio/Core/Http/Middleware/AuthMiddleware.php
Expand Up @@ -100,27 +100,24 @@ public static function handleRequest(\Psr\Http\Message\ServerRequestInterface &$
protected static function bootSessionServer(ServerRequestInterface $request){

$parameters = $request->getParsedBody();
if (AuthService::usersEnabled()) {
if (isSet($parameters["tmp_repository_id"])) {
try{
ConfService::switchRootDir($parameters["tmp_repository_id"], true);
}catch(PydioException $e){}
} else if (isSet($_SESSION["SWITCH_BACK_REPO_ID"])) {
ConfService::switchRootDir($_SESSION["SWITCH_BACK_REPO_ID"]);
unset($_SESSION["SWITCH_BACK_REPO_ID"]);
}


if (AuthService::usersEnabled()) {
$loggedUser = AuthService::getLoggedUser();
if ($loggedUser != null) {
$res = ConfService::switchUserToActiveRepository($loggedUser, (isSet($parameters["tmp_repository_id"])?$parameters["tmp_repository_id"]:"-1"));
if (!$res) {
AuthService::disconnect();
}
}

}else{

if (isSet($parameters["tmp_repository_id"])) {
try{
ConfService::switchRootDir($parameters["tmp_repository_id"], true);
}catch(PydioException $e){}
} else if (isSet($_SESSION["SWITCH_BACK_REPO_ID"])) {
ConfService::switchRootDir($_SESSION["SWITCH_BACK_REPO_ID"]);
unset($_SESSION["SWITCH_BACK_REPO_ID"]);
}

}

//Set language
Expand Down

0 comments on commit dabc448

Please sign in to comment.