summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2013-02-28 10:39:23 -0500
committerMichael Gapczynski <mtgap@owncloud.com>2013-02-28 10:39:23 -0500
commitb5989c933f3c51887724d89e989a3e2af4207d6e (patch)
tree40677bfa8daa1357b1ca3a561b551a142cbe6c82 /apps/files_sharing
parentea83acedebbcf70b19643efe82b72fb139cf8ad2 (diff)
parent93e713d3781c5d5fc6d0dbb6c6a0a8f9c2e15b97 (diff)
downloadnextcloud-server-b5989c933f3c51887724d89e989a3e2af4207d6e.tar.gz
nextcloud-server-b5989c933f3c51887724d89e989a3e2af4207d6e.zip
Merge branch 'master' into shared-folder-etags
Conflicts: apps/files_sharing/lib/sharedstorage.php
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/appinfo/info.xml2
-rw-r--r--apps/files_sharing/appinfo/update.php5
-rw-r--r--apps/files_sharing/l10n/ka.php4
-rw-r--r--apps/files_sharing/l10n/my_MM.php6
-rw-r--r--apps/files_sharing/l10n/ur_PK.php4
-rw-r--r--apps/files_sharing/lib/cache.php5
-rw-r--r--apps/files_sharing/lib/permissions.php3
-rw-r--r--apps/files_sharing/lib/share/file.php14
-rw-r--r--apps/files_sharing/lib/share/folder.php5
-rw-r--r--apps/files_sharing/lib/sharedstorage.php13
-rw-r--r--apps/files_sharing/public.php10
-rw-r--r--apps/files_sharing/templates/public.php20
12 files changed, 68 insertions, 23 deletions
diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml
index 1f24a4dde83..9a199281a76 100644
--- a/apps/files_sharing/appinfo/info.xml
+++ b/apps/files_sharing/appinfo/info.xml
@@ -5,7 +5,7 @@
<description>File sharing between users</description>
<licence>AGPL</licence>
<author>Michael Gapczynski</author>
- <require>4.91</require>
+ <require>4.93</require>
<shipped>true</shipped>
<default_enable/>
<types>
diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php
index 1d22b32b503..48e41e93048 100644
--- a/apps/files_sharing/appinfo/update.php
+++ b/apps/files_sharing/appinfo/update.php
@@ -52,7 +52,10 @@ if (version_compare($installedVersion, '0.3', '<')) {
}
catch (Exception $e) {
$update_error = true;
- OCP\Util::writeLog('files_sharing', 'Upgrade Routine: Skipping sharing "'.$row['source'].'" to "'.$shareWith.'" (error is "'.$e->getMessage().'")', OCP\Util::WARN);
+ OCP\Util::writeLog('files_sharing',
+ 'Upgrade Routine: Skipping sharing "'.$row['source'].'" to "'.$shareWith
+ .'" (error is "'.$e->getMessage().'")',
+ OCP\Util::WARN);
}
OC_Util::tearDownFS();
}
diff --git a/apps/files_sharing/l10n/ka.php b/apps/files_sharing/l10n/ka.php
new file mode 100644
index 00000000000..0270d5d6f8c
--- /dev/null
+++ b/apps/files_sharing/l10n/ka.php
@@ -0,0 +1,4 @@
+<?php $TRANSLATIONS = array(
+"Password" => "პაროლი",
+"Download" => "გადმოწერა"
+);
diff --git a/apps/files_sharing/l10n/my_MM.php b/apps/files_sharing/l10n/my_MM.php
new file mode 100644
index 00000000000..dc7ec17e9c5
--- /dev/null
+++ b/apps/files_sharing/l10n/my_MM.php
@@ -0,0 +1,6 @@
+<?php $TRANSLATIONS = array(
+"Password" => "စကားဝှက်",
+"Submit" => "ထည့်သွင်းမည်",
+"Download" => "ဒေါင်းလုတ်",
+"web services under your control" => "သင်၏ထိန်းချုပ်မှု့အောက်တွင်ရှိသော Web services"
+);
diff --git a/apps/files_sharing/l10n/ur_PK.php b/apps/files_sharing/l10n/ur_PK.php
new file mode 100644
index 00000000000..f68b714350f
--- /dev/null
+++ b/apps/files_sharing/l10n/ur_PK.php
@@ -0,0 +1,4 @@
+<?php $TRANSLATIONS = array(
+"Password" => "پاسورڈ",
+"web services under your control" => "آپ کے اختیار میں ویب سروسیز"
+);
diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 851e958f686..6f834e08999 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -79,8 +79,9 @@ class Shared_Cache extends Cache {
}
} else {
$query = \OC_DB::prepare(
- 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted`
- FROM `*PREFIX*filecache` WHERE `fileid` = ?');
+ 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`,'
+ .' `size`, `mtime`, `encrypted`'
+ .' FROM `*PREFIX*filecache` WHERE `fileid` = ?');
$result = $query->execute(array($file));
$data = $result->fetchRow();
$data['fileid'] = (int)$data['fileid'];
diff --git a/apps/files_sharing/lib/permissions.php b/apps/files_sharing/lib/permissions.php
index 2b068ff9350..72c1ec96c46 100644
--- a/apps/files_sharing/lib/permissions.php
+++ b/apps/files_sharing/lib/permissions.php
@@ -33,7 +33,8 @@ class Shared_Permissions extends Permissions {
if ($fileId == -1) {
return \OCP\PERMISSION_READ;
}
- $source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE, null, true);
+ $source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE,
+ null, true);
if ($source) {
return $source['permissions'];
} else {
diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php
index ceabc7d548b..b5d506b173b 100644
--- a/apps/files_sharing/lib/share/file.php
+++ b/apps/files_sharing/lib/share/file.php
@@ -72,7 +72,11 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
public function formatItems($items, $format, $parameters = null) {
if ($format == self::FORMAT_SHARED_STORAGE) {
// Only 1 item should come through for this format call
- return array('path' => $items[key($items)]['path'], 'permissions' => $items[key($items)]['permissions'], 'uid_owner' => $items[key($items)]['uid_owner']);
+ return array(
+ 'path' => $items[key($items)]['path'],
+ 'permissions' => $items[key($items)]['permissions'],
+ 'uid_owner' => $items[key($items)]['uid_owner']
+ );
} else if ($format == self::FORMAT_GET_FOLDER_CONTENTS) {
$files = array();
foreach ($items as $item) {
@@ -100,7 +104,13 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent {
}
$size += (int)$item['size'];
}
- return array('fileid' => -1, 'name' => 'Shared', 'mtime' => $mtime, 'mimetype' => 'httpd/unix-directory', 'size' => $size);
+ return array(
+ 'fileid' => -1,
+ 'name' => 'Shared',
+ 'mtime' => $mtime,
+ 'mimetype' => 'httpd/unix-directory',
+ 'size' => $size
+ );
} else if ($format == self::FORMAT_OPENDIR) {
$files = array();
foreach ($items as $item) {
diff --git a/apps/files_sharing/lib/share/folder.php b/apps/files_sharing/lib/share/folder.php
index 11c8c6b1e80..4426beec636 100644
--- a/apps/files_sharing/lib/share/folder.php
+++ b/apps/files_sharing/lib/share/folder.php
@@ -33,7 +33,8 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share
}
while (!empty($parents)) {
$parents = "'".implode("','", $parents)."'";
- $query = OC_DB::prepare('SELECT `fileid`, `name`, `mimetype` FROM `*PREFIX*filecache` WHERE `parent` IN ('.$parents.')');
+ $query = OC_DB::prepare('SELECT `fileid`, `name`, `mimetype` FROM `*PREFIX*filecache`'
+ .' WHERE `parent` IN ('.$parents.')');
$result = $query->execute();
$parents = array();
while ($file = $result->fetchRow()) {
@@ -47,4 +48,4 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share
return $children;
}
-} \ No newline at end of file
+}
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 0163f2e00b4..19abc838258 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -250,7 +250,8 @@ class Shared extends \OC\Files\Storage\Common {
public function file_put_contents($path, $data) {
if ($source = $this->getSourcePath($path)) {
// Check if permission is granted
- if (($this->file_exists($path) && !$this->isUpdatable($path)) || ($this->is_dir($path) && !$this->isCreatable($path))) {
+ if (($this->file_exists($path) && !$this->isUpdatable($path))
+ || ($this->is_dir($path) && !$this->isCreatable($path))) {
return false;
}
$info = array(
@@ -333,7 +334,8 @@ class Shared extends \OC\Files\Storage\Common {
if ($this->isCreatable(dirname($path2))) {
$source = $this->fopen($path1, 'r');
$target = $this->fopen($path2, 'w');
- return \OC_Helper::streamCopy($source, $target);
+ list ($count, $result) = \OC_Helper::streamCopy($source, $target);
+ return $result;
}
return false;
}
@@ -409,9 +411,12 @@ class Shared extends \OC\Files\Storage\Common {
}
public static function setup($options) {
- if (!\OCP\User::isLoggedIn() || \OCP\User::getUser() != $options['user'] || \OCP\Share::getItemsSharedWith('file')) {
+ if (!\OCP\User::isLoggedIn() || \OCP\User::getUser() != $options['user']
+ || \OCP\Share::getItemsSharedWith('file')) {
$user_dir = $options['user_dir'];
- \OC\Files\Filesystem::mount('\OC\Files\Storage\Shared', array('sharedFolder' => '/Shared'), $user_dir.'/Shared/');
+ \OC\Files\Filesystem::mount('\OC\Files\Storage\Shared',
+ array('sharedFolder' => '/Shared'),
+ $user_dir.'/Shared/');
\OC_Hook::connect('OC_Filesystem', 'post_write', '\OC\Files\Cache\Shared_Updater', 'writeHook');
\OC_Hook::connect('OC_Filesystem', 'post_delete', '\OC\Files\Cache\Shared_Updater', 'deleteHook');
\OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Shared_Updater', 'renameHook');
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 38d598f7780..243ee668f1f 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -43,7 +43,7 @@ if (isset($_GET['t'])) {
$path = \OC\Files\Filesystem::getPath($linkItem['file_source']);
}
}
-}
+}
if (isset($path)) {
if (!isset($linkItem['item_type'])) {
OCP\Util::writeLog('share', 'No item type set for share id: ' . $linkItem['id'], \OCP\Util::ERROR);
@@ -171,7 +171,9 @@ if (isset($path)) {
$list->assign('files', $files, false);
$list->assign('disableSharing', true);
$list->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false);
- $list->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=', false);
+ $list->assign('downloadURL',
+ OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=',
+ false);
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
$breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false);
@@ -188,7 +190,8 @@ if (isset($path)) {
$folder->assign('usedSpacePercent', 0);
$tmpl->assign('folder', $folder->fetchPage(), false);
$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
- $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath));
+ $tmpl->assign('downloadURL',
+ OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath));
} else {
$tmpl->assign('dir', $dir);
@@ -209,4 +212,3 @@ if (isset($path)) {
header('HTTP/1.0 404 Not Found');
$tmpl = new OCP\Template('', '404', 'guest');
$tmpl->printPage();
-
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 7776fd63b3c..f9ff12679bc 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -3,15 +3,20 @@
<input type="hidden" name="filename" value="<?php echo $_['filename'] ?>" id="filename">
<input type="hidden" name="mimetype" value="<?php echo $_['mimetype'] ?>" id="mimetype">
<header><div id="header">
- <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a>
+ <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg"
+ src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a>
<div class="header-right">
<?php if (isset($_['folder'])): ?>
- <span id="details"><?php echo $l->t('%s shared the folder %s with you', array($_['displayName'], $_['fileTarget'])) ?></span>
+ <span id="details"><?php echo $l->t('%s shared the folder %s with you',
+ array($_['displayName'], $_['fileTarget'])) ?></span>
<?php else: ?>
- <span id="details"><?php echo $l->t('%s shared the file %s with you', array($_['displayName'], $_['fileTarget'])) ?></span>
+ <span id="details"><?php echo $l->t('%s shared the file %s with you',
+ array($_['displayName'], $_['fileTarget'])) ?></span>
<?php endif; ?>
<?php if (!isset($_['folder']) || $_['allowZipDownload']): ?>
- <a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a>
+ <a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img
+ class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>"
+ /><?php echo $l->t('Download')?></a>
<?php endif; ?>
</div>
</div></header>
@@ -27,9 +32,12 @@
<ul id="noPreview">
<li class="error">
<?php echo $l->t('No preview available for').' '.$_['fileTarget']; ?><br />
- <a href="<?php echo $_['downloadURL']; ?>" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a>
+ <a href="<?php echo $_['downloadURL']; ?>" id="download"><img class="svg" alt="Download"
+ src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>"
+ /><?php echo $l->t('Download')?></a>
</li>
</ul>
<?php endif; ?>
</div>
-<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> &ndash; <?php echo $l->t('web services under your control'); ?></p></footer>
+<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> &ndash;
+<?php echo $l->t('web services under your control'); ?></p></footer>