summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-12-18 11:46:21 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-12-18 11:46:21 +0100
commite42f262d85ddd891ce823dd5d9b5a4a87c8a7786 (patch)
tree886ea4f3eceae73a52fb582b55185bad3dfa0b07 /lib
parent3d55569a277a68c9dac54b33684c3e22839386d8 (diff)
downloadnextcloud-server-e42f262d85ddd891ce823dd5d9b5a4a87c8a7786.tar.gz
nextcloud-server-e42f262d85ddd891ce823dd5d9b5a4a87c8a7786.zip
properly use OCP\Util instead of OC_Helper
Diffstat (limited to 'lib')
-rw-r--r--lib/private/helper.php16
-rw-r--r--lib/private/util.php8
-rw-r--r--lib/public/util.php5
3 files changed, 8 insertions, 21 deletions
diff --git a/lib/private/helper.php b/lib/private/helper.php
index 92ae25de4cc..efbc6bda1db 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -54,22 +54,6 @@ class OC_Helper {
private static $templateManager;
/**
- * Creates an absolute url
- * @param string $app app
- * @param string $file file
- * @param array $args array with param=>value, will be appended to the returned url
- * The value of $args will be urlencoded
- * @return string the url
- *
- * Returns a absolute url to the given app and file.
- */
- public static function linkToAbsolute($app, $file, $args = array()) {
- return OC::$server->getURLGenerator()->getAbsoluteURL(
- OC::$server->getURLGenerator()->linkTo($app, $file, $args)
- );
- }
-
- /**
* Creates an url for remote use
* @param string $service id
* @return string the url
diff --git a/lib/private/util.php b/lib/private/util.php
index c63befb3f32..2ecacc53bd4 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -974,7 +974,7 @@ class OC_Util {
*/
public static function checkAppEnabled($app) {
if (!OC_App::isEnabled($app)) {
- header('Location: ' . OC_Helper::linkToAbsolute('', 'index.php'));
+ header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php'));
exit();
}
}
@@ -988,7 +988,7 @@ class OC_Util {
public static function checkLoggedIn() {
// Check if we are a user
if (!OC_User::isLoggedIn()) {
- header('Location: ' . OC_Helper::linkToAbsolute('', 'index.php',
+ header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php',
[
'redirect_url' => \OC::$server->getRequest()->getRequestUri()
]
@@ -1006,7 +1006,7 @@ class OC_Util {
public static function checkAdminUser() {
OC_Util::checkLoggedIn();
if (!OC_User::isAdminUser(OC_User::getUser())) {
- header('Location: ' . OC_Helper::linkToAbsolute('', 'index.php'));
+ header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php'));
exit();
}
}
@@ -1046,7 +1046,7 @@ class OC_Util {
}
if (!$isSubAdmin) {
- header('Location: ' . OC_Helper::linkToAbsolute('', 'index.php'));
+ header('Location: ' . \OCP\Util::linkToAbsolute('', 'index.php'));
exit();
}
return true;
diff --git a/lib/public/util.php b/lib/public/util.php
index da4aa6e9deb..6f5016fa4a1 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -269,7 +269,10 @@ class Util {
* @since 4.0.0 - parameter $args was added in 4.5.0
*/
public static function linkToAbsolute( $app, $file, $args = array() ) {
- return(\OC_Helper::linkToAbsolute( $app, $file, $args ));
+ $urlGenerator = \OC::$server->getURLGenerator();
+ return $urlGenerator->getAbsoluteURL(
+ $urlGenerator->linkTo($app, $file, $args)
+ );
}
/**