diff options
author | Björn Schießle <schiessle@owncloud.com> | 2012-10-11 13:45:16 +0200 |
---|---|---|
committer | Björn Schießle <schiessle@owncloud.com> | 2012-10-11 13:45:16 +0200 |
commit | 77d91d5a03819cf1f768ecdfbd2f67090a84790b (patch) | |
tree | f730a1ea9a5223aacb9d6161ba7c4eed63c7c0d1 /apps | |
parent | 4d451f649d4bdcab9fd5aef750f6aa8823e919a0 (diff) | |
download | nextcloud-server-77d91d5a03819cf1f768ecdfbd2f67090a84790b.tar.gz nextcloud-server-77d91d5a03819cf1f768ecdfbd2f67090a84790b.zip |
generate correct link for shared files and shared directories
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_sharing/public.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 5119086ce0d..e9f318efd9d 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -45,6 +45,11 @@ if (isset($_GET['file']) || isset($_GET['dir'])) { } if (isset($linkItem['share_with'])) { // Check password + if (isset($_GET['file'])) {
+ $url = OCP\Util::linkToPublic('files').'&file='.$_GET['file'];
+ } else {
+ $url = OCP\Util::linkToPublic('files').'&dir='.$_GET['dir'];
+ } if (isset($_POST['password'])) { $password = $_POST['password']; $storedHash = $linkItem['share_with']; @@ -52,7 +57,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) { $hasher = new PasswordHash(8, $forcePortable); if (!($hasher->CheckPassword($password.OC_Config::getValue('passwordsalt', ''), $storedHash))) { $tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest'); - $tmpl->assign('URL', OCP\Util::linkToPublic('files').'&file='.$_GET['file']); + $tmpl->assign('URL', $url); $tmpl->assign('error', true); $tmpl->printPage(); exit(); @@ -64,7 +69,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) { } else if (!isset($_SESSION['public_link_authenticated']) || $_SESSION['public_link_authenticated'] !== $linkItem['id']) { // Prompt for password $tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest'); - $tmpl->assign('URL', OCP\Util::linkToPublic('files').'&file='.$_GET['file']); + $tmpl->assign('URL', $url); $tmpl->printPage(); exit(); } |