Permalink
Browse files

Fix Sharing on Api v1

  • Loading branch information...
1 parent 51dd701 commit 45c0963e68dda7dfb57b8616d8f1f2999320c3da @cdujeu cdujeu committed Sep 15, 2016
@@ -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;
}
@@ -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"])){

0 comments on commit 45c0963

Please sign in to comment.