aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_external/lib/amazons3.php29
-rw-r--r--apps/files_sharing/css/public.css2
-rw-r--r--core/css/mobile.css9
-rw-r--r--core/css/styles.css9
-rw-r--r--core/js/oc-dialogs.js2
-rw-r--r--lib/private/ocsclient.php18
6 files changed, 40 insertions, 29 deletions
diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php
index 10fc626c5da..3b0ae5bbe0d 100644
--- a/apps/files_external/lib/amazons3.php
+++ b/apps/files_external/lib/amazons3.php
@@ -190,26 +190,17 @@ class AmazonS3 extends \OC\Files\Storage\Common {
return false;
}
- $dh = $this->opendir($path);
-
- if(is_resource($dh)) {
- while (($file = readdir($dh)) !== false) {
- if ($file === '.' || $file === '..') {
- continue;
- }
-
- if ($this->is_dir($path . '/' . $file)) {
- $this->rmdir($path . '/' . $file);
- } else {
- $this->unlink($path . '/' . $file);
- }
- }
- }
+ // Since there are no real directories on S3, we need
+ // to delete all objects prefixed with the path.
+ $objects = $this->connection->listObjects(array(
+ 'Bucket' => $this->bucket,
+ 'Prefix' => $path . '/'
+ ));
try {
- $result = $this->connection->deleteObject(array(
+ $result = $this->connection->deleteObjects(array(
'Bucket' => $this->bucket,
- 'Key' => $path . '/'
+ 'Objects' => $objects['Contents']
));
$this->testTimeout();
} catch (S3Exception $e) {
@@ -310,6 +301,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
public function unlink($path) {
$path = $this->normalizePath($path);
+ if ( $this->is_dir($path) ) {
+ return $this->rmdir($path);
+ }
+
try {
$result = $this->connection->deleteObject(array(
'Bucket' => $this->bucket,
diff --git a/apps/files_sharing/css/public.css b/apps/files_sharing/css/public.css
index f6ca1c7dbc1..8a843c39caa 100644
--- a/apps/files_sharing/css/public.css
+++ b/apps/files_sharing/css/public.css
@@ -2,7 +2,7 @@
background: #fff;
text-align: center;
margin: 45px auto 0;
- min-height: 150px;
+ min-height: 600px;
}
#preview .notCreatable {
diff --git a/core/css/mobile.css b/core/css/mobile.css
index 21090d08cb7..0310b0228e2 100644
--- a/core/css/mobile.css
+++ b/core/css/mobile.css
@@ -152,6 +152,15 @@ table.multiselect thead {
}
+/* do not show dates in filepicker */
+#oc-dialog-filepicker-content .filelist .date {
+ display: none;
+}
+#oc-dialog-filepicker-content .filelist .filename {
+ max-width: 80%;
+}
+
+
/* fix controls bar jumping when navigation is slid out */
.snapjs-left #app-navigation-toggle,
.snapjs-left #controls {
diff --git a/core/css/styles.css b/core/css/styles.css
index 9c615c98c84..230ecf9744a 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -767,14 +767,19 @@ a.bookmarklet { background-color:#ddd; border:1px solid #ccc; padding:5px;paddin
#oc-dialog-filepicker-content .filelist .filename {
position: absolute;
top: 8px;
+ max-width: 60%;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
}
#oc-dialog-filepicker-content .filelist img {
margin: 2px 1em 0 4px;
}
#oc-dialog-filepicker-content .filelist .date {
float: right;
- margin-right: 1em;
- margin-top: 8px;
+ margin-right: 10px;
+ margin-top: 0;
+ padding-top: 9px;
}
#oc-dialog-filepicker-content .filepicker_element_selected { background-color:lightblue;}
.ui-dialog {position:fixed !important;}
diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js
index 9920cc58e23..9b767930c10 100644
--- a/core/js/oc-dialogs.js
+++ b/core/js/oc-dialogs.js
@@ -206,7 +206,7 @@ var OCdialogs = {
self.$filePicker.ocdialog({
closeOnEscape: true,
- width: (4/9)*$(document).width(),
+ width: (4/5)*$(document).width(),
height: 420,
modal: modal,
buttons: buttonlist,
diff --git a/lib/private/ocsclient.php b/lib/private/ocsclient.php
index dc52fc27b5e..e4cce6b2260 100644
--- a/lib/private/ocsclient.php
+++ b/lib/private/ocsclient.php
@@ -59,7 +59,7 @@ class OC_OCSClient{
/**
* Get all the categories from the OCS server
- * @return array an array of category ids
+ * @return array|null an array of category ids or null
* @note returns NULL if config value appstoreenabled is set to false
* This function returns a list of all the application categories on the OCS server
*/
@@ -92,7 +92,7 @@ class OC_OCSClient{
/**
* Get all the applications from the OCS server
- * @return array an array of application data
+ * @return array|null an array of application data or null
*
* This function returns a list of all the applications on the OCS server
* @param array|string $categories
@@ -150,9 +150,9 @@ class OC_OCSClient{
/**
* Get an the applications from the OCS server
* @param string $id
- * @return array an array of application data
+ * @return array|null an array of application data or null
*
- * This function returns an applications from the OCS server
+ * This function returns an applications from the OCS server
*/
public static function getApplication($id) {
if(OC_Config::getValue('appstoreenabled', true)==false) {
@@ -162,7 +162,7 @@ class OC_OCSClient{
$xml=OC_OCSClient::getOCSresponse($url);
if($xml==false) {
- OC_Log::write('core', 'Unable to parse OCS content', OC_Log::FATAL);
+ OC_Log::write('core', 'Unable to parse OCS content for app ' . $id, OC_Log::FATAL);
return null;
}
$loadEntities = libxml_disable_entity_loader(true);
@@ -170,6 +170,10 @@ class OC_OCSClient{
libxml_disable_entity_loader($loadEntities);
$tmp=$data->data->content;
+ if (is_null($tmp)) {
+ OC_Log::write('core', 'Invalid OCS content returned for app ' . $id, OC_Log::FATAL);
+ return null;
+ }
$app=array();
$app['id']=$tmp->id;
$app['name']=$tmp->name;
@@ -192,7 +196,7 @@ class OC_OCSClient{
/**
* Get the download url for an application from the OCS server
- * @return array an array of application data
+ * @return array|null an array of application data or null
*
* This function returns an download url for an applications from the OCS server
* @param string $id
@@ -223,6 +227,4 @@ class OC_OCSClient{
return $app;
}
-
-
}