]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/front/controller/admin/ShaarliAdminController.php
Merge pull request #1547 from ArthurHoaro/fix/daily-visibility
[github/shaarli/Shaarli.git] / application / front / controller / admin / ShaarliAdminController.php
index 3385006c0271446c7d7ab460734cc2361b2941ea..c26c9cbe2e5050f42fa3da07f72e3d59d63939c0 100644 (file)
@@ -4,9 +4,7 @@ declare(strict_types=1);
 
 namespace Shaarli\Front\Controller\Admin;
 
-use Shaarli\Container\ShaarliContainer;
 use Shaarli\Front\Controller\Visitor\ShaarliVisitorController;
-use Shaarli\Front\Exception\UnauthorizedException;
 use Shaarli\Front\Exception\WrongTokenException;
 use Shaarli\Security\SessionManager;
 use Slim\Http\Request;
@@ -22,23 +20,16 @@ use Slim\Http\Request;
  */
 abstract class ShaarliAdminController extends ShaarliVisitorController
 {
-    public function __construct(ShaarliContainer $container)
-    {
-        parent::__construct($container);
-
-        if (true !== $this->container->loginManager->isLoggedIn()) {
-            throw new UnauthorizedException();
-        }
-    }
-
     /**
      * Any persistent action to the config or data store must check the XSRF token validity.
      */
-    protected function checkToken(Request $request): void
+    protected function checkToken(Request $request): bool
     {
         if (!$this->container->sessionManager->checkToken($request->getParam('token'))) {
             throw new WrongTokenException();
         }
+
+        return true;
     }
 
     /**