diff --git a/core/Controller/TwoFactorChallengeController.php b/core/Controller/TwoFactorChallengeController.php index 9f379ad30d..af69b55173 100644 --- a/core/Controller/TwoFactorChallengeController.php +++ b/core/Controller/TwoFactorChallengeController.php @@ -69,8 +69,8 @@ class TwoFactorChallengeController extends Controller { /** * @return string */ - protected function getLogoutAttribute() { - return OC_User::getLogoutAttribute(); + protected function getLogoutUrl() { + return OC_User::getLogoutUrl(); } /** @@ -89,7 +89,7 @@ class TwoFactorChallengeController extends Controller { 'providers' => $providers, 'backupProvider' => $backupProvider, 'redirect_url' => $redirect_url, - 'logout_attribute' => $this->getLogoutAttribute(), + 'logout_url' => $this->getLogoutUrl(), ]; return new TemplateResponse($this->appName, 'twofactorselectchallenge', $data, 'guest'); } @@ -131,7 +131,7 @@ class TwoFactorChallengeController extends Controller { 'error_message' => $errorMessage, 'provider' => $provider, 'backupProvider' => $backupProvider, - 'logout_attribute' => $this->getLogoutAttribute(), + 'logout_url' => $this->getLogoutUrl(), 'redirect_url' => $redirect_url, 'template' => $tmpl->fetchPage(), ]; diff --git a/core/templates/twofactorselectchallenge.php b/core/templates/twofactorselectchallenge.php index 431f4c78c2..a1e626567e 100644 --- a/core/templates/twofactorselectchallenge.php +++ b/core/templates/twofactorselectchallenge.php @@ -19,7 +19,7 @@
- >t('Cancel log in')) ?> + t('Cancel log in')) ?> - >t('Cancel log in')) ?> + t('Cancel log in')) ?> . + * Gets the current logout URL * - * @return string with one or more HTML attributes. - * @since 6.0.0 + * @return string + * @since 12.0.3 */ - public function getLogoutAttribute(); + public function getLogoutUrl(); /** * Return the id of the current user diff --git a/tests/Core/Controller/TwoFactorChallengeControllerTest.php b/tests/Core/Controller/TwoFactorChallengeControllerTest.php index bef343f904..ed6452316f 100644 --- a/tests/Core/Controller/TwoFactorChallengeControllerTest.php +++ b/tests/Core/Controller/TwoFactorChallengeControllerTest.php @@ -76,10 +76,10 @@ class TwoFactorChallengeControllerTest extends TestCase { $this->session, $this->urlGenerator, ]) - ->setMethods(['getLogoutAttribute']) + ->setMethods(['getLogoutUrl']) ->getMock(); $this->controller->expects($this->any()) - ->method('getLogoutAttribute') + ->method('getLogoutUrl') ->willReturn('logoutAttribute'); } @@ -106,7 +106,7 @@ class TwoFactorChallengeControllerTest extends TestCase { 'providers' => $providers, 'backupProvider' => 'backup', 'redirect_url' => '/some/url', - 'logout_attribute' => 'logoutAttribute', + 'logout_url' => 'logoutAttribute', ], 'guest'); $this->assertEquals($expected, $this->controller->selectChallenge('/some/url')); @@ -155,7 +155,7 @@ class TwoFactorChallengeControllerTest extends TestCase { 'error' => true, 'provider' => $provider, 'backupProvider' => $backupProvider, - 'logout_attribute' => 'logoutAttribute', + 'logout_url' => 'logoutAttribute', 'template' => '', 'redirect_url' => '/re/dir/ect/url', 'error_message' => null, diff --git a/tests/lib/NavigationManagerTest.php b/tests/lib/NavigationManagerTest.php index ab396a88c7..26dd452e66 100644 --- a/tests/lib/NavigationManagerTest.php +++ b/tests/lib/NavigationManagerTest.php @@ -271,7 +271,7 @@ class NavigationManagerTest extends TestCase { [ 'id' => 'logout', 'order' => 99999, - 'href' => null, + 'href' => \OC_User::getLogoutUrl(), 'icon' => '/apps/core/img/actions/logout.svg', 'name' => 'Log out', 'active' => false,