File tree Expand file tree Collapse file tree
apps/dav/lib/Connector/Sabre Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public function __construct(
1919 }
2020
2121 public function initialize (\Sabre \DAV \Server $ server ): void {
22- $ server ->on ('afterMethod :* ' , [$ this , 'afterMethod ' ]);
22+ $ server ->on ('beforeMethod :* ' , [$ this , 'beforeMethod ' ]);
2323 }
2424
2525 /**
@@ -28,7 +28,7 @@ public function initialize(\Sabre\DAV\Server $server): void {
2828 * @param RequestInterface $request request
2929 * @param ResponseInterface $response response
3030 */
31- public function afterMethod (RequestInterface $ request , ResponseInterface $ response ): void {
31+ public function beforeMethod (RequestInterface $ request , ResponseInterface $ response ): void {
3232 if ($ user = $ this ->userSession ->getUser ()) {
3333 $ response ->setHeader ('X-User-Id ' , $ user ->getUID ());
3434 }
Original file line number Diff line number Diff line change @@ -1098,7 +1098,9 @@ public static function handleRequest(): void {
10981098 // Redirect to the default app or login only as an entry point
10991099 if ($ requestPath === '' ) {
11001100 // Someone is logged in
1101- if (Server::get (IUserSession::class)->isLoggedIn ()) {
1101+ $ userSession = Server::get (IUserSession::class);
1102+ if ($ userSession ->isLoggedIn ()) {
1103+ header ('X-User-Id: ' . $ userSession ->getUser ()?->getUID());
11021104 header ('Location: ' . Server::get (IURLGenerator::class)->linkToDefaultPageUrl ());
11031105 } else {
11041106 // Not handled and not logged in
You can’t perform that action at this time.
0 commit comments