summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-01-17 14:47:29 +0100
committerRobin Appelman <icewind@owncloud.com>2014-01-17 14:47:29 +0100
commit5cb08bb9cb6cf603d47a124ffa0ea60881f7de51 (patch)
tree89ac0ff4115dc175cb79b35b4df837dab3f7df45 /apps
parent299bb4d99db935bb529a30fe6ae0c9bc72344d69 (diff)
parentdb353e14cce316b271d3bfcfdbc6989e146d4517 (diff)
downloadnextcloud-server-5cb08bb9cb6cf603d47a124ffa0ea60881f7de51.tar.gz
nextcloud-server-5cb08bb9cb6cf603d47a124ffa0ea60881f7de51.zip
Merge branch 'master' into fileinfo
Conflicts: tests/lib/files/cache/cache.php
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js5
-rw-r--r--apps/files/templates/part.breadcrumb.php6
-rw-r--r--apps/files_encryption/appinfo/info.xml2
-rw-r--r--apps/files_encryption/lib/proxy.php4
-rw-r--r--apps/files_external/js/dropbox.js17
-rw-r--r--apps/files_external/js/google.js21
-rw-r--r--apps/files_external/js/settings.js14
-rw-r--r--apps/files_external/lib/webdav.php2
-rw-r--r--apps/files_sharing/public.php2
-rw-r--r--apps/files_trashbin/lib/trashbin.php6
-rw-r--r--apps/files_versions/lib/versions.php6
-rw-r--r--apps/user_ldap/lib/connection.php3
-rw-r--r--apps/user_ldap/lib/wizard.php11
13 files changed, 64 insertions, 35 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index c02ab70ce8d..30aea9c8c8d 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -300,7 +300,10 @@ var FileList={
},
remove:function(name){
var fileEl = FileList.findFileEl(name);
- fileEl.find('td.filename').draggable('destroy');
+ if (fileEl.data('permissions') & OC.PERMISSION_DELETE) {
+ // file is only draggable when delete permissions are set
+ fileEl.find('td.filename').draggable('destroy');
+ }
fileEl.remove();
FileList.updateFileSummary();
if ( ! $('tr[data-file]').exists() ) {
diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php
index 90d07d4336c..2a0df622767 100644
--- a/apps/files/templates/part.breadcrumb.php
+++ b/apps/files/templates/part.breadcrumb.php
@@ -1,6 +1,10 @@
<div class="crumb <?php if(!count($_["breadcrumb"])) p('last');?>" data-dir=''>
<a href="<?php print_unescaped($_['baseURL']); ?>">
- <img src="<?php print_unescaped(OCP\image_path('core', 'places/home.svg'));?>" class="svg" />
+ <?php if(isset($_['rootBreadCrumb'])):
+ echo $_['rootBreadCrumb'];
+ else:?>
+ <img src="<?php print_unescaped(OCP\image_path('core', 'places/home.svg'));?>" class="svg" />
+ <?php endif;?>
</a>
</div>
<?php for($i=0; $i<count($_["breadcrumb"]); $i++):
diff --git a/apps/files_encryption/appinfo/info.xml b/apps/files_encryption/appinfo/info.xml
index 9d495916d26..ee05b651361 100644
--- a/apps/files_encryption/appinfo/info.xml
+++ b/apps/files_encryption/appinfo/info.xml
@@ -2,7 +2,7 @@
<info>
<id>files_encryption</id>
<name>Encryption</name>
- <description>The new ownCloud 5 files encryption system. After the app was enabled you need to re-login to initialize your encryption keys.</description>
+ <description>The ownCloud files encryption system provides server side-encryption. After the app was enabled you need to re-login to initialize your encryption keys.</description>
<licence>AGPL</licence>
<author>Sam Tuke, Bjoern Schiessle, Florin Peter</author>
<require>4</require>
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index c1b60799e64..0b7e066f2e2 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -255,8 +255,8 @@ class Proxy extends \OC_FileProxy {
// split the path parts
$pathParts = explode('/', $path);
- // FIXME: handling for /userId/cache used by webdav for chunking. The cache chunks are NOT encrypted
- if (isset($pathParts[2]) && $pathParts[2] === 'cache') {
+ // don't try to encrypt/decrypt cache chunks or files in the trash bin
+ if (isset($pathParts[2]) && ($pathParts[2] === 'cache' || $pathParts[2] === 'files_trashbin')) {
return $result;
}
diff --git a/apps/files_external/js/dropbox.js b/apps/files_external/js/dropbox.js
index 957daeb4d1f..6baaabe11b6 100644
--- a/apps/files_external/js/dropbox.js
+++ b/apps/files_external/js/dropbox.js
@@ -23,9 +23,12 @@ $(document).ready(function() {
$(token).val(result.access_token);
$(token_secret).val(result.access_token_secret);
$(configured).val('true');
- OC.MountConfig.saveStorage(tr);
- $(tr).find('.configuration input').attr('disabled', 'disabled');
- $(tr).find('.configuration').append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>');
+ OC.MountConfig.saveStorage(tr, function(status) {
+ if (status) {
+ $(tr).find('.configuration input').attr('disabled', 'disabled');
+ $(tr).find('.configuration').append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>');
+ }
+ });
} else {
OC.dialogs.alert(result.data.message, t('files_external', 'Error configuring Dropbox storage'));
}
@@ -77,7 +80,6 @@ $(document).ready(function() {
var tr = $(this).parent().parent();
var app_key = $(this).parent().find('[data-parameter="app_key"]').val();
var app_secret = $(this).parent().find('[data-parameter="app_secret"]').val();
- var statusSpan = $(tr).find('.status span');
if (app_key != '' && app_secret != '') {
var tr = $(this).parent().parent();
var configured = $(this).parent().find('[data-parameter="configured"]');
@@ -88,10 +90,9 @@ $(document).ready(function() {
$(configured).val('false');
$(token).val(result.data.request_token);
$(token_secret).val(result.data.request_token_secret);
- OC.MountConfig.saveStorage(tr);
- statusSpan.removeClass();
- statusSpan.addClass('waiting');
- window.location = result.data.url;
+ OC.MountConfig.saveStorage(tr, function() {
+ window.location = result.data.url;
+ });
} else {
OC.dialogs.alert(result.data.message, t('files_external', 'Error configuring Dropbox storage'));
}
diff --git a/apps/files_external/js/google.js b/apps/files_external/js/google.js
index b4be1c1dc41..068c2c13c66 100644
--- a/apps/files_external/js/google.js
+++ b/apps/files_external/js/google.js
@@ -32,11 +32,14 @@ $(document).ready(function() {
if (result && result.status == 'success') {
$(token).val(result.data.token);
$(configured).val('true');
- OC.MountConfig.saveStorage(tr);
- $(tr).find('.configuration input').attr('disabled', 'disabled');
- $(tr).find('.configuration').append($('<span/>')
- .attr('id', 'access')
- .text(t('files_external', 'Access granted')));
+ OC.MountConfig.saveStorage(tr, function(status) {
+ if (status) {
+ $(tr).find('.configuration input').attr('disabled', 'disabled');
+ $(tr).find('.configuration').append($('<span/>')
+ .attr('id', 'access')
+ .text(t('files_external', 'Access granted')));
+ }
+ });
} else {
OC.dialogs.alert(result.data.message,
t('files_external', 'Error configuring Google Drive storage')
@@ -99,7 +102,6 @@ $(document).ready(function() {
var configured = $(this).parent().find('[data-parameter="configured"]');
var client_id = $(this).parent().find('[data-parameter="client_id"]').val();
var client_secret = $(this).parent().find('[data-parameter="client_secret"]').val();
- var statusSpan = $(tr).find('.status span');
if (client_id != '' && client_secret != '') {
var token = $(this).parent().find('[data-parameter="token"]');
$.post(OC.filePath('files_external', 'ajax', 'google.php'),
@@ -112,10 +114,9 @@ $(document).ready(function() {
if (result && result.status == 'success') {
$(configured).val('false');
$(token).val('false');
- OC.MountConfig.saveStorage(tr);
- statusSpan.removeClass();
- statusSpan.addClass('waiting');
- window.location = result.data.url;
+ OC.MountConfig.saveStorage(tr, function(status) {
+ window.location = result.data.url;
+ });
} else {
OC.dialogs.alert(result.data.message,
t('files_external', 'Error configuring Google Drive storage')
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 886c324e338..895f97bd2c3 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -12,7 +12,7 @@ function updateStatus(statusEl, result){
}
OC.MountConfig={
- saveStorage:function(tr) {
+ saveStorage:function(tr, callback) {
var mountPoint = $(tr).find('.mountPoint input').val();
if (mountPoint == '') {
return false;
@@ -84,9 +84,15 @@ OC.MountConfig={
},
success: function(result) {
status = updateStatus(statusSpan, result);
+ if (callback) {
+ callback(status);
+ }
},
error: function(result){
status = updateStatus(statusSpan, result);
+ if (callback) {
+ callback(status);
+ }
}
});
});
@@ -137,9 +143,15 @@ OC.MountConfig={
},
success: function(result) {
status = updateStatus(statusSpan, result);
+ if (callback) {
+ callback(status);
+ }
},
error: function(result){
status = updateStatus(statusSpan, result);
+ if (callback) {
+ callback(status);
+ }
}
});
}
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index 0f8034e57d9..f6f4cb16e87 100644
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -224,7 +224,7 @@ class DAV extends \OC\Files\Storage\Common{
if (isset($response['{DAV:}quota-available-bytes'])) {
return (int)$response['{DAV:}quota-available-bytes'];
} else {
- return 0;
+ return \OC\Files\SPACE_UNKNOWN;
}
} catch(\Exception $e) {
return \OC\Files\SPACE_UNKNOWN;
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index f4042f65248..ef4345da20e 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -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;
@@ -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_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php
index 567f88b91b1..769fd8d8990 100644
--- a/apps/files_trashbin/lib/trashbin.php
+++ b/apps/files_trashbin/lib/trashbin.php
@@ -189,7 +189,7 @@ class Trashbin {
if ($rootView->is_dir($owner . '/files_versions/' . $ownerPath)) {
$size += self::calculateSize(new \OC\Files\View('/' . $owner . '/files_versions/' . $ownerPath));
if ($owner !== $user) {
- $rootView->copy($owner . '/files_versions/' . $ownerPath, $owner . '/files_trashbin/versions/' . basename($ownerPath) . '.d' . $timestamp);
+ self::copy_recursive($owner . '/files_versions/' . $ownerPath, $owner . '/files_trashbin/versions/' . basename($ownerPath) . '.d' . $timestamp, $rootView);
}
$rootView->rename($owner . '/files_versions/' . $ownerPath, $user . '/files_trashbin/versions/' . $filename . '.d' . $timestamp);
} else if ($versions = \OCA\Files_Versions\Storage::getVersions($owner, $ownerPath)) {
@@ -247,7 +247,7 @@ class Trashbin {
if ($rootView->is_dir($keyfile)) {
$size += self::calculateSize(new \OC\Files\View($keyfile));
if ($owner !== $user) {
- $rootView->copy($keyfile, $owner . '/files_trashbin/keyfiles/' . basename($ownerPath) . '.d' . $timestamp);
+ self::copy_recursive($keyfile, $owner . '/files_trashbin/keyfiles/' . basename($ownerPath) . '.d' . $timestamp, $rootView);
}
$rootView->rename($keyfile, $user . '/files_trashbin/keyfiles/' . $filename . '.d' . $timestamp);
} else {
@@ -265,7 +265,7 @@ class Trashbin {
if ($rootView->is_dir($sharekeys)) {
$size += self::calculateSize(new \OC\Files\View($sharekeys));
if ($owner !== $user) {
- $rootView->copy($sharekeys, $owner . '/files_trashbin/share-keys/' . basename($ownerPath) . '.d' . $timestamp);
+ self::copy_recursive($sharekeys, $owner . '/files_trashbin/share-keys/' . basename($ownerPath) . '.d' . $timestamp, $rootView);
}
$rootView->rename($sharekeys, $user . '/files_trashbin/share-keys/' . $filename . '.d' . $timestamp);
} else {
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 42a15612d67..7e6cc818efb 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -98,7 +98,6 @@ class Storage {
$files_view = new \OC\Files\View('/'.$uid .'/files');
$users_view = new \OC\Files\View('/'.$uid);
- $versions_view = new \OC\Files\View('/'.$uid.'/files_versions');
// check if filename is a directory
if($files_view->is_dir($filename)) {
@@ -132,7 +131,10 @@ class Storage {
\OC_FileProxy::$enabled = false;
// store a new version of a file
- $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename));
+ $mtime = $users_view->filemtime('files'.$filename);
+ $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'. $mtime);
+ // call getFileInfo to enforce a file cache entry for the new version
+ $users_view->getFileInfo('files_versions'.$filename.'.v'.$mtime);
// reset proxy state
\OC_FileProxy::$enabled = $proxyStatus;
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index 14dfaa1174d..c4e4efd0483 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -50,7 +50,8 @@ class Connection extends LDAPUtility {
parent::__construct($ldap);
$this->configPrefix = $configPrefix;
$this->configID = $configID;
- $this->configuration = new Configuration($configPrefix);
+ $this->configuration = new Configuration($configPrefix,
+ !is_null($configID));
$memcache = new \OC\Memcache\Factory();
if($memcache->isAvailable()) {
$this->cache = $memcache->create();
diff --git a/apps/user_ldap/lib/wizard.php b/apps/user_ldap/lib/wizard.php
index 348a871e2b3..b70ede8599c 100644
--- a/apps/user_ldap/lib/wizard.php
+++ b/apps/user_ldap/lib/wizard.php
@@ -792,10 +792,13 @@ class Wizard extends LDAPUtility {
\OCP\Util::writeLog('user_ldap', 'Wiz: Setting LDAP Options ', \OCP\Util::DEBUG);
//set LDAP options
- $a = $this->ldap->setOption($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
- $c = $this->ldap->setOption($cr, LDAP_OPT_NETWORK_TIMEOUT, self::LDAP_NW_TIMEOUT);
+ $this->ldap->setOption($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
+ $this->ldap->setOption($cr, LDAP_OPT_NETWORK_TIMEOUT, self::LDAP_NW_TIMEOUT);
if($tls) {
- $this->ldap->startTls($cr);
+ $isTlsWorking = @$this->ldap->startTls($cr);
+ if(!$isTlsWorking) {
+ return false;
+ }
}
\OCP\Util::writeLog('user_ldap', 'Wiz: Attemping to Bind ', \OCP\Util::DEBUG);
@@ -809,7 +812,7 @@ class Wizard extends LDAPUtility {
if($ncc) {
throw new \Exception('Certificate cannot be validated.');
}
- \OCP\Util::writeLog('user_ldap', 'Wiz: Bind succesfull with Port '. $port, \OCP\Util::DEBUG);
+ \OCP\Util::writeLog('user_ldap', 'Wiz: Bind successfull to Port '. $port . ' TLS ' . intval($tls), \OCP\Util::DEBUG);
return true;
}