Olivier Massot 4 lat temu
rodzic
commit
f916967b56

+ 5 - 8
ot_core/Classes/Page/OtPageRepository.php

@@ -117,16 +117,13 @@ class OtPageRepository
     /**
      * Returns all the pages of the given page's website, starting from the root page
      *
-     * @param int $pageUid The uid of the page
+     * @param int $rootUid
      * @param bool $withRestrictions Set to true to add the standard restrictions (deleted, forbidden...etc.)
      * @return array
      */
-    public function getAllSitePages(int $pageUid, bool $withRestrictions=false) {
-        $rootPage = $this->getRootPageFor($pageUid);
-        if (!$rootPage) {
-            return [];
-        }
-        return array_merge([$rootPage], $this->getAllSubpagesForPage($rootPage['uid']));
+    public function getAllSitePages(int $rootUid, bool $withRestrictions=false): array
+    {
+        return array_merge([$this->getPage($rootUid)], $this->getAllSubpagesForPage($rootUid));
     }
 
     /**
@@ -234,6 +231,6 @@ class OtPageRepository
     }
 
     public function getPage(int $uid) {
-        return $this->pageRepository->getPage($uid);
+        return $this->pageRepository->getPage($uid, true);
     }
 }

+ 1 - 10
ot_router/Classes/Middleware/Router.php

@@ -23,17 +23,8 @@ class Router implements MiddlewareInterface
     public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
     {
         $uri = $request->getUri();
-        if (preg_match("/^(.*&)*logintype=logout(&.*)*$/", $uri->getQuery())) {
-            // this is a logout request, and it has already been handled by the
-            // auth service.
-            $newQuery = preg_replace("/logintype=logout&?/", '', $uri->getQuery());
 
-            return new RedirectResponse(
-                $uri->withQuery($newQuery),
-                303,
-                ['X-Redirect-By' => 'OtConnect logout redirection']
-            );
-        }
+        
 
         // just pass the plate to the next middleware...
         return $handler->handle($request);