diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-02-28 10:39:23 -0500 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-02-28 10:39:23 -0500 |
commit | b5989c933f3c51887724d89e989a3e2af4207d6e (patch) | |
tree | 40677bfa8daa1357b1ca3a561b551a142cbe6c82 /apps | |
parent | ea83acedebbcf70b19643efe82b72fb139cf8ad2 (diff) | |
parent | 93e713d3781c5d5fc6d0dbb6c6a0a8f9c2e15b97 (diff) | |
download | nextcloud-server-b5989c933f3c51887724d89e989a3e2af4207d6e.tar.gz nextcloud-server-b5989c933f3c51887724d89e989a3e2af4207d6e.zip |
Merge branch 'master' into shared-folder-etags
Conflicts:
apps/files_sharing/lib/sharedstorage.php
Diffstat (limited to 'apps')
230 files changed, 1681 insertions, 1122 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index 9031c729eff..5b697777e47 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -26,8 +26,7 @@ foreach ($_FILES['files']['error'] as $error) { UPLOAD_ERR_OK => $l->t('There is no error, the file uploaded with success'), UPLOAD_ERR_INI_SIZE => $l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ') . ini_get('upload_max_filesize'), - UPLOAD_ERR_FORM_SIZE => $l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified' - . ' in the HTML form'), + UPLOAD_ERR_FORM_SIZE => $l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'), UPLOAD_ERR_PARTIAL => $l->t('The uploaded file was only partially uploaded'), UPLOAD_ERR_NO_FILE => $l->t('No file was uploaded'), UPLOAD_ERR_NO_TMP_DIR => $l->t('Missing a temporary folder'), diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml index 7c82c839dab..34800378537 100644 --- a/apps/files/appinfo/info.xml +++ b/apps/files/appinfo/info.xml @@ -5,7 +5,7 @@ <description>File Management</description> <licence>AGPL</licence> <author>Robin Appelman</author> - <require>4.91</require> + <require>4.93</require> <shipped>true</shipped> <standalone/> <default_enable/> diff --git a/apps/files/css/files.css b/apps/files/css/files.css index dfc2e4c0e2f..cd339ad26a5 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -123,6 +123,18 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } .selectedActions a { display:inline; margin:-.5em 0; padding:.5em !important; } .selectedActions a img { position:relative; top:.3em; } +#fileList a.action { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter: alpha(opacity=0); +} +#fileList tr:hover a.action { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=.5)"; + filter: alpha(opacity=.5); +} +#fileList tr:hover a.action:hover { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=1)"; + filter: alpha(opacity=1); +} #scanning-message{ top:40%; left:40%; position:absolute; display:none; } diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index cc107656da8..f5f3f3ba0c6 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -35,7 +35,7 @@ var FileList={ if(extension){ name_span.append($('<span></span>').addClass('extension').text(extension)); } - //dirs can show the number of uploaded files + //dirs can show the number of uploaded files if (type == 'dir') { link_elem.append($('<span></span>').attr({ 'class': 'uploadtext', @@ -44,7 +44,7 @@ var FileList={ } td.append(link_elem); tr.append(td); - + //size column if(size!=t('files', 'Pending')){ simpleSize=simpleFileSize(size); @@ -59,7 +59,7 @@ var FileList={ "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" }); @@ -87,7 +87,7 @@ var FileList={ lastModified, $('#permissions').val() ); - + FileList.insertElement(name, 'file', tr.attr('data-file',name)); var row = $('tr').filterAttr('data-file',name); if(loading){ @@ -101,7 +101,7 @@ var FileList={ FileActions.display(row.find('td.filename')); }, addDir:function(name,size,lastModified,hidden){ - + var tr = this.createRow( 'dir', name, @@ -111,7 +111,7 @@ var FileList={ lastModified, $('#permissions').val() ); - + FileList.insertElement(name,'dir',tr); var row = $('tr').filterAttr('data-file',name); row.find('td.filename').draggable(dragOptions); @@ -315,8 +315,8 @@ var FileList={ do_delete:function(files){ if(files.substr){ files=[files]; - } - for (var i in files) { + } + for (var i=0; i<files.length; i++) { var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete"); var oldHTML = deleteAction[0].outerHTML; var newHTML = '<img class="move2trash" data-action="Delete" title="'+t('files', 'perform delete operation')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>'; @@ -334,7 +334,7 @@ var FileList={ if (result.status == 'success') { $.each(files,function(index,file){ var files = $('tr').filterAttr('data-file',file); - files.hide(); + files.remove(); files.find('input[type="checkbox"]').removeAttr('checked'); files.removeClass('selected'); }); @@ -344,7 +344,7 @@ var FileList={ var deleteAction = $('tr').filterAttr('data-file',file).children("td.date").children(".move2trash"); deleteAction[0].outerHTML = oldHTML; }); - } + } }); } }; diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 918182162d4..464f7703685 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -114,7 +114,7 @@ $(document).ready(function() { $(this).parent().children('#file_upload_start').trigger('click'); return false; }); - + // Show trash bin $('#trash a').live('click', function() { window.location=OC.filePath('files_trashbin', '', 'index.php'); @@ -162,9 +162,10 @@ $(document).ready(function() { var tr=$('tr').filterAttr('data-file',filename); var renaming=tr.data('renaming'); if(!renaming && !FileList.isLoading(filename)){ - var mime=$(this).parent().parent().data('mime'); - var type=$(this).parent().parent().data('type'); - var permissions = $(this).parent().parent().data('permissions'); + FileActions.currentFile = $(this).parent(); + var mime=FileActions.getCurrentMimeType(); + var type=FileActions.getCurrentType(); + var permissions = FileActions.getCurrentPermissions(); var action=FileActions.getDefault(mime,type, permissions); if(action){ event.preventDefault(); @@ -523,7 +524,7 @@ $(document).ready(function() { crumb.text(text); } - $(window).click(function(){ + $(document).click(function(){ $('#new>ul').hide(); $('#new').removeClass('active'); $('#new li').each(function(i,element){ @@ -594,7 +595,7 @@ $(document).ready(function() { var date=new Date(); FileList.addFile(name,0,date,false,hidden); var tr=$('tr').filterAttr('data-file',name); - tr.data('mime','text/plain').data('id',result.data.id); + tr.attr('data-mime','text/plain'); tr.attr('data-id', result.data.id); getMimeIcon('text/plain',function(path){ tr.find('td.filename').attr('style','background-image:url('+path+')'); @@ -816,26 +817,26 @@ var createDragShadow = function(event){ //select dragged file $(event.target).parents('tr').find('td input:first').prop('checked',true); } - + var selectedFiles = getSelectedFiles(); - + if (!isDragSelected && selectedFiles.length == 1) { //revert the selection $(event.target).parents('tr').find('td input:first').prop('checked',false); } - + //also update class when we dragged more than one file if (selectedFiles.length > 1) { $(event.target).parents('tr').addClass('selected'); } - + // build dragshadow var dragshadow = $('<table class="dragshadow"></table>'); var tbody = $('<tbody></tbody>'); dragshadow.append(tbody); - + var dir=$('#dir').val(); - + $(selectedFiles).each(function(i,elem){ var newtr = $('<tr data-dir="'+dir+'" data-filename="'+elem.name+'">' +'<td class="filename">'+elem.name+'</td><td class="size">'+humanFileSize(elem.size)+'</td>' @@ -849,7 +850,7 @@ var createDragShadow = function(event){ }); } }); - + return dragshadow; } @@ -862,6 +863,10 @@ var dragOptions={ $('#fileList tr td.filename').addClass('ui-draggable'); } } +// sane browsers support using the distance option +if ( ! $.browser.msie) { + dragOptions['distance'] = 20; +} var folderDropOptions={ drop: function( event, ui ) { @@ -869,9 +874,9 @@ var folderDropOptions={ if ($(event.target).parents('tr').find('td input:first').prop('checked') === true) { return false; } - + var target=$.trim($(this).find('.nametext').text()); - + var files = ui.helper.find('tr'); $(files).each(function(i,row){ var dir = $(row).data('dir'); diff --git a/apps/files/l10n/de_DE.php b/apps/files/l10n/de_DE.php index 8d119afada4..1462efdd5d6 100644 --- a/apps/files/l10n/de_DE.php +++ b/apps/files/l10n/de_DE.php @@ -24,7 +24,7 @@ "replaced {new_name}" => "{new_name} wurde ersetzt", "undo" => "rückgängig machen", "replaced {new_name} with {old_name}" => "{old_name} wurde ersetzt durch {new_name}", -"perform delete operation" => "Führe das Löschen aus", +"perform delete operation" => "führe das Löschen aus", "'.' is an invalid file name." => "'.' ist kein gültiger Dateiname.", "File name cannot be empty." => "Der Dateiname darf nicht leer sein.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.", @@ -69,5 +69,5 @@ "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Die Datei überschreitet die Maximalgröße für Uploads auf diesem Server.", "Files are being scanned, please wait." => "Dateien werden gescannt, bitte warten.", "Current scanning" => "Scanne", -"Upgrading filesystem cache..." => "Aktualisiere den Dateisystem-Cache" +"Upgrading filesystem cache..." => "Aktualisiere den Dateisystem-Cache..." ); diff --git a/apps/files/l10n/el.php b/apps/files/l10n/el.php index 60456d180d3..541ec5ba8ae 100644 --- a/apps/files/l10n/el.php +++ b/apps/files/l10n/el.php @@ -62,7 +62,7 @@ "From link" => "Από σύνδεσμο", "Deleted files" => "Διαγραμμένα αρχεία", "Cancel upload" => "Ακύρωση αποστολής", -"Nothing in here. Upload something!" => "Δεν υπάρχει τίποτα εδώ. Ανέβασε κάτι!", +"Nothing in here. Upload something!" => "Δεν υπάρχει τίποτα εδώ. Μεταφορτώστε κάτι!", "Download" => "Λήψη", "Unshare" => "Διακοπή κοινής χρήσης", "Upload too large" => "Πολύ μεγάλο αρχείο προς αποστολή", diff --git a/apps/files/l10n/es.php b/apps/files/l10n/es.php index 12262b54818..3c6d25722e7 100644 --- a/apps/files/l10n/es.php +++ b/apps/files/l10n/es.php @@ -60,6 +60,7 @@ "Text file" => "Archivo de texto", "Folder" => "Carpeta", "From link" => "Desde el enlace", +"Deleted files" => "Archivos eliminados", "Cancel upload" => "Cancelar subida", "Nothing in here. Upload something!" => "Aquí no hay nada. ¡Sube algo!", "Download" => "Descargar", diff --git a/apps/files/l10n/he.php b/apps/files/l10n/he.php index 442eafe1c04..ca2cb14027c 100644 --- a/apps/files/l10n/he.php +++ b/apps/files/l10n/he.php @@ -8,6 +8,7 @@ "Missing a temporary folder" => "תיקייה זמנית חסרה", "Failed to write to disk" => "הכתיבה לכונן נכשלה", "Files" => "קבצים", +"Delete permanently" => "מחק לצמיתות", "Delete" => "מחיקה", "Rename" => "שינוי שם", "Pending" => "ממתין", diff --git a/apps/files/l10n/hy.php b/apps/files/l10n/hy.php new file mode 100644 index 00000000000..29c0cd8b8d0 --- /dev/null +++ b/apps/files/l10n/hy.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Delete" => "Ջնջել", +"Close" => "Փակել", +"Save" => "Պահպանել", +"Download" => "Բեռնել" +); diff --git a/apps/files/l10n/id.php b/apps/files/l10n/id.php index 4c4e2e0f714..aff1933e569 100644 --- a/apps/files/l10n/id.php +++ b/apps/files/l10n/id.php @@ -19,6 +19,10 @@ "Name" => "Nama", "Size" => "Ukuran", "Modified" => "Dimodifikasi", +"1 folder" => "1 map", +"{count} folders" => "{count} map", +"1 file" => "1 berkas", +"{count} files" => "{count} berkas", "Upload" => "Unggah", "File handling" => "Penanganan berkas", "Maximum upload size" => "Ukuran unggah maksimum", diff --git a/apps/files/l10n/ka.php b/apps/files/l10n/ka.php new file mode 100644 index 00000000000..148e688547a --- /dev/null +++ b/apps/files/l10n/ka.php @@ -0,0 +1,4 @@ +<?php $TRANSLATIONS = array( +"Files" => "ფაილები", +"Download" => "გადმოწერა" +); diff --git a/apps/files/l10n/my_MM.php b/apps/files/l10n/my_MM.php new file mode 100644 index 00000000000..b791a134ccc --- /dev/null +++ b/apps/files/l10n/my_MM.php @@ -0,0 +1,4 @@ +<?php $TRANSLATIONS = array( +"Files" => "ဖိုင်များ", +"Download" => "ဒေါင်းလုတ်" +); diff --git a/apps/files/l10n/pl.php b/apps/files/l10n/pl.php index d68a871a7d7..7570f1cb475 100644 --- a/apps/files/l10n/pl.php +++ b/apps/files/l10n/pl.php @@ -13,6 +13,7 @@ "Not enough storage available" => "Za mało miejsca", "Invalid directory." => "Zła ścieżka.", "Files" => "Pliki", +"Delete permanently" => "Trwale usuń", "Delete" => "Usuwa element", "Rename" => "Zmień nazwę", "Pending" => "Oczekujące", @@ -23,9 +24,13 @@ "replaced {new_name}" => "zastąpiony {new_name}", "undo" => "wróć", "replaced {new_name} with {old_name}" => "zastąpiony {new_name} z {old_name}", +"perform delete operation" => "wykonywanie operacji usuwania", "'.' is an invalid file name." => "'.' jest nieprawidłową nazwą pliku.", "File name cannot be empty." => "Nazwa pliku nie może być pusta.", "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Niepoprawna nazwa, Znaki '\\', '/', '<', '>', ':', '\"', '|', '?' oraz '*'są niedozwolone.", +"Your storage is full, files can not be updated or synced anymore!" => "Dysk jest pełny, pliki nie mogą być aktualizowane lub zsynchronizowane!", +"Your storage is almost full ({usedSpacePercent}%)" => "Twój dysk jest prawie pełny ({usedSpacePercent}%)", +"Your download is being prepared. This might take some time if the files are big." => "Pobieranie jest przygotowywane. Może to zająć trochę czasu, jeśli pliki są duże.", "Unable to upload your file as it is a directory or has 0 bytes" => "Nie można wczytać pliku jeśli jest katalogiem lub ma 0 bajtów", "Upload Error" => "Błąd wczytywania", "Close" => "Zamknij", @@ -63,5 +68,6 @@ "Upload too large" => "Wysyłany plik ma za duży rozmiar", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Pliki które próbujesz przesłać, przekraczają maksymalną, dopuszczalną wielkość.", "Files are being scanned, please wait." => "Skanowanie plików, proszę czekać.", -"Current scanning" => "Aktualnie skanowane" +"Current scanning" => "Aktualnie skanowane", +"Upgrading filesystem cache..." => "Uaktualnianie plików pamięci podręcznej..." ); diff --git a/apps/files/l10n/pt_BR.php b/apps/files/l10n/pt_BR.php index 3a9dafcabf9..eb66e154725 100644 --- a/apps/files/l10n/pt_BR.php +++ b/apps/files/l10n/pt_BR.php @@ -60,6 +60,7 @@ "Text file" => "Arquivo texto", "Folder" => "Pasta", "From link" => "Do link", +"Deleted files" => "Arquivos apagados", "Cancel upload" => "Cancelar upload", "Nothing in here. Upload something!" => "Nada aqui.Carrege alguma coisa!", "Download" => "Baixar", diff --git a/apps/files/l10n/sv.php b/apps/files/l10n/sv.php index ca4dfcf553b..12fef78dbd0 100644 --- a/apps/files/l10n/sv.php +++ b/apps/files/l10n/sv.php @@ -60,6 +60,7 @@ "Text file" => "Textfil", "Folder" => "Mapp", "From link" => "Från länk", +"Deleted files" => "Raderade filer", "Cancel upload" => "Avbryt uppladdning", "Nothing in here. Upload something!" => "Ingenting här. Ladda upp något!", "Download" => "Ladda ner", diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php index 3c6c5dbd267..eefebd6649b 100644 --- a/apps/files/templates/part.list.php +++ b/apps/files/templates/part.list.php @@ -28,9 +28,9 @@ > <?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?> <?php if($file['type'] == 'dir'): ?> - <a class="name" href="<?php echo $_['baseURL'].$directory.'/'.$name; ?>" title=""> + <a class="name" href="<?php echo rtrim($_['baseURL'],'/').'/'.trim($directory,'/').'/'.$name; ?>" title=""> <?php else: ?> - <a class="name" href="<?php echo $_['downloadURL'].$directory.'/'.$name; ?>" title=""> + <a class="name" href="<?php echo rtrim($_['downloadURL'],'/').'/'.trim($directory,'/').'/'.$name; ?>" title=""> <?php endif; ?> <span class="nametext"> <?php if($file['type'] == 'dir'):?> diff --git a/apps/files_encryption/l10n/id.php b/apps/files_encryption/l10n/id.php index 3f9a6c7d07f..6044348e72e 100644 --- a/apps/files_encryption/l10n/id.php +++ b/apps/files_encryption/l10n/id.php @@ -1,4 +1,7 @@ <?php $TRANSLATIONS = array( -"Encryption" => "enkripsi", -"None" => "tidak ada" +"Encryption" => "Enkripsi", +"File encryption is enabled." => "Enkripsi berkas aktif.", +"The following file types will not be encrypted:" => "Tipe berkas berikut tidak akan dienkripsi:", +"Exclude the following file types from encryption:" => "Kecualikan tipe berkas berikut dari enkripsi:", +"None" => "Tidak ada" ); diff --git a/apps/files_encryption/templates/settings-personal.php b/apps/files_encryption/templates/settings-personal.php index 47467c52c08..8c3bf491d84 100644 --- a/apps/files_encryption/templates/settings-personal.php +++ b/apps/files_encryption/templates/settings-personal.php @@ -8,7 +8,7 @@ </p>
<?php if ( ! empty( $_["blacklist"] ) ): ?>
<p>
- <?php $l->t( 'The following file types will not be encrypted:' ); ?>
+ <?php echo $l->t( 'The following file types will not be encrypted:' ); ?>
</p>
<ul>
<?php foreach( $_["blacklist"] as $type ): ?>
diff --git a/apps/files_external/ajax/addMountPoint.php b/apps/files_external/ajax/addMountPoint.php index 4cd8871b310..fed2ddfcf3d 100644 --- a/apps/files_external/ajax/addMountPoint.php +++ b/apps/files_external/ajax/addMountPoint.php @@ -10,9 +10,10 @@ if ($_POST['isPersonal'] == 'true') { OCP\JSON::checkAdminUser(); $isPersonal = false; } -OC_Mount_Config::addMountPoint($_POST['mountPoint'], +$status = OC_Mount_Config::addMountPoint($_POST['mountPoint'], $_POST['class'], $_POST['classOptions'], $_POST['mountType'], $_POST['applicable'], - $isPersonal);
\ No newline at end of file + $isPersonal); +OCP\JSON::success(array('data' => array('message' => $status)));
\ No newline at end of file diff --git a/apps/files_external/appinfo/info.xml b/apps/files_external/appinfo/info.xml index 2c04216a9fb..0542b7b10a7 100644 --- a/apps/files_external/appinfo/info.xml +++ b/apps/files_external/appinfo/info.xml @@ -5,7 +5,7 @@ <description>Mount external storage sources</description> <licence>AGPL</licence> <author>Robin Appelman, Michael Gapczynski</author> - <require>4.91</require> + <require>4.93</require> <shipped>true</shipped> <types> <filesystem/> diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css index ca4b1c3ba89..94b453793b1 100644 --- a/apps/files_external/css/settings.css +++ b/apps/files_external/css/settings.css @@ -1,4 +1,7 @@ -.error { color: #FF3B3B; } +td.status>span { display:inline-block; height:16px; width:16px; } +span.success { background-image: url('../img/success.png'); background-repeat:no-repeat; } +span.error { background-image: url('../img/error.png'); background-repeat:no-repeat; } +span.waiting { background-image: url('../img/waiting.png'); background-repeat:no-repeat; } td.mountPoint, td.backend { width:10em; } td.remove>img { visibility:hidden; padding-top:0.8em; } tr:hover>td.remove>img { visibility:visible; cursor:pointer; } diff --git a/apps/files_external/img/error.png b/apps/files_external/img/error.png Binary files differnew file mode 100644 index 00000000000..e8cf45e7a41 --- /dev/null +++ b/apps/files_external/img/error.png diff --git a/apps/files_external/img/success.png b/apps/files_external/img/success.png Binary files differnew file mode 100644 index 00000000000..6f7022ee7f5 --- /dev/null +++ b/apps/files_external/img/success.png diff --git a/apps/files_external/img/waiting.png b/apps/files_external/img/waiting.png Binary files differnew file mode 100644 index 00000000000..02a8cbff0da --- /dev/null +++ b/apps/files_external/img/waiting.png diff --git a/apps/files_external/js/dropbox.js b/apps/files_external/js/dropbox.js index cd3c957e0a8..957daeb4d1f 100644 --- a/apps/files_external/js/dropbox.js +++ b/apps/files_external/js/dropbox.js @@ -15,6 +15,9 @@ $(document).ready(function() { if (pos != -1 && window.location.search.substr(pos, $(token).val().length) == $(token).val()) { var token_secret = $(this).find('.configuration [data-parameter="token_secret"]'); var tr = $(this); + var statusSpan = $(tr).find('.status span'); + statusSpan.removeClass(); + statusSpan.addClass('waiting'); $.post(OC.filePath('files_external', 'ajax', 'dropbox.php'), { step: 2, app_key: app_key, app_secret: app_secret, request_token: $(token).val(), request_token_secret: $(token_secret).val() }, function(result) { if (result && result.status == 'success') { $(token).val(result.access_token); @@ -24,23 +27,40 @@ $(document).ready(function() { $(tr).find('.configuration input').attr('disabled', 'disabled'); $(tr).find('.configuration').append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>'); } else { - OC.dialogs.alert(result.data.message, - t('files_external', 'Error configuring Dropbox storage') - ); + OC.dialogs.alert(result.data.message, t('files_external', 'Error configuring Dropbox storage')); } }); } - } else if ($(this).find('.mountPoint input').val() != '' && $(config).find('[data-parameter="app_key"]').val() != '' && $(config).find('[data-parameter="app_secret"]').val() != '' && $(this).find('.dropbox').length == 0) { - $(this).find('.configuration').append('<a class="button dropbox">'+t('files_external', 'Grant access')+'</a>'); + } else { + onDropboxInputsChange($(this)); } } }); - $('#externalStorage tbody').on('keyup', 'tr input', function() { - var tr = $(this).parent().parent(); - if ($(tr).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Dropbox') && $(tr).find('[data-parameter="configured"]').val() != 'true') { + $('#externalStorage').on('paste', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Dropbox td', function() { + var tr = $(this).parent(); + setTimeout(function() { + onDropboxInputsChange(tr); + }, 20); + }); + + $('#externalStorage').on('keyup', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Dropbox td', function() { + onDropboxInputsChange($(this).parent()); + }); + + $('#externalStorage').on('change', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Dropbox .chzn-select', function() { + onDropboxInputsChange($(this).parent().parent()); + }); + + function onDropboxInputsChange(tr) { + if ($(tr).find('[data-parameter="configured"]').val() != 'true') { var config = $(tr).find('.configuration'); - if ($(tr).find('.mountPoint input').val() != '' && $(config).find('[data-parameter="app_key"]').val() != '' && $(config).find('[data-parameter="app_secret"]').val() != '') { + if ($(tr).find('.mountPoint input').val() != '' + && $(config).find('[data-parameter="app_key"]').val() != '' + && $(config).find('[data-parameter="app_secret"]').val() != '' + && ($(tr).find('.chzn-select').length == 0 + || $(tr).find('.chzn-select').val() != null)) + { if ($(tr).find('.dropbox').length == 0) { $(config).append('<a class="button dropbox">'+t('files_external', 'Grant access')+'</a>'); } else { @@ -50,41 +70,37 @@ $(document).ready(function() { $(tr).find('.dropbox').hide(); } } - }); + } - $('.dropbox').on('click', function(event) { + $('#externalStorage').on('click', '.dropbox', function(event) { event.preventDefault(); + var tr = $(this).parent().parent(); var app_key = $(this).parent().find('[data-parameter="app_key"]').val(); var app_secret = $(this).parent().find('[data-parameter="app_secret"]').val(); + var statusSpan = $(tr).find('.status span'); if (app_key != '' && app_secret != '') { var tr = $(this).parent().parent(); var configured = $(this).parent().find('[data-parameter="configured"]'); var token = $(this).parent().find('[data-parameter="token"]'); var token_secret = $(this).parent().find('[data-parameter="token_secret"]'); - $.post(OC.filePath('files_external', 'ajax', 'dropbox.php'), { step: 1, app_key: app_key, app_secret: app_secret, callback: window.location.href }, function(result) { + $.post(OC.filePath('files_external', 'ajax', 'dropbox.php'), { step: 1, app_key: app_key, app_secret: app_secret, callback: location.protocol + '//' + location.host + location.pathname }, function(result) { if (result && result.status == 'success') { $(configured).val('false'); $(token).val(result.data.request_token); $(token_secret).val(result.data.request_token_secret); - if (OC.MountConfig.saveStorage(tr)) { - window.location = result.data.url; - } else { - OC.dialogs.alert( - t('files_external', 'Fill out all required fields'), - t('files_external', 'Error configuring Dropbox storage') - ); - } + OC.MountConfig.saveStorage(tr); + statusSpan.removeClass(); + statusSpan.addClass('waiting'); + window.location = result.data.url; } else { - OC.dialogs.alert(result.data.message, - t('files_external', 'Error configuring Dropbox storage') - ); + OC.dialogs.alert(result.data.message, t('files_external', 'Error configuring Dropbox storage')); } }); } else { OC.dialogs.alert( - t('files_external', 'Please provide a valid Dropbox app key and secret.'), - t('files_external', 'Error configuring Dropbox storage') - ); + t('files_external', 'Please provide a valid Dropbox app key and secret.'), + t('files_external', 'Error configuring Dropbox storage') + ); } }); diff --git a/apps/files_external/js/google.js b/apps/files_external/js/google.js index 9b7f9514f12..7be1b338e90 100644 --- a/apps/files_external/js/google.js +++ b/apps/files_external/js/google.js @@ -1,19 +1,30 @@ $(document).ready(function() { - $('#externalStorage tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google').each(function() { - var configured = $(this).find('[data-parameter="configured"]'); + $('#externalStorage tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google').each(function(index, tr) { + setupGoogleRow(tr); + }); + + $('#externalStorage').on('change', '#selectBackend', function() { + if ($(this).val() == '\\OC\\Files\\Storage\\Google') { + setupGoogleRow($('#externalStorage tbody>tr:last').prev('tr')); + } + }); + + function setupGoogleRow(tr) { + var configured = $(tr).find('[data-parameter="configured"]'); if ($(configured).val() == 'true') { - $(this).find('.configuration') - .append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>'); + $(tr).find('.configuration').append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>'); } else { - var token = $(this).find('[data-parameter="token"]'); - var token_secret = $(this).find('[data-parameter="token_secret"]'); + var token = $(tr).find('[data-parameter="token"]'); + var token_secret = $(tr).find('[data-parameter="token_secret"]'); var params = {}; window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m, key, value) { params[key] = value; }); if (params['oauth_token'] !== undefined && params['oauth_verifier'] !== undefined && decodeURIComponent(params['oauth_token']) == $(token).val()) { - var tr = $(this); + var statusSpan = $(tr).find('.status span'); + statusSpan.removeClass(); + statusSpan.addClass('waiting'); $.post(OC.filePath('files_external', 'ajax', 'google.php'), { step: 2, oauth_verifier: params['oauth_verifier'], request_token: $(token).val(), request_token_secret: $(token_secret).val() }, function(result) { if (result && result.status == 'success') { $(token).val(result.access_token); @@ -22,61 +33,64 @@ $(document).ready(function() { OC.MountConfig.saveStorage(tr); $(tr).find('.configuration').append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>'); } else { - OC.dialogs.alert(result.data.message, - t('files_external', 'Error configuring Google Drive storage') - ); + OC.dialogs.alert(result.data.message, t('files_external', 'Error configuring Google Drive storage')); + onGoogleInputsChange(tr); } }); - } else if ($(this).find('.google').length == 0) { - $(this).find('.configuration').append('<a class="button google">'+t('files_external', 'Grant access')+'</a>'); + } else { + onGoogleInputsChange(tr); } } + } + + $('#externalStorage').on('paste', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google td', function() { + var tr = $(this).parent(); + setTimeout(function() { + onGoogleInputsChange(tr); + }, 20); }); - $('#externalStorage tbody').on('change', 'tr', function() { - if ($(this).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Google') && $(this).find('[data-parameter="configured"]').val() != 'true') { - if ($(this).find('.mountPoint input').val() != '') { - if ($(this).find('.google').length == 0) { - $(this).find('.configuration').append('<a class="button google">'+t('files_external', 'Grant access')+'</a>'); - } - } - } + $('#externalStorage').on('keyup', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google td', function() { + onGoogleInputsChange($(this).parent()); }); - $('#externalStorage tbody').on('keyup', 'tr .mountPoint input', function() { - var tr = $(this).parent().parent(); - if ($(tr).hasClass('\\\\OC\\\\Files\\\\Storage\\\\Google') && $(tr).find('[data-parameter="configured"]').val() != 'true' && $(tr).find('.google').length > 0) { - if ($(this).val() != '') { - $(tr).find('.google').show(); - } else { + $('#externalStorage').on('change', 'tbody tr.\\\\OC\\\\Files\\\\Storage\\\\Google .chzn-select', function() { + onGoogleInputsChange($(this).parent().parent()); + }); + + function onGoogleInputsChange(tr) { + if ($(tr).find('[data-parameter="configured"]').val() != 'true') { + var config = $(tr).find('.configuration'); + if ($(tr).find('.mountPoint input').val() != '' && ($(tr).find('.chzn-select').length == 0 || $(tr).find('.chzn-select').val() != null)) { + if ($(tr).find('.google').length == 0) { + $(config).append('<a class="button google">'+t('files_external', 'Grant access')+'</a>'); + } else { + $(tr).find('.google').show(); + } + } else if ($(tr).find('.google').length > 0) { $(tr).find('.google').hide(); } } - }); + } - $('.google').on('click', function(event) { + $('#externalStorage').on('click', '.google', function(event) { event.preventDefault(); var tr = $(this).parent().parent(); var configured = $(this).parent().find('[data-parameter="configured"]'); var token = $(this).parent().find('[data-parameter="token"]'); var token_secret = $(this).parent().find('[data-parameter="token_secret"]'); - $.post(OC.filePath('files_external', 'ajax', 'google.php'), { step: 1, callback: window.location.href }, function(result) { + var statusSpan = $(tr).find('.status span'); + $.post(OC.filePath('files_external', 'ajax', 'google.php'), { step: 1, callback: location.protocol + '//' + location.host + location.pathname }, function(result) { if (result && result.status == 'success') { $(configured).val('false'); $(token).val(result.data.request_token); $(token_secret).val(result.data.request_token_secret); - if (OC.MountConfig.saveStorage(tr)) { - window.location = result.data.url; - } else { - OC.dialogs.alert( - t('files_external', 'Fill out all required fields'), - t('files_external', 'Error configuring Google Drive storage') - ); - } + OC.MountConfig.saveStorage(tr); + statusSpan.removeClass(); + statusSpan.addClass('waiting'); + window.location = result.data.url; } else { - OC.dialogs.alert(result.data.message, - t('files_external', 'Error configuring Google Drive storage') - ); + OC.dialogs.alert(result.data.message, t('files_external', 'Error configuring Google Drive storage')); } }); }); diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index 12690395270..ac408786ff6 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -4,6 +4,7 @@ OC.MountConfig={ if (mountPoint == '') { return false; } + var statusSpan = $(tr).find('.status span'); var backendClass = $(tr).find('.backend').data('class'); var configuration = $(tr).find('.configuration input'); var addMountPoint = true; @@ -26,12 +27,20 @@ OC.MountConfig={ classOptions[$(input).data('parameter')] = $(input).val(); } }); + if ($('#externalStorage').data('admin') === true) { + var multiselect = $(tr).find('.chzn-select').val(); + if (multiselect == null) { + return false; + } + } if (addMountPoint) { + var status = false; if ($('#externalStorage').data('admin') === true) { var isPersonal = false; - var multiselect = $(tr).find('.chzn-select').val(); var oldGroups = $(tr).find('.applicable').data('applicable-groups'); var oldUsers = $(tr).find('.applicable').data('applicable-users'); + var groups = []; + var users = []; $.each(multiselect, function(index, value) { var pos = value.indexOf('(group)'); if (pos != -1) { @@ -40,30 +49,96 @@ OC.MountConfig={ if ($.inArray(applicable, oldGroups) != -1) { oldGroups.splice($.inArray(applicable, oldGroups), 1); } + groups.push(applicable); } else { var mountType = 'user'; var applicable = value; if ($.inArray(applicable, oldUsers) != -1) { oldUsers.splice($.inArray(applicable, oldUsers), 1); } + users.push(applicable); } - $.post(OC.filePath('files_external', 'ajax', 'addMountPoint.php'), { mountPoint: mountPoint, 'class': backendClass, classOptions: classOptions, mountType: mountType, applicable: applicable, isPersonal: isPersonal }); + $.ajax({type: 'POST', + url: OC.filePath('files_external', 'ajax', 'addMountPoint.php'), + data: { + mountPoint: mountPoint, + 'class': backendClass, + classOptions: classOptions, + mountType: mountType, + applicable: applicable, + isPersonal: isPersonal + }, + async: false, + success: function(result) { + statusSpan.removeClass(); + if (result && result.status == 'success' && result.data.message) { + status = true; + statusSpan.addClass('success'); + } else { + statusSpan.addClass('error'); + } + } + }); }); + $(tr).find('.applicable').data('applicable-groups', groups); + $(tr).find('.applicable').data('applicable-users', users); var mountType = 'group'; $.each(oldGroups, function(index, applicable) { - $.post(OC.filePath('files_external', 'ajax', 'removeMountPoint.php'), { mountPoint: mountPoint, mountType: mountType, applicable: applicable, isPersonal: isPersonal }); + $.ajax({type: 'POST', + url: OC.filePath('files_external', 'ajax', 'removeMountPoint.php'), + data: { + mountPoint: mountPoint, + class: backendClass, + classOptions: classOptions, + mountType: mountType, + applicable: applicable, + isPersonal: isPersonal + }, + async: false + }); }); var mountType = 'user'; $.each(oldUsers, function(index, applicable) { - $.post(OC.filePath('files_external', 'ajax', 'removeMountPoint.php'), { mountPoint: mountPoint, mountType: mountType, applicable: applicable, isPersonal: isPersonal }); + $.ajax({type: 'POST', + url: OC.filePath('files_external', 'ajax', 'removeMountPoint.php'), + data: { + mountPoint: mountPoint, + class: backendClass, + classOptions: classOptions, + mountType: mountType, + applicable: applicable, + isPersonal: isPersonal + }, + async: false + }); }); } else { var isPersonal = true; var mountType = 'user'; var applicable = OC.currentUser; - $.post(OC.filePath('files_external', 'ajax', 'addMountPoint.php'), { mountPoint: mountPoint, 'class': backendClass, classOptions: classOptions, mountType: mountType, applicable: applicable, isPersonal: isPersonal }); + $.ajax({type: 'POST', + url: OC.filePath('files_external', 'ajax', 'addMountPoint.php'), + data: { + mountPoint: mountPoint, + 'class': backendClass, + classOptions: classOptions, + mountType: mountType, + applicable: applicable, + isPersonal: isPersonal + }, + async: false, + success: function(result) { + statusSpan.removeClass(); + if (result && result.status == 'success' && result.data.message) { + status = true; + statusSpan.addClass('success'); + } else { + statusSpan.addClass('error'); + } + } + }); } - return true; + return status; } } }; @@ -71,7 +146,7 @@ OC.MountConfig={ $(document).ready(function() { $('.chzn-select').chosen(); - $('#selectBackend').on('change', function() { + $('#externalStorage').on('change', '#selectBackend', function() { var tr = $(this).parent().parent(); $('#externalStorage tbody').append($(tr).clone()); $('#externalStorage tbody tr').last().find('.mountPoint input').val(''); @@ -79,9 +154,10 @@ $(document).ready(function() { var backendClass = $(this).val(); $(this).parent().text(selected); if ($(tr).find('.mountPoint input').val() == '') { - $(tr).find('.mountPoint input').val(suggestMountPoint(selected.replace(/\s+/g, ''))); + $(tr).find('.mountPoint input').val(suggestMountPoint(selected)); } $(tr).addClass(backendClass); + $(tr).find('.status').append('<span class="waiting"></span>'); $(tr).find('.backend').data('class', backendClass); var configurations = $(this).data('configurations'); var td = $(tr).find('td.configuration'); @@ -106,7 +182,11 @@ $(document).ready(function() { return false; } }); - $('.chz-select').chosen(); + // Reset chosen + var chosen = $(tr).find('.applicable select'); + chosen.parent().find('div').remove(); + chosen.removeAttr('id').removeClass('chzn-done').css({display:'inline-block'}); + chosen.chosen(); $(tr).find('td').last().attr('class', 'remove'); $(tr).find('td').last().removeAttr('style'); $(tr).removeAttr('id'); @@ -114,6 +194,11 @@ $(document).ready(function() { }); function suggestMountPoint(defaultMountPoint) { + var pos = defaultMountPoint.indexOf('/'); + if (pos !== -1) { + defaultMountPoint = defaultMountPoint.substring(0, pos); + } + defaultMountPoint = defaultMountPoint.replace(/\s+/g, ''); var i = 1; var append = ''; var match = true; @@ -135,11 +220,34 @@ $(document).ready(function() { return defaultMountPoint+append; } - $('#externalStorage').on('change', 'td', function() { - OC.MountConfig.saveStorage($(this).parent()); + $('#externalStorage').on('paste', 'td', function() { + var tr = $(this).parent(); + setTimeout(function() { + OC.MountConfig.saveStorage(tr); + }, 20); }); - $('td.remove>img').on('click', function() { + var timer; + + $('#externalStorage').on('keyup', 'td input', function() { + clearTimeout(timer); + var tr = $(this).parent().parent(); + if ($(this).val) { + timer = setTimeout(function() { + OC.MountConfig.saveStorage(tr); + }, 2000); + } + }); + + $('#externalStorage').on('change', 'td input:checkbox', function() { + OC.MountConfig.saveStorage($(this).parent().parent().parent()); + }); + + $('#externalStorage').on('change', '.applicable .chzn-select', function() { + OC.MountConfig.saveStorage($(this).parent().parent()); + }); + + $('#externalStorage').on('click', 'td.remove>img', function() { var tr = $(this).parent().parent(); var mountPoint = $(tr).find('.mountPoint input').val(); if ( ! mountPoint) { @@ -151,23 +259,25 @@ $(document).ready(function() { if ($('#externalStorage').data('admin') === true) { var isPersonal = false; var multiselect = $(tr).find('.chzn-select').val(); - $.each(multiselect, function(index, value) { - var pos = value.indexOf('(group)'); - if (pos != -1) { - var mountType = 'group'; - var applicable = value.substr(0, pos); - } else { - var mountType = 'user'; - var applicable = value; - } - $.post(OC.filePath('files_external', 'ajax', 'removeMountPoint.php'), { mountPoint: mountPoint, mountType: mountType, applicable: applicable, isPersonal: isPersonal }); - }); + if (multiselect != null) { + $.each(multiselect, function(index, value) { + var pos = value.indexOf('(group)'); + if (pos != -1) { + var mountType = 'group'; + var applicable = value.substr(0, pos); + } else { + var mountType = 'user'; + var applicable = value; + } + $.post(OC.filePath('files_external', 'ajax', 'removeMountPoint.php'), { mountPoint: mountPoint, mountType: mountType, applicable: applicable, isPersonal: isPersonal }); + }); + } } else { var mountType = 'user'; var applicable = OC.currentUser; var isPersonal = true; + $.post(OC.filePath('files_external', 'ajax', 'removeMountPoint.php'), { mountPoint: mountPoint, mountType: mountType, applicable: applicable, isPersonal: isPersonal }); } - $.post(OC.filePath('files_external', 'ajax', 'removeMountPoint.php'), { mountPoint: mountPoint, mountType: mountType, applicable: applicable, isPersonal: isPersonal }); $(tr).remove(); }); diff --git a/apps/files_external/l10n/bg_BG.php b/apps/files_external/l10n/bg_BG.php index 6342da3f3a2..66ad4a879d4 100644 --- a/apps/files_external/l10n/bg_BG.php +++ b/apps/files_external/l10n/bg_BG.php @@ -1,9 +1,7 @@ <?php $TRANSLATIONS = array( "Access granted" => "Достъпът е даден", "Grant access" => "Даване на достъп", -"Fill out all required fields" => "Попълнете всички задължителни полета", "External Storage" => "Външно хранилище", -"Backend" => "Администрация", "Configuration" => "Конфигурация", "Options" => "Опции", "Applicable" => "Приложимо", diff --git a/apps/files_external/l10n/bn_BD.php b/apps/files_external/l10n/bn_BD.php index a4a2b23030b..07ccd500746 100644 --- a/apps/files_external/l10n/bn_BD.php +++ b/apps/files_external/l10n/bn_BD.php @@ -2,16 +2,12 @@ "Access granted" => "অধিগমনের অনুমতি প্রদান করা হলো", "Error configuring Dropbox storage" => "Dropbox সংরক্ষণাগার নির্ধারণ করতে সমস্যা ", "Grant access" => "অধিগমনের অনুমতি প্রদান কর", -"Fill out all required fields" => "আবশ্যিক সমস্ত ক্ষেত্র পূরণ করুন", "Please provide a valid Dropbox app key and secret." => "দয়া করে সঠিক এবং বৈধ Dropbox app key and secret প্রদান করুন।", "Error configuring Google Drive storage" => "Google Drive সংরক্ষণাগার নির্ধারণ করতে সমস্যা ", "External Storage" => "বাহ্যিক সংরক্ষণাগার", -"Mount point" => "মাউন্ট পয়েন্ট", -"Backend" => "পশ্চাদপট", "Configuration" => "কনফিগারেসন", "Options" => "বিকল্পসমূহ", "Applicable" => "প্রযোজ্য", -"Add mount point" => "মাউন্ট পয়েন্ট যোগ কর", "None set" => "কোনটিই নির্ধারণ করা হয় নি", "All Users" => "সমস্ত ব্যবহারকারী", "Groups" => "গোষ্ঠীসমূহ", diff --git a/apps/files_external/l10n/ca.php b/apps/files_external/l10n/ca.php index e8a922ca0f9..a1278fe9d55 100644 --- a/apps/files_external/l10n/ca.php +++ b/apps/files_external/l10n/ca.php @@ -2,18 +2,14 @@ "Access granted" => "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", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Avís:</b> \"smbclient\" no està instal·lat. No es pot muntar la compartició CIFS/SMB. Demaneu a l'administrador del sistema que l'instal·li.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Avís:</b> El suport FTP per PHP no està activat o no està instal·lat. No es pot muntar la compartició FTP. Demaneu a l'administrador del sistema que l'instal·li.", "External Storage" => "Emmagatzemament extern", -"Mount point" => "Punt de muntatge", -"Backend" => "Dorsal", "Configuration" => "Configuració", "Options" => "Options", "Applicable" => "Aplicable", -"Add mount point" => "Afegeix punt de muntatge", "None set" => "Cap d'establert", "All Users" => "Tots els usuaris", "Groups" => "Grups", diff --git a/apps/files_external/l10n/cs_CZ.php b/apps/files_external/l10n/cs_CZ.php index 9c647fad939..9165ef2b08a 100644 --- a/apps/files_external/l10n/cs_CZ.php +++ b/apps/files_external/l10n/cs_CZ.php @@ -2,18 +2,14 @@ "Access granted" => "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", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Varování:</b> není nainstalován program \"smbclient\". Není možné připojení oddílů CIFS/SMB. Prosím požádejte svého správce systému ať jej nainstaluje.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Varování:</b> není nainstalována, nebo povolena, podpora FTP v PHP. Není možné připojení oddílů FTP. Prosím požádejte svého správce systému ať ji nainstaluje.", "External Storage" => "Externí úložiště", -"Mount point" => "Přípojný bod", -"Backend" => "Podpůrná vrstva", "Configuration" => "Nastavení", "Options" => "Možnosti", "Applicable" => "Přístupný pro", -"Add mount point" => "Přidat bod připojení", "None set" => "Nenastaveno", "All Users" => "Všichni uživatelé", "Groups" => "Skupiny", diff --git a/apps/files_external/l10n/da.php b/apps/files_external/l10n/da.php index bae89a6cfdd..5a3969569c0 100644 --- a/apps/files_external/l10n/da.php +++ b/apps/files_external/l10n/da.php @@ -2,18 +2,14 @@ "Access granted" => "Adgang godkendt", "Error configuring Dropbox storage" => "Fejl ved konfiguration af Dropbox plads", "Grant access" => "Godkend adgang", -"Fill out all required fields" => "Udfyld alle nødvendige felter", "Please provide a valid Dropbox app key and secret." => "Angiv venligst en valid Dropbox app nøgle og hemmelighed", "Error configuring Google Drive storage" => "Fejl ved konfiguration af Google Drive plads", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b> Advarsel: </ b> \"smbclient\" ikke er installeret. Montering af CIFS / SMB delinger er ikke muligt. Spørg din systemadministrator om at installere det.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b> Advarsel: </ b> FTP-understøttelse i PHP ikke er aktiveret eller installeret. Montering af FTP delinger er ikke muligt. Spørg din systemadministrator om at installere det.", "External Storage" => "Ekstern opbevaring", -"Mount point" => "Monteringspunkt", -"Backend" => "Backend", "Configuration" => "Opsætning", "Options" => "Valgmuligheder", "Applicable" => "Kan anvendes", -"Add mount point" => "Tilføj monteringspunkt", "None set" => "Ingen sat", "All Users" => "Alle brugere", "Groups" => "Grupper", diff --git a/apps/files_external/l10n/de.php b/apps/files_external/l10n/de.php index 277cc2e6efe..434e4b5420d 100644 --- a/apps/files_external/l10n/de.php +++ b/apps/files_external/l10n/de.php @@ -2,18 +2,14 @@ "Access granted" => "Zugriff gestattet", "Error configuring Dropbox storage" => "Fehler beim Einrichten von Dropbox", "Grant access" => "Zugriff gestatten", -"Fill out all required fields" => "Bitte alle notwendigen Felder füllen", "Please provide a valid Dropbox app key and secret." => "Bitte trage einen gültigen Dropbox-App-Key mit Secret ein.", "Error configuring Google Drive storage" => "Fehler beim Einrichten von Google Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Warnung:</b> \"smbclient\" ist nicht installiert. Das Einhängen von CIFS/SMB-Freigaben ist nicht möglich. Bitte Deinen System-Administrator, dies zu installieren.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Warnung::</b> Die FTP Unterstützung von PHP ist nicht aktiviert oder installiert. Bitte wende Dich an Deinen Systemadministrator.", "External Storage" => "Externer Speicher", -"Mount point" => "Mount-Point", -"Backend" => "Backend", "Configuration" => "Konfiguration", "Options" => "Optionen", "Applicable" => "Zutreffend", -"Add mount point" => "Mount-Point hinzufügen", "None set" => "Nicht definiert", "All Users" => "Alle Benutzer", "Groups" => "Gruppen", diff --git a/apps/files_external/l10n/de_DE.php b/apps/files_external/l10n/de_DE.php index 5675eb057f0..2187b658207 100644 --- a/apps/files_external/l10n/de_DE.php +++ b/apps/files_external/l10n/de_DE.php @@ -2,18 +2,14 @@ "Access granted" => "Zugriff gestattet", "Error configuring Dropbox storage" => "Fehler beim Einrichten von Dropbox", "Grant access" => "Zugriff gestatten", -"Fill out all required fields" => "Bitte alle notwendigen Felder füllen", "Please provide a valid Dropbox app key and secret." => "Bitte tragen Sie einen gültigen Dropbox-App-Key mit Secret ein.", "Error configuring Google Drive storage" => "Fehler beim Einrichten von Google Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Warnung:</b> \"smbclient\" ist nicht installiert. Das Einhängen von CIFS/SMB-Freigaben ist nicht möglich. Bitten Sie Ihren Systemadministrator, dies zu installieren.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Warnung::</b> Die FTP Unterstützung von PHP ist nicht aktiviert oder installiert. Bitte wenden Sie sich an Ihren Systemadministrator.", "External Storage" => "Externer Speicher", -"Mount point" => "Mount-Point", -"Backend" => "Backend", "Configuration" => "Konfiguration", "Options" => "Optionen", "Applicable" => "Zutreffend", -"Add mount point" => "Mount-Point hinzufügen", "None set" => "Nicht definiert", "All Users" => "Alle Benutzer", "Groups" => "Gruppen", diff --git a/apps/files_external/l10n/el.php b/apps/files_external/l10n/el.php index 9bf499a911d..53d3ea0f874 100644 --- a/apps/files_external/l10n/el.php +++ b/apps/files_external/l10n/el.php @@ -2,18 +2,14 @@ "Access granted" => "Προσβαση παρασχέθηκε", "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 Drive ", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Προσοχή:</b> Ο \"smbclient\" δεν εγκαταστάθηκε. Δεν είναι δυνατή η προσάρτηση CIFS/SMB. Παρακαλώ ενημερώστε τον διαχειριστή συστήματος να το εγκαταστήσει.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Προσοχή:</b> Η υποστήριξη FTP στην PHP δεν ενεργοποιήθηκε ή εγκαταστάθηκε. Δεν είναι δυνατή η προσάρτηση FTP. Παρακαλώ ενημερώστε τον διαχειριστή συστήματος να το εγκαταστήσει.", "External Storage" => "Εξωτερικό Αποθηκευτικό Μέσο", -"Mount point" => "Σημείο προσάρτησης", -"Backend" => "Σύστημα υποστήριξης", "Configuration" => "Ρυθμίσεις", "Options" => "Επιλογές", "Applicable" => "Εφαρμόσιμο", -"Add mount point" => "Προσθήκη σημείου προσάρτησης", "None set" => "Κανένα επιλεγμένο", "All Users" => "Όλοι οι Χρήστες", "Groups" => "Ομάδες", diff --git a/apps/files_external/l10n/eo.php b/apps/files_external/l10n/eo.php index 97453aafedb..68749f085d3 100644 --- a/apps/files_external/l10n/eo.php +++ b/apps/files_external/l10n/eo.php @@ -2,16 +2,12 @@ "Access granted" => "Alirpermeso donita", "Error configuring Dropbox storage" => "Eraro dum agordado de la memorservo Dropbox", "Grant access" => "Doni alirpermeson", -"Fill out all required fields" => "Plenigu ĉiujn neprajn kampojn", "Please provide a valid Dropbox app key and secret." => "Bonvolu provizi ŝlosilon de la aplikaĵo Dropbox validan kaj sekretan.", "Error configuring Google Drive storage" => "Eraro dum agordado de la memorservo Google Drive", "External Storage" => "Malena memorilo", -"Mount point" => "Surmetingo", -"Backend" => "Motoro", "Configuration" => "Agordo", "Options" => "Malneproj", "Applicable" => "Aplikebla", -"Add mount point" => "Aldoni surmetingon", "None set" => "Nenio agordita", "All Users" => "Ĉiuj uzantoj", "Groups" => "Grupoj", diff --git a/apps/files_external/l10n/es.php b/apps/files_external/l10n/es.php index d4e56627649..cef89ecc632 100644 --- a/apps/files_external/l10n/es.php +++ b/apps/files_external/l10n/es.php @@ -2,18 +2,14 @@ "Access granted" => "Acceso garantizado", "Error configuring Dropbox storage" => "Error configurando el almacenamiento de Dropbox", "Grant access" => "Garantizar acceso", -"Fill out all required fields" => "Rellenar todos los campos requeridos", "Please provide a valid Dropbox app key and secret." => "Por favor , proporcione un secreto y una contraseña válida de la app Dropbox.", "Error configuring Google Drive storage" => "Error configurando el almacenamiento de Google Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Advertencia:</b> El cliente smb (smbclient) no se encuentra instalado. El montado de archivos o ficheros CIFS/SMB no es posible. Por favor pida al administrador de su sistema que lo instale.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Advertencia:</b> El soporte de FTP en PHP no se encuentra instalado. El montado de archivos o ficheros FTP no es posible. Por favor pida al administrador de su sistema que lo instale.", "External Storage" => "Almacenamiento externo", -"Mount point" => "Punto de montaje", -"Backend" => "Motor", "Configuration" => "Configuración", "Options" => "Opciones", "Applicable" => "Aplicable", -"Add mount point" => "Añadir punto de montaje", "None set" => "No se ha configurado", "All Users" => "Todos los usuarios", "Groups" => "Grupos", diff --git a/apps/files_external/l10n/es_AR.php b/apps/files_external/l10n/es_AR.php index aa117e80274..3c7b12d771f 100644 --- a/apps/files_external/l10n/es_AR.php +++ b/apps/files_external/l10n/es_AR.php @@ -2,18 +2,14 @@ "Access granted" => "Acceso permitido", "Error configuring Dropbox storage" => "Error al configurar el almacenamiento de Dropbox", "Grant access" => "Permitir acceso", -"Fill out all required fields" => "Rellenar todos los campos requeridos", "Please provide a valid Dropbox app key and secret." => "Por favor, proporcioná un secreto y una contraseña válida para la aplicación Dropbox.", "Error configuring Google Drive storage" => "Error al configurar el almacenamiento de Google Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Advertencia:</b> El cliente smb (smbclient) no se encuentra instalado. El montado de archivos o ficheros CIFS/SMB no es posible. Por favor pida al administrador de su sistema que lo instale.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Advertencia:</b> El soporte de FTP en PHP no se encuentra instalado. El montado de archivos o ficheros FTP no es posible. Por favor pida al administrador de su sistema que lo instale.", "External Storage" => "Almacenamiento externo", -"Mount point" => "Punto de montaje", -"Backend" => "Motor", "Configuration" => "Configuración", "Options" => "Opciones", "Applicable" => "Aplicable", -"Add mount point" => "Añadir punto de montaje", "None set" => "No fue configurado", "All Users" => "Todos los usuarios", "Groups" => "Grupos", diff --git a/apps/files_external/l10n/et_EE.php b/apps/files_external/l10n/et_EE.php index 86922bc751b..6651cc05cf8 100644 --- a/apps/files_external/l10n/et_EE.php +++ b/apps/files_external/l10n/et_EE.php @@ -2,16 +2,12 @@ "Access granted" => "Ligipääs on antud", "Error configuring Dropbox storage" => "Viga Dropboxi salvestusruumi seadistamisel", "Grant access" => "Anna ligipääs", -"Fill out all required fields" => "Täida kõik kohustuslikud lahtrid", "Please provide a valid Dropbox app key and secret." => "Palun sisesta korrektne Dropboxi rakenduse võti ja salasõna.", "Error configuring Google Drive storage" => "Viga Google Drive'i salvestusruumi seadistamisel", "External Storage" => "Väline salvestuskoht", -"Mount point" => "Ühenduspunkt", -"Backend" => "Admin", "Configuration" => "Seadistamine", "Options" => "Valikud", "Applicable" => "Rakendatav", -"Add mount point" => "Lisa ühenduspunkt", "None set" => "Pole määratud", "All Users" => "Kõik kasutajad", "Groups" => "Grupid", diff --git a/apps/files_external/l10n/eu.php b/apps/files_external/l10n/eu.php index 597204c894d..585fa7e0647 100644 --- a/apps/files_external/l10n/eu.php +++ b/apps/files_external/l10n/eu.php @@ -2,18 +2,14 @@ "Access granted" => "Sarrera baimendua", "Error configuring Dropbox storage" => "Errore bat egon da Dropbox biltegiratzea konfiguratzean", "Grant access" => "Baimendu sarrera", -"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", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Abisua:</b> \"smbclient\" ez dago instalatuta. CIFS/SMB partekatutako karpetak montatzea ez da posible. Mesedez eskatu zure sistema kudeatzaileari instalatzea.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Abisua:</b> PHPren FTP modulua ez dago instalatuta edo gaitua. FTP partekatutako karpetak montatzea ez da posible. Mesedez eskatu zure sistema kudeatzaileari instalatzea.", "External Storage" => "Kanpoko Biltegiratzea", -"Mount point" => "Montatze puntua", -"Backend" => "Motorra", "Configuration" => "Konfigurazioa", "Options" => "Aukerak", "Applicable" => "Aplikagarria", -"Add mount point" => "Gehitu muntatze puntua", "None set" => "Ezarri gabe", "All Users" => "Erabiltzaile guztiak", "Groups" => "Taldeak", diff --git a/apps/files_external/l10n/fa.php b/apps/files_external/l10n/fa.php index 5acf3eac5a5..a7eac596b04 100644 --- a/apps/files_external/l10n/fa.php +++ b/apps/files_external/l10n/fa.php @@ -3,6 +3,7 @@ "Configuration" => "پیکربندی", "Options" => "تنظیمات", "Applicable" => "قابل اجرا", +"All Users" => "تمام کاربران", "Groups" => "گروه ها", "Users" => "کاربران", "Delete" => "حذف", diff --git a/apps/files_external/l10n/fi_FI.php b/apps/files_external/l10n/fi_FI.php index 120c190790b..ca2effaf6b3 100644 --- a/apps/files_external/l10n/fi_FI.php +++ b/apps/files_external/l10n/fi_FI.php @@ -2,18 +2,14 @@ "Access granted" => "Pääsy sallittu", "Error configuring Dropbox storage" => "Virhe Dropbox levyn asetuksia tehtäessä", "Grant access" => "Salli pääsy", -"Fill out all required fields" => "Täytä kaikki vaaditut kentät", "Please provide a valid Dropbox app key and secret." => "Anna kelvollinen Dropbox-sovellusavain ja salainen vastaus.", "Error configuring Google Drive storage" => "Virhe Google Drive levyn asetuksia tehtäessä", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Varoitus:</b> \"smbclient\" ei ole asennettuna. CIFS-/SMB-jakojen liittäminen ei ole mahdollista. Pyydä järjestelmän ylläpitäjää asentamaan smbclient.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Varoitus:</b> PHP:n FTP-tuki ei ole käytössä tai sitä ei ole asennettu. FTP-jakojen liittäminen ei ole mahdollista. Pyydä järjestelmän ylläpitäjää ottamaan FTP-tuki käyttöön.", "External Storage" => "Erillinen tallennusväline", -"Mount point" => "Liitospiste", -"Backend" => "Taustaosa", "Configuration" => "Asetukset", "Options" => "Valinnat", "Applicable" => "Sovellettavissa", -"Add mount point" => "Lisää liitospiste", "None set" => "Ei asetettu", "All Users" => "Kaikki käyttäjät", "Groups" => "Ryhmät", diff --git a/apps/files_external/l10n/fr.php b/apps/files_external/l10n/fr.php index 0825a961b1c..0b1b3b3cb7c 100644 --- a/apps/files_external/l10n/fr.php +++ b/apps/files_external/l10n/fr.php @@ -2,18 +2,14 @@ "Access granted" => "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", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Attention : </b> \"smbclient\" n'est pas installé. Le montage des partages CIFS/SMB n'est pas disponible. Contactez votre administrateur système pour l'installer.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Attention : </b> Le support FTP de PHP n'est pas activé ou installé. Le montage des partages FTP n'est pas disponible. Contactez votre administrateur système pour l'installer.", "External Storage" => "Stockage externe", -"Mount point" => "Point de montage", -"Backend" => "Infrastructure", "Configuration" => "Configuration", "Options" => "Options", "Applicable" => "Disponible", -"Add mount point" => "Ajouter un point de montage", "None set" => "Aucun spécifié", "All Users" => "Tous les utilisateurs", "Groups" => "Groupes", diff --git a/apps/files_external/l10n/gl.php b/apps/files_external/l10n/gl.php index f8100e14620..b5df0ce6e14 100644 --- a/apps/files_external/l10n/gl.php +++ b/apps/files_external/l10n/gl.php @@ -2,18 +2,14 @@ "Access granted" => "Concedeuse acceso", "Error configuring Dropbox storage" => "Produciuse un erro ao configurar o almacenamento en Dropbox", "Grant access" => "Permitir o acceso", -"Fill out all required fields" => "Cubrir todos os campos obrigatorios", "Please provide a valid Dropbox app key and secret." => "Forneza unha chave correcta e segreda do Dropbox.", "Error configuring Google Drive storage" => "Produciuse un erro ao configurar o almacenamento en Google Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Aviso:</b> «smbclient» non está instalado. Non é posibel a montaxe de comparticións CIFS/SMB. Consulte co administrador do sistema para instalalo.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Aviso:</b> A compatibilidade de FTP en PHP non está activada ou instalada. Non é posibel a montaxe de comparticións FTP. Consulte co administrador do sistema para instalalo.", "External Storage" => "Almacenamento externo", -"Mount point" => "Punto de montaxe", -"Backend" => "Infraestrutura", "Configuration" => "Configuración", "Options" => "Opcións", "Applicable" => "Aplicábel", -"Add mount point" => "Engadir un punto de montaxe", "None set" => "Ningún definido", "All Users" => "Todos os usuarios", "Groups" => "Grupos", diff --git a/apps/files_external/l10n/he.php b/apps/files_external/l10n/he.php index 3dc04d4e79c..a7f45de7197 100644 --- a/apps/files_external/l10n/he.php +++ b/apps/files_external/l10n/he.php @@ -2,16 +2,12 @@ "Access granted" => "הוענקה גישה", "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 Drive", "External Storage" => "אחסון חיצוני", -"Mount point" => "נקודת עגינה", -"Backend" => "מנגנון", "Configuration" => "הגדרות", "Options" => "אפשרויות", "Applicable" => "ניתן ליישום", -"Add mount point" => "הוספת נקודת עגינה", "None set" => "לא הוגדרה", "All Users" => "כל המשתמשים", "Groups" => "קבוצות", diff --git a/apps/files_external/l10n/hu_HU.php b/apps/files_external/l10n/hu_HU.php index b8973c96411..74a5b2c5aa6 100644 --- a/apps/files_external/l10n/hu_HU.php +++ b/apps/files_external/l10n/hu_HU.php @@ -2,18 +2,14 @@ "Access granted" => "Érvényes hozzáférés", "Error configuring Dropbox storage" => "A Dropbox tárolót nem sikerült beállítani", "Grant access" => "Megadom a hozzáférést", -"Fill out all required fields" => "Töltse ki az összes szükséges mezőt", "Please provide a valid Dropbox app key and secret." => "Adjon meg egy érvényes Dropbox app key-t és secretet!", "Error configuring Google Drive storage" => "A Google Drive tárolót nem sikerült beállítani", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Figyelem:</b> az \"smbclient\" nincs telepítve a kiszolgálón. Emiatt nem lehet CIFS/SMB megosztásokat fölcsatolni. Kérje meg a rendszergazdát, hogy telepítse a szükséges programot.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Figyelem:</b> a PHP FTP támogatása vagy nincs telepítve, vagy nincs engedélyezve a kiszolgálón. Emiatt nem lehetséges FTP-tárolókat fölcsatolni. Kérje meg a rendszergazdát, hogy telepítse a szükséges programot.", "External Storage" => "Külső tárolási szolgáltatások becsatolása", -"Mount point" => "Hova csatoljuk", -"Backend" => "Külső tárolórendszer", "Configuration" => "Beállítások", "Options" => "Opciók", "Applicable" => "Érvényességi kör", -"Add mount point" => "Új csatolás létrehozása", "None set" => "Nincs beállítva", "All Users" => "Az összes felhasználó", "Groups" => "Csoportok", diff --git a/apps/files_external/l10n/hy.php b/apps/files_external/l10n/hy.php new file mode 100644 index 00000000000..3b80487278a --- /dev/null +++ b/apps/files_external/l10n/hy.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Delete" => "Ջնջել" +); diff --git a/apps/files_external/l10n/id.php b/apps/files_external/l10n/id.php index 4b7850025f4..647220706ba 100644 --- a/apps/files_external/l10n/id.php +++ b/apps/files_external/l10n/id.php @@ -1,14 +1,22 @@ <?php $TRANSLATIONS = array( -"Access granted" => "akses diberikan", -"Grant access" => "berikan hak akses", -"Fill out all required fields" => "isi semua field yang dibutuhkan", -"External Storage" => "penyimpanan eksternal", -"Configuration" => "konfigurasi", -"Options" => "pilihan", -"Applicable" => "berlaku", -"None set" => "tidak satupun di set", -"All Users" => "semua pengguna", -"Groups" => "grup", -"Users" => "pengguna", -"Delete" => "hapus" +"Access granted" => "Akses diberikan", +"Error configuring Dropbox storage" => "Kesalahan dalam mengkonfigurasi penyimpanan Dropbox", +"Grant access" => "Berikan hak akses", +"Please provide a valid Dropbox app key and secret." => "Masukkan kunci dan sandi aplikasi Dropbox yang benar.", +"Error configuring Google Drive storage" => "Kesalahan dalam mengkonfigurasi penyimpanan Google Drive", +"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Peringatan:</b> \"smbclient\" tidak terpasang. Mount direktori CIFS/SMB tidak dapat dilakukan. Silakan minta administrator sistem untuk memasangnya.", +"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Peringatan:</b> Dukungan FTP di PHP tidak aktif atau tidak terpasang. Mount direktori FTP tidak dapat dilakukan. Silakan minta administrator sistem untuk memasangnya.", +"External Storage" => "Penyimpanan Eksternal", +"Configuration" => "Konfigurasi", +"Options" => "Pilihan", +"Applicable" => "Berlaku", +"None set" => "Tidak satupun di set", +"All Users" => "Semua Pengguna", +"Groups" => "Grup", +"Users" => "Pengguna", +"Delete" => "Hapus", +"Enable User External Storage" => "Aktifkan Penyimpanan Eksternal Pengguna", +"Allow users to mount their own external storage" => "Ijinkan pengguna untuk me-mount penyimpanan eksternal mereka", +"SSL root certificates" => "Sertifikat root SSL", +"Import Root Certificate" => "Impor Sertifikat Root" ); diff --git a/apps/files_external/l10n/is.php b/apps/files_external/l10n/is.php index 5110bf5ad27..59085831a19 100644 --- a/apps/files_external/l10n/is.php +++ b/apps/files_external/l10n/is.php @@ -2,18 +2,14 @@ "Access granted" => "Aðgengi veitt", "Error configuring Dropbox storage" => "Villa við að setja upp Dropbox gagnasvæði", "Grant access" => "Veita aðgengi", -"Fill out all required fields" => "Fylltu út alla skilyrta reiti", "Please provide a valid Dropbox app key and secret." => "Gefðu upp virkan Dropbox lykil og leynikóða", "Error configuring Google Drive storage" => "Villa kom upp við að setja upp Google Drive gagnasvæði", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Aðvörun:</b> \"smbclient\" er ekki uppsettur. Uppsetning á CIFS/SMB gagnasvæðum er ekki möguleg. Hafðu samband við kerfisstjóra til að fá hann uppsettan.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Aðvörun:</b> FTP stuðningur í PHP er ekki virkur. Uppsetning á FTP gagnasvæðum er ekki möguleg. Hafðu samband við kerfisstjóra til að fá hann uppsettan.", "External Storage" => "Ytri gagnageymsla", -"Mount point" => "Mount svæði", -"Backend" => "Stjórnun", "Configuration" => "Uppsetning", "Options" => "Stillingar", "Applicable" => "Gilt", -"Add mount point" => "Bæta við mount svæði", "None set" => "Ekkert sett", "All Users" => "Allir notendur", "Groups" => "Hópar", diff --git a/apps/files_external/l10n/it.php b/apps/files_external/l10n/it.php index 98c83146d48..08e9989ebfb 100644 --- a/apps/files_external/l10n/it.php +++ b/apps/files_external/l10n/it.php @@ -2,18 +2,14 @@ "Access granted" => "Accesso consentito", "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", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Avviso:</b> \"smbclient\" non è installato. Impossibile montare condivisioni CIFS/SMB. Chiedi all'amministratore di sistema di installarlo.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Avviso:</b> il supporto FTP di PHP non è abilitato o non è installato. Impossibile montare condivisioni FTP. Chiedi all'amministratore di sistema di installarlo.", "External Storage" => "Archiviazione esterna", -"Mount point" => "Punto di mount", -"Backend" => "Motore", "Configuration" => "Configurazione", "Options" => "Opzioni", "Applicable" => "Applicabile", -"Add mount point" => "Aggiungi punto di mount", "None set" => "Nessuna impostazione", "All Users" => "Tutti gli utenti", "Groups" => "Gruppi", diff --git a/apps/files_external/l10n/ja_JP.php b/apps/files_external/l10n/ja_JP.php index cd09bb43db7..916251e6af0 100644 --- a/apps/files_external/l10n/ja_JP.php +++ b/apps/files_external/l10n/ja_JP.php @@ -2,18 +2,14 @@ "Access granted" => "アクセスは許可されました", "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ドライブストレージの設定エラー", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>警告:</b> \"smbclient\" はインストールされていません。CIFS/SMB 共有のマウントはできません。システム管理者にインストールをお願いして下さい。", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>警告:</b> PHPのFTPサポートは無効もしくはインストールされていません。FTP共有のマウントはできません。システム管理者にインストールをお願いして下さい。", "External Storage" => "外部ストレージ", -"Mount point" => "マウントポイント", -"Backend" => "バックエンド", "Configuration" => "設定", "Options" => "オプション", "Applicable" => "適用範囲", -"Add mount point" => "マウントポイントを追加", "None set" => "未設定", "All Users" => "すべてのユーザ", "Groups" => "グループ", diff --git a/apps/files_external/l10n/ka.php b/apps/files_external/l10n/ka.php new file mode 100644 index 00000000000..14c0625e1f2 --- /dev/null +++ b/apps/files_external/l10n/ka.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Users" => "მომხმარებლები" +); diff --git a/apps/files_external/l10n/ko.php b/apps/files_external/l10n/ko.php index 47b75f74b86..70f81765eb0 100644 --- a/apps/files_external/l10n/ko.php +++ b/apps/files_external/l10n/ko.php @@ -2,18 +2,14 @@ "Access granted" => "접근 허가됨", "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 드라이브 저장소 설정 오류", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>경고:</b> \"smbclient\"가 설치되지 않았습니다. CIFS/SMB 공유 자원에 연결할 수 없습니다. 시스템 관리자에게 설치를 요청하십시오.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>경고:</b> PHP FTP 지원이 비활성화되어 있거나 설치되지 않았습니다. FTP 공유를 마운트할 수 없습니다. 시스템 관리자에게 설치를 요청하십시오.", "External Storage" => "외부 저장소", -"Mount point" => "마운트 지점", -"Backend" => "백엔드", "Configuration" => "설정", "Options" => "옵션", "Applicable" => "적용 가능", -"Add mount point" => "마운트 지점 추가", "None set" => "설정되지 않음", "All Users" => "모든 사용자", "Groups" => "그룹", diff --git a/apps/files_external/l10n/lt_LT.php b/apps/files_external/l10n/lt_LT.php index cdb168dd385..fed5126073b 100644 --- a/apps/files_external/l10n/lt_LT.php +++ b/apps/files_external/l10n/lt_LT.php @@ -2,16 +2,12 @@ "Access granted" => "Priėjimas suteiktas", "Error configuring Dropbox storage" => "Klaida nustatinėjant Dropbox talpyklą", "Grant access" => "Suteikti priėjimą", -"Fill out all required fields" => "Užpildykite visus reikalingus laukelius", "Please provide a valid Dropbox app key and secret." => "Prašome įvesti teisingus Dropbox \"app key\" ir \"secret\".", "Error configuring Google Drive storage" => "Klaida nustatinėjant Google Drive talpyklą", "External Storage" => "Išorinės saugyklos", -"Mount point" => "Saugyklos pavadinimas", -"Backend" => "Posistemės pavadinimas", "Configuration" => "Konfigūracija", "Options" => "Nustatymai", "Applicable" => "Pritaikyti", -"Add mount point" => "Pridėti išorinę saugyklą", "None set" => "Nieko nepasirinkta", "All Users" => "Visi vartotojai", "Groups" => "Grupės", diff --git a/apps/files_external/l10n/lv.php b/apps/files_external/l10n/lv.php index ee53346fcde..0e8db930db2 100644 --- a/apps/files_external/l10n/lv.php +++ b/apps/files_external/l10n/lv.php @@ -2,18 +2,14 @@ "Access granted" => "Piešķirta pieeja", "Error configuring Dropbox storage" => "Kļūda, konfigurējot Dropbox krātuvi", "Grant access" => "Piešķirt pieeju", -"Fill out all required fields" => "Aizpildīt visus pieprasītos laukus", "Please provide a valid Dropbox app key and secret." => "Lūdzu, norādiet derīgu Dropbox lietotnes atslēgu un noslēpumu.", "Error configuring Google Drive storage" => "Kļūda, konfigurējot Google Drive krātuvi", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Brīdinājums:</b> nav uzinstalēts “smbclient”. Nevar montēt CIFS/SMB koplietojumus. Lūdzu, vaicājiet savam sistēmas administratoram, lai to uzinstalē.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Brīdinājums: </b> uz PHP nav aktivēts vai instalēts FTP atbalsts. Nevar montēt FTP koplietojumus. Lūdzu, vaicājiet savam sistēmas administratoram, lai to uzinstalē.", "External Storage" => "Ārējā krātuve", -"Mount point" => "Montēšanas punkts", -"Backend" => "Aizmugure", "Configuration" => "Konfigurācija", "Options" => "Opcijas", "Applicable" => "Piemērojams", -"Add mount point" => "Pievienot montēšanas punktu", "None set" => "Neviens nav iestatīts", "All Users" => "Visi lietotāji", "Groups" => "Grupas", diff --git a/apps/files_external/l10n/mk.php b/apps/files_external/l10n/mk.php index e3c1e4652b3..a7582e7e4bb 100644 --- a/apps/files_external/l10n/mk.php +++ b/apps/files_external/l10n/mk.php @@ -2,18 +2,14 @@ "Access granted" => "Пристапот е дозволен", "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 Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Внимание:</b> \"smbclient\" не е инсталиран. Не е можно монтирање на CIFS/SMB дискови. Замолете го Вашиот систем администратор да го инсталира.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Внимание:</b> Не е овозможена или инсталирани FTP подршка во PHP. Не е можно монтирање на FTP дискови. Замолете го Вашиот систем администратор да го инсталира.", "External Storage" => "Надворешно складиште", -"Mount point" => "Точка на монтирање", -"Backend" => "Админ", "Configuration" => "Конфигурација", "Options" => "Опции", "Applicable" => "Применливо", -"Add mount point" => "Додади точка на монтирање", "None set" => "Ништо поставено", "All Users" => "Сите корисници", "Groups" => "Групи", diff --git a/apps/files_external/l10n/my_MM.php b/apps/files_external/l10n/my_MM.php new file mode 100644 index 00000000000..5acfbb0321e --- /dev/null +++ b/apps/files_external/l10n/my_MM.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Users" => "သုံးစွဲသူ" +); diff --git a/apps/files_external/l10n/nl.php b/apps/files_external/l10n/nl.php index 132c8cf3ac2..1992409d25d 100644 --- a/apps/files_external/l10n/nl.php +++ b/apps/files_external/l10n/nl.php @@ -2,18 +2,14 @@ "Access granted" => "Toegang toegestaan", "Error configuring Dropbox storage" => "Fout tijdens het configureren van Dropbox opslag", "Grant access" => "Sta toegang toe", -"Fill out all required fields" => "Vul alle verplichte in", "Please provide a valid Dropbox app key and secret." => "Geef een geldige Dropbox key en secret.", "Error configuring Google Drive storage" => "Fout tijdens het configureren van Google Drive opslag", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Waarschuwing:</b> \"smbclient\" is niet geïnstalleerd. Mounten van CIFS/SMB shares is niet mogelijk. Vraag uw beheerder om smbclient te installeren.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Waarschuwing:</b> FTP ondersteuning in PHP is niet geactiveerd of geïnstalleerd. Mounten van FTP shares is niet mogelijk. Vraag uw beheerder FTP ondersteuning te installeren.", "External Storage" => "Externe opslag", -"Mount point" => "Aankoppelpunt", -"Backend" => "Backend", "Configuration" => "Configuratie", "Options" => "Opties", "Applicable" => "Van toepassing", -"Add mount point" => "Aankoppelpunt toevoegen", "None set" => "Niets ingesteld", "All Users" => "Alle gebruikers", "Groups" => "Groepen", diff --git a/apps/files_external/l10n/pl.php b/apps/files_external/l10n/pl.php index 0da31bb6b4a..29d9895d0ad 100644 --- a/apps/files_external/l10n/pl.php +++ b/apps/files_external/l10n/pl.php @@ -2,18 +2,14 @@ "Access granted" => "Dostęp do", "Error configuring Dropbox storage" => "Wystąpił błąd podczas konfigurowania zasobu Dropbox", "Grant access" => "Udziel dostępu", -"Fill out all required fields" => "Wypełnij wszystkie wymagane pola", "Please provide a valid Dropbox app key and secret." => "Proszę podać prawidłowy klucz aplikacji Dropbox i klucz sekretny.", "Error configuring Google Drive storage" => "Wystąpił błąd podczas konfigurowania zasobu Google Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Ostrzeżenie:</b> \"smbclient\" nie jest zainstalowany. Zamontowanie katalogów CIFS/SMB nie jest możliwe. Skontaktuj sie z administratorem w celu zainstalowania.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Ostrzeżenie:</b> Wsparcie dla FTP w PHP nie jest zainstalowane lub włączone. Skontaktuj sie z administratorem w celu zainstalowania lub włączenia go.", "External Storage" => "Zewnętrzna zasoby dyskowe", -"Mount point" => "Punkt montowania", -"Backend" => "Zaplecze", "Configuration" => "Konfiguracja", "Options" => "Opcje", "Applicable" => "Zastosowanie", -"Add mount point" => "Dodaj punkt montowania", "None set" => "Nie ustawione", "All Users" => "Wszyscy uzytkownicy", "Groups" => "Grupy", diff --git a/apps/files_external/l10n/pt_BR.php b/apps/files_external/l10n/pt_BR.php index 85393954886..fdd30e56b25 100644 --- a/apps/files_external/l10n/pt_BR.php +++ b/apps/files_external/l10n/pt_BR.php @@ -2,18 +2,14 @@ "Access granted" => "Acesso concedido", "Error configuring Dropbox storage" => "Erro ao configurar armazenamento do Dropbox", "Grant access" => "Permitir 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 um app key e secret válido do Dropbox", "Error configuring Google Drive storage" => "Erro ao configurar armazenamento do Google Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Aviso:</b> \"smbclient\" não está instalado. Não será possível montar compartilhamentos de CIFS/SMB. Por favor, peça ao seu administrador do sistema para instalá-lo.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Aviso:</b> O suporte para FTP do PHP não está ativado ou instalado. Não será possível montar compartilhamentos FTP. Por favor, peça ao seu administrador do sistema para instalá-lo.", "External Storage" => "Armazenamento Externo", -"Mount point" => "Ponto de montagem", -"Backend" => "Backend", "Configuration" => "Configuração", "Options" => "Opções", "Applicable" => "Aplicável", -"Add mount point" => "Adicionar ponto de montagem", "None set" => "Nenhum definido", "All Users" => "Todos os Usuários", "Groups" => "Grupos", diff --git a/apps/files_external/l10n/pt_PT.php b/apps/files_external/l10n/pt_PT.php index 06dbc0cf6bd..a47c2730bde 100644 --- a/apps/files_external/l10n/pt_PT.php +++ b/apps/files_external/l10n/pt_PT.php @@ -2,18 +2,14 @@ "Access granted" => "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", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Aviso:</b> O cliente \"smbclient\" não está instalado. Não é possível montar as partilhas CIFS/SMB . Peça ao seu administrador para instalar.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Aviso:</b> O suporte FTP no PHP não está activate ou instalado. Não é possível montar as partilhas FTP. Peça ao seu administrador para instalar.", "External Storage" => "Armazenamento Externo", -"Mount point" => "Ponto de montagem", -"Backend" => "Backend", "Configuration" => "Configuração", "Options" => "Opções", "Applicable" => "Aplicável", -"Add mount point" => "Adicionar ponto de montagem", "None set" => "Nenhum configurado", "All Users" => "Todos os utilizadores", "Groups" => "Grupos", diff --git a/apps/files_external/l10n/ro.php b/apps/files_external/l10n/ro.php index ca2c9f7e5c8..f9a49ad509f 100644 --- a/apps/files_external/l10n/ro.php +++ b/apps/files_external/l10n/ro.php @@ -2,18 +2,14 @@ "Access granted" => "Acces permis", "Error configuring Dropbox storage" => "Eroare la configurarea mediului de stocare Dropbox", "Grant access" => "Permite accesul", -"Fill out all required fields" => "Completează toate câmpurile necesare", "Please provide a valid Dropbox app key and secret." => "Prezintă te rog o cheie de Dropbox validă și parola", "Error configuring Google Drive storage" => "Eroare la configurarea mediului de stocare Google Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Atenție:</b> \"smbclient\" nu este instalat. Montarea mediilor CIFS/SMB partajate nu este posibilă. Solicită administratorului sistemului tău să îl instaleaze.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Atenție:</b> suportul pentru FTP în PHP nu este activat sau instalat. Montarea mediilor FPT partajate nu este posibilă. Solicită administratorului sistemului tău să îl instaleze.", "External Storage" => "Stocare externă", -"Mount point" => "Punctul de montare", -"Backend" => "Backend", "Configuration" => "Configurație", "Options" => "Opțiuni", "Applicable" => "Aplicabil", -"Add mount point" => "Adaugă punct de montare", "None set" => "Niciunul", "All Users" => "Toți utilizatorii", "Groups" => "Grupuri", diff --git a/apps/files_external/l10n/ru.php b/apps/files_external/l10n/ru.php index b8b5f5b1cb2..9ef3f80269e 100644 --- a/apps/files_external/l10n/ru.php +++ b/apps/files_external/l10n/ru.php @@ -2,18 +2,14 @@ "Access granted" => "Доступ предоставлен", "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 Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Внимание:</b> \"smbclient\" не установлен. Подключение по CIFS/SMB невозможно. Пожалуйста, обратитесь к системному администратору, чтобы установить его.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Внимание:</b> Поддержка FTP не включена в PHP. Подключение по FTP невозможно. Пожалуйста, обратитесь к системному администратору, чтобы включить.", "External Storage" => "Внешний носитель", -"Mount point" => "Точка монтирования", -"Backend" => "Подсистема", "Configuration" => "Конфигурация", "Options" => "Опции", "Applicable" => "Применимый", -"Add mount point" => "Добавить точку монтирования", "None set" => "Не установлено", "All Users" => "Все пользователи", "Groups" => "Группы", diff --git a/apps/files_external/l10n/ru_RU.php b/apps/files_external/l10n/ru_RU.php index e539b3cb2cf..7223a01e6d1 100644 --- a/apps/files_external/l10n/ru_RU.php +++ b/apps/files_external/l10n/ru_RU.php @@ -2,18 +2,14 @@ "Access granted" => "Доступ разрешен", "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 Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Предупреждение:</b> \"smbclient\" не установлен. Подключение общих папок CIFS/SMB невозможно. Пожалуйста, обратитесь к системному администратору, чтобы установить его.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Предупреждение:</b> Поддержка FTP в PHP не включена или не установлена. Подключение по FTP невозможно. Пожалуйста, обратитесь к системному администратору, чтобы установить ее.", "External Storage" => "Внешние системы хранения данных", -"Mount point" => "Точка монтирования", -"Backend" => "Бэкэнд", "Configuration" => "Конфигурация", "Options" => "Опции", "Applicable" => "Применимый", -"Add mount point" => "Добавить точку монтирования", "None set" => "Не задан", "All Users" => "Все пользователи", "Groups" => "Группы", diff --git a/apps/files_external/l10n/si_LK.php b/apps/files_external/l10n/si_LK.php index b8e2c5714b3..0baa638753f 100644 --- a/apps/files_external/l10n/si_LK.php +++ b/apps/files_external/l10n/si_LK.php @@ -2,16 +2,12 @@ "Access granted" => "පිවිසීමට හැක", "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 Drive ගබඩාව වින්යාස කිරීමේ දෝශයක් ඇත", "External Storage" => "භාහිර ගබඩාව", -"Mount point" => "මවුන්ට් කළ ස්ථානය", -"Backend" => "පසු පද්ධතිය", "Configuration" => "වින්යාසය", "Options" => "විකල්පයන්", "Applicable" => "අදාළ", -"Add mount point" => "මවුන්ට් කරන ස්ථානයක් එකතු කරන්න", "None set" => "කිසිවක් නැත", "All Users" => "සියළු පරිශීලකයන්", "Groups" => "කණ්ඩායම්", diff --git a/apps/files_external/l10n/sk_SK.php b/apps/files_external/l10n/sk_SK.php index d464d192ffc..e1d1293c9a7 100644 --- a/apps/files_external/l10n/sk_SK.php +++ b/apps/files_external/l10n/sk_SK.php @@ -2,18 +2,14 @@ "Access granted" => "Prístup povolený", "Error configuring Dropbox storage" => "Chyba pri konfigurácii úložiska Dropbox", "Grant access" => "Povoliť prístup", -"Fill out all required fields" => "Vyplňte všetky vyžadované kolónky", "Please provide a valid Dropbox app key and secret." => "Zadajte platný kľúč aplikácie a heslo Dropbox", "Error configuring Google Drive storage" => "Chyba pri konfigurácii úložiska Google drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Upozornenie:</b> \"smbclient\" nie je nainštalovaný. Nie je možné pripojenie oddielov CIFS/SMB. Požiadajte administrátora systému, nech ho nainštaluje.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Upozornenie:</b> Podpora FTP v PHP nie je povolená alebo nainštalovaná. Nie je možné pripojenie oddielov FTP. Požiadajte administrátora systému, nech ho nainštaluje.", "External Storage" => "Externé úložisko", -"Mount point" => "Prípojný bod", -"Backend" => "Backend", "Configuration" => "Nastavenia", "Options" => "Možnosti", "Applicable" => "Aplikovateľné", -"Add mount point" => "Pridať prípojný bod", "None set" => "Žiadne nastavené", "All Users" => "Všetci používatelia", "Groups" => "Skupiny", diff --git a/apps/files_external/l10n/sl.php b/apps/files_external/l10n/sl.php index f0db66ded96..b116c2613a1 100644 --- a/apps/files_external/l10n/sl.php +++ b/apps/files_external/l10n/sl.php @@ -2,18 +2,14 @@ "Access granted" => "Dostop je odobren", "Error configuring Dropbox storage" => "Napaka nastavljanja shrambe Dropbox", "Grant access" => "Odobri dostop", -"Fill out all required fields" => "Zapolni vsa zahtevana polja", "Please provide a valid Dropbox app key and secret." => "Vpišite veljaven ključ programa in kodo za Dropbox", "Error configuring Google Drive storage" => "Napaka nastavljanja shrambe Google Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Opozorilo:</b> \"smbclient\" ni nameščen. Priklapljanje CIFS/SMB pogonov ni mogoče. Prosimo, prosite vašega skrbnika, če ga namesti.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Opozorilo:</b> FTP podpora v PHP ni omogočena ali nameščena. Priklapljanje FTP pogonov ni mogoče. Prosimo, prosite vašega skrbnika, če jo namesti ali omogoči.", "External Storage" => "Zunanja podatkovna shramba", -"Mount point" => "Priklopna točka", -"Backend" => "Zaledje", "Configuration" => "Nastavitve", "Options" => "Možnosti", "Applicable" => "Se uporablja", -"Add mount point" => "Dodaj priklopno točko", "None set" => "Ni nastavljeno", "All Users" => "Vsi uporabniki", "Groups" => "Skupine", diff --git a/apps/files_external/l10n/sv.php b/apps/files_external/l10n/sv.php index 0d42a1f4682..9ad7f688bb2 100644 --- a/apps/files_external/l10n/sv.php +++ b/apps/files_external/l10n/sv.php @@ -2,18 +2,14 @@ "Access granted" => "Å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", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Varning:</b> \"smb-klienten\" är inte installerad. Montering av CIFS/SMB delningar är inte möjligt. Kontakta din systemadministratör för att få den installerad.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Varning:</b> Stöd för FTP i PHP är inte aktiverat eller installerat. Montering av FTP-delningar är inte möjligt. Kontakta din systemadministratör för att få det installerat.", "External Storage" => "Extern lagring", -"Mount point" => "Monteringspunkt", -"Backend" => "Källa", "Configuration" => "Konfiguration", "Options" => "Alternativ", "Applicable" => "Tillämplig", -"Add mount point" => "Lägg till monteringspunkt", "None set" => "Ingen angiven", "All Users" => "Alla användare", "Groups" => "Grupper", diff --git a/apps/files_external/l10n/ta_LK.php b/apps/files_external/l10n/ta_LK.php index 1e01b22efa0..1f5575dc51a 100644 --- a/apps/files_external/l10n/ta_LK.php +++ b/apps/files_external/l10n/ta_LK.php @@ -2,16 +2,12 @@ "Access granted" => "அனுமதி வழங்கப்பட்டது", "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" => "பின்நிலை", "Configuration" => "தகவமைப்பு", "Options" => "தெரிவுகள்", "Applicable" => "பயன்படத்தக்க", -"Add mount point" => "ஏற்றப்புள்ளியை சேர்க்க", "None set" => "தொகுப்பில்லா", "All Users" => "பயனாளர்கள் எல்லாம்", "Groups" => "குழுக்கள்", diff --git a/apps/files_external/l10n/th_TH.php b/apps/files_external/l10n/th_TH.php index 870995c8e7a..bd98e7564ac 100644 --- a/apps/files_external/l10n/th_TH.php +++ b/apps/files_external/l10n/th_TH.php @@ -2,18 +2,14 @@ "Access granted" => "การเข้าถึงได้รับอนุญาตแล้ว", "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", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>คำเตือน:</b> \"smbclient\" ยังไม่ได้ถูกติดตั้ง. การชี้ CIFS/SMB เพื่อแชร์ข้อมูลไม่สามารถกระทำได้ กรุณาสอบถามข้อมูลเพิ่มเติมจากผู้ดูแลระบบเพื่อติดตั้ง.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>คำเตือน:</b> การสนับสนุนการใช้งาน FTP ในภาษา PHP ยังไม่ได้ถูกเปิดใช้งานหรือถูกติดตั้ง. การชี้ FTP เพื่อแชร์ข้อมูลไม่สามารถดำเนินการได้ กรุณาสอบถามข้อมูลเพิ่มเติมจากผู้ดูแลระบบเพื่อติดตั้ง", "External Storage" => "พื้นทีจัดเก็บข้อมูลจากภายนอก", -"Mount point" => "จุดชี้ตำแหน่ง", -"Backend" => "ด้านหลังระบบ", "Configuration" => "การกำหนดค่า", "Options" => "ตัวเลือก", "Applicable" => "สามารถใช้งานได้", -"Add mount point" => "เพิ่มจุดชี้ตำแหน่ง", "None set" => "ยังไม่มีการกำหนด", "All Users" => "ผู้ใช้งานทั้งหมด", "Groups" => "กลุ่ม", diff --git a/apps/files_external/l10n/tr.php b/apps/files_external/l10n/tr.php index bbe6f5b6bec..8198e67bdc5 100644 --- a/apps/files_external/l10n/tr.php +++ b/apps/files_external/l10n/tr.php @@ -1,15 +1,11 @@ <?php $TRANSLATIONS = array( "Access granted" => "Giriş kabul edildi", "Grant access" => "Erişim sağlandı", -"Fill out all required fields" => "Doldurulması zorunlu alanları doldur", "Please provide a valid Dropbox app key and secret." => "Lütfen Dropbox app key ve secret temin ediniz", "External Storage" => "Harici Depolama", -"Mount point" => "Bağlama Noktası", -"Backend" => "Yönetici", "Configuration" => "Yapılandırma", "Options" => "Seçenekler", "Applicable" => "Uygulanabilir", -"Add mount point" => "Bağlama noktası ekle", "None set" => "Hiçbiri", "All Users" => "Tüm Kullanıcılar", "Groups" => "Gruplar", diff --git a/apps/files_external/l10n/uk.php b/apps/files_external/l10n/uk.php index 56169171f64..eaa3e3fdbe3 100644 --- a/apps/files_external/l10n/uk.php +++ b/apps/files_external/l10n/uk.php @@ -2,18 +2,14 @@ "Access granted" => "Доступ дозволено", "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 Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Попередження:</b> Клієнт \"smbclient\" не встановлено. Під'єднанатися до CIFS/SMB тек неможливо. Попрохайте системного адміністратора встановити його.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Попередження:</b> Підтримка FTP в PHP не увімкнута чи не встановлена. Під'єднанатися до FTP тек неможливо. Попрохайте системного адміністратора встановити її.", "External Storage" => "Зовнішні сховища", -"Mount point" => "Точка монтування", -"Backend" => "Backend", "Configuration" => "Налаштування", "Options" => "Опції", "Applicable" => "Придатний", -"Add mount point" => "Додати точку монтування", "None set" => "Не встановлено", "All Users" => "Усі користувачі", "Groups" => "Групи", diff --git a/apps/files_external/l10n/ur_PK.php b/apps/files_external/l10n/ur_PK.php new file mode 100644 index 00000000000..278357b4d68 --- /dev/null +++ b/apps/files_external/l10n/ur_PK.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Users" => "یوزرز" +); diff --git a/apps/files_external/l10n/vi.php b/apps/files_external/l10n/vi.php index c522c669e1e..e59b405ef6e 100644 --- a/apps/files_external/l10n/vi.php +++ b/apps/files_external/l10n/vi.php @@ -2,18 +2,14 @@ "Access granted" => "Đã cấp quyền truy cập", "Error configuring Dropbox storage" => "Lỗi cấu hình lưu trữ Dropbox ", "Grant access" => "Cấp quyền truy cập", -"Fill out all required fields" => "Điền vào tất cả các trường bắt buộc", "Please provide a valid Dropbox app key and secret." => "Xin vui lòng cung cấp một ứng dụng Dropbox hợp lệ và mã bí mật.", "Error configuring Google Drive storage" => "Lỗi cấu hình lưu trữ Google Drive", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Cảnh báo:</b> \"smbclient\" chưa được cài đặt. Mount CIFS/SMB shares là không thể thực hiện được. Hãy hỏi người quản trị hệ thống để cài đặt nó.", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Cảnh báo:</b> FTP trong PHP chưa được cài đặt hoặc chưa được mở. Mount FTP shares là không thể. Xin hãy yêu cầu quản trị hệ thống của bạn cài đặt nó.", "External Storage" => "Lưu trữ ngoài", -"Mount point" => "Điểm gắn", -"Backend" => "phụ trợ", "Configuration" => "Cấu hình", "Options" => "Tùy chọn", "Applicable" => "Áp dụng", -"Add mount point" => "Thêm điểm lắp", "None set" => "không", "All Users" => "Tất cả người dùng", "Groups" => "Nhóm", diff --git a/apps/files_external/l10n/zh_CN.GB2312.php b/apps/files_external/l10n/zh_CN.GB2312.php index 47983d3d7d4..2c50b452f0a 100644 --- a/apps/files_external/l10n/zh_CN.GB2312.php +++ b/apps/files_external/l10n/zh_CN.GB2312.php @@ -2,16 +2,12 @@ "Access granted" => "已授予权限", "Error configuring Dropbox storage" => "配置 Dropbox 存储出错", "Grant access" => "授予权限", -"Fill out all required fields" => "填充全部必填字段", "Please provide a valid Dropbox app key and secret." => "请提供一个有效的 Dropbox app key 和 secret。", "Error configuring Google Drive storage" => "配置 Google Drive 存储失败", "External Storage" => "外部存储", -"Mount point" => "挂载点", -"Backend" => "后端", "Configuration" => "配置", "Options" => "选项", "Applicable" => "可应用", -"Add mount point" => "添加挂载点", "None set" => "未设置", "All Users" => "所有用户", "Groups" => "群组", diff --git a/apps/files_external/l10n/zh_CN.php b/apps/files_external/l10n/zh_CN.php index 1bb88564630..8c7eb8c62da 100644 --- a/apps/files_external/l10n/zh_CN.php +++ b/apps/files_external/l10n/zh_CN.php @@ -2,18 +2,14 @@ "Access granted" => "权限已授予。", "Error configuring Dropbox storage" => "配置Dropbox存储时出错", "Grant access" => "授权", -"Fill out all required fields" => "完成所有必填项", "Please provide a valid Dropbox app key and secret." => "请提供有效的Dropbox应用key和secret", "Error configuring Google Drive storage" => "配置Google Drive存储时出错", "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>警告:</b>“smbclient” 尚未安装。CIFS/SMB 分享挂载无法实现。请咨询系统管理员进行安装。", "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>警告:</b>PHP中尚未启用或安装FTP。FTP 分享挂载无法实现。请咨询系统管理员进行安装。", "External Storage" => "外部存储", -"Mount point" => "挂载点", -"Backend" => "后端", "Configuration" => "配置", "Options" => "选项", "Applicable" => "适用的", -"Add mount point" => "增加挂载点", "None set" => "未设置", "All Users" => "所有用户", "Groups" => "组", diff --git a/apps/files_external/l10n/zh_TW.php b/apps/files_external/l10n/zh_TW.php index ab8c4caf24a..37a8b570217 100644 --- a/apps/files_external/l10n/zh_TW.php +++ b/apps/files_external/l10n/zh_TW.php @@ -1,6 +1,5 @@ <?php $TRANSLATIONS = array( "External Storage" => "外部儲存裝置", -"Mount point" => "掛載點", "None set" => "尚未設定", "All Users" => "所有使用者", "Groups" => "群組", diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 37e53a3a670..7bcefd4176c 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -33,12 +33,16 @@ class AmazonS3 extends \OC\Files\Storage\Common { private static $tempFiles = array(); - // TODO options: storage class, encryption server side, encrypt before upload? + // TODO Update to new AWS SDK public function __construct($params) { - $this->id = 'amazon::' . $params['key'] . md5($params['secret']); - $this->s3 = new \AmazonS3(array('key' => $params['key'], 'secret' => $params['secret'])); - $this->bucket = $params['bucket']; + if (isset($params['key']) && isset($params['secret']) && isset($params['bucket'])) { + $this->id = 'amazon::' . $params['key'] . md5($params['secret']); + $this->s3 = new \AmazonS3(array('key' => $params['key'], 'secret' => $params['secret'])); + $this->bucket = $params['bucket']; + } else { + throw new \Exception(); + } } private function getObject($path) { @@ -240,4 +244,12 @@ class AmazonS3 extends \OC\Files\Storage\Common { return $response->isOK(); } + public function test() { + $test = $this->s3->get_canonical_user_id(); + if (isset($test['id']) && $test['id'] != '') { + return true; + } + return false; + } + } diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index d31c2f35a68..430269e03d9 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -38,7 +38,7 @@ class OC_Mount_Config { * @return array */ public static function getBackends() { - + $backends['\OC\Files\Storage\Local']=array( 'backend' => 'Local', 'configuration' => array( @@ -77,7 +77,7 @@ class OC_Mount_Config { 'token' => '#token', 'token_secret' => '#token secret'), 'custom' => 'google'); - + $backends['\OC\Files\Storage\SWIFT']=array( 'backend' => 'OpenStack Swift', 'configuration' => array( @@ -86,7 +86,7 @@ class OC_Mount_Config { 'token' => '*Token', 'root' => '&Root', 'secure' => '!Secure ftps://')); - + if(OC_Mount_Config::checksmbclient()) $backends['\OC\Files\Storage\SMB']=array( 'backend' => 'SMB / CIFS', 'configuration' => array( @@ -95,7 +95,7 @@ class OC_Mount_Config { 'password' => '*Password', 'share' => 'Share', 'root' => '&Root')); - + $backends['\OC\Files\Storage\DAV']=array( 'backend' => 'ownCloud / WebDAV', 'configuration' => array( @@ -104,13 +104,13 @@ class OC_Mount_Config { 'password' => '*Password', 'root' => '&Root', 'secure' => '!Secure https://')); - + $backends['\OC\Files\Storage\SFTP']=array( 'backend' => 'SFTP', 'configuration' => array( 'host' => 'URL', - 'user' => 'Username', - 'password' => '*Password', + 'user' => 'Username', + 'password' => '*Password', 'root' => '&Root')); return($backends); @@ -143,7 +143,9 @@ class OC_Mount_Config { 'class' => $mount['class'], 'backend' => $backends[$mount['class']]['backend'], 'configuration' => $mount['options'], - 'applicable' => array('groups' => array($group), 'users' => array())); + 'applicable' => array('groups' => array($group), 'users' => array()), + 'status' => self::getBackendStatus($mount['class'], $mount['options']) + ); } } } @@ -162,10 +164,13 @@ class OC_Mount_Config { $system[$mountPoint]['applicable']['users'] = array_merge($system[$mountPoint]['applicable']['users'], array($user)); } else { - $system[$mountPoint] = array('class' => $mount['class'], + $system[$mountPoint] = array( + 'class' => $mount['class'], 'backend' => $backends[$mount['class']]['backend'], 'configuration' => $mount['options'], - 'applicable' => array('groups' => array(), 'users' => array($user))); + 'applicable' => array('groups' => array(), 'users' => array($user)), + 'status' => self::getBackendStatus($mount['class'], $mount['options']) + ); } } } @@ -190,14 +195,32 @@ class OC_Mount_Config { $mount['class'] = '\OC\Files\Storage\\'.substr($mount['class'], 15); } // Remove '/uid/files/' from mount point - $personal[substr($mountPoint, strlen($uid) + 8)] = array('class' => $mount['class'], - 'backend' => $backends[$mount['class']]['backend'], - 'configuration' => $mount['options']); + $personal[substr($mountPoint, strlen($uid) + 8)] = array( + 'class' => $mount['class'], + 'backend' => $backends[$mount['class']]['backend'], + 'configuration' => $mount['options'], + 'status' => self::getBackendStatus($mount['class'], $mount['options']) + ); } } return $personal; } + private static function getBackendStatus($class, $options) { + foreach ($options as &$option) { + $option = str_replace('$user', OCP\User::getUser(), $option); + } + if (class_exists($class)) { + try { + $storage = new $class($options); + return $storage->test(); + } catch (Exception $exception) { + return false; + } + } + return false; + } + /** * Add a mount point to the filesystem * @param string Mount point @@ -238,7 +261,7 @@ class OC_Mount_Config { $mountPoints[$mountType] = $mount; } self::writeData($isPersonal, $mountPoints); - return true; + return self::getBackendStatus($class, $classOptions); } /** @@ -378,7 +401,7 @@ class OC_Mount_Config { } /** - * check if php-ftp is installed + * check if php-ftp is installed */ public static function checkphpftp() { if(function_exists('ftp_login')) { diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php index 11644e4a2c8..cb04e557f8a 100755 --- a/apps/files_external/lib/dropbox.php +++ b/apps/files_external/lib/dropbox.php @@ -40,8 +40,8 @@ class Dropbox extends \OC\Files\Storage\Common { && isset($params['token']) && isset($params['token_secret']) ) { - $this->id = 'dropbox::'.$params['app_key'] . $params['token']. '/' . $params['root']; - $this->root=isset($params['root'])?$params['root']:''; + $this->root = isset($params['root']) ? $params['root'] : ''; + $this->id = 'dropbox::'.$params['app_key'] . $params['token']. '/' . $this->root; $oauth = new \Dropbox_OAuth_Curl($params['app_key'], $params['app_secret']); $oauth->setToken($params['token'], $params['token_secret']); $this->dropbox = new \Dropbox_API($oauth, 'dropbox'); diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php index 9b6c037bb57..8a7375ebe38 100644 --- a/apps/files_external/lib/ftp.php +++ b/apps/files_external/lib/ftp.php @@ -18,26 +18,31 @@ class FTP extends \OC\Files\Storage\StreamWrapper{ private static $tempFiles=array(); public function __construct($params) { - $this->host=$params['host']; - $this->user=$params['user']; - $this->password=$params['password']; - if (isset($params['secure'])) { - if (is_string($params['secure'])) { - $this->secure = ($params['secure'] === 'true'); + if (isset($params['host']) && isset($params['user']) && isset($params['password'])) { + $this->host=$params['host']; + $this->user=$params['user']; + $this->password=$params['password']; + if (isset($params['secure'])) { + if (is_string($params['secure'])) { + $this->secure = ($params['secure'] === 'true'); + } else { + $this->secure = (bool)$params['secure']; + } } else { - $this->secure = (bool)$params['secure']; + $this->secure = false; + } + $this->root=isset($params['root'])?$params['root']:'/'; + if ( ! $this->root || $this->root[0]!='/') { + $this->root='/'.$this->root; + } + //create the root folder if necessary + if ( ! $this->is_dir('')) { + $this->mkdir(''); } } else { - $this->secure = false; - } - $this->root=isset($params['root'])?$params['root']:'/'; - if ( ! $this->root || $this->root[0]!='/') { - $this->root='/'.$this->root; - } - //create the root folder if necesary - if ( ! $this->is_dir('')) { - $this->mkdir(''); + throw new \Exception(); } + } public function getId(){ @@ -83,7 +88,7 @@ class FTP extends \OC\Files\Storage\StreamWrapper{ } else { $ext=''; } - $tmpFile=OCP\Files::tmpFile($ext); + $tmpFile=\OCP\Files::tmpFile($ext); \OC\Files\Stream\Close::registerCallback($tmpFile, array($this, 'writeBack')); if ($this->file_exists($path)) { $this->getFile($path, $tmpFile); diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index f9bd4075f3e..ec7de3f3570 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -596,4 +596,11 @@ class Google extends \OC\Files\Storage\Common { } + public function test() { + if ($this->free_space('')) { + return true; + } + return false; + } + } diff --git a/apps/files_external/lib/sftp.php b/apps/files_external/lib/sftp.php index 785eb7dfc42..ede6c251fd9 100644 --- a/apps/files_external/lib/sftp.php +++ b/apps/files_external/lib/sftp.php @@ -32,7 +32,7 @@ class SFTP extends \OC\Files\Storage\Common { $this->root = isset($params['root']) ? $this->cleanPath($params['root']) : '/'; if ($this->root[0] != '/') $this->root = '/' . $this->root; if (substr($this->root, -1, 1) != '/') $this->root .= '/'; - + $host_keys = $this->read_host_keys(); $this->client = new \Net_SFTP($this->host); @@ -50,18 +50,18 @@ class SFTP extends \OC\Files\Storage\Common { $host_keys[$this->host] = $current_host_key; $this->write_host_keys($host_keys); } - + if(!$this->file_exists('')){ $this->mkdir(''); } } - + public function test() { if (!isset($params['host']) || !isset($params['user']) || !isset($params['password'])) { throw new \Exception("Required parameters not set"); - } + } } - + public function getId(){ return 'sftp::' . $this->user . '@' . $this->host . '/' . $this->root; } @@ -109,7 +109,7 @@ class SFTP extends \OC\Files\Storage\Common { $host_key_arr = explode("::", $line, 2); if (count($host_key_arr) == 2) { $hosts[] = $host_key_arr[0]; - $keys[] = $host_key_arr[1]; + $keys[] = $host_key_arr[1]; } } return array_combine($hosts, $keys); @@ -203,7 +203,7 @@ class SFTP extends \OC\Files\Storage\Common { $tmp = \OC_Helper::tmpFile($ext); $this->getFile($abs_path, $tmp); return fopen($tmp, $mode); - + case 'w': case 'wb': case 'a': diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index 62f6591d25a..961efb1a50a 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -18,22 +18,26 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ private $share; public function __construct($params) { - $this->host=$params['host']; - $this->user=$params['user']; - $this->password=$params['password']; - $this->share=$params['share']; - $this->root=isset($params['root'])?$params['root']:'/'; - if ( ! $this->root || $this->root[0]!='/') { - $this->root='/'.$this->root; - } - if (substr($this->root, -1, 1)!='/') { - $this->root.='/'; - } - if ( ! $this->share || $this->share[0]!='/') { - $this->share='/'.$this->share; - } - if(substr($this->share, -1, 1)=='/') { - $this->share = substr($this->share, 0, -1); + if (isset($params['host']) && isset($params['user']) && isset($params['password']) && isset($params['share'])) { + $this->host=$params['host']; + $this->user=$params['user']; + $this->password=$params['password']; + $this->share=$params['share']; + $this->root=isset($params['root'])?$params['root']:'/'; + if ( ! $this->root || $this->root[0]!='/') { + $this->root='/'.$this->root; + } + if (substr($this->root, -1, 1)!='/') { + $this->root.='/'; + } + if ( ! $this->share || $this->share[0]!='/') { + $this->share='/'.$this->share; + } + if (substr($this->share, -1, 1)=='/') { + $this->share = substr($this->share, 0, -1); + } + } else { + throw new \Exception(); } } diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index a00316c1f84..68c4b48f17c 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -264,27 +264,31 @@ class SWIFT extends \OC\Files\Storage\Common{ private function getSubContainerFile($container) { try { return $container->get_object(self::SUBCONTAINER_FILE); - } catch(NoSuchObjectException $e) { + } catch(\NoSuchObjectException $e) { return $container->create_object(self::SUBCONTAINER_FILE); } } public function __construct($params) { - $this->token=$params['token']; - $this->host=$params['host']; - $this->user=$params['user']; - $this->root=isset($params['root'])?$params['root']:'/'; - if (isset($params['secure'])) { - if (is_string($params['secure'])) { - $this->secure = ($params['secure'] === 'true'); + if (isset($params['token']) && isset($params['host']) && isset($params['user'])) { + $this->token=$params['token']; + $this->host=$params['host']; + $this->user=$params['user']; + $this->root=isset($params['root'])?$params['root']:'/'; + if (isset($params['secure'])) { + if (is_string($params['secure'])) { + $this->secure = ($params['secure'] === 'true'); + } else { + $this->secure = (bool)$params['secure']; + } } else { - $this->secure = (bool)$params['secure']; + $this->secure = false; + } + if ( ! $this->root || $this->root[0]!='/') { + $this->root='/'.$this->root; } } else { - $this->secure = false; - } - if ( ! $this->root || $this->root[0]!='/') { - $this->root='/'.$this->root; + throw new \Exception(); } } diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php index 91cc22779e6..3ba7c48cd57 100644 --- a/apps/files_external/lib/webdav.php +++ b/apps/files_external/lib/webdav.php @@ -23,28 +23,32 @@ class DAV extends \OC\Files\Storage\Common{ private static $tempFiles=array(); public function __construct($params) { - $host = $params['host']; - //remove leading http[s], will be generated in createBaseUri() - if (substr($host, 0, 8) == "https://") $host = substr($host, 8); - else if (substr($host, 0, 7) == "http://") $host = substr($host, 7); - $this->host=$host; - $this->user=$params['user']; - $this->password=$params['password']; - if (isset($params['secure'])) { - if (is_string($params['secure'])) { - $this->secure = ($params['secure'] === 'true'); + if (isset($params['host']) && isset($params['user']) && isset($params['password'])) { + $host = $params['host']; + //remove leading http[s], will be generated in createBaseUri() + if (substr($host, 0, 8) == "https://") $host = substr($host, 8); + else if (substr($host, 0, 7) == "http://") $host = substr($host, 7); + $this->host=$host; + $this->user=$params['user']; + $this->password=$params['password']; + if (isset($params['secure'])) { + if (is_string($params['secure'])) { + $this->secure = ($params['secure'] === 'true'); + } else { + $this->secure = (bool)$params['secure']; + } } else { - $this->secure = (bool)$params['secure']; + $this->secure = false; + } + $this->root=isset($params['root'])?$params['root']:'/'; + if ( ! $this->root || $this->root[0]!='/') { + $this->root='/'.$this->root; + } + if (substr($this->root, -1, 1)!='/') { + $this->root.='/'; } } else { - $this->secure = false; - } - $this->root=isset($params['root'])?$params['root']:'/'; - if ( ! $this->root || $this->root[0]!='/') { - $this->root='/'.$this->root; - } - if (substr($this->root, -1, 1)!='/') { - $this->root.='/'; + throw new \Exception(); } } @@ -54,11 +58,11 @@ class DAV extends \OC\Files\Storage\Common{ } $this->ready = true; - $settings = array( - 'baseUri' => $this->createBaseUri(), - 'userName' => $this->user, - 'password' => $this->password, - ); + $settings = array( + 'baseUri' => $this->createBaseUri(), + 'userName' => $this->user, + 'password' => $this->password, + ); $this->client = new \Sabre_DAV_Client($settings); @@ -69,7 +73,7 @@ class DAV extends \OC\Files\Storage\Common{ $this->client->addTrustedCertificates($certPath); } } - //create the root folder if necesary + //create the root folder if necessary $this->mkdir(''); } @@ -313,7 +317,7 @@ class DAV extends \OC\Files\Storage\Common{ } } - private function cleanPath($path) { + public function cleanPath($path) { if ( ! $path || $path[0]=='/') { return substr($path, 1); } else { diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 3709fd2e51d..76d691eedb2 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -5,8 +5,9 @@ <table id="externalStorage" data-admin='<?php echo json_encode($_['isAdminPage']); ?>'> <thead> <tr> - <th><?php echo $l->t('Mount point'); ?></th> - <th><?php echo $l->t('Backend'); ?></th> + <th></th> + <th><?php echo $l->t('Folder name'); ?></th> + <th><?php echo $l->t('External storage'); ?></th> <th><?php echo $l->t('Configuration'); ?></th> <!--<th><?php echo $l->t('Options'); ?></th> --> <?php if ($_['isAdminPage']) echo '<th>'.$l->t('Applicable').'</th>'; ?> @@ -17,14 +18,19 @@ <?php $_['mounts'] = array_merge($_['mounts'], array('' => array())); ?> <?php foreach ($_['mounts'] as $mountPoint => $mount): ?> <tr <?php echo ($mountPoint != '') ? 'class="'.$mount['class'].'"' : 'id="addMountPoint"'; ?>> + <td class="status"> + <?php if (isset($mount['status'])): ?> + <span class="<?php echo ($mount['status']) ? 'success' : 'error'; ?>"></span> + <?php endif; ?> + </td> <td class="mountPoint"><input type="text" name="mountPoint" value="<?php p($mountPoint); ?>" - placeholder="<?php echo $l->t('Mount point'); ?>" /></td> + placeholder="<?php echo $l->t('Folder name'); ?>" /></td> <?php if ($mountPoint == ''): ?> <td class="backend"> <select id="selectBackend" data-configurations='<?php echo json_encode($_['backends']); ?>'> <option value="" disabled selected - style="display:none;"><?php echo $l->t('Add mount point'); ?></option> + style="display:none;"><?php echo $l->t('Add storage'); ?></option> <?php foreach ($_['backends'] as $class => $backend): ?> <option value="<?php echo $class; ?>"><?php echo $backend['backend']; ?></option> <?php endforeach; ?> @@ -67,9 +73,8 @@ <?php endif; ?> <?php endif; ?> <?php endforeach; ?> - <?php if (isset($_['backends'][$mount['class']]['custom'])): ?> - <?php OCP\Util::addScript('files_external', - $_['backends'][$mount['class']]['custom']); ?> + <?php if (isset($_['backends'][$mount['class']]['custom']) && !in_array('files_external/js/'.$_['backends'][$mount['class']]['custom'], \OC_Util::$scripts)): ?> + <?php OCP\Util::addScript('files_external', $_['backends'][$mount['class']]['custom']); ?> <?php endif; ?> <?php endif; ?> </td> diff --git a/apps/files_sharing/appinfo/info.xml b/apps/files_sharing/appinfo/info.xml index 1f24a4dde83..9a199281a76 100644 --- a/apps/files_sharing/appinfo/info.xml +++ b/apps/files_sharing/appinfo/info.xml @@ -5,7 +5,7 @@ <description>File sharing between users</description> <licence>AGPL</licence> <author>Michael Gapczynski</author> - <require>4.91</require> + <require>4.93</require> <shipped>true</shipped> <default_enable/> <types> diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php index 1d22b32b503..48e41e93048 100644 --- a/apps/files_sharing/appinfo/update.php +++ b/apps/files_sharing/appinfo/update.php @@ -52,7 +52,10 @@ if (version_compare($installedVersion, '0.3', '<')) { } catch (Exception $e) { $update_error = true; - OCP\Util::writeLog('files_sharing', 'Upgrade Routine: Skipping sharing "'.$row['source'].'" to "'.$shareWith.'" (error is "'.$e->getMessage().'")', OCP\Util::WARN); + OCP\Util::writeLog('files_sharing', + 'Upgrade Routine: Skipping sharing "'.$row['source'].'" to "'.$shareWith + .'" (error is "'.$e->getMessage().'")', + OCP\Util::WARN); } OC_Util::tearDownFS(); } diff --git a/apps/files_sharing/l10n/ka.php b/apps/files_sharing/l10n/ka.php new file mode 100644 index 00000000000..0270d5d6f8c --- /dev/null +++ b/apps/files_sharing/l10n/ka.php @@ -0,0 +1,4 @@ +<?php $TRANSLATIONS = array( +"Password" => "პაროლი", +"Download" => "გადმოწერა" +); diff --git a/apps/files_sharing/l10n/my_MM.php b/apps/files_sharing/l10n/my_MM.php new file mode 100644 index 00000000000..dc7ec17e9c5 --- /dev/null +++ b/apps/files_sharing/l10n/my_MM.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Password" => "စကားဝှက်", +"Submit" => "ထည့်သွင်းမည်", +"Download" => "ဒေါင်းလုတ်", +"web services under your control" => "သင်၏ထိန်းချုပ်မှု့အောက်တွင်ရှိသော Web services" +); diff --git a/apps/files_sharing/l10n/ur_PK.php b/apps/files_sharing/l10n/ur_PK.php new file mode 100644 index 00000000000..f68b714350f --- /dev/null +++ b/apps/files_sharing/l10n/ur_PK.php @@ -0,0 +1,4 @@ +<?php $TRANSLATIONS = array( +"Password" => "پاسورڈ", +"web services under your control" => "آپ کے اختیار میں ویب سروسیز" +); diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 851e958f686..6f834e08999 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -79,8 +79,9 @@ class Shared_Cache extends Cache { } } else { $query = \OC_DB::prepare( - 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted` - FROM `*PREFIX*filecache` WHERE `fileid` = ?'); + 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`,' + .' `size`, `mtime`, `encrypted`' + .' FROM `*PREFIX*filecache` WHERE `fileid` = ?'); $result = $query->execute(array($file)); $data = $result->fetchRow(); $data['fileid'] = (int)$data['fileid']; diff --git a/apps/files_sharing/lib/permissions.php b/apps/files_sharing/lib/permissions.php index 2b068ff9350..72c1ec96c46 100644 --- a/apps/files_sharing/lib/permissions.php +++ b/apps/files_sharing/lib/permissions.php @@ -33,7 +33,8 @@ class Shared_Permissions extends Permissions { if ($fileId == -1) { return \OCP\PERMISSION_READ; } - $source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE, null, true); + $source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE, + null, true); if ($source) { return $source['permissions']; } else { diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php index ceabc7d548b..b5d506b173b 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -72,7 +72,11 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { public function formatItems($items, $format, $parameters = null) { if ($format == self::FORMAT_SHARED_STORAGE) { // Only 1 item should come through for this format call - return array('path' => $items[key($items)]['path'], 'permissions' => $items[key($items)]['permissions'], 'uid_owner' => $items[key($items)]['uid_owner']); + return array( + 'path' => $items[key($items)]['path'], + 'permissions' => $items[key($items)]['permissions'], + 'uid_owner' => $items[key($items)]['uid_owner'] + ); } else if ($format == self::FORMAT_GET_FOLDER_CONTENTS) { $files = array(); foreach ($items as $item) { @@ -100,7 +104,13 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { } $size += (int)$item['size']; } - return array('fileid' => -1, 'name' => 'Shared', 'mtime' => $mtime, 'mimetype' => 'httpd/unix-directory', 'size' => $size); + return array( + 'fileid' => -1, + 'name' => 'Shared', + 'mtime' => $mtime, + 'mimetype' => 'httpd/unix-directory', + 'size' => $size + ); } else if ($format == self::FORMAT_OPENDIR) { $files = array(); foreach ($items as $item) { diff --git a/apps/files_sharing/lib/share/folder.php b/apps/files_sharing/lib/share/folder.php index 11c8c6b1e80..4426beec636 100644 --- a/apps/files_sharing/lib/share/folder.php +++ b/apps/files_sharing/lib/share/folder.php @@ -33,7 +33,8 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share } while (!empty($parents)) { $parents = "'".implode("','", $parents)."'"; - $query = OC_DB::prepare('SELECT `fileid`, `name`, `mimetype` FROM `*PREFIX*filecache` WHERE `parent` IN ('.$parents.')'); + $query = OC_DB::prepare('SELECT `fileid`, `name`, `mimetype` FROM `*PREFIX*filecache`' + .' WHERE `parent` IN ('.$parents.')'); $result = $query->execute(); $parents = array(); while ($file = $result->fetchRow()) { @@ -47,4 +48,4 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share return $children; } -}
\ No newline at end of file +} diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 0163f2e00b4..19abc838258 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -250,7 +250,8 @@ class Shared extends \OC\Files\Storage\Common { public function file_put_contents($path, $data) { if ($source = $this->getSourcePath($path)) { // Check if permission is granted - if (($this->file_exists($path) && !$this->isUpdatable($path)) || ($this->is_dir($path) && !$this->isCreatable($path))) { + if (($this->file_exists($path) && !$this->isUpdatable($path)) + || ($this->is_dir($path) && !$this->isCreatable($path))) { return false; } $info = array( @@ -333,7 +334,8 @@ class Shared extends \OC\Files\Storage\Common { if ($this->isCreatable(dirname($path2))) { $source = $this->fopen($path1, 'r'); $target = $this->fopen($path2, 'w'); - return \OC_Helper::streamCopy($source, $target); + list ($count, $result) = \OC_Helper::streamCopy($source, $target); + return $result; } return false; } @@ -409,9 +411,12 @@ class Shared extends \OC\Files\Storage\Common { } public static function setup($options) { - if (!\OCP\User::isLoggedIn() || \OCP\User::getUser() != $options['user'] || \OCP\Share::getItemsSharedWith('file')) { + if (!\OCP\User::isLoggedIn() || \OCP\User::getUser() != $options['user'] + || \OCP\Share::getItemsSharedWith('file')) { $user_dir = $options['user_dir']; - \OC\Files\Filesystem::mount('\OC\Files\Storage\Shared', array('sharedFolder' => '/Shared'), $user_dir.'/Shared/'); + \OC\Files\Filesystem::mount('\OC\Files\Storage\Shared', + array('sharedFolder' => '/Shared'), + $user_dir.'/Shared/'); \OC_Hook::connect('OC_Filesystem', 'post_write', '\OC\Files\Cache\Shared_Updater', 'writeHook'); \OC_Hook::connect('OC_Filesystem', 'post_delete', '\OC\Files\Cache\Shared_Updater', 'deleteHook'); \OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Shared_Updater', 'renameHook'); diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 38d598f7780..243ee668f1f 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -43,7 +43,7 @@ if (isset($_GET['t'])) { $path = \OC\Files\Filesystem::getPath($linkItem['file_source']); } } -} +} if (isset($path)) { if (!isset($linkItem['item_type'])) { OCP\Util::writeLog('share', 'No item type set for share id: ' . $linkItem['id'], \OCP\Util::ERROR); @@ -171,7 +171,9 @@ if (isset($path)) { $list->assign('files', $files, false); $list->assign('disableSharing', true); $list->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false); - $list->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=', false); + $list->assign('downloadURL', + OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=', + false); $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); $breadcrumbNav->assign('breadcrumb', $breadcrumb, false); $breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false); @@ -188,7 +190,8 @@ if (isset($path)) { $folder->assign('usedSpacePercent', 0); $tmpl->assign('folder', $folder->fetchPage(), false); $tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); - $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath)); + $tmpl->assign('downloadURL', + OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath)); } else { $tmpl->assign('dir', $dir); @@ -209,4 +212,3 @@ if (isset($path)) { header('HTTP/1.0 404 Not Found'); $tmpl = new OCP\Template('', '404', 'guest'); $tmpl->printPage(); - diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 7776fd63b3c..f9ff12679bc 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -3,15 +3,20 @@ <input type="hidden" name="filename" value="<?php echo $_['filename'] ?>" id="filename"> <input type="hidden" name="mimetype" value="<?php echo $_['mimetype'] ?>" id="mimetype"> <header><div id="header"> - <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a> + <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" + src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a> <div class="header-right"> <?php if (isset($_['folder'])): ?> - <span id="details"><?php echo $l->t('%s shared the folder %s with you', array($_['displayName'], $_['fileTarget'])) ?></span> + <span id="details"><?php echo $l->t('%s shared the folder %s with you', + array($_['displayName'], $_['fileTarget'])) ?></span> <?php else: ?> - <span id="details"><?php echo $l->t('%s shared the file %s with you', array($_['displayName'], $_['fileTarget'])) ?></span> + <span id="details"><?php echo $l->t('%s shared the file %s with you', + array($_['displayName'], $_['fileTarget'])) ?></span> <?php endif; ?> <?php if (!isset($_['folder']) || $_['allowZipDownload']): ?> - <a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a> + <a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img + class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" + /><?php echo $l->t('Download')?></a> <?php endif; ?> </div> </div></header> @@ -27,9 +32,12 @@ <ul id="noPreview"> <li class="error"> <?php echo $l->t('No preview available for').' '.$_['fileTarget']; ?><br /> - <a href="<?php echo $_['downloadURL']; ?>" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a> + <a href="<?php echo $_['downloadURL']; ?>" id="download"><img class="svg" alt="Download" + src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" + /><?php echo $l->t('Download')?></a> </li> </ul> <?php endif; ?> </div> -<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> – <?php echo $l->t('web services under your control'); ?></p></footer> +<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> – +<?php echo $l->t('web services under your control'); ?></p></footer> diff --git a/apps/files_trashbin/ajax/delete.php b/apps/files_trashbin/ajax/delete.php index f41482bef55..1834fb54003 100644 --- a/apps/files_trashbin/ajax/delete.php +++ b/apps/files_trashbin/ajax/delete.php @@ -3,24 +3,43 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::callCheck(); -$file = $_REQUEST['file']; +$files = $_POST['files']; +$dirlisting = $_POST['dirlisting']; +$list = json_decode($files); -$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; -} +$error = array(); +$success = array(); -OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp); +$i = 0; +foreach ($list as $file) { + if ( $dirlisting=='0') { + $delimiter = strrpos($file, '.d'); + $filename = substr($file, 0, $delimiter); + $timestamp = substr($file, $delimiter+2); + } else { + $filename = $file; + $timestamp = null; + } -if (!OCA\Files_Trashbin\Trashbin::file_exists($filename)) { - 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))))); + OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp); + if (!OCA\Files_Trashbin\Trashbin::file_exists($filename, $timestamp)) { + $success[$i]['filename'] = $file; + $success[$i]['timestamp'] = $timestamp; + $i++; + } else { + $error[] = $filename; + } } +if ( $error ) { + $filelist = ''; + foreach ( $error as $e ) { + $filelist .= $e.', '; + } + $l = OC_L10N::get('files_trashbin'); + $message = $l->t("Couldn't delete %s permanently", array(rtrim($filelist, ', '))); + OCP\JSON::error(array("data" => array("message" => $message, + "success" => $success, "error" => $error))); +} else { + OCP\JSON::success(array("data" => array("success" => $success))); +} diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php index 6320c1d0827..80de3c31f91 100644 --- a/apps/files_trashbin/ajax/undelete.php +++ b/apps/files_trashbin/ajax/undelete.php @@ -1,11 +1,11 @@ -<?php +<?php OCP\JSON::checkLoggedIn(); OCP\JSON::callCheck(); -$files = $_REQUEST['files']; -$dirlisting = $_REQUEST['dirlisting']; -$list = explode(';', $files); +$files = $_POST['files']; +$dirlisting = $_POST['dirlisting']; +$list = json_decode($files); $error = array(); $success = array(); @@ -21,7 +21,7 @@ foreach ($list as $file) { $filename = $path_parts['basename']; $timestamp = null; } - + if ( !OCA\Files_Trashbin\Trashbin::restore($file, $filename, $timestamp) ) { $error[] = $filename; } else { diff --git a/apps/files_trashbin/appinfo/app.php b/apps/files_trashbin/appinfo/app.php index b1a15cd13d1..7c04e583db1 100644 --- a/apps/files_trashbin/appinfo/app.php +++ b/apps/files_trashbin/appinfo/app.php @@ -1,7 +1,7 @@ <?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';
+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\Files_Trashbin\Hooks", "remove_hook"); diff --git a/apps/files_trashbin/appinfo/database.xml b/apps/files_trashbin/appinfo/database.xml index 1144a1c9a97..aae334b1489 100644 --- a/apps/files_trashbin/appinfo/database.xml +++ b/apps/files_trashbin/appinfo/database.xml @@ -18,7 +18,7 @@ <type>text</type> <default></default> <notnull>true</notnull> - <length>50</length> + <length>250</length> </field> <field> @@ -26,7 +26,7 @@ <type>text</type> <default></default> <notnull>true</notnull> - <length>50</length> + <length>64</length> </field> <field> @@ -42,7 +42,7 @@ <type>text</type> <default></default> <notnull>true</notnull> - <length>200</length> + <length>512</length> </field> <field> @@ -89,4 +89,30 @@ </table> + <table> + + <name>*dbprefix*files_trashsize</name> + + <declaration> + + <field> + <name>user</name> + <type>text</type> + <default></default> + <notnull>true</notnull> + <length>64</length> + </field> + + <field> + <name>size</name> + <type>text</type> + <default></default> + <notnull>true</notnull> + <length>50</length> + </field> + + </declaration> + + </table> + </database> diff --git a/apps/files_trashbin/appinfo/info.xml b/apps/files_trashbin/appinfo/info.xml index e4217339602..7f807da579e 100644 --- a/apps/files_trashbin/appinfo/info.xml +++ b/apps/files_trashbin/appinfo/info.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <info> <id>files_trashbin</id> - <name>Trash bin</name> + <name>Deleted files</name> <description>Keep a copy of deleted files so that they can be restored if needed</description> <licence>AGPL</licence> <author>Bjoern Schiessle</author> diff --git a/apps/files_trashbin/appinfo/update.php b/apps/files_trashbin/appinfo/update.php new file mode 100644 index 00000000000..b0bf79cc510 --- /dev/null +++ b/apps/files_trashbin/appinfo/update.php @@ -0,0 +1,40 @@ +<?php + +$installedVersion=OCP\Config::getAppValue('files_trashbin', 'installed_version'); +// move versions to new directory + +if (version_compare($installedVersion, '0.2', '<')) { + $datadir = \OCP\Config::getSystemValue('datadirectory').'/'; + + $users = \OCP\User::getUsers(); + foreach ($users as $user) { + + //create new folders + @mkdir($datadir.$user.'/files_trashbin/files'); + @mkdir($datadir.$user.'/files_trashbin/versions'); + @mkdir($datadir.$user.'/files_trashbin/keyfiles'); + + // move files to the new folders + if ($handle = opendir($datadir.$user.'/files_trashbin')) { + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != ".." && $file != 'files' && $file != 'versions' && $file != 'keyfiles') { + rename($datadir.$user.'/files_trashbin/'.$file, + $datadir.$user.'/files_trashbin/files/'.$file); + } + } + closedir($handle); + } + + // move versions to the new folder + if ($handle = opendir($datadir.$user.'/versions_trashbin')) { + while (false !== ($file = readdir($handle))) { + rename($datadir.$user.'/versions_trashbin/'.$file, + $datadir.$user.'/files_trashbin/versions/'.$file); + } + closedir($handle); + } + + @rmdir($datadir.$user.'/versions_trashbin'); + + } +}
\ No newline at end of file diff --git a/apps/files_trashbin/appinfo/version b/apps/files_trashbin/appinfo/version index 49d59571fbf..be586341736 100644 --- a/apps/files_trashbin/appinfo/version +++ b/apps/files_trashbin/appinfo/version @@ -1 +1 @@ -0.1 +0.3 diff --git a/apps/files_trashbin/download.php b/apps/files_trashbin/download.php index 665697dca5f..60328e1dddb 100644 --- a/apps/files_trashbin/download.php +++ b/apps/files_trashbin/download.php @@ -26,7 +26,7 @@ OCP\User::checkLoggedIn(); $filename = $_GET["file"]; -$view = new OC_FilesystemView('/'.\OCP\User::getUser().'/files_trashbin'); +$view = new OC_FilesystemView('/'.\OCP\User::getUser().'/files_trashbin/files'); if(!$view->file_exists($filename)) { header("HTTP/1.0 404 Not Found"); diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php index a2d4cc0a44d..31b46cc2dec 100644 --- a/apps/files_trashbin/index.php +++ b/apps/files_trashbin/index.php @@ -1,24 +1,26 @@ <?php -// Check if we are a user
+// Check if we are a user OCP\User::checkLoggedIn(); +OCP\App::setActiveNavigationEntry('files_index'); + OCP\Util::addScript('files_trashbin', 'trash'); OCP\Util::addScript('files_trashbin', 'disableDefaultActions'); OCP\Util::addScript('files', 'fileactions'); $tmpl = new OCP\Template('files_trashbin', 'index', 'user'); $user = \OCP\User::getUser(); -$view = new OC_Filesystemview('/'.$user.'/files_trashbin'); +$view = new OC_Filesystemview('/'.$user.'/files_trashbin/files'); OCP\Util::addStyle('files', 'files'); OCP\Util::addScript('files', 'filelist'); $dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : ''; +$result = array(); if ($dir) { $dirlisting = true; - $view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_trashbin');
$fullpath = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath($dir); $dirContent = opendir($fullpath); $i = 0; @@ -35,13 +37,13 @@ if ($dir) { 'type' => $view->is_dir($dir.'/'.$entryName) ? 'dir' : 'file', 'location' => $dir, ); - }
+ } } - closedir($fullpath); - + closedir($dirContent); + } else { $dirlisting = false; - $query = \OC_DB::prepare('SELECT id,location,timestamp,type,mime FROM *PREFIX*files_trash WHERE user=?'); + $query = \OC_DB::prepare('SELECT `id`,`location`,`timestamp`,`type`,`mime` FROM `*PREFIX*files_trash` WHERE user = ?'); $result = $query->execute(array($user))->fetchAll(); } @@ -66,35 +68,48 @@ foreach ($result as $r) { $files[] = $i; } -// Make breadcrumb
+function fileCmp($a, $b) { + if ($a['type'] == 'dir' and $b['type'] != 'dir') { + return -1; + } elseif ($a['type'] != 'dir' and $b['type'] == 'dir') { + return 1; + } else { + return strnatcasecmp($a['name'], $b['name']); + } +} + +usort($files, "fileCmp"); + +// Make breadcrumb $pathtohere = ''; -$breadcrumb = array();
-foreach (explode('/', $dir) as $i) {
+$breadcrumb = array(); +foreach (explode('/', $dir) as $i) { if ($i != '') { if ( preg_match('/^(.+)\.d[0-9]+$/', $i, $match) ) { $name = $match[1]; } else { $name = $i; - }
- $pathtohere .= '/' . $i;
- $breadcrumb[] = array('dir' => $pathtohere, 'name' => $name);
- }
+ } + $pathtohere .= '/' . $i; + $breadcrumb[] = array('dir' => $pathtohere, 'name' => $name); + } } -$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
-$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
+$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); +$breadcrumbNav->assign('breadcrumb', $breadcrumb, false); $breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php') . '?dir=', false); $list = new OCP\Template('files_trashbin', 'part.list', ''); $list->assign('files', $files, false); -$list->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php'). '?dir='.$dir, false);
+$list->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php'). '?dir='.$dir, false); $list->assign('downloadURL', OCP\Util::linkTo('files_trashbin', 'download.php') . '?file='.$dir, false); $list->assign('disableSharing', true); $list->assign('dirlisting', $dirlisting); $list->assign('disableDownloadActions', true); $tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage(), false); +$tmpl->assign('dirlisting', $dirlisting); $tmpl->assign('fileList', $list->fetchPage(), false); $tmpl->assign('files', $files); -$tmpl->assign('dir', OC_Filesystem::normalizePath($view->getAbsolutePath())); +$tmpl->assign('dir', \OC\Files\Filesystem::normalizePath($view->getAbsolutePath())); $tmpl->printPage(); diff --git a/apps/files_trashbin/js/disableDefaultActions.js b/apps/files_trashbin/js/disableDefaultActions.js index 27c3e13db4d..df08bfb1a50 100644 --- a/apps/files_trashbin/js/disableDefaultActions.js +++ b/apps/files_trashbin/js/disableDefaultActions.js @@ -1,4 +1,4 @@ -/* disable download and sharing actions */
-var disableDownloadActions = true;
-var disableSharing = true;
+/* disable download and sharing actions */ +var disableDownloadActions = true; +var disableSharing = true; var trashBinApp = true;
\ No newline at end of file diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index 6c810e4c2bd..39e76e10c9c 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -6,9 +6,10 @@ $(document).ready(function() { var tr=$('tr').filterAttr('data-file', filename); var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>'; var undeleteAction = $('tr').filterAttr('data-file',filename).children("td.date"); + var files = tr.attr('data-file'); undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner; $.post(OC.filePath('files_trashbin','ajax','undelete.php'), - {files:tr.attr('data-file'), dirlisting:tr.attr('data-dirlisting') }, + {files:JSON.stringify([files]), dirlisting:tr.attr('data-dirlisting') }, function(result){ for (var i = 0; i < result.data.success.length; i++) { var row = document.getElementById(result.data.success[i].filename); @@ -18,35 +19,36 @@ $(document).ready(function() { OC.dialogs.alert(result.data.message, 'Error'); } }); - + }); }; - + 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>'; + var files = tr.attr('data-file'); deleteAction[0].outerHTML = newHTML; - + $.post(OC.filePath('files_trashbin','ajax','delete.php'), - {file:tr.attr('data-file') }, + {files:JSON.stringify([files]), dirlisting:tr.attr('data-dirlisting') }, function(result){ - if ( result.status == 'success' ) { - var row = document.getElementById(result.data.filename); + for (var i = 0; i < result.data.success.length; i++) { + var row = document.getElementById(result.data.success[i].filename); row.parentNode.removeChild(row); - } else { - deleteAction[0].outerHTML = oldHTML; + } + if (result.status != 'success') { OC.dialogs.alert(result.data.message, 'Error'); } }); - + }); - + // Sets the select_all checkbox behaviour : $('#select_all').click(function() { if($(this).attr('checked')){ @@ -88,19 +90,19 @@ $(document).ready(function() { } } processSelection(); - }); - + }); + $('.undelete').click('click',function(event) { var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>'; var files=getSelectedFiles('file'); - var fileslist=files.join(';'); + var fileslist = JSON.stringify(files); var dirlisting=getSelectedFiles('dirlisting')[0]; - - for (var i in files) { + + for (var i=0; i<files.length; i++) { var undeleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date"); undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner; } - + $.post(OC.filePath('files_trashbin','ajax','undelete.php'), {files:fileslist, dirlisting:dirlisting}, function(result){ @@ -111,10 +113,57 @@ $(document).ready(function() { if (result.status != 'success') { OC.dialogs.alert(result.data.message, 'Error'); } - }); + }); + }); + + $('.delete').click('click',function(event) { + console.log("delete selected"); + var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'Delete permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>'; + var files=getSelectedFiles('file'); + var fileslist = JSON.stringify(files); + var dirlisting=getSelectedFiles('dirlisting')[0]; + + for (var i=0; i<files.length; i++) { + var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date"); + deleteAction[0].innerHTML = deleteAction[0].innerHTML+spinner; + } + + $.post(OC.filePath('files_trashbin','ajax','delete.php'), + {files:fileslist, dirlisting:dirlisting}, + function(result){ + for (var i = 0; i < result.data.success.length; i++) { + var row = document.getElementById(result.data.success[i].filename); + row.parentNode.removeChild(row); + } + if (result.status != 'success') { + OC.dialogs.alert(result.data.message, 'Error'); + } + }); }); - + $('#fileList').on('click', 'td.filename a', function(event) { + var mime = $(this).parent().parent().data('mime'); + if (mime !== 'httpd/unix-directory') { + event.preventDefault(); + } + var filename = $(this).parent().parent().attr('data-file'); + var tr = $('tr').filterAttr('data-file',filename); + var renaming = tr.data('renaming'); + if(!renaming && !FileList.isLoading(filename)){ + if(mime.substr(0, 5) === 'text/'){ //no texteditor for now + return; + } + var type = $(this).parent().parent().data('type'); + var permissions = $(this).parent().parent().data('permissions'); + var action = FileActions.getDefault(mime, type, permissions); + if(action){ + event.preventDefault(); + action(filename); + } + } + }); + + FileActions.actions.dir = {}; }); function processSelection(){ @@ -180,4 +229,8 @@ function getSelectedFiles(property){ } }); return files; -}
\ No newline at end of file +} + +function fileDownloadPath(dir, file) { + return OC.filePath('files_trashbin', '', 'download.php') + '?file='+encodeURIComponent(file); +} diff --git a/apps/files_trashbin/l10n/ar.php b/apps/files_trashbin/l10n/ar.php index e38130fe2d3..7b2e2863367 100644 --- a/apps/files_trashbin/l10n/ar.php +++ b/apps/files_trashbin/l10n/ar.php @@ -1,3 +1,4 @@ <?php $TRANSLATIONS = array( -"Name" => "اسم" +"Name" => "اسم", +"Delete" => "إلغاء" ); diff --git a/apps/files_trashbin/l10n/bg_BG.php b/apps/files_trashbin/l10n/bg_BG.php index 05965c2a9ad..957f6a45aac 100644 --- a/apps/files_trashbin/l10n/bg_BG.php +++ b/apps/files_trashbin/l10n/bg_BG.php @@ -10,5 +10,6 @@ "1 file" => "1 файл", "{count} files" => "{count} файла", "Nothing in here. Your trash bin is empty!" => "Няма нищо. Кофата е празна!", -"Restore" => "Възтановяване" +"Restore" => "Възтановяване", +"Delete" => "Изтриване" ); diff --git a/apps/files_trashbin/l10n/bn_BD.php b/apps/files_trashbin/l10n/bn_BD.php index c669eff7e1f..d61355c52c2 100644 --- a/apps/files_trashbin/l10n/bn_BD.php +++ b/apps/files_trashbin/l10n/bn_BD.php @@ -3,5 +3,6 @@ "1 folder" => "১টি ফোল্ডার", "{count} folders" => "{count} টি ফোল্ডার", "1 file" => "১টি ফাইল", -"{count} files" => "{count} টি ফাইল" +"{count} files" => "{count} টি ফাইল", +"Delete" => "মুছে" ); diff --git a/apps/files_trashbin/l10n/ca.php b/apps/files_trashbin/l10n/ca.php index 803b0c81ef0..894ed6a729d 100644 --- a/apps/files_trashbin/l10n/ca.php +++ b/apps/files_trashbin/l10n/ca.php @@ -3,6 +3,7 @@ "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", +"Delete permanently" => "Esborra permanentment", "Name" => "Nom", "Deleted" => "Eliminat", "1 folder" => "1 carpeta", @@ -10,5 +11,6 @@ "1 file" => "1 fitxer", "{count} files" => "{count} fitxers", "Nothing in here. Your trash bin is empty!" => "La paperera està buida!", -"Restore" => "Recupera" +"Restore" => "Recupera", +"Delete" => "Esborra" ); diff --git a/apps/files_trashbin/l10n/cs_CZ.php b/apps/files_trashbin/l10n/cs_CZ.php index eeb27784d3e..d32af39877b 100644 --- a/apps/files_trashbin/l10n/cs_CZ.php +++ b/apps/files_trashbin/l10n/cs_CZ.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Nelze obnovit %s", "perform restore operation" => "provést obnovu", "delete file permanently" => "trvale odstranit soubor", +"Delete permanently" => "Trvale odstranit", "Name" => "Název", "Deleted" => "Smazáno", "1 folder" => "1 složka", @@ -10,5 +11,6 @@ "1 file" => "1 soubor", "{count} files" => "{count} soubory", "Nothing in here. Your trash bin is empty!" => "Žádný obsah. Váš koš je prázdný.", -"Restore" => "Obnovit" +"Restore" => "Obnovit", +"Delete" => "Smazat" ); diff --git a/apps/files_trashbin/l10n/da.php b/apps/files_trashbin/l10n/da.php index 855888b3159..ca4a2e8215d 100644 --- a/apps/files_trashbin/l10n/da.php +++ b/apps/files_trashbin/l10n/da.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Kunne ikke gendanne %s", "perform restore operation" => "udfør gendannelsesoperation", "delete file permanently" => "slet fil permanent", +"Delete permanently" => "Slet permanent", "Name" => "Navn", "Deleted" => "Slettet", "1 folder" => "1 mappe", @@ -10,5 +11,6 @@ "1 file" => "1 fil", "{count} files" => "{count} filer", "Nothing in here. Your trash bin is empty!" => "Intet at se her. Din papirkurv er tom!", -"Restore" => "Gendan" +"Restore" => "Gendan", +"Delete" => "Slet" ); diff --git a/apps/files_trashbin/l10n/de.php b/apps/files_trashbin/l10n/de.php index 1271f5c313a..d1952c9635a 100644 --- a/apps/files_trashbin/l10n/de.php +++ b/apps/files_trashbin/l10n/de.php @@ -1,8 +1,9 @@ <?php $TRANSLATIONS = array( -"Couldn't delete %s permanently" => "Konnte %s nicht permanent löschen", +"Couldn't delete %s permanently" => "Konnte %s nicht dauerhaft löschen", "Couldn't restore %s" => "Konnte %s nicht wiederherstellen", "perform restore operation" => "Wiederherstellung ausführen", -"delete file permanently" => "Datei permanent löschen", +"delete file permanently" => "Datei dauerhaft löschen", +"Delete permanently" => "Permanent löschen", "Name" => "Name", "Deleted" => "gelöscht", "1 folder" => "1 Ordner", @@ -10,5 +11,6 @@ "1 file" => "1 Datei", "{count} files" => "{count} Dateien", "Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, der Papierkorb ist leer!", -"Restore" => "Wiederherstellen" +"Restore" => "Wiederherstellen", +"Delete" => "Löschen" ); diff --git a/apps/files_trashbin/l10n/de_DE.php b/apps/files_trashbin/l10n/de_DE.php index 6d944b3580c..269680ca2c3 100644 --- a/apps/files_trashbin/l10n/de_DE.php +++ b/apps/files_trashbin/l10n/de_DE.php @@ -1,8 +1,9 @@ <?php $TRANSLATIONS = array( -"Couldn't delete %s permanently" => "Konnte %s nicht entgültig löschen", +"Couldn't delete %s permanently" => "Konnte %s nicht dauerhaft löschen", "Couldn't restore %s" => "Konnte %s nicht wiederherstellen", "perform restore operation" => "Wiederherstellung ausführen", -"delete file permanently" => "Datei entgültig löschen", +"delete file permanently" => "Datei dauerhaft löschen", +"Delete permanently" => "Endgültig löschen", "Name" => "Name", "Deleted" => "Gelöscht", "1 folder" => "1 Ordner", @@ -10,5 +11,6 @@ "1 file" => "1 Datei", "{count} files" => "{count} Dateien", "Nothing in here. Your trash bin is empty!" => "Nichts zu löschen, Ihr Papierkorb ist leer!", -"Restore" => "Wiederherstellen" +"Restore" => "Wiederherstellen", +"Delete" => "Löschen" ); diff --git a/apps/files_trashbin/l10n/el.php b/apps/files_trashbin/l10n/el.php index bc3c2350da6..cf9471780c0 100644 --- a/apps/files_trashbin/l10n/el.php +++ b/apps/files_trashbin/l10n/el.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Αδυναμία επαναφοράς %s", "perform restore operation" => "εκτέλεση λειτουργία επαναφοράς", "delete file permanently" => "μόνιμη διαγραφή αρχείου", +"Delete permanently" => "Μόνιμη διαγραφή", "Name" => "Όνομα", "Deleted" => "Διαγράφηκε", "1 folder" => "1 φάκελος", @@ -10,5 +11,6 @@ "1 file" => "1 αρχείο", "{count} files" => "{count} αρχεία", "Nothing in here. Your trash bin is empty!" => "Δεν υπάρχει τίποτα εδώ. Ο κάδος σας είναι άδειος!", -"Restore" => "Επαναφορά" +"Restore" => "Επαναφορά", +"Delete" => "Διαγραφή" ); diff --git a/apps/files_trashbin/l10n/eo.php b/apps/files_trashbin/l10n/eo.php index f357e3c10c2..e1e5acbb5a8 100644 --- a/apps/files_trashbin/l10n/eo.php +++ b/apps/files_trashbin/l10n/eo.php @@ -4,5 +4,6 @@ "{count} folders" => "{count} dosierujoj", "1 file" => "1 dosiero", "{count} files" => "{count} dosierujoj", -"Restore" => "Restaŭri" +"Restore" => "Restaŭri", +"Delete" => "Forigi" ); diff --git a/apps/files_trashbin/l10n/es.php b/apps/files_trashbin/l10n/es.php index c14b9776473..ebc01b1d21e 100644 --- a/apps/files_trashbin/l10n/es.php +++ b/apps/files_trashbin/l10n/es.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "No se puede restaurar %s", "perform restore operation" => "Restaurar", "delete file permanently" => "Eliminar archivo permanentemente", +"Delete permanently" => "Eliminar permanentemente", "Name" => "Nombre", "Deleted" => "Eliminado", "1 folder" => "1 carpeta", @@ -10,5 +11,6 @@ "1 file" => "1 archivo", "{count} files" => "{count} archivos", "Nothing in here. Your trash bin is empty!" => "Nada aqui. La papelera esta vacia!", -"Restore" => "Recuperar" +"Restore" => "Recuperar", +"Delete" => "Eliminar" ); diff --git a/apps/files_trashbin/l10n/es_AR.php b/apps/files_trashbin/l10n/es_AR.php index c7f98e38df7..bb78a39d6c3 100644 --- a/apps/files_trashbin/l10n/es_AR.php +++ b/apps/files_trashbin/l10n/es_AR.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "No se pudo restaurar %s", "perform restore operation" => "Restaurar", "delete file permanently" => "Borrar archivo de manera permanente", +"Delete permanently" => "Borrar de manera permanente", "Name" => "Nombre", "Deleted" => "Borrado", "1 folder" => "1 directorio", @@ -10,5 +11,6 @@ "1 file" => "1 archivo", "{count} files" => "{count} archivos", "Nothing in here. Your trash bin is empty!" => "No hay nada acá. ¡La papelera está vacía!", -"Restore" => "Recuperar" +"Restore" => "Recuperar", +"Delete" => "Borrar" ); diff --git a/apps/files_trashbin/l10n/et_EE.php b/apps/files_trashbin/l10n/et_EE.php index 8744ab5f122..73ae9dbee18 100644 --- a/apps/files_trashbin/l10n/et_EE.php +++ b/apps/files_trashbin/l10n/et_EE.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "%s ei saa taastada", "perform restore operation" => "soorita taastamine", "delete file permanently" => "kustuta fail jäädavalt", +"Delete permanently" => "Kustuta jäädavalt", "Name" => "Nimi", "Deleted" => "Kustutatud", "1 folder" => "1 kaust", @@ -10,5 +11,6 @@ "1 file" => "1 fail", "{count} files" => "{count} faili", "Nothing in here. Your trash bin is empty!" => "Siin pole midagi. Sinu prügikast on tühi!", -"Restore" => "Taasta" +"Restore" => "Taasta", +"Delete" => "Kustuta" ); diff --git a/apps/files_trashbin/l10n/eu.php b/apps/files_trashbin/l10n/eu.php index 6a4ff125454..5a565436ede 100644 --- a/apps/files_trashbin/l10n/eu.php +++ b/apps/files_trashbin/l10n/eu.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Ezin izan da %s berreskuratu", "perform restore operation" => "berreskuratu", "delete file permanently" => "ezabatu fitxategia betirako", +"Delete permanently" => "Ezabatu betirako", "Name" => "Izena", "Deleted" => "Ezabatuta", "1 folder" => "karpeta bat", @@ -10,5 +11,6 @@ "1 file" => "fitxategi bat", "{count} files" => "{count} fitxategi", "Nothing in here. Your trash bin is empty!" => "Ez dago ezer ez. Zure zakarrontzia hutsik dago!", -"Restore" => "Berrezarri" +"Restore" => "Berrezarri", +"Delete" => "Ezabatu" ); diff --git a/apps/files_trashbin/l10n/fa.php b/apps/files_trashbin/l10n/fa.php index 487d1657985..7cc695215e6 100644 --- a/apps/files_trashbin/l10n/fa.php +++ b/apps/files_trashbin/l10n/fa.php @@ -4,5 +4,6 @@ "{count} folders" => "{ شمار} پوشه ها", "1 file" => "1 پرونده", "{count} files" => "{ شمار } فایل ها", -"Restore" => "بازیابی" +"Restore" => "بازیابی", +"Delete" => "حذف" ); diff --git a/apps/files_trashbin/l10n/fi_FI.php b/apps/files_trashbin/l10n/fi_FI.php index ffdac8735b1..e18689956d0 100644 --- a/apps/files_trashbin/l10n/fi_FI.php +++ b/apps/files_trashbin/l10n/fi_FI.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Kohteen %s palautus epäonnistui", "perform restore operation" => "suorita palautustoiminto", "delete file permanently" => "poista tiedosto pysyvästi", +"Delete permanently" => "Poista pysyvästi", "Name" => "Nimi", "Deleted" => "Poistettu", "1 folder" => "1 kansio", @@ -10,5 +11,6 @@ "1 file" => "1 tiedosto", "{count} files" => "{count} tiedostoa", "Nothing in here. Your trash bin is empty!" => "Tyhjää täynnä! Roskakorissa ei ole mitään.", -"Restore" => "Palauta" +"Restore" => "Palauta", +"Delete" => "Poista" ); diff --git a/apps/files_trashbin/l10n/fr.php b/apps/files_trashbin/l10n/fr.php index 609b2fa9bd7..0a783785efb 100644 --- a/apps/files_trashbin/l10n/fr.php +++ b/apps/files_trashbin/l10n/fr.php @@ -3,6 +3,7 @@ "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", +"Delete permanently" => "Supprimer de façon définitive", "Name" => "Nom", "Deleted" => "Effacé", "1 folder" => "1 dossier", @@ -10,5 +11,6 @@ "1 file" => "1 fichier", "{count} files" => "{count} fichiers", "Nothing in here. Your trash bin is empty!" => "Il n'y a rien ici. Votre corbeille est vide !", -"Restore" => "Restaurer" +"Restore" => "Restaurer", +"Delete" => "Supprimer" ); diff --git a/apps/files_trashbin/l10n/gl.php b/apps/files_trashbin/l10n/gl.php index ad9f6802e66..4e31dd0018a 100644 --- a/apps/files_trashbin/l10n/gl.php +++ b/apps/files_trashbin/l10n/gl.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Non foi posíbel restaurar %s", "perform restore operation" => "realizar a operación de restauración", "delete file permanently" => "eliminar o ficheiro permanentemente", +"Delete permanently" => "Eliminar permanentemente", "Name" => "Nome", "Deleted" => "Eliminado", "1 folder" => "1 cartafol", @@ -10,5 +11,6 @@ "1 file" => "1 ficheiro", "{count} files" => "{count} ficheiros", "Nothing in here. Your trash bin is empty!" => "Aquí non hai nada. O cesto do lixo está baleiro!", -"Restore" => "Restablecer" +"Restore" => "Restablecer", +"Delete" => "Eliminar" ); diff --git a/apps/files_trashbin/l10n/he.php b/apps/files_trashbin/l10n/he.php index d026add5d75..9c767d2222c 100644 --- a/apps/files_trashbin/l10n/he.php +++ b/apps/files_trashbin/l10n/he.php @@ -1,7 +1,16 @@ <?php $TRANSLATIONS = array( +"Couldn't delete %s permanently" => "בלתי אפשרי למחוק את %s לצמיתות", +"Couldn't restore %s" => "בלתי אפשרי לשחזר את %s", +"perform restore operation" => "בצע פעולת שחזור", +"delete file permanently" => "מחק קובץ לצמיתות", +"Delete permanently" => "מחק לצמיתות", "Name" => "שם", +"Deleted" => "נמחק", "1 folder" => "תיקייה אחת", "{count} folders" => "{count} תיקיות", "1 file" => "קובץ אחד", -"{count} files" => "{count} קבצים" +"{count} files" => "{count} קבצים", +"Nothing in here. Your trash bin is empty!" => "שום דבר כאן. סל המחזור שלך ריק!", +"Restore" => "שחזר", +"Delete" => "מחיקה" ); diff --git a/apps/files_trashbin/l10n/hr.php b/apps/files_trashbin/l10n/hr.php index 52255c7429a..2cb86adfd40 100644 --- a/apps/files_trashbin/l10n/hr.php +++ b/apps/files_trashbin/l10n/hr.php @@ -1,3 +1,4 @@ <?php $TRANSLATIONS = array( -"Name" => "Ime" +"Name" => "Ime", +"Delete" => "Obriši" ); diff --git a/apps/files_trashbin/l10n/hu_HU.php b/apps/files_trashbin/l10n/hu_HU.php index 931e5a7543e..9c158c2b9ec 100644 --- a/apps/files_trashbin/l10n/hu_HU.php +++ b/apps/files_trashbin/l10n/hu_HU.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Nem sikerült %s visszaállítása", "perform restore operation" => "a visszaállítás végrehajtása", "delete file permanently" => "az állomány végleges törlése", +"Delete permanently" => "Végleges törlés", "Name" => "Név", "Deleted" => "Törölve", "1 folder" => "1 mappa", @@ -10,5 +11,6 @@ "1 file" => "1 fájl", "{count} files" => "{count} fájl", "Nothing in here. Your trash bin is empty!" => "Itt nincs semmi. Az Ön szemetes mappája üres!", -"Restore" => "Visszaállítás" +"Restore" => "Visszaállítás", +"Delete" => "Törlés" ); diff --git a/apps/files_trashbin/l10n/hy.php b/apps/files_trashbin/l10n/hy.php new file mode 100644 index 00000000000..3b80487278a --- /dev/null +++ b/apps/files_trashbin/l10n/hy.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Delete" => "Ջնջել" +); diff --git a/apps/files_trashbin/l10n/ia.php b/apps/files_trashbin/l10n/ia.php index c2581f3de17..0a51752312f 100644 --- a/apps/files_trashbin/l10n/ia.php +++ b/apps/files_trashbin/l10n/ia.php @@ -1,3 +1,4 @@ <?php $TRANSLATIONS = array( -"Name" => "Nomine" +"Name" => "Nomine", +"Delete" => "Deler" ); diff --git a/apps/files_trashbin/l10n/id.php b/apps/files_trashbin/l10n/id.php index 1a14d8b7c21..ab5fe25ac6b 100644 --- a/apps/files_trashbin/l10n/id.php +++ b/apps/files_trashbin/l10n/id.php @@ -1,3 +1,15 @@ <?php $TRANSLATIONS = array( -"Name" => "nama" +"Couldn't delete %s permanently" => "Tidak dapat menghapus permanen %s", +"Couldn't restore %s" => "Tidak dapat memulihkan %s", +"perform restore operation" => "jalankan operasi pemulihan", +"delete file permanently" => "hapus berkas secara permanen", +"Name" => "Nama", +"Deleted" => "Dihapus", +"1 folder" => "1 map", +"{count} folders" => "{count} map", +"1 file" => "1 berkas", +"{count} files" => "{count} berkas", +"Nothing in here. Your trash bin is empty!" => "Tempat sampah anda kosong!", +"Restore" => "Pulihkan", +"Delete" => "Hapus" ); diff --git a/apps/files_trashbin/l10n/is.php b/apps/files_trashbin/l10n/is.php index 416f641a8ef..fba36c91cb5 100644 --- a/apps/files_trashbin/l10n/is.php +++ b/apps/files_trashbin/l10n/is.php @@ -3,5 +3,6 @@ "1 folder" => "1 mappa", "{count} folders" => "{count} möppur", "1 file" => "1 skrá", -"{count} files" => "{count} skrár" +"{count} files" => "{count} skrár", +"Delete" => "Eyða" ); diff --git a/apps/files_trashbin/l10n/it.php b/apps/files_trashbin/l10n/it.php index 8627682d088..027b22c91ac 100644 --- a/apps/files_trashbin/l10n/it.php +++ b/apps/files_trashbin/l10n/it.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Impossibile ripristinare %s", "perform restore operation" => "esegui operazione di ripristino", "delete file permanently" => "elimina il file definitivamente", +"Delete permanently" => "Elimina definitivamente", "Name" => "Nome", "Deleted" => "Eliminati", "1 folder" => "1 cartella", @@ -10,5 +11,6 @@ "1 file" => "1 file", "{count} files" => "{count} file", "Nothing in here. Your trash bin is empty!" => "Qui non c'è niente. Il tuo cestino è vuoto.", -"Restore" => "Ripristina" +"Restore" => "Ripristina", +"Delete" => "Elimina" ); diff --git a/apps/files_trashbin/l10n/ja_JP.php b/apps/files_trashbin/l10n/ja_JP.php index 2bccf3f3bd5..478aa400664 100644 --- a/apps/files_trashbin/l10n/ja_JP.php +++ b/apps/files_trashbin/l10n/ja_JP.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "%s を復元出来ませんでした", "perform restore operation" => "復元操作を実行する", "delete file permanently" => "ファイルを完全に削除する", +"Delete permanently" => "完全に削除する", "Name" => "名前", "Deleted" => "削除済み", "1 folder" => "1 フォルダ", @@ -10,5 +11,6 @@ "1 file" => "1 ファイル", "{count} files" => "{count} ファイル", "Nothing in here. Your trash bin is empty!" => "ここには何もありません。ゴミ箱は空です!", -"Restore" => "復元" +"Restore" => "復元", +"Delete" => "削除" ); diff --git a/apps/files_trashbin/l10n/ka_GE.php b/apps/files_trashbin/l10n/ka_GE.php index 43dba38f5c7..05068767863 100644 --- a/apps/files_trashbin/l10n/ka_GE.php +++ b/apps/files_trashbin/l10n/ka_GE.php @@ -3,5 +3,6 @@ "1 folder" => "1 საქაღალდე", "{count} folders" => "{count} საქაღალდე", "1 file" => "1 ფაილი", -"{count} files" => "{count} ფაილი" +"{count} files" => "{count} ფაილი", +"Delete" => "წაშლა" ); diff --git a/apps/files_trashbin/l10n/ko.php b/apps/files_trashbin/l10n/ko.php index 61acd1276a7..b40546e34b8 100644 --- a/apps/files_trashbin/l10n/ko.php +++ b/apps/files_trashbin/l10n/ko.php @@ -4,5 +4,6 @@ "{count} folders" => "폴더 {count}개", "1 file" => "파일 1개", "{count} files" => "파일 {count}개", -"Restore" => "복원" +"Restore" => "복원", +"Delete" => "삭제" ); diff --git a/apps/files_trashbin/l10n/lb.php b/apps/files_trashbin/l10n/lb.php index d1bd7518663..01deea23500 100644 --- a/apps/files_trashbin/l10n/lb.php +++ b/apps/files_trashbin/l10n/lb.php @@ -1,3 +1,4 @@ <?php $TRANSLATIONS = array( -"Name" => "Numm" +"Name" => "Numm", +"Delete" => "Läschen" ); diff --git a/apps/files_trashbin/l10n/lt_LT.php b/apps/files_trashbin/l10n/lt_LT.php index 4933e97202f..513c7626c4e 100644 --- a/apps/files_trashbin/l10n/lt_LT.php +++ b/apps/files_trashbin/l10n/lt_LT.php @@ -3,5 +3,6 @@ "1 folder" => "1 aplankalas", "{count} folders" => "{count} aplankalai", "1 file" => "1 failas", -"{count} files" => "{count} failai" +"{count} files" => "{count} failai", +"Delete" => "Ištrinti" ); diff --git a/apps/files_trashbin/l10n/lv.php b/apps/files_trashbin/l10n/lv.php index 5ecb99b9892..d3c68e2a778 100644 --- a/apps/files_trashbin/l10n/lv.php +++ b/apps/files_trashbin/l10n/lv.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Nevarēja atjaunot %s", "perform restore operation" => "veikt atjaunošanu", "delete file permanently" => "dzēst datni pavisam", +"Delete permanently" => "Dzēst pavisam", "Name" => "Nosaukums", "Deleted" => "Dzēsts", "1 folder" => "1 mape", @@ -10,5 +11,6 @@ "1 file" => "1 datne", "{count} files" => "{count} datnes", "Nothing in here. Your trash bin is empty!" => "Šeit nekā nav. Jūsu miskaste ir tukša!", -"Restore" => "Atjaunot" +"Restore" => "Atjaunot", +"Delete" => "Dzēst" ); diff --git a/apps/files_trashbin/l10n/mk.php b/apps/files_trashbin/l10n/mk.php index b983c341e8c..22b288b002f 100644 --- a/apps/files_trashbin/l10n/mk.php +++ b/apps/files_trashbin/l10n/mk.php @@ -3,5 +3,6 @@ "1 folder" => "1 папка", "{count} folders" => "{count} папки", "1 file" => "1 датотека", -"{count} files" => "{count} датотеки" +"{count} files" => "{count} датотеки", +"Delete" => "Избриши" ); diff --git a/apps/files_trashbin/l10n/ms_MY.php b/apps/files_trashbin/l10n/ms_MY.php index 73e97b496e4..381d599865e 100644 --- a/apps/files_trashbin/l10n/ms_MY.php +++ b/apps/files_trashbin/l10n/ms_MY.php @@ -1,3 +1,4 @@ <?php $TRANSLATIONS = array( -"Name" => "Nama" +"Name" => "Nama", +"Delete" => "Padam" ); diff --git a/apps/files_trashbin/l10n/nb_NO.php b/apps/files_trashbin/l10n/nb_NO.php index 49364753d13..dc7b8fe97c5 100644 --- a/apps/files_trashbin/l10n/nb_NO.php +++ b/apps/files_trashbin/l10n/nb_NO.php @@ -3,5 +3,6 @@ "1 folder" => "1 mappe", "{count} folders" => "{count} mapper", "1 file" => "1 fil", -"{count} files" => "{count} filer" +"{count} files" => "{count} filer", +"Delete" => "Slett" ); diff --git a/apps/files_trashbin/l10n/nl.php b/apps/files_trashbin/l10n/nl.php index c4a26104ba4..c576e5d81f8 100644 --- a/apps/files_trashbin/l10n/nl.php +++ b/apps/files_trashbin/l10n/nl.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Kon %s niet herstellen", "perform restore operation" => "uitvoeren restore operatie", "delete file permanently" => "verwijder bestanden definitief", +"Delete permanently" => "Verwijder definitief", "Name" => "Naam", "Deleted" => "Verwijderd", "1 folder" => "1 map", @@ -10,5 +11,6 @@ "1 file" => "1 bestand", "{count} files" => "{count} bestanden", "Nothing in here. Your trash bin is empty!" => "Niets te vinden. Uw prullenbak is leeg!", -"Restore" => "Herstellen" +"Restore" => "Herstellen", +"Delete" => "Verwijder" ); diff --git a/apps/files_trashbin/l10n/nn_NO.php b/apps/files_trashbin/l10n/nn_NO.php index be60dabdf01..f8ab465ee42 100644 --- a/apps/files_trashbin/l10n/nn_NO.php +++ b/apps/files_trashbin/l10n/nn_NO.php @@ -1,3 +1,4 @@ <?php $TRANSLATIONS = array( -"Name" => "Namn" +"Name" => "Namn", +"Delete" => "Slett" ); diff --git a/apps/files_trashbin/l10n/oc.php b/apps/files_trashbin/l10n/oc.php index 2c705193c15..e6b939dac0c 100644 --- a/apps/files_trashbin/l10n/oc.php +++ b/apps/files_trashbin/l10n/oc.php @@ -1,3 +1,4 @@ <?php $TRANSLATIONS = array( -"Name" => "Nom" +"Name" => "Nom", +"Delete" => "Escafa" ); diff --git a/apps/files_trashbin/l10n/pl.php b/apps/files_trashbin/l10n/pl.php index d2ada4c9466..e5ea45b88ae 100644 --- a/apps/files_trashbin/l10n/pl.php +++ b/apps/files_trashbin/l10n/pl.php @@ -1,8 +1,16 @@ <?php $TRANSLATIONS = array( +"Couldn't delete %s permanently" => "Nie można trwale usunąć %s", +"Couldn't restore %s" => "Nie można przywrócić %s", +"perform restore operation" => "wykonywanie operacji przywracania", +"delete file permanently" => "trwale usuń plik", +"Delete permanently" => "Trwale usuń", "Name" => "Nazwa", +"Deleted" => "Usunięte", "1 folder" => "1 folder", "{count} folders" => "{count} foldery", "1 file" => "1 plik", "{count} files" => "{count} pliki", -"Restore" => "Przywróć" +"Nothing in here. Your trash bin is empty!" => "Nic tu nie ma. Twój kosz jest pusty!", +"Restore" => "Przywróć", +"Delete" => "Usuń" ); diff --git a/apps/files_trashbin/l10n/pt_BR.php b/apps/files_trashbin/l10n/pt_BR.php index 5a6fc3a86be..b9932a71023 100644 --- a/apps/files_trashbin/l10n/pt_BR.php +++ b/apps/files_trashbin/l10n/pt_BR.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Não foi possível restaurar %s", "perform restore operation" => "realizar operação de restauração", "delete file permanently" => "excluir arquivo permanentemente", +"Delete permanently" => "Excluir permanentemente", "Name" => "Nome", "Deleted" => "Excluído", "1 folder" => "1 pasta", @@ -10,5 +11,6 @@ "1 file" => "1 arquivo", "{count} files" => "{count} arquivos", "Nothing in here. Your trash bin is empty!" => "Nada aqui. Sua lixeira está vazia!", -"Restore" => "Restaurar" +"Restore" => "Restaurar", +"Delete" => "Excluir" ); diff --git a/apps/files_trashbin/l10n/pt_PT.php b/apps/files_trashbin/l10n/pt_PT.php index 978ab452d6e..a621587ea0b 100644 --- a/apps/files_trashbin/l10n/pt_PT.php +++ b/apps/files_trashbin/l10n/pt_PT.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Não foi possível restaurar %s", "perform restore operation" => "Restaurar", "delete file permanently" => "Eliminar permanentemente o(s) ficheiro(s)", +"Delete permanently" => "Eliminar permanentemente", "Name" => "Nome", "Deleted" => "Apagado", "1 folder" => "1 pasta", @@ -10,5 +11,6 @@ "1 file" => "1 ficheiro", "{count} files" => "{count} ficheiros", "Nothing in here. Your trash bin is empty!" => "Não ha ficheiros. O lixo está vazio", -"Restore" => "Restaurar" +"Restore" => "Restaurar", +"Delete" => "Apagar" ); diff --git a/apps/files_trashbin/l10n/ro.php b/apps/files_trashbin/l10n/ro.php index 6ece51e02cf..6a919b62dfb 100644 --- a/apps/files_trashbin/l10n/ro.php +++ b/apps/files_trashbin/l10n/ro.php @@ -3,5 +3,6 @@ "1 folder" => "1 folder", "{count} folders" => "{count} foldare", "1 file" => "1 fisier", -"{count} files" => "{count} fisiere" +"{count} files" => "{count} fisiere", +"Delete" => "Șterge" ); diff --git a/apps/files_trashbin/l10n/ru.php b/apps/files_trashbin/l10n/ru.php index f6c85a6800e..4cf9af1fc39 100644 --- a/apps/files_trashbin/l10n/ru.php +++ b/apps/files_trashbin/l10n/ru.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "%s не может быть восстановлен", "perform restore operation" => "выполнить операцию восстановления", "delete file permanently" => "удалить файл навсегда", +"Delete permanently" => "Удалено навсегда", "Name" => "Имя", "Deleted" => "Удалён", "1 folder" => "1 папка", @@ -10,5 +11,6 @@ "1 file" => "1 файл", "{count} files" => "{count} файлов", "Nothing in here. Your trash bin is empty!" => "Здесь ничего нет. Ваша корзина пуста!", -"Restore" => "Восстановить" +"Restore" => "Восстановить", +"Delete" => "Удалить" ); diff --git a/apps/files_trashbin/l10n/ru_RU.php b/apps/files_trashbin/l10n/ru_RU.php index 379ee37af83..04a899bdd5d 100644 --- a/apps/files_trashbin/l10n/ru_RU.php +++ b/apps/files_trashbin/l10n/ru_RU.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "%s не может быть восстановлен", "perform restore operation" => "выполнить операцию восстановления", "delete file permanently" => "удалить файл навсегда", +"Delete permanently" => "Удалить навсегда", "Name" => "Имя", "Deleted" => "Удалён", "1 folder" => "1 папка", @@ -10,5 +11,6 @@ "1 file" => "1 файл", "{count} files" => "{количество} файлов", "Nothing in here. Your trash bin is empty!" => "Здесь ничего нет. Ваша корзина пуста!", -"Restore" => "Восстановить" +"Restore" => "Восстановить", +"Delete" => "Удалить" ); diff --git a/apps/files_trashbin/l10n/si_LK.php b/apps/files_trashbin/l10n/si_LK.php index cb351afaec9..71c56329776 100644 --- a/apps/files_trashbin/l10n/si_LK.php +++ b/apps/files_trashbin/l10n/si_LK.php @@ -1,5 +1,6 @@ <?php $TRANSLATIONS = array( "Name" => "නම", "1 folder" => "1 ෆොල්ඩරයක්", -"1 file" => "1 ගොනුවක්" +"1 file" => "1 ගොනුවක්", +"Delete" => "මකා දමන්න" ); diff --git a/apps/files_trashbin/l10n/sk_SK.php b/apps/files_trashbin/l10n/sk_SK.php index b86e5d86e44..c5806a5dee8 100644 --- a/apps/files_trashbin/l10n/sk_SK.php +++ b/apps/files_trashbin/l10n/sk_SK.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Nemožno obnoviť %s", "perform restore operation" => "vykonať obnovu", "delete file permanently" => "trvalo zmazať súbor", +"Delete permanently" => "Zmazať trvalo", "Name" => "Meno", "Deleted" => "Zmazané", "1 folder" => "1 priečinok", @@ -10,5 +11,6 @@ "1 file" => "1 súbor", "{count} files" => "{count} súborov", "Nothing in here. Your trash bin is empty!" => "Žiadny obsah. Kôš je prázdny!", -"Restore" => "Obnoviť" +"Restore" => "Obnoviť", +"Delete" => "Zmazať" ); diff --git a/apps/files_trashbin/l10n/sl.php b/apps/files_trashbin/l10n/sl.php index 2579f95c862..4765945747d 100644 --- a/apps/files_trashbin/l10n/sl.php +++ b/apps/files_trashbin/l10n/sl.php @@ -3,5 +3,6 @@ "1 folder" => "1 mapa", "{count} folders" => "{count} map", "1 file" => "1 datoteka", -"{count} files" => "{count} datotek" +"{count} files" => "{count} datotek", +"Delete" => "Izbriši" ); diff --git a/apps/files_trashbin/l10n/sr.php b/apps/files_trashbin/l10n/sr.php index 36659e70803..2e7c139e389 100644 --- a/apps/files_trashbin/l10n/sr.php +++ b/apps/files_trashbin/l10n/sr.php @@ -7,5 +7,6 @@ "1 file" => "1 датотека", "{count} files" => "{count} датотеке/а", "Nothing in here. Your trash bin is empty!" => "Овде нема ништа. Корпа за отпатке је празна.", -"Restore" => "Врати" +"Restore" => "Врати", +"Delete" => "Обриши" ); diff --git a/apps/files_trashbin/l10n/sr@latin.php b/apps/files_trashbin/l10n/sr@latin.php index 52255c7429a..2cb86adfd40 100644 --- a/apps/files_trashbin/l10n/sr@latin.php +++ b/apps/files_trashbin/l10n/sr@latin.php @@ -1,3 +1,4 @@ <?php $TRANSLATIONS = array( -"Name" => "Ime" +"Name" => "Ime", +"Delete" => "Obriši" ); diff --git a/apps/files_trashbin/l10n/sv.php b/apps/files_trashbin/l10n/sv.php index 53bb7a6ce0f..6f8c2365818 100644 --- a/apps/files_trashbin/l10n/sv.php +++ b/apps/files_trashbin/l10n/sv.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Kunde inte återställa %s", "perform restore operation" => "utför återställning", "delete file permanently" => "radera filen permanent", +"Delete permanently" => "Radera permanent", "Name" => "Namn", "Deleted" => "Raderad", "1 folder" => "1 mapp", @@ -10,5 +11,6 @@ "1 file" => "1 fil", "{count} files" => "{count} filer", "Nothing in here. Your trash bin is empty!" => "Ingenting här. Din papperskorg är tom!", -"Restore" => "Återskapa" +"Restore" => "Återskapa", +"Delete" => "Radera" ); diff --git a/apps/files_trashbin/l10n/ta_LK.php b/apps/files_trashbin/l10n/ta_LK.php index a436e2344a4..f21e5fc750d 100644 --- a/apps/files_trashbin/l10n/ta_LK.php +++ b/apps/files_trashbin/l10n/ta_LK.php @@ -3,5 +3,6 @@ "1 folder" => "1 கோப்புறை", "{count} folders" => "{எண்ணிக்கை} கோப்புறைகள்", "1 file" => "1 கோப்பு", -"{count} files" => "{எண்ணிக்கை} கோப்புகள்" +"{count} files" => "{எண்ணிக்கை} கோப்புகள்", +"Delete" => "நீக்குக" ); diff --git a/apps/files_trashbin/l10n/th_TH.php b/apps/files_trashbin/l10n/th_TH.php index 8a031fb0d70..3f5d44c763e 100644 --- a/apps/files_trashbin/l10n/th_TH.php +++ b/apps/files_trashbin/l10n/th_TH.php @@ -7,5 +7,6 @@ "1 file" => "1 ไฟล์", "{count} files" => "{count} ไฟล์", "Nothing in here. Your trash bin is empty!" => "ไม่มีอะไรอยู่ในนี้ ถังขยะของคุณยังว่างอยู่", -"Restore" => "คืนค่า" +"Restore" => "คืนค่า", +"Delete" => "ลบ" ); diff --git a/apps/files_trashbin/l10n/tr.php b/apps/files_trashbin/l10n/tr.php index cebe615a05f..c874d73316a 100644 --- a/apps/files_trashbin/l10n/tr.php +++ b/apps/files_trashbin/l10n/tr.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "%s Geri yüklenemedi", "perform restore operation" => "Geri yükleme işlemini gerçekleştir", "delete file permanently" => "Dosyayı kalıcı olarak sil", +"Delete permanently" => "Kalıcı olarak sil", "Name" => "İsim", "Deleted" => "Silindi", "1 folder" => "1 dizin", @@ -10,5 +11,6 @@ "1 file" => "1 dosya", "{count} files" => "{count} dosya", "Nothing in here. Your trash bin is empty!" => "Burası boş. Çöp kutun tamamen boş.", -"Restore" => "Geri yükle" +"Restore" => "Geri yükle", +"Delete" => "Sil" ); diff --git a/apps/files_trashbin/l10n/uk.php b/apps/files_trashbin/l10n/uk.php index 06474d9b2cd..df7dd24864c 100644 --- a/apps/files_trashbin/l10n/uk.php +++ b/apps/files_trashbin/l10n/uk.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Неможливо відновити %s", "perform restore operation" => "виконати операцію відновлення", "delete file permanently" => "видалити файл назавжди", +"Delete permanently" => "Видалити назавжди", "Name" => "Ім'я", "Deleted" => "Видалено", "1 folder" => "1 папка", @@ -10,5 +11,6 @@ "1 file" => "1 файл", "{count} files" => "{count} файлів", "Nothing in here. Your trash bin is empty!" => "Нічого немає. Ваший кошик для сміття пустий!", -"Restore" => "Відновити" +"Restore" => "Відновити", +"Delete" => "Видалити" ); diff --git a/apps/files_trashbin/l10n/vi.php b/apps/files_trashbin/l10n/vi.php index ac2a7be0291..165fa9cfd94 100644 --- a/apps/files_trashbin/l10n/vi.php +++ b/apps/files_trashbin/l10n/vi.php @@ -3,6 +3,7 @@ "Couldn't restore %s" => "Không thể khôi phục %s", "perform restore operation" => "thực hiện phục hồi", "delete file permanently" => "xóa file vĩnh viễn", +"Delete permanently" => "Xóa vĩnh vễn", "Name" => "Tên", "Deleted" => "Đã xóa", "1 folder" => "1 thư mục", @@ -10,5 +11,6 @@ "1 file" => "1 tập tin", "{count} files" => "{count} tập tin", "Nothing in here. Your trash bin is empty!" => "Không có gì ở đây. Thùng rác của bạn rỗng!", -"Restore" => "Khôi phục" +"Restore" => "Khôi phục", +"Delete" => "Xóa" ); diff --git a/apps/files_trashbin/l10n/zh_CN.GB2312.php b/apps/files_trashbin/l10n/zh_CN.GB2312.php index 2c6a7891e98..606d80d441b 100644 --- a/apps/files_trashbin/l10n/zh_CN.GB2312.php +++ b/apps/files_trashbin/l10n/zh_CN.GB2312.php @@ -3,5 +3,6 @@ "1 folder" => "1 个文件夹", "{count} folders" => "{count} 个文件夹", "1 file" => "1 个文件", -"{count} files" => "{count} 个文件" +"{count} files" => "{count} 个文件", +"Delete" => "删除" ); diff --git a/apps/files_trashbin/l10n/zh_CN.php b/apps/files_trashbin/l10n/zh_CN.php index 0060b1f31d6..327a3e24707 100644 --- a/apps/files_trashbin/l10n/zh_CN.php +++ b/apps/files_trashbin/l10n/zh_CN.php @@ -3,5 +3,6 @@ "1 folder" => "1个文件夹", "{count} folders" => "{count} 个文件夹", "1 file" => "1 个文件", -"{count} files" => "{count} 个文件" +"{count} files" => "{count} 个文件", +"Delete" => "删除" ); diff --git a/apps/files_trashbin/l10n/zh_TW.php b/apps/files_trashbin/l10n/zh_TW.php index be61d9b0b6d..0142e901f58 100644 --- a/apps/files_trashbin/l10n/zh_TW.php +++ b/apps/files_trashbin/l10n/zh_TW.php @@ -1,7 +1,9 @@ <?php $TRANSLATIONS = array( +"Delete permanently" => "永久刪除", "Name" => "名稱", "1 folder" => "1 個資料夾", "{count} folders" => "{count} 個資料夾", "1 file" => "1 個檔案", -"{count} files" => "{count} 個檔案" +"{count} files" => "{count} 個檔案", +"Delete" => "刪除" ); diff --git a/apps/files_trashbin/lib/hooks.php b/apps/files_trashbin/lib/hooks.php index d6a62d447b8..9081706a2c5 100644 --- a/apps/files_trashbin/lib/hooks.php +++ b/apps/files_trashbin/lib/hooks.php @@ -1,23 +1,23 @@ <?php -/**
- * ownCloud - trash bin
- *
- * @author Bjoern Schiessle
- * @copyright 2013 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/>.
- *
+/** + * ownCloud - trash bin + * + * @author Bjoern Schiessle + * @copyright 2013 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/>. + * */ /** @@ -36,7 +36,7 @@ class Hooks { * to copy the file to the trash bin */ public static function remove_hook($params) { - + if ( \OCP\App::isEnabled('files_trashbin') ) { $path = $params['path']; Trashbin::move2trash($path); diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index 8d54a471b42..0b8472198d9 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -1,111 +1,131 @@ <?php -/**
- * ownCloud - trash bin
- *
- * @author Bjoern Schiessle
- * @copyright 2013 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\Files_Trashbin;
-
+/** + * ownCloud - trash bin + * + * @author Bjoern Schiessle + * @copyright 2013 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\Files_Trashbin; + class Trashbin { - - const DEFAULT_RETENTION_OBLIGATION=180; // how long do we keep files in the trash bin if no other value is defined in the config file (unit: days) - const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota - + // how long do we keep files in the trash bin if no other value is defined in the config file (unit: days) + const DEFAULT_RETENTION_OBLIGATION=180; + + // unit: percentage; 50% of available disk space/quota + const DEFAULTMAXSIZE=50; + /** * move file to the trash bin - * + * * @param $file_path path to the deleted file/directory relative to the files root directory */ public static function move2trash($file_path) { $user = \OCP\User::getUser(); - $view = new \OC_FilesystemView('/'. $user);
- if (!$view->is_dir('files_trashbin')) {
- $view->mkdir('files_trashbin');
- $view->mkdir("versions_trashbin");
- }
-
- $path_parts = pathinfo($file_path);
-
- $deleted = $path_parts['basename'];
- $location = $path_parts['dirname'];
- $timestamp = time();
- $mime = $view->getMimeType('files'.$file_path);
-
- if ( $view->is_dir('files'.$file_path) ) {
- $type = 'dir';
- } else {
- $type = 'file';
+ $view = new \OC\Files\View('/'. $user); + if (!$view->is_dir('files_trashbin')) { + $view->mkdir('files_trashbin'); + $view->mkdir("files_trashbin/files"); + $view->mkdir("files_trashbin/versions"); + $view->mkdir("files_trashbin/keyfiles"); + } + + $path_parts = pathinfo($file_path); + + $deleted = $path_parts['basename']; + $location = $path_parts['dirname']; + $timestamp = time(); + $mime = $view->getMimeType('files'.$file_path); + + if ( $view->is_dir('files'.$file_path) ) { + $type = 'dir'; + } else { + $type = 'file'; } -
- if ( ($trashbinSize = \OCP\Config::getAppValue('files_trashbin', 'size')) === null ) {
- $trashbinSize = self::calculateSize(new \OC_FilesystemView('/'. $user.'/files_trashbin')); - $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin'));
+ + $trashbinSize = self::getTrashbinSize($user); + if ( $trashbinSize === false || $trashbinSize < 0 ) { + $trashbinSize = self::calculateSize(new \OC\Files\View('/'. $user.'/files_trashbin')); } - $trashbinSize += self::copy_recursive($file_path, 'files_trashbin/'.$deleted.'.d'.$timestamp, $view); + $trashbinSize += self::copy_recursive($file_path, 'files_trashbin/files/'.$deleted.'.d'.$timestamp, $view); - if ( $view->file_exists('files_trashbin/'.$deleted.'.d'.$timestamp) ) {
- $query = \OC_DB::prepare("INSERT INTO *PREFIX*files_trash (id,timestamp,location,type,mime,user) VALUES (?,?,?,?,?,?)");
+ if ( $view->file_exists('files_trashbin/files/'.$deleted.'.d'.$timestamp) ) { + $query = \OC_DB::prepare("INSERT INTO *PREFIX*files_trash (id,timestamp,location,type,mime,user) VALUES (?,?,?,?,?,?)"); $result = $query->execute(array($deleted, $timestamp, $location, $type, $mime, $user)); if ( !$result ) { // if file couldn't be added to the database than also don't store it in the trash bin. - $view->deleteAll('files_trashbin/'.$deleted.'.d'.$timestamp); + $view->deleteAll('files_trashbin/files/'.$deleted.'.d'.$timestamp); \OC_Log::write('files_trashbin', 'trash bin database couldn\'t be updated', \OC_log::ERROR); return; - }
-
- if ( \OCP\App::isEnabled('files_versions') ) {
+ } + + // Take care of file versions + if ( \OCP\App::isEnabled('files_versions') ) { if ( $view->is_dir('files_versions'.$file_path) ) { - $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/files_versions/'.$file_path));
- $view->rename('files_versions'.$file_path, 'versions_trashbin/'. $deleted.'.d'.$timestamp);
- } else if ( $versions = \OCA\Files_Versions\Storage::getVersions($file_path) ) {
+ $trashbinSize += self::calculateSize(new \OC\Files\View('/'. $user.'/files_versions/'.$file_path)); + $view->rename('files_versions'.$file_path, 'files_trashbin/versions'. $deleted.'.d'.$timestamp); + } else if ( $versions = \OCA\Files_Versions\Storage::getVersions($user, $file_path) ) { foreach ($versions as $v) { - $trashbinSize += $view->filesize('files_versions'.$v['path'].'.v'.$v['version']);
- $view->rename('files_versions'.$v['path'].'.v'.$v['version'], 'versions_trashbin/'. $deleted.'.v'.$v['version'].'.d'.$timestamp);
- }
- }
+ $trashbinSize += $view->filesize('files_versions'.$v['path'].'.v'.$v['version']); + $view->rename('files_versions'.$v['path'].'.v'.$v['version'], 'files_trashbin/versions'. $deleted.'.v'.$v['version'].'.d'.$timestamp); + } + } + } + + // Take care of encryption keys + $keyfile = \OC\Files\Filesystem::normalizePath('files_encryption/keyfiles/'.$file_path); + if ( \OCP\App::isEnabled('files_encryption') && $view->file_exists($keyfile.'.key') ) { + if ( $view->is_dir('files'.$file_path) ) { + $trashbinSize += self::calculateSize(new \OC\Files\View('/'.$user.'/'.$keyfile)); + $view->rename($keyfile, 'files_trashbin/keyfiles/'. $deleted.'.d'.$timestamp); + } else { + $trashbinSize += $view->filesize($keyfile.'.key'); + $view->rename($keyfile.'.key', 'files_trashbin/keyfiles/'. $deleted.'.key.d'.$timestamp); + } } } else { \OC_Log::write('files_trashbin', 'Couldn\'t move '.$file_path.' to the trash bin', \OC_log::ERROR); } - // get available disk space for user
- $quota = \OCP\Util::computerFileSize(\OC_Preferences::getValue($user, 'files', 'quota'));
- if ( $quota == null ) {
- $quota = \OCP\Util::computerFileSize(\OC_Appconfig::getValue('files', 'default_quota'));
- }
- if ( $quota == null ) {
- $quota = \OC\Files\Filesystem::free_space('/');
+ // get available disk space for user + $quota = \OC_Preferences::getValue($user, 'files', 'quota'); + if ( $quota === null || $quota === 'default') { + $quota = \OC_Appconfig::getValue('files', 'default_quota'); } - - // calculate available space for trash bin
- $rootInfo = $view->getFileInfo('/files');
- $free = $quota-$rootInfo['size']; // remaining free space for user
- if ( $free > 0 ) {
- $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions
- } else {
- $availableSpace = $free-$trashbinSize;
+ if ( $quota === null ) { + $quota = \OC\Files\Filesystem::free_space('/') / count(\OCP\User::getUsers()); + } else { + $quota = \OCP\Util::computerFileSize($quota); } + // calculate available space for trash bin + $rootInfo = $view->getFileInfo('/files'); + $free = $quota-$rootInfo['size']; // remaining free space for user + if ( $free > 0 ) { + $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions + } else { + $availableSpace = $free-$trashbinSize; + } $trashbinSize -= self::expire($availableSpace); - \OCP\Config::setAppValue('files_trashbin', 'size', $trashbinSize);
+ + self::setTrashbinSize($user, $trashbinSize); + } - - + + /** * restore files from trash bin * @param $file path to the deleted file @@ -114,46 +134,47 @@ class Trashbin { */ public static function restore($file, $filename, $timestamp) { $user = \OCP\User::getUser(); - $view = new \OC_FilesystemView('/'.$user); + $view = new \OC\Files\View('/'.$user); - if ( ($trashbinSize = \OCP\Config::getAppValue('files_trashbin', 'size')) === null ) {
- $trashbinSize = self::calculateSize(new \OC_FilesystemView('/'. $user.'/files_trashbin'));
- $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin'));
+ $trashbinSize = self::getTrashbinSize($user); + if ( $trashbinSize === false || $trashbinSize < 0 ) { + $trashbinSize = self::calculateSize(new \OC\Files\View('/'. $user.'/files_trashbin')); } if ( $timestamp ) { - $query = \OC_DB::prepare('SELECT location,type FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?');
+ $query = \OC_DB::prepare('SELECT location,type FROM *PREFIX*files_trash' + .' WHERE user=? AND id=? AND timestamp=?'); $result = $query->execute(array($user,$filename,$timestamp))->fetchAll(); if ( count($result) != 1 ) { \OC_Log::write('files_trashbin', 'trash bin database inconsistent!', \OC_Log::ERROR); return false; } - - // if location no longer exists, restore file in the root directory
- $location = $result[0]['location'];
- if ( $result[0]['location'] != '/' && - (!$view->is_dir('files'.$result[0]['location']) || - !$view->isUpdatable('files'.$result[0]['location'])) ) {
- $location = '';
+ + // if location no longer exists, restore file in the root directory + $location = $result[0]['location']; + if ( $result[0]['location'] != '/' && + (!$view->is_dir('files'.$result[0]['location']) || + !$view->isUpdatable('files'.$result[0]['location'])) ) { + $location = ''; } } else { - $path_parts = pathinfo($filename); + $path_parts = pathinfo($file); $result[] = array( 'location' => $path_parts['dirname'], - 'type' => $view->is_dir('/files_trashbin/'.$file) ? 'dir' : 'files', + 'type' => $view->is_dir('/files_trashbin/files/'.$file) ? 'dir' : 'files', ); $location = ''; } - $source = \OC_Filesystem::normalizePath('files_trashbin/'.$file); - $target = \OC_Filesystem::normalizePath('files/'.$location.'/'.$filename); - + $source = \OC\Files\Filesystem::normalizePath('files_trashbin/files/'.$file); + $target = \OC\Files\Filesystem::normalizePath('files/'.$location.'/'.$filename); + // we need a extension in case a file/dir with the same name already exists $ext = self::getUniqueExtension($location, $filename, $view); $mtime = $view->filemtime($source); if( $view->rename($source, $target.$ext) ) { $view->touch($target.$ext, $mtime); if ($view->is_dir($target.$ext)) { - $trashbinSize -= self::calculateSize(new \OC_FilesystemView('/'.$user.'/'.$target.$ext)); + $trashbinSize -= self::calculateSize(new \OC\Files\View('/'.$user.'/'.$target.$ext)); } else { $trashbinSize -= $view->filesize($target.$ext); } @@ -163,29 +184,50 @@ class Trashbin { $versionedFile = $filename; } else { $versionedFile = $file; - }
- if ( $result[0]['type'] == 'dir' ) { - $trashbinSize -= self::calculateSize(new \OC_FilesystemView('/'.$user.'/'.'versions_trashbin/'. $file));
- $view->rename(\OC_Filesystem::normalizePath('versions_trashbin/'. $file), \OC_Filesystem::normalizePath('files_versions/'.$location.'/'.$filename.$ext));
- } else if ( $versions = self::getVersionsFromTrash($versionedFile, $timestamp) ) {
+ } + if ( $result[0]['type'] === 'dir' ) { + $trashbinSize -= self::calculateSize(new \OC\Files\View('/'.$user.'/'.'files_trashbin/versions/'. $file)); + $view->rename(\OC\Files\Filesystem::normalizePath('files_trashbin/versions/'. $file), \OC\Files\Filesystem::normalizePath('files_versions/'.$location.'/'.$filename.$ext)); + } else if ( $versions = self::getVersionsFromTrash($versionedFile, $timestamp) ) { foreach ($versions as $v) { if ($timestamp ) { - $trashbinSize -= $view->filesize('versions_trashbin/'.$versionedFile.'.v'.$v.'.d'.$timestamp); - $view->rename('versions_trashbin/'.$versionedFile.'.v'.$v.'.d'.$timestamp, 'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v); + $trashbinSize -= $view->filesize('files_trashbin/versions/'.$versionedFile.'.v'.$v.'.d'.$timestamp); + $view->rename('files_trashbin/versions/'.$versionedFile.'.v'.$v.'.d'.$timestamp, 'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v); } else { - $trashbinSize -= $view->filesize('versions_trashbin/'.$versionedFile.'.v'.$v); - $view->rename('versions_trashbin/'.$versionedFile.'.v'.$v, 'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v); - }
- }
- }
+ $trashbinSize -= $view->filesize('files_trashbin/versions/'.$versionedFile.'.v'.$v); + $view->rename('files_trashbin/versions/'.$versionedFile.'.v'.$v, 'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v); + } + } + } } - + + // Take care of encryption keys TODO! Get '.key' in file between file name and delete date (also for permanent delete!) + $parts = pathinfo($file); + if ( $result[0]['type'] === 'dir' ) { + $keyfile = \OC\Files\Filesystem::normalizePath('files_trashbin/keyfiles/'.$parts['dirname'].'/'.$filename); + } else { + $keyfile = \OC\Files\Filesystem::normalizePath('files_trashbin/keyfiles/'.$parts['dirname'].'/'.$filename.'.key'); + } + if ($timestamp) { + $keyfile .= '.d'.$timestamp; + } + if ( \OCP\App::isEnabled('files_encryption') && $view->file_exists($keyfile) ) { + if ( $result[0]['type'] === 'dir' ) { + $trashbinSize -= self::calculateSize(new \OC\Files\View('/'.$user.'/'.$keyfile)); + $view->rename($keyfile, 'files_encryption/keyfiles/'. $location.'/'.$filename); + } else { + $trashbinSize -= $view->filesize($keyfile); + $view->rename($keyfile, 'files_encryption/keyfiles/'. $location.'/'.$filename.'.key'); + } + } + if ( $timestamp ) { - $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?');
+ $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?'); $query->execute(array($user,$filename,$timestamp)); } - \OCP\Config::setAppValue('files_trashbin', 'size', $trashbinSize); + self::setTrashbinSize($user, $trashbinSize); + return true; } else { \OC_Log::write('files_trashbin', 'Couldn\'t restore file from trash bin, '.$filename, \OC_log::ERROR); @@ -193,58 +235,77 @@ class Trashbin { return false; } - - /**
- * delete file from trash bin permanently
+ + /** + * delete file from trash bin permanently * @param $filename path to the file - * @param $timestamp of deletion time
- * @return size of deleted files
- */
- public static function delete($filename, $timestamp=null) {
- $user = \OCP\User::getUser();
- $view = new \OC_FilesystemView('/'.$user); - $size = 0;
+ * @param $timestamp of deletion time + * @return size of deleted files + */ + public static function delete($filename, $timestamp=null) { + $user = \OCP\User::getUser(); + $view = new \OC\Files\View('/'.$user); + $size = 0; - if ( ($trashbinSize = \OCP\Config::getAppValue('files_trashbin', 'size')) === null ) {
- $trashbinSize = self::calculateSize(new \OC_FilesystemView('/'. $user.'/files_trashbin'));
- $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin'));
+ $trashbinSize = self::getTrashbinSize($user); + if ( $trashbinSize === false || $trashbinSize < 0 ) { + $trashbinSize = self::calculateSize(new \OC\Files\View('/'. $user.'/files_trashbin')); } -
- if ( $timestamp ) {
- $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?');
- $query->execute(array($user,$filename,$timestamp));
+ + 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)) { - $size += self::calculateSize(new \OC_Filesystemview('/'.$user.'/versions_trashbin/'.$file)); - $view->unlink('versions_trashbin/'.$file); + if ($view->is_dir('files_trashbin/versions/'.$file)) { + $size += self::calculateSize(new \OC\Files\view('/'.$user.'/files_trashbin/versions/'.$file)); + $view->unlink('files_trashbin/versions/'.$file); } else if ( $versions = self::getVersionsFromTrash($filename, $timestamp) ) { foreach ($versions as $v) { if ($timestamp ) { - $size += $view->filesize('/versions_trashbin/'.$filename.'.v'.$v.'.d'.$timestamp); - $view->unlink('/versions_trashbin/'.$filename.'.v'.$v.'.d'.$timestamp); + $size += $view->filesize('/files_trashbin/versions/'.$filename.'.v'.$v.'.d'.$timestamp); + $view->unlink('/files_trashbin/versions/'.$filename.'.v'.$v.'.d'.$timestamp); } else { - $size += $view->filesize('/versions_trashbin/'.$filename.'.v'.$v); - $view->unlink('/versions_trashbin/'.$filename.'.v'.$v); + $size += $view->filesize('/files_trashbin/versions/'.$filename.'.v'.$v); + $view->unlink('/files_trashbin/versions/'.$filename.'.v'.$v); } } } - }
+ } + + // Take care of encryption keys + $parts = pathinfo($file); + if ( $view->is_dir('/files_trashbin/files/'.$file) ) { + $keyfile = \OC\Files\Filesystem::normalizePath('files_trashbin/keyfiles/'.$filename); + } else { + $keyfile = \OC\Files\Filesystem::normalizePath('files_trashbin/keyfiles/'.$filename.'.key'); + } + if ($timestamp) { + $keyfile .= '.d'.$timestamp; + } + if ( \OCP\App::isEnabled('files_encryption') && $view->file_exists($keyfile) ) { + if ( $view->is_dir($keyfile) ) { + $size += self::calculateSize(new \OC\Files\View('/'.$user.'/'.$keyfile)); + } else { + $size += $view->filesize($keyfile); + } + $view->unlink($keyfile); + } - if ($view->is_dir('/files_trashbin/'.$file)) { - $size += self::calculateSize(new \OC_Filesystemview('/'.$user.'/files_trashbin/'.$file)); + if ($view->is_dir('/files_trashbin/files/'.$file)) { + $size += self::calculateSize(new \OC\Files\View('/'.$user.'/files_trashbin/files/'.$file)); } else { - $size += $view->filesize('/files_trashbin/'.$file); + $size += $view->filesize('/files_trashbin/files/'.$file); } - $view->unlink('/files_trashbin/'.$file); + $view->unlink('/files_trashbin/files/'.$file); $trashbinSize -= $size; - \OCP\Config::setAppValue('files_trashbin', 'size', $trashbinSize); -
- return $size;
+ self::setTrashbinSize($user, $trashbinSize); + + return $size; } /** @@ -255,7 +316,7 @@ class Trashbin { */ public static function file_exists($filename, $timestamp=null) { $user = \OCP\User::getUser(); - $view = new \OC_FilesystemView('/'.$user); + $view = new \OC\Files\View('/'.$user); if ($timestamp) { $filename = $filename.'.d'.$timestamp; @@ -263,56 +324,40 @@ class Trashbin { $filename = $filename; } - $target = \OC_Filesystem::normalizePath('files_trashbin/'.$filename); + $target = \OC\Files\Filesystem::normalizePath('files_trashbin/files/'.$filename); return $view->file_exists($target); } - /**
+ /** * clean up the trash bin - * @param max. available disk space for trashbin
- */
+ * @param max. available disk space for trashbin + */ private static function expire($availableSpace) { - + $user = \OCP\User::getUser(); - $view = new \OC_FilesystemView('/'.$user); + $view = new \OC\Files\View('/'.$user); $size = 0; - - $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=?');
+ + $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=?'); $result = $query->execute(array($user))->fetchAll(); - - $retention_obligation = \OC_Config::getValue('trashbin_retention_obligation', self::DEFAULT_RETENTION_OBLIGATION); - + + $retention_obligation = \OC_Config::getValue('trashbin_retention_obligation', + self::DEFAULT_RETENTION_OBLIGATION); + $limit = time() - ($retention_obligation * 86400); foreach ( $result as $r ) { $timestamp = $r['timestamp']; $filename = $r['id']; if ( $r['timestamp'] < $limit ) { - if ($view->is_dir('files_trashbin/'.$filename.'.d'.$timestamp)) { - $size += self::calculateSize(new \OC_FilesystemView('/'.$user.'/files_trashbin/'.$filename.'.d'.$timestamp)); - } else { - $size += $view->filesize('files_trashbin/'.$filename.'.d'.$timestamp); - } - $view->unlink('files_trashbin/'.$filename.'.d'.$timestamp); - if ($r['type'] == 'dir') { - $size += self::calculateSize(new \OC_FilesystemView('/'.$user.'/versions_trashbin/'.$filename.'.d'.$timestamp)); - $view->unlink('versions_trashbin/'.$filename.'.d'.$timestamp); - } else if ( $versions = self::getVersionsFromTrash($filename, $timestamp) ) { - foreach ($versions as $v) { - $size += $view->filesize('versions_trashbin/'.$filename.'.v'.$v.'.d'.$timestamp); - $view->unlink('versions_trashbin/'.$filename.'.v'.$v.'.d'.$timestamp); - } - } + $size += self::delete($filename, $timestamp); } } - - $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND timestamp<?');
- $query->execute(array($user,$limit)); - $availableSpace = $availableSpace + $size; // if size limit for trash bin reached, delete oldest files in trash bin if ($availableSpace < 0) { - $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=? ORDER BY timestamp ASC');
+ $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash' + .' WHERE user=? ORDER BY timestamp ASC'); $result = $query->execute(array($user))->fetchAll(); $length = count($result); $i = 0; @@ -322,15 +367,16 @@ class Trashbin { $size += $tmp; $i++; } - + + } - - return $size;
+ + return $size; } - + /** * recursive copy to copy a whole directory - * + * * @param $source source path, relative to the users files directory * @param $destination destination path relative to the users root directoy * @param $view file view for the users root directory @@ -357,15 +403,15 @@ class Trashbin { } return $size; } - + /** * find all versions which belong to the file we want to restore * @param $filename name of the file which should be restored * @param $timestamp timestamp when the file was deleted */ private static function getVersionsFromTrash($filename, $timestamp) { - $view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/versions_trashbin'); - $versionsName = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath($filename);
+ $view = new \OC\Files\View('/'.\OCP\User::getUser().'/files_trashbin/versions'); + $versionsName = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath($filename); $versions = array(); if ($timestamp ) { // fetch for old versions @@ -373,20 +419,20 @@ class Trashbin { $offset = -strlen($timestamp)-2; } else { $matches = glob( $versionsName.'.v*' ); - }
-
+ } + foreach( $matches as $ma ) { if ( $timestamp ) { - $parts = explode( '.v', substr($ma, 0, $offset) );
+ $parts = explode( '.v', substr($ma, 0, $offset) ); $versions[] = ( end( $parts ) ); } else { - $parts = explode( '.v', $ma );
+ $parts = explode( '.v', $ma ); $versions[] = ( end( $parts ) ); } } return $versions; } - + /** * find unique extension for restored file if a file with the same name already exists * @param $location where the file should be restored @@ -395,39 +441,71 @@ class Trashbin { * @return string with unique extension */ private static function getUniqueExtension($location, $filename, $view) { - $ext = '';
- if ( $view->file_exists('files'.$location.'/'.$filename) ) {
- $tmpext = '.restored';
- $ext = $tmpext;
- $i = 1;
- while ( $view->file_exists('files'.$location.'/'.$filename.$ext) ) {
- $ext = $tmpext.$i;
- $i++;
- }
+ $ext = ''; + if ( $view->file_exists('files'.$location.'/'.$filename) ) { + $tmpext = '.restored'; + $ext = $tmpext; + $i = 1; + while ( $view->file_exists('files'.$location.'/'.$filename.$ext) ) { + $ext = $tmpext.$i; + $i++; + } } return $ext; } - /**
+ /** * @brief get the size from a given root folder - * @param $view file view on the root folder
- * @return size of the folder
- */
- private static function calculateSize($view) {
- $root = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath('');
+ * @param $view file view on the root folder + * @return size of the folder + */ + private static function calculateSize($view) { + $root = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath(''); if (!file_exists($root)) { return 0; } - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root), \RecursiveIteratorIterator::CHILD_FIRST);
- $size = 0;
-
+ $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root), + \RecursiveIteratorIterator::CHILD_FIRST); + $size = 0; + foreach ($iterator as $path) { $relpath = substr($path, strlen($root)-1); if ( !$view->is_dir($relpath) ) { $size += $view->filesize($relpath); - }
- }
- return $size;
+ } + } + return $size; + } + + /** + * get current size of trash bin from a given user + * + * @param $user user who owns the trash bin + * @return mixed trash bin size or false if no trash bin size is stored + */ + private static function getTrashbinSize($user) { + $query = \OC_DB::prepare('SELECT size FROM *PREFIX*files_trashsize WHERE user=?'); + $result = $query->execute(array($user))->fetchAll(); + + if ($result) { + return $result[0]['size']; + } + return false; + } + + /** + * write to the database how much space is in use for the trash bin + * + * @param $user owner of the trash bin + * @param $size size of the trash bin + */ + private static function setTrashbinSize($user, $size) { + if ( self::getTrashbinSize($user) === false) { + $query = \OC_DB::prepare('INSERT INTO *PREFIX*files_trashsize (size, user) VALUES (?, ?)'); + }else { + $query = \OC_DB::prepare('UPDATE *PREFIX*files_trashsize SET size=? WHERE user=?'); + } + $query->execute(array($size, $user)); } -}
+} diff --git a/apps/files_trashbin/templates/index.php b/apps/files_trashbin/templates/index.php index c3e51b4becd..aaeeb5c6f6e 100644 --- a/apps/files_trashbin/templates/index.php +++ b/apps/files_trashbin/templates/index.php @@ -5,7 +5,7 @@ </div> <div id='notification'></div> -<?php if (isset($_['files']) && count($_['files'])==0):?> +<?php if (isset($_['files']) && count($_['files'])==0 && $_['dirlisting'] == false):?> <div id="emptyfolder"><?php echo $l->t('Nothing in here. Your trash bin is empty!')?></div> <?php endif; ?> @@ -25,6 +25,13 @@ </th> <th id="headerDate"> <span id="modified"><?php echo $l->t( 'Deleted' ); ?></span> + <span class="selectedActions"> + <a href="" class="delete"> + <?php echo $l->t('Delete')?> + <img class="svg" alt="<?php echo $l->t('Delete')?>" + src="<?php echo OCP\image_path("core", "actions/delete.svg"); ?>" /> + </a> + </span> </th> </tr> </thead> diff --git a/apps/files_trashbin/templates/part.list.php b/apps/files_trashbin/templates/part.list.php index fe8a71f44e6..dea0a43cd4c 100644 --- a/apps/files_trashbin/templates/part.list.php +++ b/apps/files_trashbin/templates/part.list.php @@ -1,12 +1,8 @@ <input type="hidden" id="disableSharing" data-status="<?php echo $_['disableSharing']; ?>"> <?php foreach($_['files'] as $file): - $simple_file_size = OCP\simple_file_size($file['size']); - // the bigger the file, the darker the shade of grey; megabytes*2 - $simple_size_color = intval(200-$file['size']/(1024*1024)*2); - if($simple_size_color<0) $simple_size_color = 0; $relative_deleted_date = OCP\relative_modified_date($file['timestamp']); // the older the file, the brighter the shade of grey; days*14 - $relative_date_color = round((time()-$file['mtime'])/60/60/24*14); + $relative_date_color = round((time()-$file['date'])/60/60/24*14); if($relative_date_color>200) $relative_date_color = 200; $name = str_replace('+', '%20', urlencode($file['name'])); $name = str_replace('%2F', '/', $name); @@ -73,4 +69,3 @@ </td> </tr> <?php endforeach; -
\ No newline at end of file diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php index 53fc04625c6..f9174c45a65 100644 --- a/apps/files_versions/ajax/getVersions.php +++ b/apps/files_versions/ajax/getVersions.php @@ -1,11 +1,10 @@ <?php OCP\JSON::checkAppEnabled('files_versions'); -$userDirectory = "/".OCP\USER::getUser()."/files"; $source = $_GET['source']; - +list ($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($source); $count = 5; //show the newest revisions -if( ($versions = OCA\Files_Versions\Storage::getVersions( $source, $count)) ) { +if( ($versions = OCA\Files_Versions\Storage::getVersions($uid, $filename, $count)) ) { $versionsFormatted = array(); diff --git a/apps/files_versions/ajax/rollbackVersion.php b/apps/files_versions/ajax/rollbackVersion.php index 2970915ac63..284b46ee093 100644 --- a/apps/files_versions/ajax/rollbackVersion.php +++ b/apps/files_versions/ajax/rollbackVersion.php @@ -14,4 +14,3 @@ if(OCA\Files_Versions\Storage::rollback( $file, $revision )) { $l = OC_L10N::get('files_versions'); OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) )))); } - diff --git a/apps/files_versions/ajax/togglesettings.php b/apps/files_versions/ajax/togglesettings.php deleted file mode 100644 index 546b37ae1aa..00000000000 --- a/apps/files_versions/ajax/togglesettings.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -OCP\JSON::checkAppEnabled('files_versions'); -OCP\JSON::checkAdminUser(); -OCP\JSON::callCheck(); -if (OCP\Config::getSystemValue('versions', 'true')=='true') { - OCP\Config::setSystemValue('versions', 'false'); -} else { - OCP\Config::setSystemValue('versions', 'true'); -} diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php index 9e3e81c580a..ae48b0cc10a 100644 --- a/apps/files_versions/appinfo/app.php +++ b/apps/files_versions/appinfo/app.php @@ -4,12 +4,10 @@ OC::$CLASSPATH['OCA\Files_Versions\Storage'] = 'apps/files_versions/lib/versions.php'; OC::$CLASSPATH['OCA\Files_Versions\Hooks'] = 'apps/files_versions/lib/hooks.php'; -OCP\App::registerAdmin('files_versions', 'settings'); - OCP\Util::addscript('files_versions', 'versions'); // Listen to write signals OCP\Util::connectHook('OC_Filesystem', 'write', "OCA\Files_Versions\Hooks", "write_hook"); // Listen to delete and rename signals -OCP\Util::connectHook('OC_Filesystem', 'post-delete', "OCA\Files_Versions\Hooks", "remove_hook"); +OCP\Util::connectHook('OC_Filesystem', 'post_delete', "OCA\Files_Versions\Hooks", "remove_hook"); OCP\Util::connectHook('OC_Filesystem', 'rename', "OCA\Files_Versions\Hooks", "rename_hook"); diff --git a/apps/files_versions/appinfo/database.xml b/apps/files_versions/appinfo/database.xml new file mode 100644 index 00000000000..d3854776980 --- /dev/null +++ b/apps/files_versions/appinfo/database.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<database> + + <name>*dbname*</name> + <create>true</create> + <overwrite>false</overwrite> + + <charset>utf8</charset> + + <table> + + <name>*dbprefix*files_versions</name> + + <declaration> + + <field> + <name>user</name> + <type>text</type> + <default></default> + <notnull>true</notnull> + <length>64</length> + </field> + <field> + <name>size</name> + <type>text</type> + <default></default> + <notnull>true</notnull> + <length>50</length> + </field> + + </declaration> + + </table> + +</database> diff --git a/apps/files_versions/appinfo/info.xml b/apps/files_versions/appinfo/info.xml index 0155f8e830f..44878da5e4d 100644 --- a/apps/files_versions/appinfo/info.xml +++ b/apps/files_versions/appinfo/info.xml @@ -4,7 +4,7 @@ <name>Versions</name> <licence>AGPL</licence> <author>Frank Karlitschek</author> - <require>4.91</require> + <require>4.93</require> <shipped>true</shipped> <description>Versioning of files</description> <types> diff --git a/apps/files_versions/appinfo/version b/apps/files_versions/appinfo/version index e6d5cb833c6..e4c0d46e55f 100644 --- a/apps/files_versions/appinfo/version +++ b/apps/files_versions/appinfo/version @@ -1 +1 @@ -1.0.2
\ No newline at end of file +1.0.3
\ No newline at end of file diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index b9c54689813..b82b9001fdb 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -1,19 +1,9 @@ -$(document).ready(function() { - $('#versions').bind('change', function() { - var checked = 1; - if (!this.checked) { - checked = 0; - } - $.post(OC.filePath('files_versions','ajax','togglesettings.php'), 'versions='+checked); - }); -}); - $(document).ready(function(){ if (typeof FileActions !== 'undefined') { - // Add history button to 'files/index.php' + // Add versions button to 'files/index.php' FileActions.register( 'file' - , t('files_versions', 'History') + , t('files_versions', 'Versions') , OC.PERMISSION_UPDATE , function() { // Specify icon for hitory button @@ -41,6 +31,10 @@ $(document).ready(function(){ } }); +function goToVersionPage(url){ + window.location(url); +} + function createVersionsDropdown(filename, files) { var historyUrl = OC.linkTo('files_versions', 'history.php') + '?path='+encodeURIComponent( $( '#dir' ).val() ).replace( /%2F/g, '/' )+'/'+encodeURIComponent( filename ); @@ -51,7 +45,7 @@ function createVersionsDropdown(filename, files) { html += '<option value=""></option>'; html += '</select>'; html += '</div>'; - html += '<input type="button" value="All versions..." onclick="window.location=\''+historyUrl+'\'" name="makelink" id="makelink" />'; + html += '<input type="button" value="All versions..." name="makelink" id="makelink" />'; html += '<input id="link" style="display:none; width:90%;" />'; if (filename) { @@ -61,6 +55,10 @@ function createVersionsDropdown(filename, files) { $(html).appendTo($('thead .share')); } + $("#makelink").click(function() { + goToVersionPage(historyUrl); + }); + $.ajax({ type: 'GET', url: OC.filePath('files_versions', 'ajax', 'getVersions.php'), diff --git a/apps/files_versions/l10n/ca.php b/apps/files_versions/l10n/ca.php index fc900c47dc7..47ff232235c 100644 --- a/apps/files_versions/l10n/ca.php +++ b/apps/files_versions/l10n/ca.php @@ -6,8 +6,5 @@ "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" +"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" ); diff --git a/apps/files_versions/l10n/cs_CZ.php b/apps/files_versions/l10n/cs_CZ.php index 22d4a2ad827..4ebd329332c 100644 --- a/apps/files_versions/l10n/cs_CZ.php +++ b/apps/files_versions/l10n/cs_CZ.php @@ -6,8 +6,5 @@ "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" +"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" ); diff --git a/apps/files_versions/l10n/da.php b/apps/files_versions/l10n/da.php index 93fcb9c99cf..76ababe665a 100644 --- a/apps/files_versions/l10n/da.php +++ b/apps/files_versions/l10n/da.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "Filen %s blev genskabt til version: %s", "No old versions available" => "Ingen gamle version tilgængelige", "No path specified" => "Ingen sti specificeret", -"History" => "Historik", -"Revert a file to a previous version by clicking on its revert button" => "Genskab en fil til en tidligere version ved at klikke på denne genskab knap.", -"Files Versioning" => "Versionering af filer", -"Enable" => "Aktiver" +"Revert a file to a previous version by clicking on its revert button" => "Genskab en fil til en tidligere version ved at klikke på denne genskab knap." ); diff --git a/apps/files_versions/l10n/de.php b/apps/files_versions/l10n/de.php index d7427fbbbf2..ac7fb39ae82 100644 --- a/apps/files_versions/l10n/de.php +++ b/apps/files_versions/l10n/de.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "Datei %s konnte nicht auf Version %s zurückgesetzt werden", "No old versions available" => "Keine älteren Versionen verfügbar", "No path specified" => "Kein Pfad angegeben", -"History" => "Historie", -"Revert a file to a previous version by clicking on its revert button" => "Setze eine Datei durch klicken auf den Zurücksetzen Button zurück", -"Files Versioning" => "Dateiversionierung", -"Enable" => "Aktivieren" +"Revert a file to a previous version by clicking on its revert button" => "Setze eine Datei durch klicken auf den Zurücksetzen Button zurück" ); diff --git a/apps/files_versions/l10n/de_DE.php b/apps/files_versions/l10n/de_DE.php index ba849c5ea87..6543c3ed45e 100644 --- a/apps/files_versions/l10n/de_DE.php +++ b/apps/files_versions/l10n/de_DE.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "Die Datei %s konnte nicht zur Version %s zurückgesetzt werden", "No old versions available" => "Keine älteren Versionen verfügbar", "No path specified" => "Kein Pfad angegeben", -"History" => "Historie", -"Revert a file to a previous version by clicking on its revert button" => "Setze eine Datei durch Klicken auf den Zurücksetzen-Button auf eine frühere Version zurück", -"Files Versioning" => "Dateiversionierung", -"Enable" => "Aktivieren" +"Revert a file to a previous version by clicking on its revert button" => "Setze eine Datei durch Klicken auf den Zurücksetzen-Button auf eine frühere Version zurück" ); diff --git a/apps/files_versions/l10n/el.php b/apps/files_versions/l10n/el.php index 8b7ecf085fb..6e1900b233b 100644 --- a/apps/files_versions/l10n/el.php +++ b/apps/files_versions/l10n/el.php @@ -6,8 +6,5 @@ "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" => "Ενεργοποίηση" +"Revert a file to a previous version by clicking on its revert button" => "Επαναφορά ενός αρχείου σε προηγούμενη έκδοση πατώντας στο κουμπί επαναφοράς" ); diff --git a/apps/files_versions/l10n/es.php b/apps/files_versions/l10n/es.php index 608e171a4b1..c43dbe77c2f 100644 --- a/apps/files_versions/l10n/es.php +++ b/apps/files_versions/l10n/es.php @@ -6,8 +6,5 @@ "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" +"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" ); diff --git a/apps/files_versions/l10n/es_AR.php b/apps/files_versions/l10n/es_AR.php index dc604e2a9c8..1d40b712abe 100644 --- a/apps/files_versions/l10n/es_AR.php +++ b/apps/files_versions/l10n/es_AR.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "El archivo %s no pudo ser revertido a la versión %s", "No old versions available" => "No hay versiones antiguas disponibles", "No path specified" => "Ruta de acceso no especificada", -"History" => "Historia", -"Revert a file to a previous version by clicking on its revert button" => "Revertí un archivo a una versión anterior haciendo click en su botón de \"revertir\"", -"Files Versioning" => "Versionado de archivos", -"Enable" => "Activar" +"Revert a file to a previous version by clicking on its revert button" => "Revertí un archivo a una versión anterior haciendo click en su botón de \"revertir\"" ); diff --git a/apps/files_versions/l10n/et_EE.php b/apps/files_versions/l10n/et_EE.php index 4aa80c4f55e..fa2a33f9dda 100644 --- a/apps/files_versions/l10n/et_EE.php +++ b/apps/files_versions/l10n/et_EE.php @@ -2,8 +2,5 @@ "success" => "korras", "failure" => "ebaõnnestus", "No old versions available" => "Vanu versioone pole saadaval", -"No path specified" => "Asukohta pole määratud", -"History" => "Ajalugu", -"Files Versioning" => "Failide versioonihaldus", -"Enable" => "Luba" +"No path specified" => "Asukohta pole määratud" ); diff --git a/apps/files_versions/l10n/eu.php b/apps/files_versions/l10n/eu.php index d7f7a796639..9e454cedf62 100644 --- a/apps/files_versions/l10n/eu.php +++ b/apps/files_versions/l10n/eu.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "%s fitxategia ezin da %s bertsiora leheneratu", "No old versions available" => "Ez dago bertsio zaharrik eskuragarri", "No path specified" => "Ez da bidea zehaztu", -"History" => "Historia", -"Revert a file to a previous version by clicking on its revert button" => "Itzuli fitxategi bat aurreko bertsio batera leheneratu bere leheneratu botoia sakatuz", -"Files Versioning" => "Fitxategien Bertsioak", -"Enable" => "Gaitu" +"Revert a file to a previous version by clicking on its revert button" => "Itzuli fitxategi bat aurreko bertsio batera leheneratu bere leheneratu botoia sakatuz" ); diff --git a/apps/files_versions/l10n/fa.php b/apps/files_versions/l10n/fa.php index 9b618fdd320..4ec6aa1bbb4 100644 --- a/apps/files_versions/l10n/fa.php +++ b/apps/files_versions/l10n/fa.php @@ -1,4 +1,8 @@ <?php $TRANSLATIONS = array( -"History" => "تاریخچه", -"Enable" => "فعال" +"Could not revert: %s" => "بازگردانی امکان ناپذیر است: %s", +"success" => "موفقیت", +"failure" => "شکست", +"No old versions available" => "هیچ نسخه قدیمی در دسترس نیست", +"No path specified" => "هیچ مسیری مشخص نشده است", +"Revert a file to a previous version by clicking on its revert button" => "بازگردانی یک پرورنده به نسخه قدیمی اش از طریق دکمه بازگردانی امکان پذیر است" ); diff --git a/apps/files_versions/l10n/fi_FI.php b/apps/files_versions/l10n/fi_FI.php index 61e073d4e06..0dec7fc2580 100644 --- a/apps/files_versions/l10n/fi_FI.php +++ b/apps/files_versions/l10n/fi_FI.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "Tiedoston %s palautus versioon %s epäonnistui", "No old versions available" => "Vanhoja ei ole saatavilla", "No path specified" => "Polkua ei ole määritetty", -"History" => "Historia", -"Revert a file to a previous version by clicking on its revert button" => "Palauta tiedoston edellinen versio napsauttamalla palautuspainiketta", -"Files Versioning" => "Tiedostojen versiointi", -"Enable" => "Käytä" +"Revert a file to a previous version by clicking on its revert button" => "Palauta tiedoston edellinen versio napsauttamalla palautuspainiketta" ); diff --git a/apps/files_versions/l10n/fr.php b/apps/files_versions/l10n/fr.php index 6b2cf9ba6b5..76ad8fc97a6 100644 --- a/apps/files_versions/l10n/fr.php +++ b/apps/files_versions/l10n/fr.php @@ -6,8 +6,5 @@ "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" +"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" ); diff --git a/apps/files_versions/l10n/gl.php b/apps/files_versions/l10n/gl.php index b822b223cc1..feb7f59e9a4 100644 --- a/apps/files_versions/l10n/gl.php +++ b/apps/files_versions/l10n/gl.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "Non foi posíbel reverter o ficheiro %s á versión %s", "No old versions available" => "Non hai versións antigas dispoñíbeis", "No path specified" => "Non foi indicada a ruta", -"History" => "Historial", -"Revert a file to a previous version by clicking on its revert button" => "Reverta un ficheiro a unha versión anterior premendo no botón reversión", -"Files Versioning" => "Sistema de versión de ficheiros", -"Enable" => "Activar" +"Revert a file to a previous version by clicking on its revert button" => "Reverta un ficheiro a unha versión anterior premendo no botón reversión" ); diff --git a/apps/files_versions/l10n/hu_HU.php b/apps/files_versions/l10n/hu_HU.php index dcf28838158..f400b2f81f5 100644 --- a/apps/files_versions/l10n/hu_HU.php +++ b/apps/files_versions/l10n/hu_HU.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "%s állományt nem sikerült átállítani erre a változatra: %s", "No old versions available" => "Nincs régebbi változat", "No path specified" => "Nincs megadva az útvonal", -"History" => "Korábbi változatok", -"Revert a file to a previous version by clicking on its revert button" => "Az állomány átállítható egy régebbi változatra, ha a gombra kattint", -"Files Versioning" => "Az állományok verzionálása", -"Enable" => "engedélyezve" +"Revert a file to a previous version by clicking on its revert button" => "Az állomány átállítható egy régebbi változatra, ha a gombra kattint" ); diff --git a/apps/files_versions/l10n/id.php b/apps/files_versions/l10n/id.php index 6c553327c42..4662aa86432 100644 --- a/apps/files_versions/l10n/id.php +++ b/apps/files_versions/l10n/id.php @@ -1,5 +1,10 @@ <?php $TRANSLATIONS = array( -"History" => "riwayat", -"Files Versioning" => "pembuatan versi file", -"Enable" => "aktifkan" +"Could not revert: %s" => "Tidak dapat mengembalikan: %s", +"success" => "sukses", +"File %s was reverted to version %s" => "Berkas %s telah dikembalikan ke versi %s", +"failure" => "gagal", +"File %s could not be reverted to version %s" => "Berkas %s gagal dikembalikan ke versi %s", +"No old versions available" => "Versi lama tidak tersedia", +"No path specified" => "Lokasi tidak ditentukan", +"Revert a file to a previous version by clicking on its revert button" => "Kembalikan berkas ke versi sebelumnya dengan mengklik tombol kembalikan" ); diff --git a/apps/files_versions/l10n/it.php b/apps/files_versions/l10n/it.php index 3289f7f68d1..40ac14ffd95 100644 --- a/apps/files_versions/l10n/it.php +++ b/apps/files_versions/l10n/it.php @@ -6,8 +6,5 @@ "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" +"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" ); diff --git a/apps/files_versions/l10n/ja_JP.php b/apps/files_versions/l10n/ja_JP.php index 16018765708..8d20a554d1c 100644 --- a/apps/files_versions/l10n/ja_JP.php +++ b/apps/files_versions/l10n/ja_JP.php @@ -6,8 +6,5 @@ "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" => "有効化" +"Revert a file to a previous version by clicking on its revert button" => "もとに戻すボタンをクリックすると、ファイルを過去のバージョンに戻します" ); diff --git a/apps/files_versions/l10n/lv.php b/apps/files_versions/l10n/lv.php index 2203dc706b8..af699de02be 100644 --- a/apps/files_versions/l10n/lv.php +++ b/apps/files_versions/l10n/lv.php @@ -6,8 +6,5 @@ "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" +"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" ); diff --git a/apps/files_versions/l10n/nl.php b/apps/files_versions/l10n/nl.php index fb1cfc3533c..c50f76c7add 100644 --- a/apps/files_versions/l10n/nl.php +++ b/apps/files_versions/l10n/nl.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "Bestand %s kon niet worden teruggedraaid naar versie %s", "No old versions available" => "Geen oudere versies beschikbaar", "No path specified" => "Geen pad opgegeven", -"History" => "Geschiedenis", -"Revert a file to a previous version by clicking on its revert button" => "Draai een bestand terug naar een voorgaande versie door te klikken op de terugdraai knop", -"Files Versioning" => "Bestand versies", -"Enable" => "Activeer" +"Revert a file to a previous version by clicking on its revert button" => "Draai een bestand terug naar een voorgaande versie door te klikken op de terugdraai knop" ); diff --git a/apps/files_versions/l10n/pl.php b/apps/files_versions/l10n/pl.php index ae3bfc4a842..6448c0eb71a 100644 --- a/apps/files_versions/l10n/pl.php +++ b/apps/files_versions/l10n/pl.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "Plik %s nie mógł być przywrócony do wersji %s", "No old versions available" => "Nie są dostępne żadne starsze wersje", "No path specified" => "Nie podano ścieżki", -"History" => "Historia", -"Revert a file to a previous version by clicking on its revert button" => "Przywróć plik do poprzedniej wersji klikając w jego przycisk przywrócenia", -"Files Versioning" => "Wersjonowanie plików", -"Enable" => "Włącz" +"Revert a file to a previous version by clicking on its revert button" => "Przywróć plik do poprzedniej wersji klikając w jego przycisk przywrócenia" ); diff --git a/apps/files_versions/l10n/pt_BR.php b/apps/files_versions/l10n/pt_BR.php index 9ce509c6534..f68197ef092 100644 --- a/apps/files_versions/l10n/pt_BR.php +++ b/apps/files_versions/l10n/pt_BR.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "Arquivo %s não pôde ser revertido à versão %s", "No old versions available" => "Nenhuma versão antiga disponível", "No path specified" => "Nenhum caminho especificado", -"History" => "Histórico", -"Revert a file to a previous version by clicking on its revert button" => "Reverta um arquivo a uma versão anterior clicando no botão reverter", -"Files Versioning" => "Versionamento de Arquivos", -"Enable" => "Habilitar" +"Revert a file to a previous version by clicking on its revert button" => "Reverta um arquivo a uma versão anterior clicando no botão reverter" ); diff --git a/apps/files_versions/l10n/pt_PT.php b/apps/files_versions/l10n/pt_PT.php index 629809f9556..2baccf3def8 100644 --- a/apps/files_versions/l10n/pt_PT.php +++ b/apps/files_versions/l10n/pt_PT.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "Não foi possível reverter o ficheiro %s para a versão %s", "No old versions available" => "Não existem versões mais antigas", "No path specified" => "Nenhum caminho especificado", -"History" => "Histórico", -"Revert a file to a previous version by clicking on its revert button" => "Reverter um ficheiro para uma versão anterior clicando no seu botão reverter.", -"Files Versioning" => "Versionamento de Ficheiros", -"Enable" => "Activar" +"Revert a file to a previous version by clicking on its revert button" => "Reverter um ficheiro para uma versão anterior clicando no seu botão reverter." ); diff --git a/apps/files_versions/l10n/ru.php b/apps/files_versions/l10n/ru.php index 221d24ce8d1..092a25af774 100644 --- a/apps/files_versions/l10n/ru.php +++ b/apps/files_versions/l10n/ru.php @@ -6,8 +6,5 @@ "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" => "Включить" +"Revert a file to a previous version by clicking on its revert button" => "Вернуть файл к предыдущей версии нажатием на кнопку возврата" ); diff --git a/apps/files_versions/l10n/sk_SK.php b/apps/files_versions/l10n/sk_SK.php index 8b46e93bb97..cbf81d4da2e 100644 --- a/apps/files_versions/l10n/sk_SK.php +++ b/apps/files_versions/l10n/sk_SK.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "Súbor %s nemohol byť obnovený na verziu %s", "No old versions available" => "Nie sú dostupné žiadne staršie verzie", "No path specified" => "Nevybrali ste cestu", -"History" => "História", -"Revert a file to a previous version by clicking on its revert button" => "Obnovte súbor do predošlej verzie kliknutím na tlačítko obnoviť", -"Files Versioning" => "Vytváranie verzií súborov", -"Enable" => "Zapnúť" +"Revert a file to a previous version by clicking on its revert button" => "Obnovte súbor do predošlej verzie kliknutím na tlačítko obnoviť" ); diff --git a/apps/files_versions/l10n/sv.php b/apps/files_versions/l10n/sv.php index 853644848f4..46e2c0f8bcf 100644 --- a/apps/files_versions/l10n/sv.php +++ b/apps/files_versions/l10n/sv.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "Filen %s kunde inte återställas till version %s", "No old versions available" => "Inga gamla versioner finns tillgängliga", "No path specified" => "Ingen sökväg angiven", -"History" => "Historik", -"Revert a file to a previous version by clicking on its revert button" => "Återställ en fil till en tidigare version genom att klicka på knappen", -"Files Versioning" => "Versionshantering av filer", -"Enable" => "Aktivera" +"Revert a file to a previous version by clicking on its revert button" => "Återställ en fil till en tidigare version genom att klicka på knappen" ); diff --git a/apps/files_versions/l10n/tr.php b/apps/files_versions/l10n/tr.php index 3db3a4bc822..5ba8248a45d 100644 --- a/apps/files_versions/l10n/tr.php +++ b/apps/files_versions/l10n/tr.php @@ -5,8 +5,5 @@ "failure" => "hata", "File %s could not be reverted to version %s" => "Dosya %s, %s versiyonuna döndürülemedi.", "No old versions available" => "Eski versiyonlar mevcut değil.", -"No path specified" => "Yama belirtilmemiş", -"History" => "Geçmiş", -"Files Versioning" => "Dosya Sürümleri", -"Enable" => "Etkinleştir" +"No path specified" => "Yama belirtilmemiş" ); diff --git a/apps/files_versions/l10n/uk.php b/apps/files_versions/l10n/uk.php index 861523bf6a4..bfee066c63d 100644 --- a/apps/files_versions/l10n/uk.php +++ b/apps/files_versions/l10n/uk.php @@ -6,8 +6,5 @@ "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" => "Включити" +"Revert a file to a previous version by clicking on its revert button" => "Відновити файл на попередню версію, натиснувши на кнопку Відновити" ); diff --git a/apps/files_versions/l10n/vi.php b/apps/files_versions/l10n/vi.php index 675cb841c78..f2499e7bf35 100644 --- a/apps/files_versions/l10n/vi.php +++ b/apps/files_versions/l10n/vi.php @@ -6,8 +6,5 @@ "File %s could not be reverted to version %s" => "File %s không thể khôi phục về phiên bản %s", "No old versions available" => "Không có phiên bản cũ nào", "No path specified" => "Không chỉ ra đường dẫn rõ ràng", -"History" => "Lịch sử", -"Revert a file to a previous version by clicking on its revert button" => "Khôi phục một file về phiên bản trước đó bằng cách click vào nút Khôi phục tương ứng", -"Files Versioning" => "Phiên bản tập tin", -"Enable" => "Bật " +"Revert a file to a previous version by clicking on its revert button" => "Khôi phục một file về phiên bản trước đó bằng cách click vào nút Khôi phục tương ứng" ); diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php index dc02c605c44..7891b20e92f 100644 --- a/apps/files_versions/lib/hooks.php +++ b/apps/files_versions/lib/hooks.php @@ -20,13 +20,10 @@ class Hooks { public static function write_hook( $params ) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { - - $versions = new Storage( new \OC\Files\View('') ); - $path = $params[\OC\Files\Filesystem::signal_param_path]; - - if($path<>'') $versions->store( $path ); - + if($path<>'') { + Storage::store($path); + } } } @@ -40,13 +37,11 @@ class Hooks { */ public static function remove_hook($params) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { - - $versions = new Storage( new \OC_FilesystemView('') ); - $path = $params[\OC\Files\Filesystem::signal_param_path]; - - if($path<>'') $versions->delete( $path ); - + if($path<>'') { + Storage::delete($path); + } + } } @@ -59,15 +54,13 @@ class Hooks { */ public static function rename_hook($params) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { - - $versions = new Storage( new \OC_FilesystemView('') ); - $oldpath = $params['oldpath']; $newpath = $params['newpath']; - - if($oldpath<>'' && $newpath<>'') $versions->rename( $oldpath, $newpath ); - + if($oldpath<>'' && $newpath<>'') { + Storage::rename( $oldpath, $newpath ); + } + } } - + } diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index f23381cb156..12f8fdaa0dc 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -19,53 +19,73 @@ class Storage { const DEFAULTENABLED=true; const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota - + private static $max_versions_per_interval = array( - 1 => array('intervalEndsAfter' => 10, //first 10sec, one version every 2sec - 'step' => 2), - 2 => array('intervalEndsAfter' => 60, //next minute, one version every 10sec - 'step' => 10), - 3 => array('intervalEndsAfter' => 3600, //next hour, one version every minute - 'step' => 60), - 4 => array('intervalEndsAfter' => 86400, //next 24h, one version every hour - 'step' => 3600), - 5 => array('intervalEndsAfter' => 2592000, //next 30days, one version per day - 'step' => 86400), - 6 => array('intervalEndsAfter' => -1, //until the end one version per week - 'step' => 604800), - ); - - private static function getUidAndFilename($filename) - { - if (\OCP\App::isEnabled('files_sharing') - && substr($filename, 0, 7) == '/Shared' - && $source = \OCP\Share::getItemSharedWith('file', - substr($filename, 7), - \OC_Share_Backend_File::FORMAT_SHARED_STORAGE)) { - $filename = $source['path']; - $pos = strpos($filename, '/files', 1); - $uid = substr($filename, 1, $pos - 1); - $filename = substr($filename, $pos + 6); - } else { - $uid = \OCP\User::getUser(); + //first 10sec, one version every 2sec + 1 => array('intervalEndsAfter' => 10, 'step' => 2), + //next minute, one version every 10sec + 2 => array('intervalEndsAfter' => 60, 'step' => 10), + //next hour, one version every minute + 3 => array('intervalEndsAfter' => 3600, 'step' => 60), + //next 24h, one version every hour + 4 => array('intervalEndsAfter' => 86400, 'step' => 3600), + //next 30days, one version per day + 5 => array('intervalEndsAfter' => 2592000, 'step' => 86400), + //until the end one version per week + 6 => array('intervalEndsAfter' => -1, 'step' => 604800), + ); + + public static function getUidAndFilename($filename) { + $uid = \OC\Files\Filesystem::getOwner($filename); + \OC\Files\Filesystem::initMountPoints($uid); + if ( $uid != \OCP\User::getUser() ) { + $info = \OC\Files\Filesystem::getFileInfo($filename); + $ownerView = new \OC\Files\View('/'.$uid.'/files'); + $filename = $ownerView->getPath($info['fileid']); } return array($uid, $filename); } /** + * get current size of all versions from a given user + * + * @param $user user who owns the versions + * @return mixed versions size or false if no versions size is stored + */ + private static function getVersionsSize($user) { + $query = \OC_DB::prepare('SELECT size FROM *PREFIX*files_versions WHERE user=?'); + $result = $query->execute(array($user))->fetchAll(); + + if ($result) { + return $result[0]['size']; + } + return false; + } + + /** + * write to the database how much space is in use for versions + * + * @param $user owner of the versions + * @param $size size of the versions + */ + private static function setVersionsSize($user, $size) { + if ( self::getVersionsSize($user) === false) { + $query = \OC_DB::prepare('INSERT INTO *PREFIX*files_versions (size, user) VALUES (?, ?)'); + }else { + $query = \OC_DB::prepare('UPDATE *PREFIX*files_versions SET size=? WHERE user=?'); + } + $query->execute(array($size, $user)); + } + + /** * store a new version of a file. */ - public function store($filename) { + public static function store($filename) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { list($uid, $filename) = self::getUidAndFilename($filename); - $files_view = new \OC\Files\View('/'.\OCP\User::getUser() .'/files'); - $users_view = new \OC\Files\View('/'.\OCP\User::getUser()); - //check if source file already exist as version to avoid recursions. - // todo does this check work? - if ($users_view->file_exists($filename)) { - return false; - } + $files_view = new \OC\Files\View('/'.$uid .'/files'); + $users_view = new \OC\Files\View('/'.$uid); // check if filename is a directory if($files_view->is_dir($filename)) { @@ -85,17 +105,19 @@ class Storage { } // store a new version of a file - $result = $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename)); - if ( ($versionsSize = \OCP\Config::getAppValue('files_versions', 'size')) === null ) { + $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename)); + $versionsSize = self::getVersionsSize($uid); + if ( $versionsSize === false || $versionsSize < 0 ) { $versionsSize = self::calculateSize($uid); } + $versionsSize += $users_view->filesize('files'.$filename); - + // expire old revisions if necessary $newSize = self::expire($filename, $versionsSize); - + if ( $newSize != $versionsSize ) { - \OCP\Config::setAppValue('files_versions', 'size', $versionsSize); + self::setVersionsSize($uid, $newSize); } } } @@ -106,43 +128,43 @@ class Storage { */ public static function delete($filename) { list($uid, $filename) = self::getUidAndFilename($filename); - $versions_fileview = new \OC_FilesystemView('/'.$uid .'/files_versions'); - + $versions_fileview = new \OC\Files\View('/'.$uid .'/files_versions'); + $abs_path = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$filename.'.v'; - if( ($versions = self::getVersions($filename)) ) { - if ( ($versionsSize = \OCP\Config::getAppValue('files_versions', 'size')) === null ) { + if( ($versions = self::getVersions($uid, $filename)) ) { + $versionsSize = self::getVersionsSize($uid); + if ( $versionsSize === false || $versionsSize < 0 ) { $versionsSize = self::calculateSize($uid); } foreach ($versions as $v) { unlink($abs_path . $v['version']); $versionsSize -= $v['size']; } - \OCP\Config::setAppValue('files_versions', 'size', $versionsSize); + self::setVersionsSize($uid, $versionsSize); } } - + /** * rename versions of a file */ public static function rename($oldpath, $newpath) { list($uid, $oldpath) = self::getUidAndFilename($oldpath); list($uidn, $newpath) = self::getUidAndFilename($newpath); - $versions_view = new \OC_FilesystemView('/'.$uid .'/files_versions'); - $files_view = new \OC_FilesystemView('/'.$uid .'/files'); + $versions_view = new \OC\Files\View('/'.$uid .'/files_versions'); + $files_view = new \OC\Files\View('/'.$uid .'/files'); $abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_view->getAbsolutePath('').$newpath; - + if ( $files_view->is_dir($oldpath) && $versions_view->is_dir($oldpath) ) { $versions_view->rename($oldpath, $newpath); - } else if ( ($versions = Storage::getVersions($oldpath)) ) { + } else if ( ($versions = Storage::getVersions($uid, $oldpath)) ) { $info=pathinfo($abs_newpath); if(!file_exists($info['dirname'])) mkdir($info['dirname'], 0750, true); - $versions = Storage::getVersions($oldpath); foreach ($versions as $v) { $versions_view->rename($oldpath.'.v'.$v['version'], $newpath.'.v'.$v['version']); } } } - + /** * rollback to an old version of a file. */ @@ -152,14 +174,14 @@ class Storage { list($uid, $filename) = self::getUidAndFilename($filename); $users_view = new \OC\Files\View('/'.$uid); $versionCreated = false; - + //first create a new version $version = 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename); if ( !$users_view->file_exists($version)) { $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename)); $versionCreated = true; } - + // rollback if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) { $users_view->touch('files'.$filename, $revision); @@ -177,27 +199,27 @@ class Storage { /** * @brief get a list of all available versions of a file in descending chronological order + * @param $uid user id from the owner of the file * @param $filename file to find versions of, relative to the user files dir * @param $count number of versions to return * @returns array */ - public static function getVersions( $filename, $count = 0 ) { + public static function getVersions($uid, $filename, $count = 0 ) { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { - list($uid, $filename) = self::getUidAndFilename($filename); - $versions_fileview = new \OC\Files\View('/' . \OCP\User::getUser() . '/files_versions'); + $versions_fileview = new \OC\Files\View('/' . $uid . '/files_versions'); - $versionsName = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename); + $versionsName = \OC_Filesystem::normalizePath(\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename)); $versions = array(); // fetch for old versions - $matches = glob( $versionsName.'.v*' ); - + $matches = glob(preg_quote($versionsName).'.v*' ); + if ( !$matches ) { return $versions; } sort( $matches ); - $files_view = new \OC_FilesystemView('/'.$uid.'/files'); + $files_view = new \OC\Files\View('/'.$uid.'/files'); $local_file = $files_view->getLocalFile($filename); $local_file_md5 = \md5_file( $local_file ); @@ -248,24 +270,27 @@ class Storage { */ private static function calculateSize($uid) { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { - $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); + $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions'); $versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath(''); - - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($versionsRoot), \RecursiveIteratorIterator::CHILD_FIRST); - + + $iterator = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($versionsRoot), + \RecursiveIteratorIterator::CHILD_FIRST + ); + $size = 0; - + foreach ($iterator as $path) { if ( preg_match('/^.+\.v(\d+)$/', $path, $match) ) { $relpath = substr($path, strlen($versionsRoot)-1); $size += $versions_fileview->filesize($relpath); } } - + return $size; } } - + /** * @brief returns all stored file versions from a given user * @param $uid id to the user @@ -273,26 +298,29 @@ class Storage { */ private static function getAllVersions($uid) { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { - $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); + $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions'); $versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath(''); - - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($versionsRoot), \RecursiveIteratorIterator::CHILD_FIRST); - + + $iterator = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($versionsRoot), + \RecursiveIteratorIterator::CHILD_FIRST + ); + $versions = array(); - + foreach ($iterator as $path) { if ( preg_match('/^.+\.v(\d+)$/', $path, $match) ) { $relpath = substr($path, strlen($versionsRoot)-1); $versions[$match[1].'#'.$relpath] = array('path' => $relpath, 'timestamp' => $match[1]); } } - + ksort($versions); - + $i = 0; - + $result = array(); - + foreach( $versions as $key => $value ) { $i++; $size = $versions_fileview->filesize($value['path']); @@ -301,14 +329,14 @@ class Storage { $result['all'][$key]['version'] = $value['timestamp']; $result['all'][$key]['path'] = $filename; $result['all'][$key]['size'] = $size; - + $filename = substr($value['path'], 0, -strlen($value['timestamp'])-2); $result['by_file'][$filename][$key]['version'] = $value['timestamp']; $result['by_file'][$filename][$key]['path'] = $filename; $result['by_file'][$filename][$key]['size'] = $size; - + } - + return $result; } } @@ -318,68 +346,71 @@ class Storage { */ private static function expire($filename, $versionsSize = null) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { - list($uid, $filename) = self::getUidAndFilename($filename); - $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); - + list($uid, $filename) = self::getUidAndFilename($filename); + $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions'); + // get available disk space for user - $quota = \OCP\Util::computerFileSize(\OC_Preferences::getValue($uid, 'files', 'quota')); - if ( $quota == null ) { - $quota = \OCP\Util::computerFileSize(\OC_Appconfig::getValue('files', 'default_quota')); + $quota = \OC_Preferences::getValue($uid, 'files', 'quota'); + if ( $quota === null ) { + $quota = \OC_Appconfig::getValue('files', 'default_quota'); } - if ( $quota == null ) { - $quota = \OC\Files\Filesystem::free_space('/'); + if ( $quota === null ) { + $quota = \OC\Files\Filesystem::free_space('/') / count(\OCP\User::getUsers()); + } else { + $quota = \OCP\Util::computerFileSize($quota); } - + // make sure that we have the current size of the version history if ( $versionsSize === null ) { - if ( ($versionsSize = \OCP\Config::getAppValue('files_versions', 'size')) === null ) { + $versionsSize = self::getVersionsSize($uid); + if ( $versionsSize === false || $versionsSize < 0 ) { $versionsSize = self::calculateSize($uid); } } // calculate available space for version history - $files_view = new \OC_FilesystemView('/'.$uid.'/files'); + $files_view = new \OC\Files\View('/'.$uid.'/files'); $rootInfo = $files_view->getFileInfo('/'); $free = $quota-$rootInfo['size']; // remaining free space for user if ( $free > 0 ) { $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $versionsSize; // how much space can be used for versions } else { $availableSpace = $free-$versionsSize; - } + } - // after every 1000s run reduce the number of all versions not only for the current file + // after every 1000s run reduce the number of all versions not only for the current file $random = rand(0, 1000); if ($random == 0) { $result = Storage::getAllVersions($uid); $versions_by_file = $result['by_file']; $all_versions = $result['all']; } else { - $all_versions = Storage::getVersions($filename); + $all_versions = Storage::getVersions($uid, $filename); $versions_by_file[$filename] = $all_versions; } - + $time = time(); - + // it is possible to expire versions from more than one file // iterate through all given files foreach ($versions_by_file as $filename => $versions) { $versions = array_reverse($versions); // newest version first - + $interval = 1; - $step = Storage::$max_versions_per_interval[$interval]['step']; + $step = Storage::$max_versions_per_interval[$interval]['step']; if (Storage::$max_versions_per_interval[$interval]['intervalEndsAfter'] == -1) { $nextInterval = -1; } else { $nextInterval = $time - Storage::$max_versions_per_interval[$interval]['intervalEndsAfter']; } - + $firstVersion = reset($versions); $firstKey = key($versions); $prevTimestamp = $firstVersion['version']; $nextVersion = $firstVersion['version'] - $step; $remaining_versions[$firstKey] = $firstVersion; unset($versions[$firstKey]); - + foreach ($versions as $key => $version) { $newInterval = true; while ( $newInterval ) { @@ -409,11 +440,11 @@ class Storage { $prevTimestamp = $version['version']; } } - + // check if enough space is available after versions are rearranged. // if not we delete the oldest versions until we meet the size limit for versions $numOfVersions = count($all_versions); - $i = 0; + $i = 0; while ($availableSpace < 0) { if ($i = $numOfVersions-2) break; // keep at least the last version $versions_fileview->unlink($all_versions[$i]['path'].'.v'.$all_versions[$i]['version']); @@ -421,10 +452,10 @@ class Storage { $availableSpace += $all_versions[$i]['size']; $i++; } - + return $versionsSize; // finally return the new size of the version history } - + return false; } } diff --git a/apps/files_versions/settings.php b/apps/files_versions/settings.php deleted file mode 100644 index f2873b8f7c2..00000000000 --- a/apps/files_versions/settings.php +++ /dev/null @@ -1,9 +0,0 @@ -<?php - -OCP\User::checkAdminUser(); - -OCP\Util::addscript( 'files_versions', 'versions' ); - -$tmpl = new OCP\Template( 'files_versions', 'settings'); - -return $tmpl->fetchPage(); diff --git a/apps/files_versions/templates/history.php b/apps/files_versions/templates/history.php index 850ece89c98..c450af66ad5 100644 --- a/apps/files_versions/templates/history.php +++ b/apps/files_versions/templates/history.php @@ -22,7 +22,8 @@ if( isset( $_['message'] ) ) { foreach ( $_['versions'] as $v ) { echo ' '; echo OCP\Util::formatDate( doubleval($v['version']) ); - echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php', array('path' => $_['path'], 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />'; + echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php', + array('path' => $_['path'], 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />'; if ( $v['cur'] ) { echo ' (<b>Current</b>)'; } diff --git a/apps/files_versions/templates/settings.php b/apps/files_versions/templates/settings.php deleted file mode 100644 index bfca8366f5d..00000000000 --- a/apps/files_versions/templates/settings.php +++ /dev/null @@ -1,6 +0,0 @@ -<form id="versionssettings"> - <fieldset class="personalblock"> - <legend><strong><?php echo $l->t('Files Versioning');?></strong></legend> - <input type="checkbox" name="versions" id="versions" value="1" <?php if (OCP\Config::getSystemValue('versions', 'true')=='true') echo ' checked="checked"'; ?> /> <label for="versions"><?php echo $l->t('Enable'); ?></label> <br/> - </fieldset> -</form> diff --git a/apps/user_ldap/appinfo/info.xml b/apps/user_ldap/appinfo/info.xml index 53269edfb34..03a4fa52332 100644 --- a/apps/user_ldap/appinfo/info.xml +++ b/apps/user_ldap/appinfo/info.xml @@ -7,7 +7,7 @@ This app is not compatible to the WebDAV user backend.</description> <licence>AGPL</licence> <author>Dominik Schmidt and Arthur Schiwon</author> - <require>4.91</require> + <require>4.93</require> <shipped>true</shipped> <types> <authentication/> diff --git a/apps/user_ldap/l10n/de.php b/apps/user_ldap/l10n/de.php index 182025e8fb9..6217a6d4821 100644 --- a/apps/user_ldap/l10n/de.php +++ b/apps/user_ldap/l10n/de.php @@ -12,7 +12,7 @@ "Do you really want to delete the current Server Configuration?" => "Wollen Sie die aktuelle Serverkonfiguration wirklich löschen?", "Confirm Deletion" => "Löschung bestätigen", "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour. Please ask your system administrator to disable one of them." => "<b>Warnung:</b> Die Anwendungen user_ldap und user_webdavauth sind inkompatibel. Es kann demzufolge zu unerwarteten Verhalten kommen. Bitte Deinen Systemadministator eine der beiden Anwendungen zu deaktivieren.", -"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Warnung:</b> Da das PHP-Modul für LDAP nicht installiert ist, wird das Backend nicht funktionieren. Bitte deinen Systemadministrator das Modul zu installieren.", +"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Warnung:</b> Da das PHP-Modul für LDAP nicht installiert ist, wird das Backend nicht funktionieren. Bitte Deinen Systemadministrator das Modul zu installieren.", "Server configuration" => "Serverkonfiguration", "Add Server Configuration" => "Serverkonfiguration hinzufügen", "Host" => "Host", @@ -38,12 +38,12 @@ "When unchecked, this configuration will be skipped." => "Konfiguration wird übersprungen wenn deaktiviert", "Port" => "Port", "Backup (Replica) Host" => "Backup Host (Kopie)", -"Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Gib einen optionalen Backup Host an. Es muss sich um eine kopie des Haupt LDAP/AD Servers handeln.", +"Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Gib einen optionalen Backup Host an. Es muss sich um eine Kopie des Haupt LDAP/AD Servers handeln.", "Backup (Replica) Port" => "Backup Port", "Disable Main Server" => "Hauptserver deaktivieren", -"When switched on, ownCloud will only connect to the replica server." => "Wenn aktiviert wird ownCloud ausschließlich den Backupserver verwenden", +"When switched on, ownCloud will only connect to the replica server." => "Wenn aktiviert, wird ownCloud ausschließlich den Backupserver verwenden.", "Use TLS" => "Nutze TLS", -"Do not use it additionally for LDAPS connections, it will fail." => "Benutze es nicht zusätzlich für LDAPS Verbindungen, es wird scheitern.", +"Do not use it additionally for LDAPS connections, it will fail." => "Benutze es nicht zusammen mit LDAPS Verbindungen, es wird fehlschlagen.", "Case insensitve LDAP server (Windows)" => "LDAP-Server (Windows: Groß- und Kleinschreibung bleibt unbeachtet)", "Turn off SSL certificate validation." => "Schalte die SSL-Zertifikatsprüfung aus.", "If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Falls die Verbindung es erfordert, muss das SSL-Zertifikat des LDAP-Server importiert werden.", @@ -55,7 +55,7 @@ "Base User Tree" => "Basis-Benutzerbaum", "One User Base DN per line" => "Ein Benutzer Base DN pro Zeile", "User Search Attributes" => "Benutzersucheigenschaften", -"Optional; one attribute per line" => "Optional, eine Eigenschaft pro Zeile", +"Optional; one attribute per line" => "Optional; eine Eigenschaft pro Zeile", "Group Display Name Field" => "Feld für den Anzeigenamen der Gruppe", "The LDAP attribute to use to generate the groups`s ownCloud name." => "Das LDAP-Attribut für die Generierung des Gruppennamens in ownCloud. ", "Base Group Tree" => "Basis-Gruppenbaum", diff --git a/apps/user_ldap/l10n/de_DE.php b/apps/user_ldap/l10n/de_DE.php index 9bee0a219ae..c88ed22b4fa 100644 --- a/apps/user_ldap/l10n/de_DE.php +++ b/apps/user_ldap/l10n/de_DE.php @@ -43,7 +43,7 @@ "Disable Main Server" => "Hauptserver deaktivieren", "When switched on, ownCloud will only connect to the replica server." => "Wenn eingeschaltet wird sich die ownCloud nur mit dem Replikat-Server verbinden.", "Use TLS" => "Nutze TLS", -"Do not use it additionally for LDAPS connections, it will fail." => "Benutzen Sie es nicht zusätzlich für LDAPS Verbindungen, es wird fehlschlagen.", +"Do not use it additionally for LDAPS connections, it will fail." => "Benutzen Sie es nicht in Verbindung mit LDAPS Verbindungen, es wird fehlschlagen.", "Case insensitve LDAP server (Windows)" => "LDAP-Server (Windows: Groß- und Kleinschreibung bleibt unbeachtet)", "Turn off SSL certificate validation." => "Schalten Sie die SSL-Zertifikatsprüfung aus.", "If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Falls die Verbindung es erfordert, muss das SSL-Zertifikat des LDAP-Server importiert werden.", @@ -55,7 +55,7 @@ "Base User Tree" => "Basis-Benutzerbaum", "One User Base DN per line" => "Ein Benutzer Base DN pro Zeile", "User Search Attributes" => "Benutzer-Suche Eigenschaften", -"Optional; one attribute per line" => "Optional; Ein Attribut pro Zeile", +"Optional; one attribute per line" => "Optional; ein Attribut pro Zeile", "Group Display Name Field" => "Feld für den Anzeigenamen der Gruppe", "The LDAP attribute to use to generate the groups`s ownCloud name." => "Das LDAP-Attribut für die Generierung des Gruppennamens in ownCloud. ", "Base Group Tree" => "Basis-Gruppenbaum", diff --git a/apps/user_ldap/l10n/he.php b/apps/user_ldap/l10n/he.php index 5c563b7b6f3..c9b0e282f1d 100644 --- a/apps/user_ldap/l10n/he.php +++ b/apps/user_ldap/l10n/he.php @@ -7,6 +7,7 @@ "User Login Filter" => "סנן כניסת משתמש", "User List Filter" => "סנן רשימת משתמשים", "Group Filter" => "סנן קבוצה", +"Port" => "פורט", "in seconds. A change empties the cache." => "בשניות. שינוי מרוקן את המטמון.", "in bytes" => "בבתים", "Help" => "עזרה" diff --git a/apps/user_ldap/l10n/id.php b/apps/user_ldap/l10n/id.php index c07892386d6..5912789c856 100644 --- a/apps/user_ldap/l10n/id.php +++ b/apps/user_ldap/l10n/id.php @@ -1,14 +1,69 @@ <?php $TRANSLATIONS = array( +"Failed to delete the server configuration" => "Gagal menghapus konfigurasi server", +"The configuration is valid and the connection could be established!" => "Konfigurasi valid dan koneksi dapat dilakukan!", +"The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "Konfigurasi valid, tetapi Bind gagal. Silakan cek pengaturan server dan keamanan.", +"The configuration is invalid. Please look in the ownCloud log for further details." => "Konfigurasi salah. Silakan lihat log ownCloud untuk lengkapnya.", "Deletion failed" => "penghapusan gagal", +"Take over settings from recent server configuration?" => "Ambil alih pengaturan dari konfigurasi server saat ini?", +"Keep settings?" => "Biarkan pengaturan?", +"Cannot add server configuration" => "Gagal menambah konfigurasi server", +"Connection test succeeded" => "Tes koneksi sukses", +"Connection test failed" => "Tes koneksi gagal", +"Do you really want to delete the current Server Configuration?" => "Anda ingin menghapus Konfigurasi Server saat ini?", +"Confirm Deletion" => "Konfirmasi Penghapusan", +"<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour. Please ask your system administrator to disable one of them." => "<b>Peringatan:/b> Aplikasi user_ldap dan user_webdavauth tidak kompatibel. Anda mungkin akan mengalami kejadian yang tidak diharapkan. Silakan minta administrator sistem untuk menonaktifkan salah satunya.", +"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Peringatan:</b> Modul LDAP PHP tidak terpasang, perangkat tidak akan bekerja. Silakan minta administrator sistem untuk memasangnya.", +"Server configuration" => "Konfigurasi server", +"Add Server Configuration" => "Tambah Konfigurasi Server", "Host" => "host", +"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Protokol dapat tidak ditulis, kecuali anda menggunakan SSL. Lalu jalankan dengan ldaps://", +"Base DN" => "Base DN", +"One Base DN per line" => "Satu Base DN per baris", +"You can specify Base DN for users and groups in the Advanced tab" => "Anda dapat menetapkan Base DN untuk pengguna dan grup dalam tab Lanjutan", +"User DN" => "User DN", +"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "DN dari klien pengguna yang dengannya tautan akan diterapkan, mis. uid=agen,dc=contoh,dc=com. Untuk akses anonim, biarkan DN dan kata sandi kosong.", "Password" => "kata kunci", +"For anonymous access, leave DN and Password empty." => "Untuk akses anonim, biarkan DN dan Kata sandi kosong.", "User Login Filter" => "gunakan saringan login", +"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action." => "Definisikan filter untuk diterapkan, saat login dilakukan. %%uid menggantikan username saat login.", +"use %%uid placeholder, e.g. \"uid=%%uid\"" => "gunakan pengganti %%uid, mis. \"uid=%%uid\"", +"User List Filter" => "Daftar Filter Pengguna", +"Defines the filter to apply, when retrieving users." => "Definisikan filter untuk diterapkan saat menerima pengguna.", +"without any placeholder, e.g. \"objectClass=person\"." => "tanpa pengganti apapun, mis. \"objectClass=seseorang\".", "Group Filter" => "saringan grup", +"Defines the filter to apply, when retrieving groups." => "Definisikan filter untuk diterapkan saat menerima grup.", +"without any placeholder, e.g. \"objectClass=posixGroup\"." => "tanpa pengganti apapaun, mis. \"objectClass=posixGroup\".", +"Connection Settings" => "Pengaturan Koneksi", +"Configuration Active" => "Konfigurasi Aktif", +"When unchecked, this configuration will be skipped." => "Jika tidak dicentang, konfigurasi ini dilewati.", "Port" => "port", +"Backup (Replica) Host" => "Host Cadangan (Replika)", +"Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Berikan pilihan host cadangan. Harus merupakan replika dari server LDAP/AD utama.", +"Backup (Replica) Port" => "Port Cadangan (Replika)", +"Disable Main Server" => "Nonaktifkan Server Utama", +"When switched on, ownCloud will only connect to the replica server." => "Saat diaktifkan, ownCloud hanya akan terhubung ke server replika.", "Use TLS" => "gunakan TLS", +"Do not use it additionally for LDAPS connections, it will fail." => "Jangan gunakan utamanya untuk koneksi LDAPS, koneksi akan gagal.", +"Case insensitve LDAP server (Windows)" => "Server LDAP dengan kapitalisasi tidak sensitif (Windows)", "Turn off SSL certificate validation." => "matikan validasi sertivikat SSL", +"If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Jika koneksi hanya bekerja dengan opsi ini, impor sertifikat SSL server LDAP dari server ownCloud anda.", "Not recommended, use for testing only." => "tidak disarankan, gunakan hanya untuk pengujian.", "in seconds. A change empties the cache." => "dalam detik. perubahan mengosongkan cache", +"Directory Settings" => "Pengaturan Direktori", +"User Display Name Field" => "Bidang Tampilan Nama Pengguna", +"The LDAP attribute to use to generate the user`s ownCloud name." => "Atribut LDAP yang digunakan untuk menghasilkan nama pengguna ownCloud.", +"Base User Tree" => "Pohon Pengguna Dasar", +"One User Base DN per line" => "Satu Pengguna Base DN per baris", +"User Search Attributes" => "Atribut Pencarian Pengguna", +"Optional; one attribute per line" => "Pilihan; satu atribut per baris", +"Group Display Name Field" => "Bidang Tampilan Nama Grup", +"The LDAP attribute to use to generate the groups`s ownCloud name." => "Atribut LDAP yang digunakan untuk menghasilkan nama grup ownCloud.", +"Base Group Tree" => "Pohon Grup Dasar", +"One Group Base DN per line" => "Satu Grup Base DN per baris", +"Group Search Attributes" => "Atribut Pencarian Grup", +"Group-Member association" => "asosiasi Anggota-Grup", +"Special Attributes" => "Atribut Khusus", "in bytes" => "dalam bytes", +"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Biarkan nama pengguna kosong (default). Atau tetapkan atribut LDAP/AD.", "Help" => "bantuan" ); diff --git a/apps/user_ldap/l10n/ka.php b/apps/user_ldap/l10n/ka.php new file mode 100644 index 00000000000..169926283e9 --- /dev/null +++ b/apps/user_ldap/l10n/ka.php @@ -0,0 +1,4 @@ +<?php $TRANSLATIONS = array( +"Password" => "პაროლი", +"Help" => "შველა" +); diff --git a/apps/user_ldap/l10n/my_MM.php b/apps/user_ldap/l10n/my_MM.php new file mode 100644 index 00000000000..ee8d3dd26fa --- /dev/null +++ b/apps/user_ldap/l10n/my_MM.php @@ -0,0 +1,4 @@ +<?php $TRANSLATIONS = array( +"Password" => "စကားဝှက်", +"Help" => "အကူအညီ" +); diff --git a/apps/user_ldap/l10n/pl.php b/apps/user_ldap/l10n/pl.php index ef3f9140ef7..7b532e253df 100644 --- a/apps/user_ldap/l10n/pl.php +++ b/apps/user_ldap/l10n/pl.php @@ -1,9 +1,24 @@ <?php $TRANSLATIONS = array( +"Failed to delete the server configuration" => "Nie można usunąć konfiguracji serwera", +"The configuration is valid and the connection could be established!" => "Konfiguracja jest prawidłowa i można ustanowić połączenie!", +"The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "Konfiguracja jest prawidłowa, ale Bind nie. Sprawdź ustawienia serwera i poświadczenia.", +"The configuration is invalid. Please look in the ownCloud log for further details." => "Konfiguracja jest nieprawidłowa. Proszę przejrzeć logi dziennika ownCloud ", "Deletion failed" => "Skasowanie nie powiodło się", +"Take over settings from recent server configuration?" => "Przejmij ustawienia z ostatnich konfiguracji serwera?", +"Keep settings?" => "Zachować ustawienia?", +"Cannot add server configuration" => "Nie można dodać konfiguracji serwera", +"Connection test succeeded" => "Test połączenia udany", +"Connection test failed" => "Test połączenia nie udany", +"Do you really want to delete the current Server Configuration?" => "Czy chcesz usunąć bieżącą konfigurację serwera?", +"Confirm Deletion" => "Potwierdź usunięcie", "<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour. Please ask your system administrator to disable one of them." => "<b>Ostrzeżenie:</b> Aplikacje user_ldap i user_webdavauth nie są kompatybilne. Mogą powodować nieoczekiwane zachowanie. Poproś administratora o wyłączenie jednej z nich.", +"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Ostrzeżenie:</b> Moduł PHP LDAP nie jest zainstalowany i nie będzie działał. Poproś administratora o włączenie go.", +"Server configuration" => "Konfiguracja servera", +"Add Server Configuration" => "Dodaj konfigurację servera", "Host" => "Host", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "Można pominąć protokół, z wyjątkiem wymaganego protokołu SSL. Następnie uruchom z ldaps://", "Base DN" => "Baza DN", +"One Base DN per line" => "Jedna baza DN na linię", "You can specify Base DN for users and groups in the Advanced tab" => "Bazę DN można określić dla użytkowników i grup w karcie Zaawansowane", "User DN" => "Użytkownik DN", "The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "DN użytkownika klienta, z którym powiązanie wykonuje się, np. uid=agent,dc=example,dc=com. Dla dostępu anonimowego pozostawić DN i hasło puste", @@ -18,20 +33,36 @@ "Group Filter" => "Grupa filtrów", "Defines the filter to apply, when retrieving groups." => "Definiuje filtry do zastosowania, podczas pobierania grup.", "without any placeholder, e.g. \"objectClass=posixGroup\"." => "bez żadnych symboli zastępczych np. \"objectClass=posixGroup\".", +"Connection Settings" => "Konfiguracja połączeń", +"Configuration Active" => "Konfiguracja archiwum", +"When unchecked, this configuration will be skipped." => "Gdy niezaznaczone, ta konfiguracja zostanie pominięta.", "Port" => "Port", +"Backup (Replica) Host" => "Kopia zapasowa (repliki) host", +"Give an optional backup host. It must be a replica of the main LDAP/AD server." => "Dać opcjonalnie hosta kopii zapasowej . To musi być repliką głównego serwera LDAP/AD.", +"Backup (Replica) Port" => "Kopia zapasowa (repliki) Port", +"Disable Main Server" => "Wyłącz serwer główny", +"When switched on, ownCloud will only connect to the replica server." => "Po włączeniu, ownCloud tylko połączy się z serwerem repliki.", "Use TLS" => "Użyj TLS", +"Do not use it additionally for LDAPS connections, it will fail." => "Nie używaj go dodatkowo dla połączeń protokołu LDAPS, zakończy się niepowodzeniem.", "Case insensitve LDAP server (Windows)" => "Wielkość liter serwera LDAP (Windows)", "Turn off SSL certificate validation." => "Wyłączyć sprawdzanie poprawności certyfikatu SSL.", "If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Jeśli połączenie działa tylko z tą opcją, zaimportuj certyfikat SSL serwera LDAP w serwerze ownCloud.", "Not recommended, use for testing only." => "Niezalecane, użyj tylko testowo.", "in seconds. A change empties the cache." => "w sekundach. Zmiana opróżnia pamięć podręczną.", +"Directory Settings" => "Ustawienia katalogów", "User Display Name Field" => "Pole wyświetlanej nazwy użytkownika", "The LDAP attribute to use to generate the user`s ownCloud name." => "Atrybut LDAP służy do generowania nazwy użytkownika ownCloud.", "Base User Tree" => "Drzewo bazy użytkowników", +"One User Base DN per line" => "Jeden użytkownik Bazy DN na linię", +"User Search Attributes" => "Szukaj atrybutów", +"Optional; one attribute per line" => "Opcjonalnie; jeden atrybut w wierszu", "Group Display Name Field" => "Pole wyświetlanej nazwy grupy", "The LDAP attribute to use to generate the groups`s ownCloud name." => "Atrybut LDAP służy do generowania nazwy grup ownCloud.", "Base Group Tree" => "Drzewo bazy grup", +"One Group Base DN per line" => "Jedna grupa bazy DN na linię", +"Group Search Attributes" => "Grupa atrybutów wyszukaj", "Group-Member association" => "Członek grupy stowarzyszenia", +"Special Attributes" => "Specjalne atrybuty", "in bytes" => "w bajtach", "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Pozostaw puste dla user name (domyślnie). W przeciwnym razie podaj atrybut LDAP/AD.", "Help" => "Pomoc" diff --git a/apps/user_ldap/l10n/pt_BR.php b/apps/user_ldap/l10n/pt_BR.php index c86263d52a8..e3d2da463cc 100644 --- a/apps/user_ldap/l10n/pt_BR.php +++ b/apps/user_ldap/l10n/pt_BR.php @@ -4,6 +4,7 @@ "The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "A configuração é válida, mas o Bind falhou. Confira as configurações do servidor e as credenciais.", "The configuration is invalid. Please look in the ownCloud log for further details." => "A configuração é inválida. Leia o \"log\" do ownCloud para mais detalhes.", "Deletion failed" => "Remoção falhou", +"Take over settings from recent server configuration?" => "Tomar parámetros de recente configuração de servidor?", "Keep settings?" => "Manter ajustes?", "Cannot add server configuration" => "Não foi possível adicionar a configuração do servidor", "Connection test succeeded" => "Teste de conexão bem sucedido", diff --git a/apps/user_ldap/l10n/ur_PK.php b/apps/user_ldap/l10n/ur_PK.php new file mode 100644 index 00000000000..4c606a13808 --- /dev/null +++ b/apps/user_ldap/l10n/ur_PK.php @@ -0,0 +1,4 @@ +<?php $TRANSLATIONS = array( +"Password" => "پاسورڈ", +"Help" => "مدد" +); diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 901299e7c21..05249b8f163 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -624,7 +624,8 @@ abstract class Access { * @brief executes an LDAP search * @param $filter the LDAP filter for the search * @param $base an array containing the LDAP subtree(s) that shall be searched - * @param $attr optional, when a certain attribute shall be filtered out + * @param $attr optional, array, one or more attributes that shall be + * retrieved. Results will according to the order in the array. * @returns array with the search result * * Executes an LDAP search @@ -656,6 +657,14 @@ abstract class Access { \OCP\Util::writeLog('user_ldap', 'Attempt for Paging? '.print_r($pagedSearchOK, true), \OCP\Util::ERROR); return array(); } + + // Do the server-side sorting + foreach(array_reverse($attr) as $sortAttr){ + foreach($sr as $searchResource) { + ldap_sort($link_resource, $searchResource, $sortAttr); + } + } + $findings = array(); foreach($sr as $key => $res) { $findings = array_merge($findings, ldap_get_entries($link_resource, $res )); diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index abbc133038c..6643428afe4 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -357,9 +357,6 @@ class Connection { case 'ldapAgentPassword': $value = base64_encode($value); break; - case 'homeFolderNamingRule': - $value = empty($value) ? 'opt:username' : $value; - break; case 'ldapBase': case 'ldapBaseUsers': case 'ldapBaseGroups': @@ -394,10 +391,10 @@ class Connection { $config = array(); foreach($trans as $dbKey => $classKey) { if($classKey == 'homeFolderNamingRule') { - if(strpos($this->config[$classKey], 'opt') === 0) { - $config[$dbKey] = ''; - } else { + if(strpos($this->config[$classKey], 'attr:') === 0) { $config[$dbKey] = substr($this->config[$classKey], 5); + } else { + $config[$dbKey] = ''; } continue; } else if((strpos($classKey, 'ldapBase') !== false) @@ -540,7 +537,7 @@ class Connection { 'ldap_cache_ttl' => 600, 'ldap_uuid_attribute' => 'auto', 'ldap_override_uuid_attribute' => 0, - 'home_folder_naming_rule' => 'opt:username', + 'home_folder_naming_rule' => '', 'ldap_turn_off_cert_check' => 0, 'ldap_configuration_active' => 1, 'ldap_attributes_for_user_search' => '', diff --git a/apps/user_ldap/lib/helper.php b/apps/user_ldap/lib/helper.php index 29ce998dae7..45c379445af 100644 --- a/apps/user_ldap/lib/helper.php +++ b/apps/user_ldap/lib/helper.php @@ -102,4 +102,3 @@ class Helper { return true; } } - diff --git a/apps/user_webdavauth/appinfo/info.xml b/apps/user_webdavauth/appinfo/info.xml index f62f03577e8..76b314e48aa 100755 --- a/apps/user_webdavauth/appinfo/info.xml +++ b/apps/user_webdavauth/appinfo/info.xml @@ -7,7 +7,7 @@ This app is not compatible to the LDAP user and group backend.</description> <licence>AGPL</licence> <author>Frank Karlitschek</author> - <require>4.91</require> + <require>4.93</require> <shipped>true</shipped> <types> <authentication/> diff --git a/apps/user_webdavauth/settings.php b/apps/user_webdavauth/settings.php index 7eabb0d48cc..ae9cb7e4c92 100755 --- a/apps/user_webdavauth/settings.php +++ b/apps/user_webdavauth/settings.php @@ -26,7 +26,7 @@ OC_Util::checkAdminUser(); if($_POST) { // CSRF check OCP\JSON::callCheck(); - + if(isset($_POST['webdav_url'])) { OC_CONFIG::setValue('user_webdavauth_url', strip_tags($_POST['webdav_url'])); } |