Permalink
Browse files

Fix tmp_repository_id mechanism, was broken.

  • Loading branch information...
1 parent 5c330cc commit dabc448aba711fbd3cb51e0b343b00c0bee21976 @cdujeu cdujeu committed May 21, 2016
Showing with 10 additions and 13 deletions.
  1. +10 −13 core/src/core/src/pydio/Core/Http/Middleware/AuthMiddleware.php
@@ -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

0 comments on commit dabc448

Please sign in to comment.