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

Commit

Permalink
Handle Minisite + Lock case - Fix #1278
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Nov 22, 2016
1 parent 00d4dd7 commit 1c2acd6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -96,12 +96,15 @@ public static function handleRequest(ServerRequestInterface $requestInterface, R
ApplicationState::setStateMinisite($hash);
}
if(!empty($ctx) && $ctx->hasUser() && isSet($shareData["REPOSITORY"])){
$repoObject = UsersService::getRepositoryWithPermission($ctx->getUser(), $shareData["REPOSITORY"]);
$ctx->setRepositoryObject($repoObject);
if($sessions){
SessionService::saveRepositoryId($shareData["REPOSITORY"]);
}
$requestInterface = $requestInterface->withAttribute("ctx", $ctx);
$uLock = $ctx->getUser()->getLock();
if(empty($uLock)){
$repoObject = UsersService::getRepositoryWithPermission($ctx->getUser(), $shareData["REPOSITORY"]);
$ctx->setRepositoryObject($repoObject);
$requestInterface = $requestInterface->withAttribute("ctx", $ctx);
}
}

return Server::callNextMiddleWare($requestInterface, $responseInterface, $next);
Expand Down
Expand Up @@ -178,7 +178,7 @@ public static function writeHtml(ResponseInterface $responseInterface, ContextIn
$confs = $shareCenter->getConfigs();
}
$repoObject = $context->getRepository();
if($repoObject === null && isSet($data['PRESET_LOGIN']) && isSet($data["REPOSITORY"])){
if($repoObject === null && (isSet($data['PRESET_LOGIN']) || ($context->hasUser() && $context->getUser()->getLock() !== false)) && isSet($data["REPOSITORY"])){
$repoObject = RepositoryService::getRepositoryById($data["REPOSITORY"]);
}

Expand Down

0 comments on commit 1c2acd6

Please sign in to comment.