summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-04-05 10:34:24 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-04-05 13:59:45 +0200
commit9b05413bcbbaa69ec6587ade1d3566552e0f3eb3 (patch)
tree966710d87a7692cd0a4d63418c150657d61e180a
parentfeef3cbba03c4517b25a60820e8c4534b0a02b67 (diff)
downloadnextcloud-server-9b05413bcbbaa69ec6587ade1d3566552e0f3eb3.tar.gz
nextcloud-server-9b05413bcbbaa69ec6587ade1d3566552e0f3eb3.zip
Show the new dav url in the web UI
Fixes #8795 Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r--apps/files/lib/Controller/ViewController.php6
-rw-r--r--apps/files/templates/appnavigation.php2
-rw-r--r--apps/files/tests/Controller/ViewControllerTest.php1
3 files changed, 8 insertions, 1 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index fa8243822a8..7cb0f112f72 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -175,6 +175,12 @@ class ViewController extends Controller {
});
$nav->assign('navigationItems', $navItems);
+ $webdavurl = $this->urlGenerator->linkTo('', 'remote.php') .
+ '/dav/files/' .
+ $this->userSession->getUser()->getUID() .
+ '/';
+ $webdavurl = $this->urlGenerator->getAbsoluteURL($webdavurl);
+ $nav->assign('webdavurl', $webdavurl);
$nav->assign('usage', \OC_Helper::humanFileSize($storageInfo['used']));
if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php
index 5d270914ff1..a85e2515a92 100644
--- a/apps/files/templates/appnavigation.php
+++ b/apps/files/templates/appnavigation.php
@@ -41,7 +41,7 @@
<label for="showhiddenfilesToggle"><?php p($l->t('Show hidden files')); ?></label>
</div>
<label for="webdavurl"><?php p($l->t('WebDAV'));?></label>
- <input id="webdavurl" type="text" readonly="readonly" value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>" />
+ <input id="webdavurl" type="text" readonly="readonly" value="<?php p($_['webdavurl']); ?>" />
<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer noopener">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
</div>
</div>
diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php
index b4f07b65e76..a739e26bd90 100644
--- a/apps/files/tests/Controller/ViewControllerTest.php
+++ b/apps/files/tests/Controller/ViewControllerTest.php
@@ -138,6 +138,7 @@ class ViewControllerTest extends TestCase {
$nav->assign('usage', '123 B');
$nav->assign('quota', 100);
$nav->assign('total_space', '100 B');
+ $nav->assign('webdavurl', '');
$nav->assign('navigationItems', [
[
'id' => 'files',