diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-01-23 00:39:11 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-01-23 00:39:11 +0100 |
commit | f950ce82ae137977eeca5babe69d732ca55cbeaa (patch) | |
tree | 4c1b949c81b45ce081503343780eea91afd6b659 /apps/files_sharing | |
parent | 4ec6debe2b145b0df106c7e5a3f4ed0cf2885957 (diff) | |
parent | 4474421ada2a4b5642f1a081d6491d7858b3b9b0 (diff) | |
download | nextcloud-server-f950ce82ae137977eeca5babe69d732ca55cbeaa.tar.gz nextcloud-server-f950ce82ae137977eeca5babe69d732ca55cbeaa.zip |
Merge branch 'master' into mobile-style
Conflicts:
apps/files/js/files.js
apps/files_sharing/css/public.css
apps/files_sharing/js/public.js
apps/files_sharing/templates/public.php
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/ajax/publicpreview.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/appinfo/update.php | 1 | ||||
-rw-r--r-- | apps/files_sharing/css/public.css | 34 | ||||
-rw-r--r-- | apps/files_sharing/js/public.js | 6 | ||||
-rw-r--r-- | apps/files_sharing/js/share.js | 2 | ||||
-rw-r--r-- | apps/files_sharing/l10n/ru_RU.php | 8 | ||||
-rw-r--r-- | apps/files_sharing/lib/share/file.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/lib/sharedstorage.php | 8 | ||||
-rw-r--r-- | apps/files_sharing/lib/watcher.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/public.php | 12 | ||||
-rw-r--r-- | apps/files_sharing/templates/public.php | 2 |
11 files changed, 38 insertions, 42 deletions
diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php index 54a9806e8bf..a52f522afac 100644 --- a/apps/files_sharing/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -39,6 +39,7 @@ if(!isset($linkedItem['uid_owner']) || !isset($linkedItem['file_source'])) { $rootLinkItem = OCP\Share::resolveReShare($linkedItem); $userId = $rootLinkItem['uid_owner']; +OCP\JSON::checkUserExists($rootLinkItem['uid_owner']); \OC_Util::setupFS($userId); \OC\Files\Filesystem::initMountPoints($userId); $view = new \OC\Files\View('/' . $userId . '/files'); @@ -88,4 +89,4 @@ try{ } catch (\Exception $e) { \OC_Response::setStatus(500); \OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG); -}
\ No newline at end of file +} diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php index 0d827da28ea..4b716e764f4 100644 --- a/apps/files_sharing/appinfo/update.php +++ b/apps/files_sharing/appinfo/update.php @@ -44,6 +44,7 @@ if (version_compare($installedVersion, '0.3', '<')) { $shareType = OCP\Share::SHARE_TYPE_USER; $shareWith = $row['uid_shared_with']; } + OCP\JSON::checkUserExists($row['uid_owner']); OC_User::setUserId($row['uid_owner']); //we need to setup the filesystem for the user, otherwise OC_FileSystem::getRoot will fail and break OC_Util::setupFS($row['uid_owner']); diff --git a/apps/files_sharing/css/public.css b/apps/files_sharing/css/public.css index d593d353dd7..7bcafd542ca 100644 --- a/apps/files_sharing/css/public.css +++ b/apps/files_sharing/css/public.css @@ -92,16 +92,24 @@ thead{ .directLink { margin-bottom: 20px; } - .directDownload .button img { - vertical-align: text-bottom; - } - .directLink label { - font-weight: normal; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; - filter: alpha(opacity=50); - opacity: .5; - } - .directLink input { - margin-left: 5px; - width: 300px; - } +.directDownload .button img { + vertical-align: text-bottom; +} +.directLink label { + font-weight: normal; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; + filter: alpha(opacity=50); + opacity: .5; +} +.directLink input { + margin-left: 5px; + width: 300px; +} + +/*.directLink label {*/ + /*font-weight: normal;*/ +/*}*/ +/*.directLink input {*/ + /*margin-left: 10px;*/ + /*width: 300px;*/ +/*}*/ diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 63e1ccaadfa..31572f5ccf5 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -27,19 +27,19 @@ $(document).ready(function() { } } FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function(filename) { - var tr = $('tr').filterAttr('data-file', filename); + var tr = FileList.findFileEl(filename); if (tr.length > 0) { window.location = $(tr).find('a.name').attr('href'); } }); FileActions.register('file', 'Download', OC.PERMISSION_READ, '', function(filename) { - var tr = $('tr').filterAttr('data-file', filename); + var tr = FileList.findFileEl(filename); if (tr.length > 0) { window.location = $(tr).find('a.name').attr('href'); } }); FileActions.register('dir', 'Download', OC.PERMISSION_READ, '', function(filename) { - var tr = $('tr').filterAttr('data-file', filename); + var tr = FileList.findFileEl(filename); if (tr.length > 0) { window.location = $(tr).find('a.name').attr('href')+'&download'; } diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 340e0939445..36de452a55e 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -22,7 +22,7 @@ $(document).ready(function() { } else { var item = $('#dir').val() + '/' + filename; } - var tr = $('tr').filterAttr('data-file', filename); + var tr = FileList.findFileEl(filename); if ($(tr).data('type') == 'dir') { var itemType = 'folder'; } else { diff --git a/apps/files_sharing/l10n/ru_RU.php b/apps/files_sharing/l10n/ru_RU.php deleted file mode 100644 index 2686b1e852d..00000000000 --- a/apps/files_sharing/l10n/ru_RU.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -$TRANSLATIONS = array( -"Password" => "Пароль", -"Download" => "Загрузка", -"Upload" => "Загрузка", -"Cancel upload" => "Отмена загрузки" -); -$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php index 07e7a4ca0c5..c956c55a1df 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -172,7 +172,7 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { $source['fileOwner'] = $fileOwner; return $source; } - \OCP\Util::writeLog('files_sharing', 'File source not found for: '.$target, \OCP\Util::ERROR); + \OCP\Util::writeLog('files_sharing', 'File source not found for: '.$target, \OCP\Util::DEBUG); return false; } diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 6b4db9763f5..afe5dffdebd 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -279,14 +279,6 @@ class Shared extends \OC\Files\Storage\Common { if ($this->isDeletable($path)) { list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($source); return $storage->unlink($internalPath); - } else if (dirname($path) == '/' || dirname($path) == '.') { - // Unshare the file from the user if in the root of the Shared folder - if ($this->is_dir($path)) { - $itemType = 'folder'; - } else { - $itemType = 'file'; - } - return \OCP\Share::unshareFromSelf($itemType, $path); } } return false; diff --git a/apps/files_sharing/lib/watcher.php b/apps/files_sharing/lib/watcher.php index c40cf6911b8..285b1a58c6e 100644 --- a/apps/files_sharing/lib/watcher.php +++ b/apps/files_sharing/lib/watcher.php @@ -32,7 +32,7 @@ class Shared_Watcher extends Watcher { * @param string $path */ public function checkUpdate($path) { - if ($path != '' && parent::checkUpdate($path)) { + if ($path != '' && parent::checkUpdate($path) === true) { // since checkUpdate() has already updated the size of the subdirs, // only apply the update to the owner's parent dirs diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 490cea570bc..0ca923fff08 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -35,7 +35,7 @@ function determineIcon($file, $sharingRoot, $sharingToken) { if (isset($_GET['t'])) { $token = $_GET['t']; - $linkItem = OCP\Share::getShareByToken($token); + $linkItem = OCP\Share::getShareByToken($token, false); if (is_array($linkItem) && isset($linkItem['uid_owner'])) { // seems to be a valid share $type = $linkItem['item_type']; @@ -43,10 +43,10 @@ if (isset($_GET['t'])) { $shareOwner = $linkItem['uid_owner']; $path = null; $rootLinkItem = OCP\Share::resolveReShare($linkItem); - $fileOwner = $rootLinkItem['uid_owner']; - if (isset($fileOwner)) { + if (isset($rootLinkItem['uid_owner'])) { + OCP\JSON::checkUserExists($rootLinkItem['uid_owner']); OC_Util::tearDownFS(); - OC_Util::setupFS($fileOwner); + OC_Util::setupFS($rootLinkItem['uid_owner']); $path = \OC\Files\Filesystem::getPath($linkItem['file_source']); } } @@ -111,6 +111,7 @@ if (isset($path)) { } } $basePath = $path; + $rootName = basename($path); if (isset($_GET['path']) && \OC\Files\Filesystem::isReadable($basePath . $_GET['path'])) { $getPath = \OC\Files\Filesystem::normalizePath($_GET['path']); $path .= $getPath; @@ -188,8 +189,8 @@ if (isset($path)) { } else { $i['extension'] = ''; } - $i['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($i['mimetype']); } + $i['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($i['mimetype']); $i['directory'] = $getPath; $i['permissions'] = OCP\PERMISSION_READ; $i['icon'] = determineIcon($i, $basePath, $token); @@ -216,6 +217,7 @@ if (isset($path)) { $list->assign('sharingroot', $basePath); $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); $breadcrumbNav->assign('breadcrumb', $breadcrumb); + $breadcrumbNav->assign('rootBreadCrumb', $rootName); $breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path='); $maxUploadFilesize=OCP\Util::maxUploadFilesize($path); $fileHeader = (!isset($files) or count($files) > 0); diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index fb45401458f..fd0e0ad6412 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -16,7 +16,7 @@ <div class="header-right"> <span id="details"><?php p($l->t('shared by %s', array($_['displayName']))) ?></span> </div> - </div></header> +</header> <div id="content"> <div id="preview"> <?php if (isset($_['folder'])): ?> |