summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-04-05 14:51:52 +0200
committerGitHub <noreply@github.com>2018-04-05 14:51:52 +0200
commit6ea444b24387e9b516a44000df0db0f6af786f95 (patch)
tree2acc17d1899f59dcf8467cc27a177a484daaf56c /apps/files
parent1f605cb8410076d9c59aecb3eab6ce74e5ab6e06 (diff)
parent9b05413bcbbaa69ec6587ade1d3566552e0f3eb3 (diff)
downloadnextcloud-server-6ea444b24387e9b516a44000df0db0f6af786f95.tar.gz
nextcloud-server-6ea444b24387e9b516a44000df0db0f6af786f95.zip
Merge pull request #9082 from nextcloud/feature/8795/new_webdav_url_in_web
Show the new dav url in the web UI
Diffstat (limited to 'apps/files')
-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',