[Pkg-owncloud-commits] [owncloud] 175/273: Use getAbsoluteUrl for redirection URL

David Prévot taffit at moszumanska.debian.org
Fri Jul 4 03:13:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 3e78f41d00a6b6d2f2dbc90beb9fb0a3e85f6cf4
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Tue Jul 1 16:02:38 2014 +0200

    Use getAbsoluteUrl for redirection URL
    
    Also separate the function into getDefaultPageUrl() and
    redirectToDefaultPage() to make it testable.
---
 lib/private/util.php | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/lib/private/util.php b/lib/private/util.php
index e9e081a..897795f 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();
 	}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list