summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-08-18 15:32:40 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-08-18 15:32:40 +0200
commit2e4cd445564ba4882ab239bbfd82b6aa800436e3 (patch)
tree9f8126ff5dde02c01f27b04ce921db26aad3ba2f /lib/private
parenta04feff9a780d77ca172ba7558a7d0cc4e01dc36 (diff)
downloadnextcloud-server-2e4cd445564ba4882ab239bbfd82b6aa800436e3.tar.gz
nextcloud-server-2e4cd445564ba4882ab239bbfd82b6aa800436e3.zip
Inject \OCP\IURLGenerator to make tests work
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/NavigationManager.php2
-rw-r--r--lib/private/legacy/user.php5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php
index ffeaca2b81e..5e484bea737 100644
--- a/lib/private/NavigationManager.php
+++ b/lib/private/NavigationManager.php
@@ -187,7 +187,7 @@ class NavigationManager implements INavigationManager {
'icon' => $this->urlGenerator->imagePath('settings', 'admin.svg'),
]);
- $logoutUrl = \OC_User::getLogoutUrl();
+ $logoutUrl = \OC_User::getLogoutUrl($this->urlGenerator);
if($logoutUrl !== '') {
// Logout
$this->add([
diff --git a/lib/private/legacy/user.php b/lib/private/legacy/user.php
index 97f302c826e..9e0ca4b9fee 100644
--- a/lib/private/legacy/user.php
+++ b/lib/private/legacy/user.php
@@ -283,15 +283,16 @@ class OC_User {
/**
* Returns the current logout URL valid for the currently logged-in user
*
+ * @param \OCP\IURLGenerator $urlGenerator
* @return string
*/
- public static function getLogoutUrl() {
+ public static function getLogoutUrl(\OCP\IURLGenerator $urlGenerator) {
$backend = self::findFirstActiveUsedBackend();
if ($backend) {
return $backend->getLogoutUrl();
}
- $logoutUrl = \OC::$server->getURLGenerator()->linkToRouteAbsolute(
+ $logoutUrl = $urlGenerator->linkToRouteAbsolute(
'core.login.logout',
[
'requesttoken' => \OCP\Util::callRegister(),