[Pkg-owncloud-commits] [owncloud] 09/67: generate correct link for shared files and shared directories
David Prévot
taffit at alioth.debian.org
Fri Nov 8 23:10:31 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v4.5.1
in repository owncloud.
commit c1f645cd5f710355d81ff3edb71e0c526ff31ba8
Author: Björn Schießle <schiessle at owncloud.com>
Date: Thu Oct 11 13:45:16 2012 +0200
generate correct link for shared files and shared directories
---
apps/files_sharing/public.php | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 5119086..e9f318e 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();
}
--
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