X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Ffront%2FShaarliMiddleware.php;h=164217f4f27b83b45754cfcec8d33871a553a26b;hb=b01b3b83a71044db833b21203dc510f9c45ad6fc;hp=c015c0c6f0284fcfb9802a9938494c60763f721e;hpb=af41d5ab5d2bd3ba64d052c997bc6afa6966a63c;p=github%2Fshaarli%2FShaarli.git diff --git a/application/front/ShaarliMiddleware.php b/application/front/ShaarliMiddleware.php index c015c0c6..164217f4 100644 --- a/application/front/ShaarliMiddleware.php +++ b/application/front/ShaarliMiddleware.php @@ -42,7 +42,8 @@ class ShaarliMiddleware $this->initBasePath($request); try { - if (!is_file($this->container->conf->getConfigFileExt()) + if ( + !is_file($this->container->conf->getConfigFileExt()) && !in_array($next->getName(), ['displayInstall', 'saveInstall'], true) ) { return $response->withRedirect($this->container->basePath . '/install'); @@ -86,7 +87,8 @@ class ShaarliMiddleware */ protected function checkOpenShaarli(Request $request, Response $response, callable $next): bool { - if (// if the user isn't logged in + if ( +// if the user isn't logged in !$this->container->loginManager->isLoggedIn() // and Shaarli doesn't have public content... && $this->container->conf->get('privacy.hide_public_links') @@ -94,7 +96,7 @@ class ShaarliMiddleware && $this->container->conf->get('privacy.force_login') // and the current page isn't already the login page // and the user is not requesting a feed (which would lead to a different content-type as expected) - && !in_array($next->getName(), ['login', 'atom', 'rss'], true) + && !in_array($next->getName(), ['login', 'processLogin', 'atom', 'rss'], true) ) { throw new UnauthorizedException(); }