Merge branch 'master' into fix-shared-links

This commit is contained in:
Michael Gapczynski 2013-02-10 00:54:20 -05:00
commit c6985d6cd4
720 changed files with 19203 additions and 8173 deletions

1
.gitignore vendored
View File

@ -56,6 +56,7 @@ nbproject
# Cloud9IDE
.settings.xml
.c9revisions
# vim ex mode
.vimrc

View File

@ -11,8 +11,10 @@ $dir = stripslashes($_POST["dir"]);
$file = stripslashes($_POST["file"]);
$target = stripslashes(rawurldecode($_POST["target"]));
$l = OC_L10N::get('files');
if(\OC\Files\Filesystem::file_exists($target . '/' . $file)) {
OCP\JSON::error(array("data" => array( "message" => "Could not move $file - File with this name already exists" )));
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not move %s - File with this name already exists", array($file)) )));
exit;
}
@ -22,8 +24,8 @@ if ($dir != '' || $file != 'Shared') {
if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) {
OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $file )));
} else {
OCP\JSON::error(array("data" => array( "message" => "Could not move $file" )));
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not move %s", array($file)) )));
}
}else{
OCP\JSON::error(array("data" => array( "message" => "Could not move $file" )));
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not move %s", array($file)) )));
}

View File

@ -11,14 +11,16 @@ $dir = stripslashes($_GET["dir"]);
$file = stripslashes($_GET["file"]);
$newname = stripslashes($_GET["newname"]);
$l = OC_L10N::get('files');
if ( $newname !== '.' and ($dir != '' || $file != 'Shared') and $newname !== '.') {
$targetFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $newname);
$sourceFile = \OC\Files\Filesystem::normalizePath($dir . '/' . $file);
if(\OC\Files\Filesystem::rename($sourceFile, $targetFile)) {
OCP\JSON::success(array("data" => array( "dir" => $dir, "file" => $file, "newname" => $newname )));
} else {
OCP\JSON::error(array("data" => array( "message" => "Unable to rename file" )));
OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to rename file") )));
}
}else{
OCP\JSON::error(array("data" => array( "message" => "Unable to rename file" )));
OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to rename file") )));
}

View File

