File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
apps/dav/lib/Connector/Sabre Expand file tree Collapse file tree 2 files changed +5
-3
lines changed 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 @@ -1190,7 +1190,9 @@ public static function handleRequest(): void {
11901190 // Redirect to the default app or login only as an entry point
11911191 if ($ requestPath === '' ) {
11921192 // Someone is logged in
1193- if (Server::get (IUserSession::class)->isLoggedIn ()) {
1193+ $ userSession = Server::get (IUserSession::class);
1194+ if ($ userSession ->isLoggedIn ()) {
1195+ header ('X-User-Id: ' . $ userSession ->getUser ()?->getUID());
11941196 header ('Location: ' . Server::get (IURLGenerator::class)->linkToDefaultPageUrl ());
11951197 } else {
11961198 // Not handled and not logged in
You can’t perform that action at this time.
0 commit comments