Skip to content

Commit

Permalink
Merge pull request #154 from nextcloud/backport/151/stable28
Browse files Browse the repository at this point in the history
[stable28] ignore null user on logout
  • Loading branch information
ArtificialOwl authored May 27, 2024
2 parents 944dd82 + b73faf6 commit 64aaac2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2']
server-versions: ['master']
server-versions: ['stable28']

services:
mysql:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-oci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.0']
server-versions: ['master']
server-versions: ['stable28']

services:
oracle:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.0']
server-versions: ['master']
server-versions: ['stable28']

services:
postgres:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
matrix:
php-versions: ['8.0']
server-versions: ['master']
server-versions: ['stable28']

steps:
- name: Set app env
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
matrix:
php-versions: ['8.0']
databases: ['sqlite']
server-versions: ['master']
server-versions: ['stable28']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

Expand Down
6 changes: 4 additions & 2 deletions lib/Listeners/UserLoggedOut.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ public function handle(Event $event): void {
return;
}

$user = $event->getUser();

/** only used in slave mode */
if ($this->globalSiteSelector->getMode() !== GlobalSiteSelector::SLAVE) {
if ($user === null || $this->globalSiteSelector->getMode() !== GlobalSiteSelector::SLAVE) {
return;
}

$this->slave->handleLogoutRequest($event->getUser());
$this->slave->handleLogoutRequest($user);
}
}

0 comments on commit 64aaac2

Please sign in to comment.