diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php
index c2d65d718c..77d866979c 100644
--- a/apps/files/ajax/newfile.php
+++ b/apps/files/ajax/newfile.php
@@ -8,12 +8,11 @@ if(!OC_User::isLoggedIn()) {
}
session_write_close();
-
// Get the params
-$dir = isset( $_REQUEST['dir'] ) ? stripslashes($_REQUEST['dir']) : '';
-$filename = isset( $_REQUEST['filename'] ) ? stripslashes($_REQUEST['filename']) : '';
+$dir = isset( $_REQUEST['dir'] ) ? trim($_REQUEST['dir'], '/\\') : '';
+$filename = isset( $_REQUEST['filename'] ) ? trim($_REQUEST['filename'], '/\\') : '';
$content = isset( $_REQUEST['content'] ) ? $_REQUEST['content'] : '';
-$source = isset( $_REQUEST['source'] ) ? stripslashes($_REQUEST['source']) : '';
+$source = isset( $_REQUEST['source'] ) ? trim($_REQUEST['source'], '/\\') : '';
if($source) {
$eventSource=new OC_EventSource();
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 0c00fe8c92..e403745452 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -178,7 +178,12 @@ $(document).ready(function() {
var dir=$('#dir').val()||'/';
$('#notification').text(t('files','generating ZIP-file, it may take some time.'));
$('#notification').fadeIn();
- window.location=OC.filePath('files', 'ajax', 'download.php') + '?'+ $.param({ dir: dir, files: files });
+ // use special download URL if provided, e.g. for public shared files
+ if ( (downloadURL = document.getElementById("downloadURL")) ) {
+ window.location=downloadURL.value+"&download&files="+files;
+ } else {
+ window.location=OC.filePath('files', 'ajax', 'download.php') + '?'+ $.param({ dir: dir, files: files });
+ }
return false;
});
@@ -195,6 +200,8 @@ $(document).ready(function() {
e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone
});
+ if ( document.getElementById("file_upload_start") ) {
+
$(function() {
$('.file_upload_start').fileupload({
dropZone: $('#content'), // restrict dropZone to content div
@@ -408,7 +415,8 @@ $(document).ready(function() {
}
})
});
-
+ }
+
$.assocArraySize = function(obj) {
// http://stackoverflow.com/a/6700/11236
var size = 0, key;
@@ -592,7 +600,10 @@ $(document).ready(function() {
var lastWidth = 0;
var breadcrumbs = [];
- var breadcrumbsWidth = $('#navigation').get(0).offsetWidth;
+ var breadcrumbsWidth = 0;
+ if ( document.getElementById("navigation") ) {
+ breadcrumbsWidth = $('#navigation').get(0).offsetWidth;
+ }
var hiddenBreadcrumbs = 0;
$.each($('.crumb'), function(index, breadcrumb) {
diff --git a/apps/files/l10n/eu.php b/apps/files/l10n/eu.php
index 9c50488000..94212afe8c 100644
--- a/apps/files/l10n/eu.php
+++ b/apps/files/l10n/eu.php
@@ -9,6 +9,7 @@
"Files" => "Fitxategiak",
"Unshare" => "Ez partekatu",
"Delete" => "Ezabatu",
+"Rename" => "Berrizendatu",
"already exists" => "dagoeneko existitzen da",
"replace" => "ordeztu",
"suggest name" => "aholkatu izena",
@@ -22,6 +23,8 @@
"Unable to upload your file as it is a directory or has 0 bytes" => "Ezin da zure fitxategia igo, karpeta bat da edo 0 byt ditu",
"Upload Error" => "Igotzean errore bat suertatu da",
"Pending" => "Zain",
+"1 file uploading" => "fitxategi 1 igotzen",
+"files uploading" => "fitxategiak igotzen",
"Upload cancelled." => "Igoera ezeztatuta",
"File upload is in progress. Leaving the page now will cancel the upload." => "Fitxategien igoera martxan da. Orria orain uzteak igoera ezeztatutko du.",
"Invalid name, '/' is not allowed." => "Baliogabeko izena, '/' ezin da erabili. ",
@@ -34,6 +37,16 @@
"folders" => "Karpetak",
"file" => "fitxategia",
"files" => "fitxategiak",
+"seconds ago" => "segundu",
+"minute ago" => "minutu",
+"minutes ago" => "minutu",
+"today" => "gaur",
+"yesterday" => "atzo",
+"days ago" => "egun",
+"last month" => "joan den hilabetean",
+"months ago" => "hilabete",
+"last year" => "joan den urtean",
+"years ago" => "urte",
"File handling" => "Fitxategien kudeaketa",
"Maximum upload size" => "Igo daitekeen gehienezko tamaina",
"max. possible: " => "max, posiblea:",
diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php
index 875fc747bb..71b695f65f 100644
--- a/apps/files/templates/part.breadcrumb.php
+++ b/apps/files/templates/part.breadcrumb.php
@@ -1,6 +1,6 @@
-
svg" data-dir='' style='background-image:url("")'>
-
">
+
svg" data-dir='' style='background-image:url("")'>
+
">
diff --git a/apps/files_external/l10n/ca.php b/apps/files_external/l10n/ca.php
index 43163ce953..fc6706381b 100644
--- a/apps/files_external/l10n/ca.php
+++ b/apps/files_external/l10n/ca.php
@@ -1,4 +1,10 @@
"S'ha concedit l'accés",
+"Error configuring Dropbox storage" => "Error en configurar l'emmagatzemament Dropbox",
+"Grant access" => "Concedeix accés",
+"Fill out all required fields" => "Ompliu els camps requerits",
+"Please provide a valid Dropbox app key and secret." => "Proporcioneu una clau d'aplicació i secret vàlids per a Dropbox",
+"Error configuring Google Drive storage" => "Error en configurar l'emmagatzemament Google Drive",
"External Storage" => "Emmagatzemament extern",
"Mount point" => "Punt de muntatge",
"Backend" => "Dorsal",
diff --git a/apps/files_external/l10n/cs_CZ.php b/apps/files_external/l10n/cs_CZ.php
index 13263b9b55..51951c19bf 100644
--- a/apps/files_external/l10n/cs_CZ.php
+++ b/apps/files_external/l10n/cs_CZ.php
@@ -1,4 +1,10 @@
"Přístup povolen",
+"Error configuring Dropbox storage" => "Chyba při nastavení úložiště Dropbox",
+"Grant access" => "Povolit přístup",
+"Fill out all required fields" => "Vyplňte všechna povinná pole",
+"Please provide a valid Dropbox app key and secret." => "Zadejte, prosím, platný klíč a bezpečnostní frázi aplikace Dropbox.",
+"Error configuring Google Drive storage" => "Chyba při nastavení úložiště Google Drive",
"External Storage" => "Externí úložiště",
"Mount point" => "Přípojný bod",
"Backend" => "Podpůrná vrstva",
diff --git a/apps/files_external/l10n/eu.php b/apps/files_external/l10n/eu.php
index 9d6f833ffc..8ec6d40563 100644
--- a/apps/files_external/l10n/eu.php
+++ b/apps/files_external/l10n/eu.php
@@ -1,4 +1,8 @@
"Errore bat egon da Dropbox biltegiratzea konfiguratzean",
+"Fill out all required fields" => "Bete eskatutako eremu guztiak",
+"Please provide a valid Dropbox app key and secret." => "Mesedez eman baliozkoa den Dropbox app giltza eta sekretua",
+"Error configuring Google Drive storage" => "Errore bat egon da Google Drive biltegiratzea konfiguratzean",
"External Storage" => "Kanpoko Biltegiratzea",
"Mount point" => "Montatze puntua",
"Backend" => "Motorra",
diff --git a/apps/files_external/l10n/fr.php b/apps/files_external/l10n/fr.php
index 409c66031e..90007aafaa 100644
--- a/apps/files_external/l10n/fr.php
+++ b/apps/files_external/l10n/fr.php
@@ -1,4 +1,10 @@
"Accès autorisé",
+"Error configuring Dropbox storage" => "Erreur lors de la configuration du support de stockage Dropbox",
+"Grant access" => "Autoriser l'accès",
+"Fill out all required fields" => "Veuillez remplir tous les champs requis",
+"Please provide a valid Dropbox app key and secret." => "Veuillez fournir une clé d'application (app key) ainsi qu'un mot de passe valides.",
+"Error configuring Google Drive storage" => "Erreur lors de la configuration du support de stockage Google Drive",
"External Storage" => "Stockage externe",
"Mount point" => "Point de montage",
"Backend" => "Infrastructure",
diff --git a/apps/files_external/l10n/it.php b/apps/files_external/l10n/it.php
index 7f467c02c5..49effebdfc 100644
--- a/apps/files_external/l10n/it.php
+++ b/apps/files_external/l10n/it.php
@@ -3,6 +3,7 @@
"Error configuring Dropbox storage" => "Errore durante la configurazione dell'archivio Dropbox",
"Grant access" => "Concedi l'accesso",
"Fill out all required fields" => "Compila tutti i campi richiesti",
+"Please provide a valid Dropbox app key and secret." => "Fornisci chiave di applicazione e segreto di Dropbox validi.",
"Error configuring Google Drive storage" => "Errore durante la configurazione dell'archivio Google Drive",
"External Storage" => "Archiviazione esterna",
"Mount point" => "Punto di mount",
diff --git a/apps/files_external/l10n/ja_JP.php b/apps/files_external/l10n/ja_JP.php
index 81c6207775..92f74ce9f7 100644
--- a/apps/files_external/l10n/ja_JP.php
+++ b/apps/files_external/l10n/ja_JP.php
@@ -1,4 +1,10 @@
"アクセスは許可されました",
+"Error configuring Dropbox storage" => "Dropboxストレージの設定エラー",
+"Grant access" => "アクセスを許可",
+"Fill out all required fields" => "すべての必須フィールドを埋めて下さい",
+"Please provide a valid Dropbox app key and secret." => "有効なDropboxアプリのキーとパスワードを入力して下さい。",
+"Error configuring Google Drive storage" => "Googleドライブストレージの設定エラー",
"External Storage" => "外部ストレージ",
"Mount point" => "マウントポイント",
"Backend" => "バックエンド",
diff --git a/apps/files_external/l10n/pt_PT.php b/apps/files_external/l10n/pt_PT.php
index f2618a14ce..4795a51a6b 100644
--- a/apps/files_external/l10n/pt_PT.php
+++ b/apps/files_external/l10n/pt_PT.php
@@ -1,4 +1,10 @@
"Acesso autorizado",
+"Error configuring Dropbox storage" => "Erro ao configurar o armazenamento do Dropbox",
+"Grant access" => "Conceder acesso",
+"Fill out all required fields" => "Preencha todos os campos obrigatórios",
+"Please provide a valid Dropbox app key and secret." => "Por favor forneça uma \"app key\" e \"secret\" do Dropbox válidas.",
+"Error configuring Google Drive storage" => "Erro ao configurar o armazenamento do Google Drive",
"External Storage" => "Armazenamento Externo",
"Mount point" => "Ponto de montagem",
"Backend" => "Backend",
diff --git a/apps/files_external/l10n/sv.php b/apps/files_external/l10n/sv.php
index 43a93961d5..0a5e1c66d9 100644
--- a/apps/files_external/l10n/sv.php
+++ b/apps/files_external/l10n/sv.php
@@ -1,4 +1,10 @@
"Åtkomst beviljad",
+"Error configuring Dropbox storage" => "Fel vid konfigurering av Dropbox",
+"Grant access" => "Bevilja åtkomst",
+"Fill out all required fields" => "Fyll i alla obligatoriska fält",
+"Please provide a valid Dropbox app key and secret." => "Ange en giltig Dropbox nyckel och hemlighet.",
+"Error configuring Google Drive storage" => "Fel vid konfigurering av Google Drive",
"External Storage" => "Extern lagring",
"Mount point" => "Monteringspunkt",
"Backend" => "Källa",
diff --git a/apps/files_external/l10n/th_TH.php b/apps/files_external/l10n/th_TH.php
index 322345a88a..70ab8d3348 100644
--- a/apps/files_external/l10n/th_TH.php
+++ b/apps/files_external/l10n/th_TH.php
@@ -1,4 +1,10 @@
"การเข้าถึงได้รับอนุญาตแล้ว",
+"Error configuring Dropbox storage" => "เกิดข้อผิดพลาดในการกำหนดค่าพื้นที่จัดเก็บข้อมูล Dropbox",
+"Grant access" => "อนุญาตให้เข้าถึงได้",
+"Fill out all required fields" => "กรอกข้อมูลในช่องข้อมูลที่จำเป็นต้องกรอกทั้งหมด",
+"Please provide a valid Dropbox app key and secret." => "กรุณากรอกรหัส app key ของ Dropbox และรหัสลับ",
+"Error configuring Google Drive storage" => "เกิดข้อผิดพลาดในการกำหนดค่าการจัดเก็บข้อมูลในพื้นที่ของ Google Drive",
"External Storage" => "พื้นทีจัดเก็บข้อมูลจากภายนอก",
"Mount point" => "จุดชี้ตำแหน่ง",
"Backend" => "ด้านหลังระบบ",
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index def0237480..916e35419c 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -32,6 +32,18 @@ $(document).ready(function() {
window.location = $(tr).find('a.name').attr('href');
}
});
+ FileActions.register('file', 'Download', OC.PERMISSION_READ, '', function(filename) {
+ var tr = $('tr').filterAttr('data-file', 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)
+ if (tr.length > 0) {
+ window.location = $(tr).find('a.name').attr('href')+'&download';
+ }
+ });
}
});
\ No newline at end of file
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 15377680ab..34340102a9 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -25,7 +25,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
if (isset($_GET['dir'])) {
$type = 'folder';
$path = $_GET['dir'];
- $baseDir = basename($path);
+ $baseDir = $path;
$dir = $baseDir;
} else {
$type = 'file';
@@ -36,6 +36,13 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
OC_Util::setupFS($uidOwner);
$fileSource = OC_Filecache::getId($path, '');
if ($fileSource != -1 && ($linkItem = OCP\Share::getItemSharedWithByLink($type, $fileSource, $uidOwner))) {
+ // TODO Fix in the getItems
+ if (!isset($linkItem['item_type']) || $linkItem['item_type'] != $type) {
+ header('HTTP/1.0 404 Not Found');
+ $tmpl = new OCP\Template('', '404', 'guest');
+ $tmpl->printPage();
+ exit();
+ }
if (isset($linkItem['share_with'])) {
// Check password
if (isset($_POST['password'])) {
@@ -75,14 +82,18 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
}
// Download the file
if (isset($_GET['download'])) {
- $mimetype = OC_Filesystem::getMimeType($path);
- header('Content-Transfer-Encoding: binary');
- header('Content-Disposition: attachment; filename="'.basename($path).'"');
- header('Content-Type: '.$mimetype);
- header('Content-Length: '.OC_Filesystem::filesize($path));
- OCP\Response::disableCaching();
- @ob_clean();
- OC_Filesystem::readfile($path);
+ if (isset($_GET['dir'])) {
+ if ( isset($_GET['files']) ) { // download selected files
+ OC_Files::get($path, $_GET['files'], $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+ } else if (isset($_GET['path']) && $_GET['path'] != '' ) { // download a file from a shared directory
+ OC_Files::get('', $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+ } else { // download the whole shared directory
+ OC_Files::get($path, '', $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+ }
+ } else { // download a single shared file
+ OC_Files::get("", $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+ }
+
} else {
OCP\Util::addStyle('files_sharing', 'public');
OCP\Util::addScript('files_sharing', 'public');
@@ -103,7 +114,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
$i['basename'] = $fileinfo['filename'];
$i['extension'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : '';
}
- $i['directory'] = substr($i['directory'], $rootLength);
+ $i['directory'] = '/'.substr('/'.$uidOwner.'/files'.$i['directory'], $rootLength);
if ($i['directory'] == '/') {
$i['directory'] = '';
}
@@ -113,12 +124,16 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
// Make breadcrumb
$breadcrumb = array();
$pathtohere = '';
+ $count = 1;
foreach (explode('/', $dir) as $i) {
if ($i != '') {
if ($i != $baseDir) {
$pathtohere .= '/'.$i;
+ }
+ if ( strlen($pathtohere) < strlen($_GET['dir'])) {
+ continue;
}
- $breadcrumb[] = array('dir' => $pathtohere, 'name' => $i);
+ $breadcrumb[] = array('dir' => str_replace($_GET['dir'], "", $pathtohere, $count), 'name' => $i);
}
}
$list = new OCP\Template('files', 'part.list', '');
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index fd9b79e6f1..ef81e296d8 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -31,7 +31,5 @@
-
-