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

Commit

Permalink
Fix Sharing on Api v1
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Sep 15, 2016
1 parent 51dd701 commit 45c0963
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/src/core/src/pydio/Core/Utils/ApplicationState.php
Expand Up @@ -127,9 +127,12 @@ public static function detectServerURL($withURI = false, $forceInternal = false)
$uri = dirname($_SERVER["REQUEST_URI"]);
$api = ConfService::currentContextIsRestAPI();
if (!empty($api)) {
// Keep only before api base
$explode = explode($api . "/", $uri);
$uri = array_shift($explode);
if(strpos($uri, '/api/') === 0){
$uri = '/';
}else{
// Keep only before api base
$uri = array_shift(explode("/api/", $uri));
}
}
return "$protocol://$name$port" . $uri;
}
Expand Down
2 changes: 2 additions & 0 deletions core/src/plugins/action.share/src/ShareCenter.php
Expand Up @@ -607,6 +607,8 @@ public function switchAction(ServerRequestInterface &$requestInterface, Response
$subAction = "create_minisite";
if(!isSet($httpVars["simple_right_read"]) && !isSet($httpVars["simple_right_download"])){
$httpVars["simple_right_read"] = $httpVars["simple_right_download"] = "true";
}else if(!isSet($httpVars["simple_right_read"]) && isSet($httpVars["simple_right_download"]) && !isSet($httpVars["simple_right_write"])){
$httpVars["minisite_layout"] = "ajxp_unique_dl";
}
$httpVars["create_guest_user"] = "true";
if($httpVars["simple_share_type"] == "private" && !isSet($httpVars["guest_user_pass"])){
Expand Down

0 comments on commit 45c0963

Please sign in to comment.