diff options
Diffstat (limited to 'lib/private/util.php')
-rwxr-xr-x | lib/private/util.php | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index e9e081a48fd..897795f7535 100755 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -815,10 +815,13 @@ class OC_Util { } /** - * Redirect to the user default page - * @return void + * Returns the URL of the default page + * based on the system configuration and + * the apps visible for the current user + * + * @return string URL */ - public static function redirectToDefaultPage() { + public static function getDefaultPageUrl() { $urlGenerator = \OC::$server->getURLGenerator(); if(isset($_REQUEST['redirect_url'])) { $location = urldecode($_REQUEST['redirect_url']); @@ -837,11 +840,20 @@ class OC_Util { break; } } - $location = $urlGenerator->linkTo($appId, 'index.php'); + $location = $urlGenerator->getAbsoluteURL('/index.php/apps/' . $appId . '/'); } } + return $location; + } + + /** + * Redirect to the user default page + * @return void + */ + public static function redirectToDefaultPage() { + $location = self::getDefaultPageUrl(); OC_Log::write('core', 'redirectToDefaultPage: '.$location, OC_Log::DEBUG); - header( 'Location: '.$location ); + header('Location: '.$location); exit(); } |