@ -49,7 +49,7 @@ foreach ($files['size'] as $size) {
$totalSize += $size;
}
if ($totalSize > \OC\Files\Filesystem::free_space($dir)) {
OCP\JSON::error(array('data' => array('message' => $l->t('Not enough space available'),
OCP\JSON::error(array('data' => array('message' => $l->t('Not enough storage available'),
'uploadMaxFilesize' => $maxUploadFilesize,
'maxHumanFilesize' => $maxHumanFilesize)));
exit();

View File

@ -3,7 +3,7 @@
See the COPYING-README file. */
/* FILE MENU */
.actions { padding:.3em; float:left; height:2em; width: 100%; }
.actions { padding:.3em; height:2em; width: 100%; }
.actions input, .actions button, .actions .button { margin:0; float:left; }
#new {

View File

@ -92,7 +92,7 @@ foreach (explode('/', $dir) as $i) {
$list = new OCP\Template('files', 'part.list', '');
$list->assign('files', $files, false);
$list->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir=', false);
$list->assign('downloadURL', OCP\Util::linkTo('files', 'download.php') . '?file=', false);
$list->assign('downloadURL', OCP\Util::linkToRoute('download', array('file' => '/')), false);
$list->assign('disableSharing', false);
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);

View File

@ -112,9 +112,8 @@ var FileActions = {
if (img.call) {
img = img(file);
}
// NOTE: Temporary fix to allow unsharing of files in root of Shared folder
if ($('#dir').val() == '/Shared') {
var html = '<a href="#" original-title="' + t('files', 'Unshare') + '" class="action delete" />';
if (typeof trashBinApp !== 'undefined' && trashBinApp) {
var html = '<a href="#" original-title="' + t('files', 'Delete permanently') + '" class="action delete" />';
} else {
var html = '<a href="#" original-title="' + t('files', 'Delete') + '" class="action delete" />';
}

View File

@ -3,35 +3,92 @@ var FileList={
update:function(fileListHtml) {
$('#fileList').empty().html(fileListHtml);
},
addFile:function(name,size,lastModified,loading,hidden){
var basename, extension, simpleSize, sizeColor, lastModifiedTime, modifiedColor,
img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file.png'),
html='<tr data-type="file" data-size="'+size+'" data-permissions="'+$('#permissions').val()+'">';
if(name.indexOf('.')!=-1){
createRow:function(type, name, iconurl, linktarget, size, lastModified, permissions){
var td, simpleSize, basename, extension;
//containing tr
var tr = $('<tr></tr>').attr({
"data-type": type,
"data-size": size,
"data-file": name,
"data-permissions": permissions
});
// filename td
td = $('<td></td>').attr({
"class": "filename",
"style": 'background-image:url('+iconurl+')'
});
td.append('<input type="checkbox" />');
var link_elem = $('<a></a>').attr({
"class": "name",
"href": linktarget
});
//split extension from filename for non dirs
if (type != 'dir' && name.indexOf('.')!=-1) {
basename=name.substr(0,name.lastIndexOf('.'));
extension=name.substr(name.lastIndexOf('.'));
}else{
} else {
basename=name;
extension=false;
}
html+='<td class="filename" style="background-image:url('+img+')"><input type="checkbox" />';
html+='<a class="name" href="download.php?file='+$('#dir').val().replace(/</, '&lt;').replace(/>/, '&gt;')+'/'+escapeHTML(name)+'"><span class="nametext">'+escapeHTML(basename);
var name_span=$('<span></span>').addClass('nametext').text(basename);
link_elem.append(name_span);
if(extension){
html+='<span class="extension">'+escapeHTML(extension)+'</span>';
name_span.append($('<span></span>').addClass('extension').text(extension));
}
html+='</span></a></td>';
if(size!='Pending'){
//dirs can show the number of uploaded files
if (type == 'dir') {
link_elem.append($('<span></span>').attr({
'class': 'uploadtext',
'currentUploads': 0
}));
}
td.append(link_elem);
tr.append(td);
//size column
if(size!=t('files', 'Pending')){
simpleSize=simpleFileSize(size);
}else{
simpleSize='Pending';
simpleSize=t('files', 'Pending');
}
sizeColor = Math.round(200-size/(1024*1024)*2);
lastModifiedTime=Math.round(lastModified.getTime() / 1000);
modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*14);
html+='<td class="filesize" title="'+humanFileSize(size)+'" style="color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')">'+simpleSize+'</td>';
html+='<td class="date"><span class="modified" title="'+formatDate(lastModified)+'" style="color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')">'+relative_modified_date(lastModified.getTime() / 1000)+'</span></td>';
html+='</tr>';
FileList.insertElement(name,'file',$(html).attr('data-file',name));
var sizeColor = Math.round(200-Math.pow((size/(1024*1024)),2));
var lastModifiedTime = Math.round(lastModified.getTime() / 1000);
td = $('<td></td>').attr({
"class": "filesize",
"title": humanFileSize(size),
"style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'
}).text(simpleSize);
tr.append(td);
// date column
var modifiedColor = Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5);
td = $('<td></td>').attr({ "class": "date" });
td.append($('<span></span>').attr({
"class": "modified",
"title": formatDate(lastModified),
"style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')'
}).text( relative_modified_date(lastModified.getTime() / 1000) ));
tr.append(td);
return tr;
},
addFile:function(name,size,lastModified,loading,hidden){
var imgurl;
if (loading) {
imgurl = OC.imagePath('core', 'loading.gif');
} else {
imgurl = OC.imagePath('core', 'filetypes/file.png');
}
var tr = this.createRow(
'file',
name,
imgurl,
OC.Router.generate('download', { file: $('#dir').val()+'/'+name }),
size,
lastModified,
$('#permissions').val()
);
FileList.insertElement(name, 'file', tr.attr('data-file',name));
var row = $('tr').filterAttr('data-file',name);
if(loading){
row.data('loading',true);
@ -44,30 +101,18 @@ var FileList={
FileActions.display(row.find('td.filename'));
},
addDir:function(name,size,lastModified,hidden){
var html, td, link_elem, sizeColor, lastModifiedTime, modifiedColor;
html = $('<tr></tr>').attr({ "data-type": "dir", "data-size": size, "data-file": name, "data-permissions": $('#permissions').val()});
td = $('<td></td>').attr({"class": "filename", "style": 'background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')' });
td.append('<input type="checkbox" />');
link_elem = $('<a></a>').attr({ "class": "name", "href": OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/') });
link_elem.append($('<span></span>').addClass('nametext').text(name));
link_elem.append($('<span></span>').attr({'class': 'uploadtext', 'currentUploads': 0}));
td.append(link_elem);
html.append(td);
if(size!='Pending'){
simpleSize=simpleFileSize(size);
}else{
simpleSize='Pending';
}
sizeColor = Math.round(200-Math.pow((size/(1024*1024)),2));
lastModifiedTime=Math.round(lastModified.getTime() / 1000);
modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5);
td = $('<td></td>').attr({ "class": "filesize", "title": humanFileSize(size), "style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'}).text(simpleSize);
html.append(td);
td = $('<td></td>').attr({ "class": "date" });
td.append($('<span></span>').attr({ "class": "modified", "title": formatDate(lastModified), "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')' }).text( relative_modified_date(lastModified.getTime() / 1000) ));
html.append(td);
FileList.insertElement(name,'dir',html);
var tr = this.createRow(
'dir',
name,
OC.imagePath('core', 'filetypes/folder.png'),
OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/'),
size,
lastModified,
$('#permissions').val()
);
FileList.insertElement(name,'dir',tr);
var row = $('tr').filterAttr('data-file',name);
row.find('td.filename').draggable(dragOptions);
row.find('td.filename').droppable(folderDropOptions);
@ -216,9 +261,6 @@ var FileList={
},
replace:function(oldName, newName, isNewFile) {
// Finish any existing actions
if (FileList.lastAction || !FileList.useUndo) {
FileList.lastAction();
}
$('tr').filterAttr('data-file', oldName).hide();
$('tr').filterAttr('data-file', newName).hide();
var tr = $('tr').filterAttr('data-file', oldName).clone();
@ -321,7 +363,6 @@ $(document).ready(function(){
// Delete the new uploaded file
FileList.deleteCanceled = false;
FileList.deleteFiles = [FileList.replaceOldName];
FileList.finishDelete(null, true);
} else {
$('tr').filterAttr('data-file', FileList.replaceOldName).show();
}
@ -348,7 +389,6 @@ $(document).ready(function(){
if ($('#notification').data('isNewFile')) {
FileList.deleteCanceled = false;
FileList.deleteFiles = [$('#notification').data('oldName')];
FileList.finishDelete(null, true);
}
});
FileList.useUndo=(window.onbeforeunload)?true:false;

View File

@ -262,12 +262,6 @@ $(document).ready(function() {
return;
}
totalSize+=files[i].size;
if(FileList.deleteFiles && FileList.deleteFiles.indexOf(files[i].name)!=-1){//finish delete if we are uploading a deleted file
FileList.finishDelete(function(){
$('#file_upload_start').change();
});
return;
}
}
}
if(totalSize>$('#max_upload').val()){

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "কোন ফাইল আপলোড করা হয় নি",
"Missing a temporary folder" => "অস্থায়ী ফোল্ডার খোয়া গিয়েছে",
"Failed to write to disk" => "ডিস্কে লিখতে ব্যর্থ",
"Not enough space available" => "যথেষ্ঠ পরিমাণ স্থান নেই",
"Invalid directory." => "ভুল ডিরেক্টরি",
"Files" => "ফাইল",
"Unshare" => "ভাগাভাগি বাতিল ",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "El fitxer no s'ha pujat",
"Missing a temporary folder" => "S'ha perdut un fitxer temporal",
"Failed to write to disk" => "Ha fallat en escriure al disc",
"Not enough space available" => "No hi ha prou espai disponible",
"Invalid directory." => "Directori no vàlid.",
"Files" => "Fitxers",
"Unshare" => "Deixa de compartir",
"Delete permanently" => "Esborra permanentment",
"Delete" => "Suprimeix",
"Rename" => "Reanomena",
"{new_name} already exists" => "{new_name} ja existeix",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "Žádný soubor nebyl odeslán",
"Missing a temporary folder" => "Chybí adresář pro dočasné soubory",
"Failed to write to disk" => "Zápis na disk selhal",
"Not enough space available" => "Nedostatek dostupného místa",
"Invalid directory." => "Neplatný adresář",
"Files" => "Soubory",
"Unshare" => "Zrušit sdílení",
"Delete permanently" => "Trvale odstranit",
"Delete" => "Smazat",
"Rename" => "Přejmenovat",
"{new_name} already exists" => "{new_name} již existuje",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "Es wurde keine Datei hochgeladen.",
"Missing a temporary folder" => "Temporärer Ordner fehlt.",
"Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte",
"Not enough space available" => "Nicht genug Speicherplatz verfügbar",
"Invalid directory." => "Ungültiges Verzeichnis.",
"Files" => "Dateien",
"Unshare" => "Nicht mehr freigeben",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "Es wurde keine Datei hochgeladen.",
"Missing a temporary folder" => "Der temporäre Ordner fehlt.",
"Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte",
"Not enough space available" => "Nicht genügend Speicherplatz verfügbar",
"Invalid directory." => "Ungültiges Verzeichnis.",
"Files" => "Dateien",
"Unshare" => "Nicht mehr freigeben",
"Delete permanently" => "Entgültig löschen",
"Delete" => "Löschen",
"Rename" => "Umbenennen",
"{new_name} already exists" => "{new_name} existiert bereits",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "Κανένα αρχείο δεν στάλθηκε",
"Missing a temporary folder" => "Λείπει ο προσωρινός φάκελος",
"Failed to write to disk" => "Αποτυχία εγγραφής στο δίσκο",
"Not enough space available" => "Δεν υπάρχει αρκετός διαθέσιμος χώρος",
"Invalid directory." => "Μη έγκυρος φάκελος.",
"Files" => "Αρχεία",
"Unshare" => "Διακοπή κοινής χρήσης",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "Neniu dosiero estas alŝutita",
"Missing a temporary folder" => "Mankas tempa dosierujo",
"Failed to write to disk" => "Malsukcesis skribo al disko",
"Not enough space available" => "Ne haveblas sufiĉa spaco",
"Invalid directory." => "Nevalida dosierujo.",
"Files" => "Dosieroj",
"Unshare" => "Malkunhavigi",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "No se ha subido ningún archivo",
"Missing a temporary folder" => "Falta un directorio temporal",
"Failed to write to disk" => "La escritura en disco ha fallado",
"Not enough space available" => "No hay suficiente espacio disponible",
"Invalid directory." => "Directorio invalido.",
"Files" => "Archivos",
"Unshare" => "Dejar de compartir",
"Delete permanently" => "Eliminar permanentemente",
"Delete" => "Eliminar",
"Rename" => "Renombrar",
"{new_name} already exists" => "{new_name} ya existe",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "El archivo no fue subido",
"Missing a temporary folder" => "Falta un directorio temporal",
"Failed to write to disk" => "Error al escribir en el disco",
"Not enough space available" => "No hay suficiente espacio disponible",
"Invalid directory." => "Directorio invalido.",
"Files" => "Archivos",
"Unshare" => "Dejar de compartir",
@ -20,6 +19,7 @@
"replaced {new_name}" => "reemplazado {new_name}",
"undo" => "deshacer",
"replaced {new_name} with {old_name}" => "reemplazado {new_name} con {old_name}",
"perform delete operation" => "Eliminar",
"'.' is an invalid file name." => "'.' es un nombre de archivo inválido.",
"File name cannot be empty." => "El nombre del archivo no puede quedar vacío.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nombre invalido, '\\', '/', '<', '>', ':', '\"', '|', '?' y '*' no están permitidos.",
@ -56,11 +56,13 @@
"Text file" => "Archivo de texto",
"Folder" => "Carpeta",
"From link" => "Desde enlace",
"Trash" => "Papelera",
"Cancel upload" => "Cancelar subida",
"Nothing in here. Upload something!" => "No hay nada. ¡Subí contenido!",
"Download" => "Descargar",
"Upload too large" => "El archivo es demasiado grande",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Los archivos que intentás subir sobrepasan el tamaño máximo ",
"Files are being scanned, please wait." => "Se están escaneando los archivos, por favor esperá.",
"Current scanning" => "Escaneo actual"
"Current scanning" => "Escaneo actual",
"Upgrading filesystem cache..." => "Actualizando el cache del sistema de archivos"
);

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "Ez da fitxategirik igo",
"Missing a temporary folder" => "Aldi baterako karpeta falta da",
"Failed to write to disk" => "Errore bat izan da diskoan idazterakoan",
"Not enough space available" => "Ez dago leku nahikorik.",
"Invalid directory." => "Baliogabeko karpeta.",
"Files" => "Fitxategiak",
"Unshare" => "Ez elkarbanatu",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "هیچ فایلی بارگذاری نشده",
"Missing a temporary folder" => "یک پوشه موقت گم شده است",
"Failed to write to disk" => "نوشتن بر روی دیسک سخت ناموفق بود",
"Not enough space available" => "فضای کافی در دسترس نیست",
"Invalid directory." => "فهرست راهنما نامعتبر می باشد.",
"Files" => "فایل ها",
"Unshare" => "لغو اشتراک",

View File

@ -6,7 +6,6 @@
"No file was uploaded" => "Yhtäkään tiedostoa ei lähetetty",
"Missing a temporary folder" => "Väliaikaiskansiota ei ole olemassa",
"Failed to write to disk" => "Levylle kirjoitus epäonnistui",
"Not enough space available" => "Tilaa ei ole riittävästi",
"Invalid directory." => "Virheellinen kansio.",
"Files" => "Tiedostot",
"Unshare" => "Peru jakaminen",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "Aucun fichier n'a été téléversé",
"Missing a temporary folder" => "Il manque un répertoire temporaire",
"Failed to write to disk" => "Erreur d'écriture sur le disque",
"Not enough space available" => "Espace disponible insuffisant",
"Invalid directory." => "Dossier invalide.",
"Files" => "Fichiers",
"Unshare" => "Ne plus partager",
"Delete permanently" => "Supprimer de façon définitive",
"Delete" => "Supprimer",
"Rename" => "Renommer",
"{new_name} already exists" => "{new_name} existe déjà",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "Non se enviou ningún ficheiro",
"Missing a temporary folder" => "Falta un cartafol temporal",
"Failed to write to disk" => "Erro ao escribir no disco",
"Not enough space available" => "O espazo dispoñíbel é insuficiente",
"Invalid directory." => "O directorio é incorrecto.",
"Files" => "Ficheiros",
"Unshare" => "Deixar de compartir",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "Nem töltődött fel semmi",
"Missing a temporary folder" => "Hiányzik egy ideiglenes mappa",
"Failed to write to disk" => "Nem sikerült a lemezre történő írás",
"Not enough space available" => "Nincs elég szabad hely",
"Invalid directory." => "Érvénytelen mappa.",
"Files" => "Fájlok",
"Unshare" => "Megosztás visszavonása",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "Engin skrá skilaði sér",
"Missing a temporary folder" => "Vantar bráðabirgðamöppu",
"Failed to write to disk" => "Tókst ekki að skrifa á disk",
"Not enough space available" => "Ekki nægt pláss tiltækt",
"Invalid directory." => "Ógild mappa.",
"Files" => "Skrár",
"Unshare" => "Hætta deilingu",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "Nessun file è stato caricato",
"Missing a temporary folder" => "Cartella temporanea mancante",
"Failed to write to disk" => "Scrittura su disco non riuscita",
"Not enough space available" => "Spazio disponibile insufficiente",
"Invalid directory." => "Cartella non valida.",
"Files" => "File",
"Unshare" => "Rimuovi condivisione",
"Delete permanently" => "Elimina definitivamente",
"Delete" => "Elimina",
"Rename" => "Rinomina",
"{new_name} already exists" => "{new_name} esiste già",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "ファイルはアップロードされませんでした",
"Missing a temporary folder" => "テンポラリフォルダが見つかりません",
"Failed to write to disk" => "ディスクへの書き込みに失敗しました",
"Not enough space available" => "利用可能なスペースが十分にありません",
"Invalid directory." => "無効なディレクトリです。",
"Files" => "ファイル",
"Unshare" => "共有しない",
"Delete permanently" => "完全に削除する",
"Delete" => "削除",
"Rename" => "名前の変更",
"{new_name} already exists" => "{new_name} はすでに存在しています",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "업로드된 파일 없음",
"Missing a temporary folder" => "임시 폴더가 사라짐",
"Failed to write to disk" => "디스크에 쓰지 못했습니다",
"Not enough space available" => "여유 공간이 부족합니다",
"Invalid directory." => "올바르지 않은 디렉터리입니다.",
"Files" => "파일",
"Unshare" => "공유 해제",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "Neviena datne netika augšupielādēta",
"Missing a temporary folder" => "Trūkst pagaidu mapes",
"Failed to write to disk" => "Neizdevās saglabāt diskā",
"Not enough space available" => "Nepietiek brīvas vietas",
"Invalid directory." => "Nederīga direktorija.",
"Files" => "Datnes",
"Unshare" => "Pārtraukt dalīšanos",
"Delete permanently" => "Dzēst pavisam",
"Delete" => "Dzēst",
"Rename" => "Pārsaukt",
"{new_name} already exists" => "{new_name} jau eksistē",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "Geen bestand geüpload",
"Missing a temporary folder" => "Een tijdelijke map mist",
"Failed to write to disk" => "Schrijven naar schijf mislukt",
"Not enough space available" => "Niet genoeg ruimte beschikbaar",
"Invalid directory." => "Ongeldige directory.",
"Files" => "Bestanden",
"Unshare" => "Stop delen",
"Delete permanently" => "Verwijder definitief",
"Delete" => "Verwijder",
"Rename" => "Hernoem",
"{new_name} already exists" => "{new_name} bestaat al",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "Nie przesłano żadnego pliku",
"Missing a temporary folder" => "Brak katalogu tymczasowego",
"Failed to write to disk" => "Błąd zapisu na dysk",
"Not enough space available" => "Za mało miejsca",
"Invalid directory." => "Zła ścieżka.",
"Files" => "Pliki",
"Unshare" => "Nie udostępniaj",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "Não foi enviado nenhum ficheiro",
"Missing a temporary folder" => "Falta uma pasta temporária",
"Failed to write to disk" => "Falhou a escrita no disco",
"Not enough space available" => "Espaço em disco insuficiente!",
"Invalid directory." => "Directório Inválido",
"Files" => "Ficheiros",
"Unshare" => "Deixar de partilhar",
"Delete permanently" => "Eliminar permanentemente",
"Delete" => "Apagar",
"Rename" => "Renomear",
"{new_name} already exists" => "O nome {new_name} já existe",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "Niciun fișier încărcat",
"Missing a temporary folder" => "Lipsește un dosar temporar",
"Failed to write to disk" => "Eroare la scriere pe disc",
"Not enough space available" => "Nu este suficient spațiu disponibil",
"Invalid directory." => "Director invalid.",
"Files" => "Fișiere",
"Unshare" => "Anulează partajarea",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "Файл не был загружен",
"Missing a temporary folder" => "Невозможно найти временную папку",
"Failed to write to disk" => "Ошибка записи на диск",
"Not enough space available" => "Недостаточно свободного места",
"Invalid directory." => "Неправильный каталог.",
"Files" => "Файлы",
"Unshare" => "Отменить публикацию",
"Delete permanently" => "Удалено навсегда",
"Delete" => "Удалить",
"Rename" => "Переименовать",
"{new_name} already exists" => "{new_name} уже существует",
@ -20,9 +20,13 @@
"replaced {new_name}" => "заменено {new_name}",
"undo" => "отмена",
"replaced {new_name} with {old_name}" => "заменено {new_name} на {old_name}",
"perform delete operation" => "выполняется операция удаления",
"'.' is an invalid file name." => "'.' - неправильное имя файла.",
"File name cannot be empty." => "Имя файла не может быть пустым.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Неправильное имя, '\\', '/', '<', '>', ':', '\"', '|', '?' и '*' недопустимы.",
"Your storage is full, files can not be updated or synced anymore!" => "Ваше дисковое пространство полностью заполнено, произведите очистку перед загрузкой новых файлов.",
"Your storage is almost full ({usedSpacePercent}%)" => "Ваше хранилище почти заполнено ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Загрузка началась. Это может потребовать много времени, если файл большого размера.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Не удается загрузить файл размером 0 байт в каталог",
"Upload Error" => "Ошибка загрузки",
"Close" => "Закрыть",
@ -53,11 +57,13 @@
"Text file" => "Текстовый файл",
"Folder" => "Папка",
"From link" => "Из ссылки",
"Trash" => "Корзина",
"Cancel upload" => "Отмена загрузки",
"Nothing in here. Upload something!" => "Здесь ничего нет. Загрузите что-нибудь!",
"Download" => "Скачать",
"Upload too large" => "Файл слишком большой",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Файлы, которые Вы пытаетесь загрузить, превышают лимит для файлов на этом сервере.",
"Files are being scanned, please wait." => "Подождите, файлы сканируются.",
"Current scanning" => "Текущее сканирование"
"Current scanning" => "Текущее сканирование",
"Upgrading filesystem cache..." => "Обновление кеша файловой системы..."
);

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "Файл не был загружен",
"Missing a temporary folder" => "Отсутствует временная папка",
"Failed to write to disk" => "Не удалось записать на диск",
"Not enough space available" => "Не достаточно свободного места",
"Invalid directory." => "Неверный каталог.",
"Files" => "Файлы",
"Unshare" => "Скрыть",
"Delete permanently" => "Удалить навсегда",
"Delete" => "Удалить",
"Rename" => "Переименовать",
"{new_name} already exists" => "{новое_имя} уже существует",
@ -20,9 +20,13 @@
"replaced {new_name}" => "заменено {новое_имя}",
"undo" => "отменить действие",
"replaced {new_name} with {old_name}" => "заменено {новое_имя} с {старое_имя}",
"perform delete operation" => "выполняется процесс удаления",
"'.' is an invalid file name." => "'.' является неверным именем файла.",
"File name cannot be empty." => "Имя файла не может быть пустым.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Некорректное имя, '\\', '/', '<', '>', ':', '\"', '|', '?' и '*' не допустимы.",
"Your storage is full, files can not be updated or synced anymore!" => "Ваше хранилище переполнено, фалы больше не могут быть обновлены или синхронизированы!",
"Your storage is almost full ({usedSpacePercent}%)" => "Ваше хранилище почти полно ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Идёт подготовка к скачке Вашего файла. Это может занять некоторое время, если фалы большие.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Невозможно загрузить файл,\n так как он имеет нулевой размер или является директорией",
"Upload Error" => "Ошибка загрузки",
"Close" => "Закрыть",
@ -53,6 +57,7 @@
"Text file" => "Текстовый файл",
"Folder" => "Папка",
"From link" => "По ссылке",
"Trash" => "Корзина",
"Cancel upload" => "Отмена загрузки",
"Nothing in here. Upload something!" => "Здесь ничего нет. Загрузите что-нибудь!",
"Download" => "Загрузить",

View File

@ -7,10 +7,10 @@
"No file was uploaded" => "Žiaden súbor nebol nahraný",
"Missing a temporary folder" => "Chýbajúci dočasný priečinok",
"Failed to write to disk" => "Zápis na disk sa nepodaril",
"Not enough space available" => "Nie je k dispozícii dostatok miesta",
"Invalid directory." => "Neplatný adresár",
"Files" => "Súbory",
"Unshare" => "Nezdielať",
"Delete permanently" => "Zmazať trvalo",
"Delete" => "Odstrániť",
"Rename" => "Premenovať",
"{new_name} already exists" => "{new_name} už existuje",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "Ingen fil blev uppladdad",
"Missing a temporary folder" => "Saknar en tillfällig mapp",
"Failed to write to disk" => "Misslyckades spara till disk",
"Not enough space available" => "Inte tillräckligt med utrymme tillgängligt",
"Invalid directory." => "Felaktig mapp.",
"Files" => "Filer",
"Unshare" => "Sluta dela",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "ยังไม่มีไฟล์ที่ถูกอัพโหลด",
"Missing a temporary folder" => "แฟ้มเอกสารชั่วคราวเกิดการสูญหาย",
"Failed to write to disk" => "เขียนข้อมูลลงแผ่นดิสก์ล้มเหลว",
"Not enough space available" => "มีพื้นที่เหลือไม่เพียงพอ",
"Invalid directory." => "ไดเร็กทอรี่ไม่ถูกต้อง",
"Files" => "ไฟล์",
"Unshare" => "ยกเลิกการแชร์ข้อมูล",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "Hiç dosya yüklenmedi",
"Missing a temporary folder" => "Geçici bir klasör eksik",
"Failed to write to disk" => "Diske yazılamadı",
"Not enough space available" => "Yeterli disk alanı yok",
"Invalid directory." => "Geçersiz dizin.",
"Files" => "Dosyalar",
"Unshare" => "Paylaşılmayan",

View File

@ -7,8 +7,10 @@
"No file was uploaded" => "Не відвантажено жодного файлу",
"Missing a temporary folder" => "Відсутній тимчасовий каталог",
"Failed to write to disk" => "Невдалося записати на диск",
"Invalid directory." => "Невірний каталог.",
"Files" => "Файли",
"Unshare" => "Заборонити доступ",
"Delete permanently" => "Видалити назавжди",
"Delete" => "Видалити",
"Rename" => "Перейменувати",
"{new_name} already exists" => "{new_name} вже існує",
@ -18,7 +20,13 @@
"replaced {new_name}" => "замінено {new_name}",
"undo" => "відмінити",
"replaced {new_name} with {old_name}" => "замінено {new_name} на {old_name}",
"perform delete operation" => "виконати операцію видалення",
"'.' is an invalid file name." => "'.' це невірне ім'я файлу.",
"File name cannot be empty." => " Ім'я файлу не може бути порожнім.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Невірне ім'я, '\\', '/', '<', '>', ':', '\"', '|', '?' та '*' не дозволені.",
"Your storage is full, files can not be updated or synced anymore!" => "Ваше сховище переповнене, файли більше не можуть бути оновлені або синхронізовані !",
"Your storage is almost full ({usedSpacePercent}%)" => "Ваше сховище майже повне ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Ваше завантаження готується. Це може зайняти деякий час, якщо файли завеликі.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Неможливо завантажити ваш файл тому, що він тека або файл розміром 0 байт",
"Upload Error" => "Помилка завантаження",
"Close" => "Закрити",
@ -28,6 +36,7 @@
"Upload cancelled." => "Завантаження перервано.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Виконується завантаження файлу. Закриття цієї сторінки приведе до відміни завантаження.",
"URL cannot be empty." => "URL не може бути пустим.",
"Invalid folder name. Usage of 'Shared' is reserved by Owncloud" => "Невірне ім'я теки. Використання \"Shared\" зарезервовано Owncloud",
"Name" => "Ім'я",
"Size" => "Розмір",
"Modified" => "Змінено",
@ -48,11 +57,13 @@
"Text file" => "Текстовий файл",
"Folder" => "Папка",
"From link" => "З посилання",
"Trash" => "Смітник",
"Cancel upload" => "Перервати завантаження",
"Nothing in here. Upload something!" => "Тут нічого немає. Відвантажте що-небудь!",
"Download" => "Завантажити",
"Upload too large" => "Файл занадто великий",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Файли,що ви намагаєтесь відвантажити перевищують максимальний дозволений розмір файлів на цьому сервері.",
"Files are being scanned, please wait." => "Файли скануються, зачекайте, будь-ласка.",
"Current scanning" => "Поточне сканування"
"Current scanning" => "Поточне сканування",
"Upgrading filesystem cache..." => "Оновлення кеша файлової системи..."
);

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "文件没有上传",
"Missing a temporary folder" => "缺少临时目录",
"Failed to write to disk" => "写入磁盘失败",
"Not enough space available" => "没有足够可用空间",
"Invalid directory." => "无效文件夹。",
"Files" => "文件",
"Unshare" => "取消分享",

View File

@ -7,7 +7,6 @@
"No file was uploaded" => "無已上傳檔案",
"Missing a temporary folder" => "遺失暫存資料夾",
"Failed to write to disk" => "寫入硬碟失敗",
"Not enough space available" => "沒有足夠的可用空間",
"Invalid directory." => "無效的資料夾。",
"Files" => "檔案",
"Unshare" => "取消共享",

View File

@ -37,7 +37,7 @@
</div>
<?php if ($_['trash'] ): ?>
<div id="trash" class="button">
<a><?php echo $l->t('Trash');?></a>
<a><?php echo $l->t('Trash bin');?></a>
</div>
<?php endif; ?>
<div id="uploadprogresswrapper">

View File

@ -1,38 +0,0 @@
<?php
/**
* Copyright (c) 2012, Bjoern Schiessle <schiessle@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/
use OCA\Encryption\Keymanager;
OCP\JSON::checkAppEnabled('files_encryption');
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$mode = $_POST['mode'];
$changePasswd = false;
$passwdChanged = false;
if ( isset($_POST['newpasswd']) && isset($_POST['oldpasswd']) ) {
$oldpasswd = $_POST['oldpasswd'];
$newpasswd = $_POST['newpasswd'];
$changePasswd = true;
$passwdChanged = Keymanager::changePasswd($oldpasswd, $newpasswd);
}
$query = \OC_DB::prepare( "SELECT mode FROM *PREFIX*encryption WHERE uid = ?" );
$result = $query->execute(array(\OCP\User::getUser()));
if ($result->fetchRow()){
$query = OC_DB::prepare( 'UPDATE *PREFIX*encryption SET mode = ? WHERE uid = ?' );
} else {
$query = OC_DB::prepare( 'INSERT INTO *PREFIX*encryption ( mode, uid ) VALUES( ?, ? )' );
}
if ( (!$changePasswd || $passwdChanged) && $query->execute(array($mode, \OCP\User::getUser())) ) {
OCP\JSON::success();
} else {
OCP\JSON::error();
}

View File

@ -12,7 +12,7 @@ OC_FileProxy::register( new OCA\Encryption\Proxy() );
// User-related hooks
OCP\Util::connectHook( 'OC_User', 'post_login', 'OCA\Encryption\Hooks', 'login' );
OCP\Util::connectHook( 'OC_User', 'post_setPassword','OCA\Encryption\Hooks', 'setPassphrase' );
OCP\Util::connectHook( 'OC_User', 'pre_setPassword','OCA\Encryption\Hooks', 'setPassphrase' );
// Sharing-related hooks
OCP\Util::connectHook( 'OCP\Share', 'post_shared', 'OCA\Encryption\Hooks', 'postShared' );
@ -43,6 +43,6 @@ if (
}
// Reguster settings scripts
// Register settings scripts
OCP\App::registerAdmin( 'files_encryption', 'settings' );
OCP\App::registerPersonal( 'files_encryption', 'settings-personal' );
OCP\App::registerPersonal( 'files_encryption', 'settings-personal' );

View File

@ -38,12 +38,15 @@ class Hooks {
*/
public static function login( $params ) {
// Manually initialise Filesystem{} singleton with correct
// fake root path, in order to avoid fatal webdav errors
\OC\Files\Filesystem::init( $params['uid'] . '/' . 'files' . '/' );
$view = new \OC_FilesystemView( '/' );
$util = new Util( $view, $params['uid'] );
// Check files_encryption infrastructure is ready for action
if ( ! $util->ready() ) {
\OC_Log::write( 'Encryption library', 'User account "' . $params['uid'] . '" is not ready for encryption; configuration started', \OC_Log::DEBUG );
@ -104,14 +107,16 @@ class Hooks {
* @param array $params keys: uid, password
*/
public static function setPassphrase( $params ) {
// Only attempt to change passphrase if server-side encryption
// is in use (client-side encryption does not have access to
// the necessary keys)
if ( Crypt::mode() == 'server' ) {
$session = new Session();
// Get existing decrypted private key
$privateKey = $_SESSION['privateKey'];
$privateKey = $session->getPrivateKey();
// Encrypt private key with new user pwd as passphrase
$encryptedPrivateKey = Crypt::symmetricEncryptFileContent( $privateKey, $params['password'] );
@ -160,16 +165,6 @@ class Hooks {
* @brief
*/
public static function postShared( $params ) {
// Delete existing catfile
Keymanager::deleteFileKey( );
// Generate new catfile and env keys
Crypt::multiKeyEncrypt( $plainContent, $publicKeys );
// Save env keys to user folders
}
/**

View File

@ -1,38 +0,0 @@
/**
* Copyright (c) 2012, Bjoern Schiessle <schiessle@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/
$(document).ready(function(){
$('input[name=encryption_mode]').change(function(){
var prevmode = document.getElementById('prev_encryption_mode').value
var client=$('input[value="client"]:checked').val()
,server=$('input[value="server"]:checked').val()
,user=$('input[value="user"]:checked').val()
,none=$('input[value="none"]:checked').val()
if (client) {
$.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'client' });
if (prevmode == 'server') {
OC.dialogs.info(t('encryption', 'Please switch to your ownCloud client and change your encryption password to complete the conversion.'), t('encryption', 'switched to client side encryption'));
}
} else if (server) {
if (prevmode == 'client') {
OC.dialogs.form([{text:'Login password', name:'newpasswd', type:'password'},{text:'Encryption password used on the client', name:'oldpasswd', type:'password'}],t('encryption', 'Change encryption password to login password'), function(data) {
$.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'server', newpasswd: data[0].value, oldpasswd: data[1].value }, function(result) {
if (result.status != 'success') {
document.getElementById(prevmode+'_encryption').checked = true;
OC.dialogs.alert(t('encryption', 'Please check your passwords and try again.'), t('encryption', 'Could not change your file encryption password to your login password'))
} else {
console.log("alles super");
}
}, true);
});
} else {
$.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'server' });
}
} else {
$.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'none' });
}
})
})

View File

@ -9,38 +9,11 @@ $(document).ready(function(){
$('#encryption_blacklist').multiSelect({
oncheck:blackListChange,
onuncheck:blackListChange,
createText:'...',
createText:'...'
});
function blackListChange(){
var blackList=$('#encryption_blacklist').val().join(',');
OC.AppConfig.setValue('files_encryption','type_blacklist',blackList);
}
//TODO: Handle switch between client and server side encryption
$('input[name=encryption_mode]').change(function(){
var client=$('input[value="client"]:checked').val()
,server=$('input[value="server"]:checked').val()
,user=$('input[value="user"]:checked').val()
,none=$('input[value="none"]:checked').val()
,disable=false
if (client) {
OC.AppConfig.setValue('files_encryption','mode','client');
disable = true;
} else if (server) {
OC.AppConfig.setValue('files_encryption','mode','server');
disable = true;
} else if (user) {
OC.AppConfig.setValue('files_encryption','mode','user');
disable = true;
} else {
OC.AppConfig.setValue('files_encryption','mode','none');
}
if (disable) {
document.getElementById('server_encryption').disabled = true;
document.getElementById('client_encryption').disabled = true;
document.getElementById('user_encryption').disabled = true;
document.getElementById('none_encryption').disabled = true;
}
})
})

View File

@ -5,5 +5,8 @@
"Please check your passwords and try again." => "Comproveu les contrasenyes i proveu-ho de nou.",
"Could not change your file encryption password to your login password" => "No s'ha pogut canviar la contrasenya d'encriptació de fitxers per la d'accés",
"Encryption" => "Encriptatge",
"File encryption is enabled." => "L'encriptació de fitxers està activada.",
"The following file types will not be encrypted:" => "Els tipus de fitxers següents no s'encriptaran:",
"Exclude the following file types from encryption:" => "Exclou els tipus de fitxers següents de l'encriptatge:",
"None" => "Cap"
);

View File

@ -5,5 +5,8 @@
"Please check your passwords and try again." => "Zkontrolujte, prosím, své heslo a zkuste to znovu.",
"Could not change your file encryption password to your login password" => "Nelze změnit šifrovací heslo na přihlašovací.",
"Encryption" => "Šifrování",
"File encryption is enabled." => "Šifrování je povoleno.",
"The following file types will not be encrypted:" => "Následující typy souborů nebudou šifrovány:",
"Exclude the following file types from encryption:" => "Vyjmout následující typy souborů ze šifrování:",
"None" => "Žádné"
);

View File

@ -5,5 +5,8 @@
"Please check your passwords and try again." => "Bitte überprüfen sie Ihr Passwort und versuchen Sie es erneut.",
"Could not change your file encryption password to your login password" => "Ihr Verschlüsselungspasswort konnte nicht als Anmeldepasswort gesetzt werden.",
"Encryption" => "Verschlüsselung",
"File encryption is enabled." => "Datei-Verschlüsselung ist aktiviert",
"The following file types will not be encrypted:" => "Die folgenden Datei-Typen werden nicht verschlüsselt:",
"Exclude the following file types from encryption:" => "Die folgenden Datei-Typen von der Verschlüsselung ausnehmen:",
"None" => "Keine"
);

View File

@ -5,5 +5,8 @@
"Please check your passwords and try again." => "Por favor revise su contraseña e intentelo de nuevo.",
"Could not change your file encryption password to your login password" => "No se pudo cambiar la contraseña de cifrado de archivos de su contraseña de inicio de sesión",
"Encryption" => "Cifrado",
"File encryption is enabled." => "La encriptacion de archivo esta activada.",
"The following file types will not be encrypted:" => "Los siguientes tipos de archivo no seran encriptados:",
"Exclude the following file types from encryption:" => "Excluir los siguientes tipos de archivo de la encriptacion:",
"None" => "Ninguno"
);

View File

@ -5,5 +5,8 @@
"Please check your passwords and try again." => "Veuillez vérifier vos mots de passe et réessayer.",
"Could not change your file encryption password to your login password" => "Impossible de convertir votre mot de passe de chiffrement en mot de passe de connexion",
"Encryption" => "Chiffrement",
"File encryption is enabled." => "Le chiffrement des fichiers est activé",
"The following file types will not be encrypted:" => "Les fichiers de types suivants ne seront pas chiffrés :",
"Exclude the following file types from encryption:" => "Ne pas chiffrer les fichiers dont les types sont les suivants :",
"None" => "Aucun"
);

View File

@ -5,5 +5,8 @@
"Please check your passwords and try again." => "Controlla la password e prova ancora.",
"Could not change your file encryption password to your login password" => "Impossibile convertire la password di cifratura nella password di accesso",
"Encryption" => "Cifratura",
"File encryption is enabled." => "La cifratura dei file è abilitata.",
"The following file types will not be encrypted:" => "I seguenti tipi di file non saranno cifrati:",
"Exclude the following file types from encryption:" => "Escludi i seguenti tipi di file dalla cifratura:",
"None" => "Nessuna"
);

View File

@ -5,5 +5,8 @@
"Please check your passwords and try again." => "パスワードを確認してもう一度行なってください。",
"Could not change your file encryption password to your login password" => "ファイル暗号化パスワードをログインパスワードに変更できませんでした。",
"Encryption" => "暗号化",
"File encryption is enabled." => "ファイルの暗号化は有効です。",
"The following file types will not be encrypted:" => "次のファイルタイプは暗号化されません:",
"Exclude the following file types from encryption:" => "次のファイルタイプを暗号化から除外:",
"None" => "なし"
);

View File

@ -5,5 +5,8 @@
"Please check your passwords and try again." => "Lūdzu, pārbaudiet savas paroles un mēģiniet vēlreiz.",
"Could not change your file encryption password to your login password" => "Nevarēja mainīt datņu šifrēšanas paroli uz ierakstīšanās paroli",
"Encryption" => "Šifrēšana",
"File encryption is enabled." => "Datņu šifrēšana ir aktivēta.",
"The following file types will not be encrypted:" => "Sekojošās datnes netiks šifrētas:",
"Exclude the following file types from encryption:" => "Sekojošos datņu tipus izslēgt no šifrēšanas:",
"None" => "Nav"
);

View File

@ -1,8 +1,12 @@
<?php $TRANSLATIONS = array(
"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "Schakel om naar uw eigen ownCloud client en wijzig uw versleutelwachtwoord om de conversie af te ronden.",
"switched to client side encryption" => "overgeschakeld naar client side encryptie",
"Change encryption password to login password" => "Verander encryptie wachtwoord naar login wachtwoord",
"Please check your passwords and try again." => "Controleer uw wachtwoorden en probeer het opnieuw.",
"Could not change your file encryption password to your login password" => "Kon het bestandsencryptie wachtwoord niet veranderen naar het login wachtwoord",
"Encryption" => "Versleuteling",
"File encryption is enabled." => "Bestandsversleuteling geactiveerd.",
"The following file types will not be encrypted:" => "De volgende bestandstypen zullen niet worden versleuteld:",
"Exclude the following file types from encryption:" => "Sluit de volgende bestandstypen uit van versleuteling:",
"None" => "Geen"
);

View File

@ -1,4 +1,12 @@
<?php $TRANSLATIONS = array(
"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "Пожалуйста переключитесь на Ваш клиент ownCloud и поменяйте пароль шиврования для завершения преобразования.",
"switched to client side encryption" => "переключён на шифрование со стороны клиента",
"Change encryption password to login password" => "Изменить пароль шифрования для пароля входа",
"Please check your passwords and try again." => "Пожалуйста проверьте пароли и попробуйте снова.",
"Could not change your file encryption password to your login password" => "Невозможно изменить Ваш пароль файла шифрования для пароля входа",
"Encryption" => "Шифрование",
"File encryption is enabled." => "Шифрование файла включено.",
"The following file types will not be encrypted:" => "Следующие типы файлов не будут зашифрованы:",
"Exclude the following file types from encryption:" => "Исключить следующие типы файлов из шифрованных:",
"None" => "Ничего"
);

View File

@ -5,5 +5,8 @@
"Please check your passwords and try again." => "Skontrolujte si heslo a skúste to znovu.",
"Could not change your file encryption password to your login password" => "Nie je možné zmeniť šifrovacie heslo na prihlasovacie",
"Encryption" => "Šifrovanie",
"File encryption is enabled." => "Kryptovanie súborov nastavené.",
"The following file types will not be encrypted:" => "Uvedené typy súborov nebudú kryptované:",
"Exclude the following file types from encryption:" => "Nekryptovať uvedené typy súborov",
"None" => "Žiadne"
);

View File

@ -5,5 +5,8 @@
"Please check your passwords and try again." => "Kontrollera dina lösenord och försök igen.",
"Could not change your file encryption password to your login password" => "Kunde inte ändra ditt filkrypteringslösenord till ditt loginlösenord",
"Encryption" => "Kryptering",
"File encryption is enabled." => "Filkryptering är aktiverat.",
"The following file types will not be encrypted:" => "Följande filtyper kommer inte att krypteras:",
"Exclude the following file types from encryption:" => "Exkludera följande filtyper från kryptering:",
"None" => "Ingen"
);

File diff suppressed because it is too large Load Diff

View File

@ -1,325 +1,323 @@
<?php
/**
* ownCloud
*
* @author Bjoern Schiessle
* @copyright 2012 Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Encryption;
/**
* @brief Class to manage storage and retrieval of encryption keys
* @note Where a method requires a view object, it's root must be '/'
*/
class Keymanager {
/**
* @brief retrieve the ENCRYPTED private key from a user
*
* @return string private key or false
* @note the key returned by this method must be decrypted before use
*/
public static function getPrivateKey( \OC_FilesystemView $view, $user ) {
$path = '/' . $user . '/' . 'files_encryption' . '/' . $user.'.private.key';
$key = $view->file_get_contents( $path );
return $key;
}
/**
* @brief retrieve public key for a specified user
* @return string public key or false
*/
public static function getPublicKey( \OC_FilesystemView $view, $userId ) {
return $view->file_get_contents( '/public-keys/' . '/' . $userId . '.public.key' );
}
/**
* @brief retrieve both keys from a user (private and public)
* @return array keys: privateKey, publicKey
*/
public static function getUserKeys( \OC_FilesystemView $view, $userId ) {
return array(
'publicKey' => self::getPublicKey( $view, $userId )
, 'privateKey' => self::getPrivateKey( $view, $userId )
);
}
/**
* @brief Retrieve public keys of all users with access to a file
* @param string $path Path to file
* @return array of public keys for the given file
* @note Checks that the sharing app is enabled should be performed
* by client code, that isn't checked here
*/
public static function getPublicKeys( \OC_FilesystemView $view, $userId, $filePath ) {
$path = ltrim( $path, '/' );
$filepath = '/' . $userId . '/files/' . $filePath;
// Check if sharing is enabled
if ( OC_App::isEnabled( 'files_sharing' ) ) {
} else {
// check if it is a file owned by the user and not shared at all
$userview = new \OC_FilesystemView( '/'.$userId.'/files/' );
if ( $userview->file_exists( $path ) ) {
$users[] = $userId;
}
}
$view = new \OC_FilesystemView( '/public-keys/' );
$keylist = array();
$count = 0;
foreach ( $users as $user ) {
$keylist['key'.++$count] = $view->file_get_contents( $user.'.public.key' );
}
return $keylist;
}
/**
* @brief store file encryption key
*
* @param string $path relative path of the file, including filename
* @param string $key
* @return bool true/false
* @note The keyfile is not encrypted here. Client code must
* asymmetrically encrypt the keyfile before passing it to this method
*/
public static function setFileKey( \OC_FilesystemView $view, $path, $userId, $catfile ) {
$basePath = '/' . $userId . '/files_encryption/keyfiles';
$targetPath = self::keySetPreparation( $view, $path, $basePath, $userId );
if ( $view->is_dir( $basePath . '/' . $targetPath ) ) {
} else {
// Save the keyfile in parallel directory
return $view->file_put_contents( $basePath . '/' . $targetPath . '.key', $catfile );
}
}
/**
* @brief retrieve keyfile for an encrypted file
* @param string file name
* @return string file key or false on failure
* @note The keyfile returned is asymmetrically encrypted. Decryption
* of the keyfile must be performed by client code
*/
public static function getFileKey( \OC_FilesystemView $view, $userId, $filePath ) {
$filePath_f = ltrim( $filePath, '/' );
$catfilePath = '/' . $userId . '/files_encryption/keyfiles/' . $filePath_f . '.key';
if ( $view->file_exists( $catfilePath ) ) {
return $view->file_get_contents( $catfilePath );
} else {
return false;
}
}
/**
* @brief Delete a keyfile
*
* @param OC_FilesystemView $view
* @param string $userId username
* @param string $path path of the file the key belongs to
* @return bool Outcome of unlink operation
* @note $path must be relative to data/user/files. e.g. mydoc.txt NOT
* /data/admin/files/mydoc.txt
*/
public static function deleteFileKey( \OC_FilesystemView $view, $userId, $path ) {
$trimmed = ltrim( $path, '/' );
$keyPath = '/' . $userId . '/files_encryption/keyfiles/' . $trimmed . '.key';
// Unlink doesn't tell us if file was deleted (not found returns
// true), so we perform our own test
if ( $view->file_exists( $keyPath ) ) {
return $view->unlink( $keyPath );
} else {
\OC_Log::write( 'Encryption library', 'Could not delete keyfile; does not exist: "' . $keyPath, \OC_Log::ERROR );
return false;
}
}
/**
* @brief store private key from the user
* @param string key
* @return bool
* @note Encryption of the private key must be performed by client code
* as no encryption takes place here
*/
public static function setPrivateKey( $key ) {
$user = \OCP\User::getUser();
$view = new \OC_FilesystemView( '/' . $user . '/files_encryption' );
\OC_FileProxy::$enabled = false;
if ( !$view->file_exists( '' ) ) $view->mkdir( '' );
return $view->file_put_contents( $user . '.private.key', $key );
\OC_FileProxy::$enabled = true;
}
/**
* @brief store private keys from the user
*
* @param string privatekey
* @param string publickey
* @return bool true/false
*/
public static function setUserKeys($privatekey, $publickey) {
return ( self::setPrivateKey( $privatekey ) && self::setPublicKey( $publickey ) );
}
/**
* @brief store public key of the user
*
* @param string key
* @return bool true/false
*/
public static function setPublicKey( $key ) {
$view = new \OC_FilesystemView( '/public-keys' );
\OC_FileProxy::$enabled = false;
if ( !$view->file_exists( '' ) ) $view->mkdir( '' );
return $view->file_put_contents( \OCP\User::getUser() . '.public.key', $key );
\OC_FileProxy::$enabled = true;
}
/**
* @note 'shareKey' is a more user-friendly name for env_key
*/
public static function setShareKey( \OC_FilesystemView $view, $path, $userId, $shareKey ) {
$basePath = '/' . $userId . '/files_encryption/share-keys';
$shareKeyPath = self::keySetPreparation( $view, $path, $basePath, $userId );
return $view->file_put_contents( $basePath . '/' . $shareKeyPath . '.shareKey', $shareKey );
}
/**
* @brief Make preparations to vars and filesystem for saving a keyfile
*/
public static function keySetPreparation( \OC_FilesystemView $view, $path, $basePath, $userId ) {
$targetPath = ltrim( $path, '/' );
$path_parts = pathinfo( $targetPath );
// If the file resides within a subdirectory, create it
if (
isset( $path_parts['dirname'] )
&& ! $view->file_exists( $basePath . '/' . $path_parts['dirname'] )
) {
$view->mkdir( $basePath . '/' . $path_parts['dirname'] );
}
return $targetPath;
}
/**
* @brief change password of private encryption key
*
* @param string $oldpasswd old password
* @param string $newpasswd new password
* @return bool true/false
*/
public static function changePasswd($oldpasswd, $newpasswd) {
if ( \OCP\User::checkPassword(\OCP\User::getUser(), $newpasswd) ) {
return Crypt::changekeypasscode($oldpasswd, $newpasswd);
}
return false;
}
/**
* @brief Fetch the legacy encryption key from user files
* @param string $login used to locate the legacy key
* @param string $passphrase used to decrypt the legacy key
* @return true / false
*
* if the key is left out, the default handeler will be used
*/
public function getLegacyKey() {
$user = \OCP\User::getUser();
$view = new \OC_FilesystemView( '/' . $user );
return $view->file_get_contents( 'encryption.key' );
}
<?php
/**
* ownCloud
*
* @author Bjoern Schiessle
* @copyright 2012 Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Encryption;
/**
* @brief Class to manage storage and retrieval of encryption keys
* @note Where a method requires a view object, it's root must be '/'
*/
class Keymanager {
/**
* @brief retrieve the ENCRYPTED private key from a user
*
* @return string private key or false
* @note the key returned by this method must be decrypted before use
*/
public static function getPrivateKey( \OC_FilesystemView $view, $user ) {
$path = '/' . $user . '/' . 'files_encryption' . '/' . $user.'.private.key';
$key = $view->file_get_contents( $path );
return $key;
}
/**
* @brief retrieve public key for a specified user
* @param \OC_FilesystemView $view
* @param $userId
* @return string public key or false
*/
public static function getPublicKey( \OC_FilesystemView $view, $userId ) {
return $view->file_get_contents( '/public-keys/' . '/' . $userId . '.public.key' );
}
/**
* @brief retrieve both keys from a user (private and public)
* @param \OC_FilesystemView $view
* @param $userId
* @return array keys: privateKey, publicKey
*/
public static function getUserKeys( \OC_FilesystemView $view, $userId ) {
return array(
'publicKey' => self::getPublicKey( $view, $userId )
, 'privateKey' => self::getPrivateKey( $view, $userId )
);
}
/**
* @brief Retrieve public keys of all users with access to a file
* @param string $path Path to file
* @return array of public keys for the given file
* @note Checks that the sharing app is enabled should be performed
* by client code, that isn't checked here
*/
public static function getPublicKeys( \OC_FilesystemView $view, $userId, $filePath ) {
$path = ltrim( $path, '/' );
$filepath = '/' . $userId . '/files/' . $filePath;
// Check if sharing is enabled
if ( OC_App::isEnabled( 'files_sharing' ) ) {
} else {
// check if it is a file owned by the user and not shared at all
$userview = new \OC_FilesystemView( '/'.$userId.'/files/' );
if ( $userview->file_exists( $path ) ) {
$users[] = $userId;
}
}
$view = new \OC_FilesystemView( '/public-keys/' );
$keylist = array();
$count = 0;
foreach ( $users as $user ) {
$keylist['key'.++$count] = $view->file_get_contents( $user.'.public.key' );
}
return $keylist;
}
/**
* @brief store file encryption key
*
* @param string $path relative path of the file, including filename
* @param string $key
* @return bool true/false
* @note The keyfile is not encrypted here. Client code must
* asymmetrically encrypt the keyfile before passing it to this method
*/
public static function setFileKey( \OC_FilesystemView $view, $path, $userId, $catfile ) {
$basePath = '/' . $userId . '/files_encryption/keyfiles';
$targetPath = self::keySetPreparation( $view, $path, $basePath, $userId );
if ( $view->is_dir( $basePath . '/' . $targetPath ) ) {
} else {
// Save the keyfile in parallel directory
return $view->file_put_contents( $basePath . '/' . $targetPath . '.key', $catfile );
}
}
/**
* @brief retrieve keyfile for an encrypted file
* @param \OC_FilesystemView $view
* @param $userId
* @param $filePath
* @internal param \OCA\Encryption\file $string name
* @return string file key or false
* @note The keyfile returned is asymmetrically encrypted. Decryption
* of the keyfile must be performed by client code
*/
public static function getFileKey( \OC_FilesystemView $view, $userId, $filePath ) {
$filePath_f = ltrim( $filePath, '/' );
$catfilePath = '/' . $userId . '/files_encryption/keyfiles/' . $filePath_f . '.key';
if ( $view->file_exists( $catfilePath ) ) {
return $view->file_get_contents( $catfilePath );
} else {
return false;
}
}
/**
* @brief Delete a keyfile
*
* @param OC_FilesystemView $view
* @param string $userId username
* @param string $path path of the file the key belongs to
* @return bool Outcome of unlink operation
* @note $path must be relative to data/user/files. e.g. mydoc.txt NOT
* /data/admin/files/mydoc.txt
*/
public static function deleteFileKey( \OC_FilesystemView $view, $userId, $path ) {
$trimmed = ltrim( $path, '/' );
$keyPath = '/' . $userId . '/files_encryption/keyfiles/' . $trimmed . '.key';
// Unlink doesn't tell us if file was deleted (not found returns
// true), so we perform our own test
if ( $view->file_exists( $keyPath ) ) {
return $view->unlink( $keyPath );
} else {
\OC_Log::write( 'Encryption library', 'Could not delete keyfile; does not exist: "' . $keyPath, \OC_Log::ERROR );
return false;
}
}
/**
* @brief store private key from the user
* @param string key
* @return bool
* @note Encryption of the private key must be performed by client code
* as no encryption takes place here
*/
public static function setPrivateKey( $key ) {
$user = \OCP\User::getUser();
$view = new \OC_FilesystemView( '/' . $user . '/files_encryption' );
\OC_FileProxy::$enabled = false;
if ( !$view->file_exists( '' ) )
$view->mkdir( '' );
return $view->file_put_contents( $user . '.private.key', $key );
}
/**
* @brief store private keys from the user
*
* @param string privatekey
* @param string publickey
* @return bool true/false
*/
public static function setUserKeys($privatekey, $publickey) {
return ( self::setPrivateKey( $privatekey ) && self::setPublicKey( $publickey ) );
}
/**
* @brief store public key of the user
*
* @param string key
* @return bool true/false
*/
public static function setPublicKey( $key ) {
$view = new \OC_FilesystemView( '/public-keys' );
\OC_FileProxy::$enabled = false;
if ( !$view->file_exists( '' ) )
$view->mkdir( '' );
return $view->file_put_contents( \OCP\User::getUser() . '.public.key', $key );
}
/**
* @brief store file encryption key
*
* @param string $path relative path of the file, including filename
* @param string $key
* @param null $view
* @param string $dbClassName
* @return bool true/false
* @note The keyfile is not encrypted here. Client code must
* asymmetrically encrypt the keyfile before passing it to this method
*/
public static function setShareKey( \OC_FilesystemView $view, $path, $userId, $shareKey ) {
$basePath = '/' . $userId . '/files_encryption/share-keys';
$shareKeyPath = self::keySetPreparation( $view, $path, $basePath, $userId );
return $view->file_put_contents( $basePath . '/' . $shareKeyPath . '.shareKey', $shareKey );
}
/**
* @brief Make preparations to vars and filesystem for saving a keyfile
*/
public static function keySetPreparation( \OC_FilesystemView $view, $path, $basePath, $userId ) {
$targetPath = ltrim( $path, '/' );
$path_parts = pathinfo( $targetPath );
// If the file resides within a subdirectory, create it
if (
isset( $path_parts['dirname'] )
&& ! $view->file_exists( $basePath . '/' . $path_parts['dirname'] )
) {
$view->mkdir( $basePath . '/' . $path_parts['dirname'] );
}
return $targetPath;
}
/**
* @brief Fetch the legacy encryption key from user files
* @param string $login used to locate the legacy key
* @param string $passphrase used to decrypt the legacy key
* @return true / false
*
* if the key is left out, the default handler will be used
*/
public function getLegacyKey() {
$user = \OCP\User::getUser();
$view = new \OC_FilesystemView( '/' . $user );
return $view->file_get_contents( 'encryption.key' );
}
}

View File

@ -173,7 +173,7 @@ class Stream {
// $count will always be 8192 https://bugs.php.net/bug.php?id=21641
// This makes this function a lot simpler, but will break this class if the above 'bug' gets 'fixed'
\OCP\Util::writeLog( 'files_encryption', 'PHP "bug" 21641 no longer holds, decryption system requires refactoring', OCP\Util::FATAL );
\OCP\Util::writeLog( 'files_encryption', 'PHP "bug" 21641 no longer holds, decryption system requires refactoring', \OCP\Util::FATAL );
die();
@ -209,7 +209,7 @@ class Stream {
}
/**
* @brief Encrypt and pad data ready for writting to disk
* @brief Encrypt and pad data ready for writing to disk
* @param string $plainData data to be encrypted
* @param string $key key to use for encryption
* @return encrypted data on success, false on failure
@ -403,7 +403,7 @@ class Stream {
$encrypted = $this->preWriteEncrypt( $chunk, $this->keyfile );
// Write the data chunk to disk. This will be
// addended to the last data chunk if the file
// attended to the last data chunk if the file
// being handled totals more than 6126 bytes
fwrite( $this->handle, $encrypted );

View File

@ -69,11 +69,6 @@ class Util {
//// DONE: add method to fetch legacy key
//// DONE: add method to decrypt legacy encrypted data
//// TODO: add method to encrypt all user files using new system
//// TODO: add method to decrypt all user files using new system
//// TODO: add method to encrypt all user files using old system
//// TODO: add method to decrypt all user files using old system
// Admin UI:
@ -93,7 +88,6 @@ class Util {
// Integration testing:
//// TODO: test new encryption with webdav
//// TODO: test new encryption with versioning
//// TODO: test new encryption with sharing
//// TODO: test new encryption with proxies
@ -278,7 +272,7 @@ class Util {
// will eat server resources :(
if (
Keymanager::getFileKey( $this->view, $this->userId, $file )
&& Crypt::isCatfile( $filePath )
&& Crypt::isCatfile( $data )
) {
$found['encrypted'][] = array( 'name' => $file, 'path' => $filePath );
@ -391,7 +385,6 @@ class Util {
}
// FIXME: Legacy recrypting here isn't finished yet
// Encrypt legacy encrypted files
if (
! empty( $legacyPassphrase )
@ -437,6 +430,11 @@ class Util {
}
/**
* @brief Return important encryption related paths
* @param string $pathName Name of the directory to return the path of
* @return string path
*/
public function getPath( $pathName ) {
switch ( $pathName ) {

View File

@ -12,8 +12,6 @@ $blackList = explode( ',', \OCP\Config::getAppValue( 'files_encryption', 'type_b
$tmpl->assign( 'blacklist', $blackList );
OCP\Util::addscript('files_encryption','settings-personal');
return $tmpl->fetchPage();
return null;

View File

@ -16,7 +16,7 @@
<?php echo $type; ?>
</li>
<?php endforeach; ?>
</p>
</ul>
<?php endif; ?>
</fieldset>
</form>

View File

@ -1,4 +1,5 @@
<?php $TRANSLATIONS = array(
"Password" => "Лозинка",
"Submit" => "Пошаљи"
"Submit" => "Пошаљи",
"Download" => "Преузми"
);

View File

@ -0,0 +1,24 @@
<?php
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$file = $_REQUEST['file'];
$path_parts = pathinfo($file);
if ($path_parts['dirname'] == '.') {
$delimiter = strrpos($file, '.d');
$filename = substr($file, 0, $delimiter);
$timestamp = substr($file, $delimiter+2);
} else {
$filename = $file;
$timestamp = null;
}
if (OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp)) {
OCP\JSON::success(array("data" => array("filename" => $file)));
} else {
$l = OC_L10N::get('files_trashbin');
OCP\JSON::error(array("data" => array("message" => $l->t("Couldn't delete %s permanently", array($file)))));
}

View File

@ -22,7 +22,7 @@ foreach ($list as $file) {
$timestamp = null;
}
if ( !OCA_Trash\Trashbin::restore($file, $filename, $timestamp) ) {
if ( !OCA\Files_Trashbin\Trashbin::restore($file, $filename, $timestamp) ) {
$error[] = $filename;
} else {
$success[$i]['filename'] = $file;
@ -37,8 +37,10 @@ if ( $error ) {
foreach ( $error as $e ) {
$filelist .= $e.', ';
}
OCP\JSON::error(array("data" => array("message" => "Couldn't restore ".rtrim($filelist,', '), "success" => $success, "error" => $error)));
$l = OC_L10N::get('files_trashbin');
$message = $l->t("Couldn't restore %s", array(rtrim($filelist,', ')));
OCP\JSON::error(array("data" => array("message" => $message,
"success" => $success, "error" => $error)));
} else {
OCP\JSON::success(array("data" => array("success" => $success)));
}

View File

@ -1,7 +1,7 @@
<?php
OC::$CLASSPATH['OCA_Trash\Hooks'] = 'apps/files_trashbin/lib/hooks.php';
OC::$CLASSPATH['OCA_Trash\Trashbin'] = 'apps/files_trashbin/lib/trash.php';
OC::$CLASSPATH['OCA\Files_Trashbin\Hooks'] = 'apps/files_trashbin/lib/hooks.php';
OC::$CLASSPATH['OCA\Files_Trashbin\Trashbin'] = 'apps/files_trashbin/lib/trash.php';
OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA_Trash\Hooks", "remove_hook");
OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Files_Trashbin\Hooks", "remove_hook");

View File

@ -1,3 +1,4 @@
/* disable download and sharing actions */
var disableDownloadActions = true;
var disableSharing = true;
var trashBinApp = true;

View File

@ -22,6 +22,31 @@ $(document).ready(function() {
});
};
FileActions.register('all', 'Delete', OC.PERMISSION_READ, function () {
return OC.imagePath('core', 'actions/delete');
}, function (filename) {
$('.tipsy').remove();
var tr=$('tr').filterAttr('data-file', filename);
var deleteAction = $('tr').filterAttr('data-file',filename).children("td.date").children(".action.delete");
var oldHTML = deleteAction[0].outerHTML;
var newHTML = '<img class="move2trash" data-action="Delete" title="'+t('files', 'delete file permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>';
deleteAction[0].outerHTML = newHTML;
$.post(OC.filePath('files_trashbin','ajax','delete.php'),
{file:tr.attr('data-file') },
function(result){
if ( result.status == 'success' ) {
var row = document.getElementById(result.data.filename);
row.parentNode.removeChild(row);
} else {
deleteAction[0].outerHTML = oldHTML;
OC.dialogs.alert(result.data.message, 'Error');
}
});
});
// Sets the select_all checkbox behaviour :
$('#select_all').click(function() {
if($(this).attr('checked')){

View File

@ -1,5 +1,8 @@
<?php $TRANSLATIONS = array(
"Couldn't delete %s permanently" => "No s'ha pogut esborrar permanentment %s",
"Couldn't restore %s" => "No s'ha pogut restaurar %s",
"perform restore operation" => "executa l'operació de restauració",
"delete file permanently" => "esborra el fitxer permanentment",
"Name" => "Nom",
"Deleted" => "Eliminat",
"1 folder" => "1 carpeta",

View File

@ -1,5 +1,8 @@
<?php $TRANSLATIONS = array(
"Couldn't delete %s permanently" => "Nelze trvale odstranit %s",
"Couldn't restore %s" => "Nelze obnovit %s",
"perform restore operation" => "provést obnovu",
"delete file permanently" => "trvale odstranit soubor",
"Name" => "Název",
"Deleted" => "Smazáno",
"1 folder" => "1 složka",

View File

@ -1,5 +1,6 @@
<?php $TRANSLATIONS = array(
"perform restore operation" => "Führe die Wiederherstellung aus",
"delete file permanently" => "Datei entgültig löschen",
"Name" => "Name",
"Deleted" => "Gelöscht",
"1 folder" => "1 Ordner",

View File

@ -1,5 +1,8 @@
<?php $TRANSLATIONS = array(
"Couldn't delete %s permanently" => "No se puede eliminar %s permanentemente",
"Couldn't restore %s" => "No se puede restaurar %s",
"perform restore operation" => "Restaurar",
"delete file permanently" => "Eliminar archivo permanentemente",
"Name" => "Nombre",
"Deleted" => "Eliminado",
"1 folder" => "1 carpeta",

View File

@ -1,5 +1,8 @@
<?php $TRANSLATIONS = array(
"Couldn't delete %s permanently" => "Impossible d'effacer %s de façon permanente",
"Couldn't restore %s" => "Impossible de restaurer %s",
"perform restore operation" => "effectuer l'opération de restauration",
"delete file permanently" => "effacer définitivement le fichier",
"Name" => "Nom",
"Deleted" => "Effacé",
"1 folder" => "1 dossier",

View File

@ -1,5 +1,8 @@
<?php $TRANSLATIONS = array(
"Couldn't delete %s permanently" => "Impossibile eliminare %s definitivamente",
"Couldn't restore %s" => "Impossibile ripristinare %s",
"perform restore operation" => "esegui operazione di ripristino",
"delete file permanently" => "elimina il file definitivamente",
"Name" => "Nome",
"Deleted" => "Eliminati",
"1 folder" => "1 cartella",

View File

@ -1,5 +1,8 @@
<?php $TRANSLATIONS = array(
"Couldn't delete %s permanently" => "%s を完全に削除出来ませんでした",
"Couldn't restore %s" => "%s を復元出来ませんでした",
"perform restore operation" => "復元操作を実行する",
"delete file permanently" => "ファイルを完全に削除する",
"Name" => "名前",
"Deleted" => "削除済み",
"1 folder" => "1 フォルダ",

View File

@ -1,5 +1,8 @@
<?php $TRANSLATIONS = array(
"Couldn't delete %s permanently" => "Nevarēja pilnībā izdzēst %s",
"Couldn't restore %s" => "Nevarēja atjaunot %s",
"perform restore operation" => "veikt atjaunošanu",
"delete file permanently" => "dzēst datni pavisam",
"Name" => "Nosaukums",
"Deleted" => "Dzēsts",
"1 folder" => "1 mape",

View File

@ -1,5 +1,6 @@
<?php $TRANSLATIONS = array(
"perform restore operation" => "uitvoeren restore operatie",
"delete file permanently" => "verwijder bestanden definitief",
"Name" => "Naam",
"Deleted" => "Verwijderd",
"1 folder" => "1 map",

View File

@ -1,7 +1,14 @@
<?php $TRANSLATIONS = array(
"Couldn't delete %s permanently" => "%s не может быть удалён навсегда",
"Couldn't restore %s" => "%s не может быть восстановлен",
"perform restore operation" => "выполнить операцию восстановления",
"delete file permanently" => "удалить файл навсегда",
"Name" => "Имя",
"Deleted" => "Удалён",
"1 folder" => "1 папка",
"{count} folders" => "{count} папок",
"1 file" => "1 файл",
"{count} files" => "{count} файлов"
"{count} files" => "{count} файлов",
"Nothing in here. Your trash bin is empty!" => "Здесь ничего нет. Ваша корзина пуста!",
"Restore" => "Восстановить"
);

View File

@ -3,5 +3,6 @@
"1 folder" => "1 папка",
"{count} folders" => "{количество} папок",
"1 file" => "1 файл",
"{count} files" => "{количество} файлов"
"{count} files" => "{количество} файлов",
"Restore" => "Восстановить"
);

View File

@ -1,5 +1,7 @@
<?php $TRANSLATIONS = array(
"Couldn't restore %s" => "Nemožno obnoviť %s",
"perform restore operation" => "vykonať obnovu",
"delete file permanently" => "trvalo zmazať súbor",
"Name" => "Meno",
"Deleted" => "Zmazané",
"1 folder" => "1 priečinok",

View File

@ -1,4 +1,5 @@
<?php $TRANSLATIONS = array(
"perform restore operation" => "utför återställning",
"Name" => "Namn",
"Deleted" => "Raderad",
"1 folder" => "1 mapp",

View File

@ -24,7 +24,7 @@
* This class contains all hooks.
*/
namespace OCA_Trash;
namespace OCA\Files_Trashbin;
class Hooks {

View File

@ -20,7 +20,7 @@
*
*/
namespace OCA_Trash;
namespace OCA\Files_Trashbin;
class Trashbin {
@ -65,7 +65,7 @@ class Trashbin {
if ( \OCP\App::isEnabled('files_versions') ) {
if ( $view->is_dir('files_versions'.$file_path) ) {
$view->rename('files_versions'.$file_path, 'versions_trashbin/'. $deleted.'.d'.$timestamp);
} else if ( $versions = \OCA_Versions\Storage::getVersions($file_path) ) {
} else if ( $versions = \OCA\Files_Versions\Storage::getVersions($file_path) ) {
foreach ($versions as $v) {
$view->rename('files_versions'.$v['path'].'.v'.$v['version'], 'versions_trashbin/'. $deleted.'.v'.$v['version'].'.d'.$timestamp);
}
@ -150,6 +150,45 @@ class Trashbin {
return false;
}
/**
* delete file from trash bin permanently
* @param $filename path to the file
* @param $timestamp of deletion time
* @return true/false
*/
public static function delete($filename, $timestamp=null) {
$user = \OCP\User::getUser();
$view = new \OC_FilesystemView('/'.$user);
if ( $timestamp ) {
$query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?');
$query->execute(array($user,$filename,$timestamp));
$file = $filename.'.d'.$timestamp;
} else {
$file = $filename;
}
if ( \OCP\App::isEnabled('files_versions') ) {
if ($view->is_dir('versions_trashbin/'.$file)) {
$view->unlink('versions_trashbin/'.$file);
} else if ( $versions = self::getVersionsFromTrash($file, $timestamp) ) {
foreach ($versions as $v) {
if ($timestamp ) {
$view->unlink('versions_trashbin/'.$filename.'.v'.$v.'.d'.$timestamp);
} else {
$view->unlink('versions_trashbin/'.$file.'.v'.$v);
}
}
}
}
$view->unlink('/files_trashbin/'.$file);
return true;
}
/**
* clean up the trash bin
*/

View File

@ -9,7 +9,7 @@
<div id="emptyfolder"><?php echo $l->t('Nothing in here. Your trash bin is empty!')?></div>
<?php endif; ?>
<table>
<table class="hascontrols">
<thead>
<tr>
<th id='headerName'>

View File

@ -11,6 +11,7 @@ $revision=(int)$_GET['revision'];
if(OCA\Files_Versions\Storage::rollback( $file, $revision )) {
OCP\JSON::success(array("data" => array( "revision" => $revision, "file" => $file )));
}else{
OCP\JSON::error(array("data" => array( "message" => "Could not revert:" . $file )));
$l = OC_L10N::get('files_versions');
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) ))));
}

View File

@ -24,6 +24,7 @@
OCP\User::checkLoggedIn( );
OCP\Util::addStyle('files_versions', 'versions');
$tmpl = new OCP\Template( 'files_versions', 'history', 'user' );
$l = OC_L10N::get('files_versions');
if ( isset( $_GET['path'] ) ) {
@ -36,15 +37,21 @@ if ( isset( $_GET['path'] ) ) {
if( $versions->rollback( $path, $_GET['revert'] ) ) {
$tmpl->assign( 'outcome_stat', 'success' );
$tmpl->assign( 'outcome_stat', $l->t('success') );
$tmpl->assign( 'outcome_msg', "File {$_GET['path']} was reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) );
$message = $l->t('File %s was reverted to version %s',
array($_GET['path'], OCP\Util::formatDate( doubleval($_GET['revert']) ) ) );
$tmpl->assign( 'outcome_msg', $message);
} else {
$tmpl->assign( 'outcome_stat', 'failure' );
$tmpl->assign( 'outcome_stat', $l->t('failure') );
$tmpl->assign( 'outcome_msg', "File {$_GET['path']} could not be reverted to version ".OCP\Util::formatDate( doubleval($_GET['revert']) ) );
$message = $l->t('File %s could not be reverted to version %s',
array($_GET['path'], OCP\Util::formatDate( doubleval($_GET['revert']) ) ) );
$tmpl->assign( 'outcome_msg', $message);
}
@ -58,12 +65,12 @@ if ( isset( $_GET['path'] ) ) {
}else{
$tmpl->assign( 'message', 'No old versions available' );
$tmpl->assign( 'message', $l->t('No old versions available') );
}
}else{
$tmpl->assign( 'message', 'No path specified' );
$tmpl->assign( 'message', $l->t('No path specified') );
}

View File

@ -1,5 +1,13 @@
<?php $TRANSLATIONS = array(
"Could not revert: %s" => "No s'ha pogut revertir: %s",
"success" => "èxit",
"File %s was reverted to version %s" => "El fitxer %s s'ha revertit a la versió %s",
"failure" => "fallada",
"File %s could not be reverted to version %s" => "El fitxer %s no s'ha pogut revertir a la versió %s",
"No old versions available" => "No hi ha versións antigues disponibles",
"No path specified" => "No heu especificat el camí",
"History" => "Historial",
"Revert a file to a previous version by clicking on its revert button" => "Reverteix un fitxer a una versió anterior fent clic en el seu botó de reverteix",
"Files Versioning" => "Fitxers de Versions",
"Enable" => "Habilita"
);

View File

@ -1,5 +1,13 @@
<?php $TRANSLATIONS = array(
"Could not revert: %s" => "Nelze navrátit: %s",
"success" => "úspěch",
"File %s was reverted to version %s" => "Soubor %s byl navrácen na verzi %s",
"failure" => "sehlhání",
"File %s could not be reverted to version %s" => "Soubor %s nemohl být navrácen na verzi %s",
"No old versions available" => "Nejsou dostupné žádné starší verze",
"No path specified" => "Nezadána cesta",
"History" => "Historie",
"Revert a file to a previous version by clicking on its revert button" => "Navraťte soubor do předchozí verze kliknutím na tlačítko navrátit",
"Files Versioning" => "Verzování souborů",
"Enable" => "Povolit"
);

View File

@ -1,4 +1,8 @@
<?php $TRANSLATIONS = array(
"success" => "Erfolgreich",
"failure" => "Fehlgeschlagen",
"No old versions available" => "keine älteren Versionen verfügbar",
"No path specified" => "Kein Pfad angegeben",
"History" => "Historie",
"Files Versioning" => "Dateiversionierung",
"Enable" => "Aktivieren"

View File

@ -1,5 +1,13 @@
<?php $TRANSLATIONS = array(
"Could not revert: %s" => "No se puede revertir: %s",
"success" => "exitoso",
"File %s was reverted to version %s" => "El archivo %s fue revertido a la version %s",
"failure" => "fallo",
"File %s could not be reverted to version %s" => "El archivo %s no puede ser revertido a la version %s",
"No old versions available" => "No hay versiones antiguas disponibles",
"No path specified" => "Ruta no especificada",
"History" => "Historial",
"Revert a file to a previous version by clicking on its revert button" => "Revertir un archivo a una versión anterior haciendo clic en el boton de revertir",
"Files Versioning" => "Versionado de archivos",
"Enable" => "Habilitar"
);

View File

@ -1,5 +1,13 @@
<?php $TRANSLATIONS = array(
"Could not revert: %s" => "Impossible de restaurer %s",
"success" => "succès",
"File %s was reverted to version %s" => "Le fichier %s a été restauré dans sa version %s",
"failure" => "échec",
"File %s could not be reverted to version %s" => "Le fichier %s ne peut être restauré dans sa version %s",
"No old versions available" => "Aucune ancienne version n'est disponible",
"No path specified" => "Aucun chemin spécifié",
"History" => "Historique",
"Revert a file to a previous version by clicking on its revert button" => "Restaurez un fichier dans une version antérieure en cliquant sur son bouton de restauration",
"Files Versioning" => "Versionnage des fichiers",
"Enable" => "Activer"
);

View File

@ -1,5 +1,13 @@
<?php $TRANSLATIONS = array(
"Could not revert: %s" => "Impossibild ripristinare: %s",
"success" => "completata",
"File %s was reverted to version %s" => "Il file %s è stato ripristinato alla versione %s",
"failure" => "non riuscita",
"File %s could not be reverted to version %s" => "Il file %s non può essere ripristinato alla versione %s",
"No old versions available" => "Non sono disponibili versioni precedenti",
"No path specified" => "Nessun percorso specificato",
"History" => "Cronologia",
"Revert a file to a previous version by clicking on its revert button" => "Ripristina un file a una versione precedente facendo clic sul rispettivo pulsante di ripristino",
"Files Versioning" => "Controllo di versione dei file",
"Enable" => "Abilita"
);

View File

@ -1,5 +1,13 @@
<?php $TRANSLATIONS = array(
"Could not revert: %s" => "元に戻せませんでした: %s",
"success" => "成功",
"File %s was reverted to version %s" => "ファイル %s をバージョン %s に戻しました",
"failure" => "失敗",
"File %s could not be reverted to version %s" => "ファイル %s をバージョン %s に戻せませんでした",
"No old versions available" => "利用可能な古いバージョンはありません",
"No path specified" => "パスが指定されていません",
"History" => "履歴",
"Revert a file to a previous version by clicking on its revert button" => "もとに戻すボタンをクリックすると、ファイルを過去のバージョンに戻します",
"Files Versioning" => "ファイルのバージョン管理",
"Enable" => "有効化"
);

View File

@ -1,5 +1,13 @@
<?php $TRANSLATIONS = array(
"Could not revert: %s" => "Nevarēja atgriezt — %s",
"success" => "veiksme",
"File %s was reverted to version %s" => "Datne %s tika atgriezt uz versiju %s",
"failure" => "neveiksme",
"File %s could not be reverted to version %s" => "Datni %s nevarēja atgriezt uz versiju %s",
"No old versions available" => "Nav pieejamu vecāku versiju",
"No path specified" => "Nav norādīts ceļš",
"History" => "Vēsture",
"Revert a file to a previous version by clicking on its revert button" => "Atgriez datni uz iepriekšēju versiju, spiežot uz tās atgriešanas pogu",
"Files Versioning" => "Datņu versiju izskošana",
"Enable" => "Aktivēt"
);

View File

@ -1,5 +1,13 @@
<?php $TRANSLATIONS = array(
"Could not revert: %s" => "Не может быть возвращён: %s",
"success" => "успех",
"File %s was reverted to version %s" => "Файл %s был возвращён к версии %s",
"failure" => "провал",
"File %s could not be reverted to version %s" => "Файл %s не может быть возвращён к версии %s",
"No old versions available" => "Нет доступных старых версий",
"No path specified" => "Путь не указан",
"History" => "История",
"Revert a file to a previous version by clicking on its revert button" => "Вернуть файл к предыдущей версии нажатием на кнопку возврата",
"Files Versioning" => "Версии файлов",
"Enable" => "Включить"
);

View File

@ -1,4 +1,9 @@
<?php $TRANSLATIONS = array(
"success" => "uspech",
"File %s was reverted to version %s" => "Subror %s bol vrateny na verziu %s",
"failure" => "chyba",
"No old versions available" => "Nie sú dostupné žiadne staršie verzie",
"No path specified" => "Nevybrali ste cestu",
"History" => "História",
"Files Versioning" => "Vytváranie verzií súborov",
"Enable" => "Zapnúť"

Some files were not shown because too many files have changed in this diff Show More