use app href for redirection (fix #244)
This commit is contained in:
parent
2ff4fee927
commit
dca727c120
|
@ -78,29 +78,33 @@ class AppController extends Controller
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToApp($app['id']);
|
return $this->redirectToApp($app, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirectToApp('files');
|
return $this->redirectToApp('files');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function redirectToApp($appId): RedirectResponse
|
protected function redirectToApp($app, bool $isHref = false): RedirectResponse
|
||||||
{
|
{
|
||||||
$isIgnoreFrontController = true === OC::$server->getConfig()->getSystemValue(
|
if (!$isHref) {
|
||||||
'htaccess.IgnoreFrontController',
|
$isIgnoreFrontController = true === OC::$server->getConfig()->getSystemValue(
|
||||||
false
|
'htaccess.IgnoreFrontController',
|
||||||
);
|
false
|
||||||
|
);
|
||||||
|
|
||||||
$isFrontControllerActive = 'true' === getenv('front_controller_active');
|
$isFrontControllerActive = 'true' === getenv('front_controller_active');
|
||||||
|
|
||||||
if ($isIgnoreFrontController || $isFrontControllerActive) {
|
if ($isIgnoreFrontController || $isFrontControllerActive) {
|
||||||
$path = '/apps/%s/';
|
$path = '/apps/%s/';
|
||||||
|
} else {
|
||||||
|
$path = '/index.php/apps/%s/';
|
||||||
|
}
|
||||||
|
|
||||||
|
$url = $this->urlGenerator->getAbsoluteURL(sprintf($path, $app));
|
||||||
} else {
|
} else {
|
||||||
$path = '/index.php/apps/%s/';
|
$url = $app['href'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = $this->urlGenerator->getAbsoluteURL(sprintf($path, $appId));
|
|
||||||
|
|
||||||
return new RedirectResponse($url);
|
return new RedirectResponse($url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue