Merge branch 'master' into routing

Conflicts:
	apps/files/js/fileactions.js
	lib/base.php
	lib/helper.php
	lib/ocs.php
This commit is contained in:
Bart Visscher 2012-09-07 15:42:37 +02:00
commit 5eba579827
852 changed files with 19116 additions and 11617 deletions

2
.gitignore vendored
View File

@ -19,10 +19,12 @@ _darcs/*
CVS/* CVS/*
.svn/* .svn/*
RCS/* RCS/*
*.backup*
# kdevelop # kdevelop
.kdev .kdev
*.kdev4 *.kdev4
*.kate-swp
# Lokalize # Lokalize
*lokalize* *lokalize*

View File

@ -33,7 +33,7 @@ $upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize')
$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size')); $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = OCP\Util::humanFileSize(min($upload_max_filesize, $post_max_size)); $maxUploadFilesize = OCP\Util::humanFileSize(min($upload_max_filesize, $post_max_size));
if($_POST) { if($_POST) {
if(isset($_POST['maxUploadSize'])){ if(isset($_POST['maxUploadSize'])) {
if(($setMaxSize = OC_Files::setUploadLimit(OCP\Util::computerFileSize($_POST['maxUploadSize']))) !== false) { if(($setMaxSize = OC_Files::setUploadLimit(OCP\Util::computerFileSize($_POST['maxUploadSize']))) !== false) {
$maxUploadFilesize = OCP\Util::humanFileSize($setMaxSize); $maxUploadFilesize = OCP\Util::humanFileSize($setMaxSize);
} }

View File

@ -17,7 +17,7 @@ $data = array();
if($doBreadcrumb) { if($doBreadcrumb) {
$breadcrumb = array(); $breadcrumb = array();
$pathtohere = "/"; $pathtohere = "/";
foreach( explode( "/", $dir ) as $i ){ foreach( explode( "/", $dir ) as $i ) {
if( $i != "" ) { if( $i != "" ) {
$pathtohere .= "$i/"; $pathtohere .= "$i/";
$breadcrumb[] = array( "dir" => $pathtohere, "name" => $i ); $breadcrumb[] = array( "dir" => $pathtohere, "name" => $i );
@ -32,7 +32,7 @@ if($doBreadcrumb) {
// make filelist // make filelist
$files = array(); $files = array();
foreach( OC_Files::getdirectorycontent( $dir ) as $i ){ foreach( OC_Files::getdirectorycontent( $dir ) as $i ) {
$i["date"] = OCP\Util::formatDate($i["mtime"] ); $i["date"] = OCP\Util::formatDate($i["mtime"] );
$files[] = $i; $files[] = $i;
} }

View File

@ -35,7 +35,7 @@ $dir = $_POST['dir'];
$error=''; $error='';
$totalSize=0; $totalSize=0;
foreach($files['size'] as $size){ foreach($files['size'] as $size) {
$totalSize+=$size; $totalSize+=$size;
} }
if($totalSize>OC_Filesystem::free_space('/')) { if($totalSize>OC_Filesystem::free_space('/')) {
@ -46,7 +46,7 @@ if($totalSize>OC_Filesystem::free_space('/')) {
$result=array(); $result=array();
if(strpos($dir, '..') === false) { if(strpos($dir, '..') === false) {
$fileCount=count($files['name']); $fileCount=count($files['name']);
for($i=0;$i<$fileCount;$i++){ for($i=0;$i<$fileCount;$i++) {
$target = OCP\Files::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]); $target = OCP\Files::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) { if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) {
$meta=OC_FileCache_Cached::get($target); $meta=OC_FileCache_Cached::get($target);

View File

@ -23,14 +23,14 @@
// only need filesystem apps // only need filesystem apps
$RUNTIME_APPTYPES=array('filesystem','authentication'); $RUNTIME_APPTYPES=array('filesystem','authentication');
OC_App::loadApps($RUNTIME_APPTYPES); OC_App::loadApps($RUNTIME_APPTYPES);
if(!OC_User::isLoggedIn()){ if(!OC_User::isLoggedIn()) {
if(!isset($_SERVER['PHP_AUTH_USER'])){ if(!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="ownCloud Server"'); header('WWW-Authenticate: Basic realm="ownCloud Server"');
header('HTTP/1.0 401 Unauthorized'); header('HTTP/1.0 401 Unauthorized');
echo 'Valid credentials must be supplied'; echo 'Valid credentials must be supplied';
exit(); exit();
} else { } else {
if(!OC_User::login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])){ if(!OC_User::login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])) {
exit(); exit();
} }
} }

View File

@ -5,7 +5,7 @@ $installedVersion=OCP\Config::getAppValue('files', 'installed_version');
if (version_compare($installedVersion, '1.1.4', '<')) { if (version_compare($installedVersion, '1.1.4', '<')) {
$query = OC_DB::prepare( "SELECT `propertyname`, `propertypath`, `userid` FROM `*PREFIX*properties`" ); $query = OC_DB::prepare( "SELECT `propertyname`, `propertypath`, `userid` FROM `*PREFIX*properties`" );
$result = $query->execute(); $result = $query->execute();
while( $row = $result->fetchRow()){ while( $row = $result->fetchRow()) {
$query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?' ); $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?' );
$query->execute( array( preg_replace("/^{.*}/", "", $row["propertyname"]),$row["userid"], $row["propertypath"] )); $query->execute( array( preg_replace("/^{.*}/", "", $row["propertyname"]),$row["userid"], $row["propertypath"] ));
} }

View File

@ -29,7 +29,7 @@ OCP\User::checkLoggedIn();
$filename = $_GET["file"]; $filename = $_GET["file"];
if(!OC_Filesystem::file_exists($filename)){ if(!OC_Filesystem::file_exists($filename)) {
header("HTTP/1.0 404 Not Found"); header("HTTP/1.0 404 Not Found");
$tmpl = new OCP\Template( '', '404', 'guest' ); $tmpl = new OCP\Template( '', '404', 'guest' );
$tmpl->assign('file',$filename); $tmpl->assign('file',$filename);

View File

@ -31,7 +31,7 @@ OCP\Util::addscript( 'files', 'jquery.fileupload' );
OCP\Util::addscript( 'files', 'files' ); OCP\Util::addscript( 'files', 'files' );
OCP\Util::addscript( 'files', 'filelist' ); OCP\Util::addscript( 'files', 'filelist' );
OCP\Util::addscript( 'files', 'fileactions' ); OCP\Util::addscript( 'files', 'fileactions' );
if(!isset($_SESSION['timezone'])){ if(!isset($_SESSION['timezone'])) {
OCP\Util::addscript( 'files', 'timezone' ); OCP\Util::addscript( 'files', 'timezone' );
} }
OCP\App::setActiveNavigationEntry( 'files_index' ); OCP\App::setActiveNavigationEntry( 'files_index' );
@ -44,9 +44,9 @@ if(!OC_Filesystem::is_dir($dir.'/')) {
} }
$files = array(); $files = array();
foreach( OC_Files::getdirectorycontent( $dir ) as $i ){ foreach( OC_Files::getdirectorycontent( $dir ) as $i ) {
$i['date'] = OCP\Util::formatDate($i['mtime'] ); $i['date'] = OCP\Util::formatDate($i['mtime'] );
if($i['type']=='file'){ if($i['type']=='file') {
$fileinfo=pathinfo($i['name']); $fileinfo=pathinfo($i['name']);
$i['basename']=$fileinfo['filename']; $i['basename']=$fileinfo['filename'];
if (!empty($fileinfo['extension'])) { if (!empty($fileinfo['extension'])) {
@ -56,7 +56,7 @@ foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
$i['extension']=''; $i['extension']='';
} }
} }
if($i['directory']=='/'){ if($i['directory']=='/') {
$i['directory']=''; $i['directory']='';
} }
$files[] = $i; $files[] = $i;
@ -65,8 +65,8 @@ foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
// Make breadcrumb // Make breadcrumb
$breadcrumb = array(); $breadcrumb = array();
$pathtohere = ''; $pathtohere = '';
foreach( explode( '/', $dir ) as $i ){ foreach( explode( '/', $dir ) as $i ) {
if( $i != '' ){ if( $i != '' ) {
$pathtohere .= '/'.str_replace('+','%20', urlencode($i)); $pathtohere .= '/'.str_replace('+','%20', urlencode($i));
$breadcrumb[] = array( 'dir' => $pathtohere, 'name' => $i ); $breadcrumb[] = array( 'dir' => $pathtohere, 'name' => $i );
} }
@ -89,11 +89,23 @@ $freeSpace=OC_Filesystem::free_space('/');
$freeSpace=max($freeSpace,0); $freeSpace=max($freeSpace,0);
$maxUploadFilesize = min($maxUploadFilesize ,$freeSpace); $maxUploadFilesize = min($maxUploadFilesize ,$freeSpace);
$permissions = OCP\Share::PERMISSION_READ;
if (OC_Filesystem::isUpdatable($dir.'/')) {
$permissions |= OCP\Share::PERMISSION_UPDATE;
}
if (OC_Filesystem::isDeletable($dir.'/')) {
$permissions |= OCP\Share::PERMISSION_DELETE;
}
if (OC_Filesystem::isSharable($dir.'/')) {
$permissions |= OCP\Share::PERMISSION_SHARE;
}
$tmpl = new OCP\Template( 'files', 'index', 'user' ); $tmpl = new OCP\Template( 'files', 'index', 'user' );
$tmpl->assign( 'fileList', $list->fetchPage(), false ); $tmpl->assign( 'fileList', $list->fetchPage(), false );
$tmpl->assign( 'breadcrumb', $breadcrumbNav->fetchPage(), false ); $tmpl->assign( 'breadcrumb', $breadcrumbNav->fetchPage(), false );
$tmpl->assign( 'dir', OC_Filesystem::normalizePath($dir)); $tmpl->assign( 'dir', OC_Filesystem::normalizePath($dir));
$tmpl->assign( 'isCreatable', OC_Filesystem::isCreatable($dir.'/')); $tmpl->assign( 'isCreatable', OC_Filesystem::isCreatable($dir.'/'));
$tmpl->assign('permissions', $permissions);
$tmpl->assign( 'files', $files ); $tmpl->assign( 'files', $files );
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize); $tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign( 'uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize)); $tmpl->assign( 'uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));

View File

@ -1,9 +1,4 @@
FileActions={ var FileActions={
PERMISSION_CREATE:4,
PERMISSION_READ:1,
PERMISSION_UPDATE:2,
PERMISSION_DELETE:8,
PERMISSION_SHARE:16,
actions:{}, actions:{},
defaults:{}, defaults:{},
icons:{}, icons:{},
@ -25,20 +20,20 @@ FileActions={
get:function(mime,type,permissions){ get:function(mime,type,permissions){
var actions={}; var actions={};
if(FileActions.actions.all){ if(FileActions.actions.all){
actions=$.extend( actions, FileActions.actions.all ) actions=$.extend( actions, FileActions.actions.all );
} }
if(mime){ if(mime){
if(FileActions.actions[mime]){ if(FileActions.actions[mime]){
actions=$.extend( actions, FileActions.actions[mime] ) actions=$.extend( actions, FileActions.actions[mime] );
} }
var mimePart=mime.substr(0,mime.indexOf('/')); var mimePart=mime.substr(0,mime.indexOf('/'));
if(FileActions.actions[mimePart]){ if(FileActions.actions[mimePart]){
actions=$.extend( actions, FileActions.actions[mimePart] ) actions=$.extend( actions, FileActions.actions[mimePart] );
} }
} }
if(type){//type is 'dir' or 'file' if(type){//type is 'dir' or 'file'
if(FileActions.actions[type]){ if(FileActions.actions[type]){
actions=$.extend( actions, FileActions.actions[type] ) actions=$.extend( actions, FileActions.actions[type] );
} }
} }
var filteredActions = {}; var filteredActions = {};
@ -108,7 +103,12 @@ FileActions={
if(img.call){ if(img.call){
img=img(file); img=img(file);
} }
var html='<a href="#" original-title="' + t('files', 'Delete') + '" class="action delete" style="display:none" />'; // NOTE: Temporary fix to allow unsharing of files in root of Shared folder
if ($('#dir').val() == '/Shared') {
var html = '<a href="#" original-title="' + t('files', 'Unshare') + '" class="action delete" style="display:none" />';
} else {
var html='<a href="#" original-title="' + t('files', 'Delete') + '" class="action delete" style="display:none" />';
}
var element=$(html); var element=$(html);
if(img){ if(img){
element.append($('<img src="'+img+'"/>')); element.append($('<img src="'+img+'"/>'));
@ -148,7 +148,7 @@ FileActions={
getCurrentPermissions:function() { getCurrentPermissions:function() {
return FileActions.currentFile.parent().data('permissions'); return FileActions.currentFile.parent().data('permissions');
} }
} };
$(document).ready(function(){ $(document).ready(function(){
if($('#allowZipDownload').val() == 1){ if($('#allowZipDownload').val() == 1){
@ -156,12 +156,12 @@ $(document).ready(function(){
} else { } else {
var downloadScope = 'file'; var downloadScope = 'file';
} }
FileActions.register(downloadScope,'Download', FileActions.PERMISSION_READ, function(){return OC.imagePath('core','actions/download')},function(filename){ FileActions.register(downloadScope,'Download', OC.PERMISSION_READ, function(){return OC.imagePath('core','actions/download');},function(filename){
window.location=OC.filePath('files', 'ajax', 'download.php') + encodeURIComponent('?files='+encodeURIComponent(filename)+'&dir='+encodeURIComponent($('#dir').val())); window.location=OC.filePath('files', 'ajax', 'download.php') + encodeURIComponent('?files='+encodeURIComponent(filename)+'&dir='+encodeURIComponent($('#dir').val()));
}); });
}); });
FileActions.register('all','Delete', FileActions.PERMISSION_DELETE, function(){return OC.imagePath('core','actions/delete')},function(filename){ FileActions.register('all','Delete', OC.PERMISSION_DELETE, function(){return OC.imagePath('core','actions/delete');},function(filename){
if(Files.cancelUpload(filename)) { if(Files.cancelUpload(filename)) {
if(filename.substr){ if(filename.substr){
filename=[filename]; filename=[filename];
@ -179,11 +179,11 @@ FileActions.register('all','Delete', FileActions.PERMISSION_DELETE, function(){r
$('.tipsy').remove(); $('.tipsy').remove();
}); });
FileActions.register('all','Rename', FileActions.PERMISSION_UPDATE, function(){return OC.imagePath('core','actions/rename')},function(filename){ FileActions.register('all','Rename', OC.PERMISSION_UPDATE, function(){return OC.imagePath('core','actions/rename');},function(filename){
FileList.rename(filename); FileList.rename(filename);
}); });
FileActions.register('dir','Open', FileActions.PERMISSION_READ, '', function(filename){ FileActions.register('dir','Open', OC.PERMISSION_READ, '', function(filename){
window.location=OC.linkTo('files', 'index.php') + '?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename); window.location=OC.linkTo('files', 'index.php') + '?dir='+encodeURIComponent($('#dir').val()).replace(/%2F/g, '/')+'/'+encodeURIComponent(filename);
}); });

View File

@ -1,11 +1,11 @@
FileList={ var FileList={
useUndo:true, useUndo:true,
update:function(fileListHtml) { update:function(fileListHtml) {
$('#fileList').empty().html(fileListHtml); $('#fileList').empty().html(fileListHtml);
}, },
addFile:function(name,size,lastModified,loading){ addFile:function(name,size,lastModified,loading,hidden){
var img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file.png'); var img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file.png');
var html='<tr data-type="file" data-size="'+size+'">'; var html='<tr data-type="file" data-size="'+size+'" data-permissions="'+$('#permissions').val()+'">';
if(name.indexOf('.')!=-1){ if(name.indexOf('.')!=-1){
var basename=name.substr(0,name.lastIndexOf('.')); var basename=name.substr(0,name.lastIndexOf('.'));
var extension=name.substr(name.lastIndexOf('.')); var extension=name.substr(name.lastIndexOf('.'));
@ -14,7 +14,7 @@ FileList={
var extension=false; var extension=false;
} }
html+='<td class="filename" style="background-image:url('+img+')"><input type="checkbox" />'; html+='<td class="filename" style="background-image:url('+img+')"><input type="checkbox" />';
html+='<a class="name" href="download.php?file='+$('#dir').val().replace(/</, '&lt;').replace(/>/, '&gt;')+'/'+name+'"><span class="nametext">'+basename html+='<a class="name" href="download.php?file='+$('#dir').val().replace(/</, '&lt;').replace(/>/, '&gt;')+'/'+name+'"><span class="nametext">'+basename;
if(extension){ if(extension){
html+='<span class="extension">'+extension+'</span>'; html+='<span class="extension">'+extension+'</span>';
} }
@ -36,9 +36,12 @@ FileList={
}else{ }else{
$('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions); $('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions);
} }
if (hidden) {
$('tr').filterAttr('data-file', name).hide();
}
}, },
addDir:function(name,size,lastModified){ addDir:function(name,size,lastModified,hidden){
html = $('<tr></tr>').attr({ "data-type": "dir", "data-size": size, "data-file": name}); html = $('<tr></tr>').attr({ "data-type": "dir", "data-size": size, "data-file": name, "data-permissions": $('#permissions').val()});
td = $('<td></td>').attr({"class": "filename", "style": 'background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')' }); td = $('<td></td>').attr({"class": "filename", "style": 'background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')' });
td.append('<input type="checkbox" />'); td.append('<input type="checkbox" />');
var link_elem = $('<a></a>').attr({ "class": "name", "href": OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/') }); var link_elem = $('<a></a>').attr({ "class": "name", "href": OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/') });
@ -63,6 +66,9 @@ FileList={
FileList.insertElement(name,'dir',html); FileList.insertElement(name,'dir',html);
$('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions); $('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions);
$('tr').filterAttr('data-file',name).find('td.filename').droppable(folderDropOptions); $('tr').filterAttr('data-file',name).find('td.filename').droppable(folderDropOptions);
if (hidden) {
$('tr').filterAttr('data-file', name).hide();
}
}, },
refresh:function(data) { refresh:function(data) {
result = jQuery.parseJSON(data.responseText); result = jQuery.parseJSON(data.responseText);
@ -82,7 +88,7 @@ FileList={
}, },
insertElement:function(name,type,element){ insertElement:function(name,type,element){
//find the correct spot to insert the file or folder //find the correct spot to insert the file or folder
var fileElements=$('tr[data-file][data-type="'+type+'"]'); var fileElements=$('tr[data-file][data-type="'+type+'"]:visible');
var pos; var pos;
if(name.localeCompare($(fileElements[0]).attr('data-file'))<0){ if(name.localeCompare($(fileElements[0]).attr('data-file'))<0){
pos=-1; pos=-1;
@ -137,11 +143,7 @@ FileList={
event.preventDefault(); event.preventDefault();
var newname=input.val(); var newname=input.val();
if (newname != name) { if (newname != name) {
if ($('tr').filterAttr('data-file', newname).length > 0) { if (FileList.checkName(name, newname, false)) {
$('#notification').html(newname+' '+t('files', 'already exists')+'<span class="replace">'+t('files', 'replace')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
$('#notification').data('oldName', name);
$('#notification').data('newName', newname);
$('#notification').fadeIn();
newname = name; newname = name;
} else { } else {
$.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(result) { $.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(result) {
@ -151,7 +153,6 @@ FileList={
} }
}); });
} }
} }
tr.attr('data-file', newname); tr.attr('data-file', newname);
var path = td.children('a.name').attr('href'); var path = td.children('a.name').attr('href');
@ -179,58 +180,77 @@ FileList={
form.trigger('submit'); form.trigger('submit');
}); });
}, },
replace:function(oldName, newName) { checkName:function(oldName, newName, isNewFile) {
if (isNewFile || $('tr').filterAttr('data-file', newName).length > 0) {
if (isNewFile) {
$('#notification').html(newName+' '+t('files', 'already exists')+'<span class="replace">'+t('files', 'replace')+'</span><span class="suggest">'+t('files', 'suggest name')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
} else {
$('#notification').html(newName+' '+t('files', 'already exists')+'<span class="replace">'+t('files', 'replace')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
}
$('#notification').data('oldName', oldName);
$('#notification').data('newName', newName);
$('#notification').data('isNewFile', isNewFile);
$('#notification').fadeIn();
return true;
} else {
return false;
}
},
replace:function(oldName, newName, isNewFile) {
// Finish any existing actions // Finish any existing actions
if (FileList.lastAction || !FileList.useUndo) { if (FileList.lastAction || !FileList.useUndo) {
FileList.lastAction(); FileList.lastAction();
} }
var tr = $('tr').filterAttr('data-file', oldName); $('tr').filterAttr('data-file', oldName).hide();
tr.hide(); $('tr').filterAttr('data-file', newName).hide();
var tr = $('tr').filterAttr('data-file', oldName).clone();
tr.attr('data-replace', 'true');
tr.attr('data-file', newName);
var td = tr.children('td.filename');
td.children('a.name .span').text(newName);
var path = td.children('a.name').attr('href');
td.children('a.name').attr('href', path.replace(encodeURIComponent(oldName), encodeURIComponent(newName)));
if (newName.indexOf('.') > 0) {
var basename = newName.substr(0, newName.lastIndexOf('.'));
} else {
var basename = newName;
}
td.children('a.name').empty();
var span = $('<span class="nametext"></span>');
span.text(basename);
td.children('a.name').append(span);
if (newName.indexOf('.') > 0) {
span.append($('<span class="extension">'+newName.substr(newName.lastIndexOf('.'))+'</span>'));
}
FileList.insertElement(newName, tr.data('type'), tr);
tr.show();
FileList.replaceCanceled = false; FileList.replaceCanceled = false;
FileList.replaceOldName = oldName; FileList.replaceOldName = oldName;
FileList.replaceNewName = newName; FileList.replaceNewName = newName;
FileList.replaceIsNewFile = isNewFile;
FileList.lastAction = function() { FileList.lastAction = function() {
FileList.finishReplace(); FileList.finishReplace();
}; };
$('#notification').html(t('files', 'replaced')+' '+newName+' '+t('files', 'with')+' '+oldName+'<span class="undo">'+t('files', 'undo')+'</span>'); if (isNewFile) {
$('#notification').html(t('files', 'replaced')+' '+newName+'<span class="undo">'+t('files', 'undo')+'</span>');
} else {
$('#notification').html(t('files', 'replaced')+' '+newName+' '+t('files', 'with')+' '+oldName+'<span class="undo">'+t('files', 'undo')+'</span>');
}
$('#notification').fadeIn(); $('#notification').fadeIn();
}, },
finishReplace:function() { finishReplace:function() {
if (!FileList.replaceCanceled && FileList.replaceOldName && FileList.replaceNewName) { if (!FileList.replaceCanceled && FileList.replaceOldName && FileList.replaceNewName) {
// Delete the file being replaced and rename the replacement $.ajax({url: OC.filePath('files', 'ajax', 'rename.php'), async: false, data: { dir: $('#dir').val(), newname: FileList.replaceNewName, file: FileList.replaceOldName }, success: function(result) {
FileList.deleteCanceled = false; if (result && result.status == 'success') {
FileList.deleteFiles = [FileList.replaceNewName]; $('tr').filterAttr('data-replace', 'true').removeAttr('data-replace');
FileList.finishDelete(function() { } else {
$.ajax({url: OC.filePath('files', 'ajax', 'rename.php'), async: false, data: { dir: $('#dir').val(), newname: FileList.replaceNewName, file: FileList.replaceOldName }, success: function(result) { OC.dialogs.alert(result.data.message, 'Error moving file');
if (result && result.status == 'success') { }
var tr = $('tr').filterAttr('data-file', FileList.replaceOldName); FileList.replaceCanceled = true;
tr.attr('data-file', FileList.replaceNewName); FileList.replaceOldName = null;
var td = tr.children('td.filename'); FileList.replaceNewName = null;
td.children('a.name .span').text(FileList.replaceNewName); FileList.lastAction = null;
var path = td.children('a.name').attr('href'); }});
td.children('a.name').attr('href', path.replace(encodeURIComponent(FileList.replaceOldName), encodeURIComponent(FileList.replaceNewName)));
if (FileList.replaceNewName.indexOf('.') > 0) {
var basename = FileList.replaceNewName.substr(0, FileList.replaceNewName.lastIndexOf('.'));
} else {
var basename = FileList.replaceNewName;
}
td.children('a.name').empty();
var span = $('<span class="nametext"></span>');
span.text(basename);
td.children('a.name').append(span);
if (FileList.replaceNewName.indexOf('.') > 0) {
span.append($('<span class="extension">'+FileList.replaceNewName.substr(FileList.replaceNewName.lastIndexOf('.'))+'</span>'));
}
tr.show();
} else {
OC.dialogs.alert(result.data.message, 'Error moving file');
}
FileList.replaceCanceled = true;
FileList.replaceOldName = null;
FileList.replaceNewName = null;
FileList.lastAction = null;
}});
}, true);
} }
}, },
do_delete:function(files){ do_delete:function(files){
@ -243,7 +263,12 @@ FileList={
return; return;
} }
FileList.prepareDeletion(files); FileList.prepareDeletion(files);
$('#notification').html(t('files', 'deleted')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>'); // NOTE: Temporary fix to change the text to unshared for files in root of Shared folder
if ($('#dir').val() == '/Shared') {
$('#notification').html(t('files', 'unshared')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>');
} else {
$('#notification').html(t('files', 'deleted')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>');
}
$('#notification').fadeIn(); $('#notification').fadeIn();
}, },
finishDelete:function(ready,sync){ finishDelete:function(ready,sync){
@ -255,7 +280,7 @@ FileList={
data: {dir:$('#dir').val(),files:fileNames}, data: {dir:$('#dir').val(),files:fileNames},
complete: function(data){ complete: function(data){
boolOperationFinished(data, function(){ boolOperationFinished(data, function(){
$('#notification').fadeOut(); $('#notification').fadeOut('400');
$.each(FileList.deleteFiles,function(index,file){ $.each(FileList.deleteFiles,function(index,file){
FileList.remove(file); FileList.remove(file);
}); });
@ -299,21 +324,39 @@ $(document).ready(function(){
FileList.deleteCanceled=true; FileList.deleteCanceled=true;
FileList.deleteFiles=null; FileList.deleteFiles=null;
} else if (FileList.replaceOldName && FileList.replaceNewName) { } else if (FileList.replaceOldName && FileList.replaceNewName) {
$('tr').filterAttr('data-file', FileList.replaceOldName).show(); if (FileList.replaceIsNewFile) {
// Delete the new uploaded file
FileList.deleteCanceled = false;
FileList.deleteFiles = [FileList.replaceOldName];
FileList.finishDelete(null, true);
} else {
$('tr').filterAttr('data-file', FileList.replaceOldName).show();
}
$('tr').filterAttr('data-replace', 'true').remove();
$('tr').filterAttr('data-file', FileList.replaceNewName).show();
FileList.replaceCanceled = true; FileList.replaceCanceled = true;
FileList.replaceOldName = null; FileList.replaceOldName = null;
FileList.replaceNewName = null; FileList.replaceNewName = null;
FileList.replaceIsNewFile = null;
} }
FileList.lastAction = null; FileList.lastAction = null;
$('#notification').fadeOut(); $('#notification').fadeOut('400');
}); });
$('#notification .replace').live('click', function() { $('#notification .replace').live('click', function() {
$('#notification').fadeOut('400', function() { $('#notification').fadeOut('400', function() {
FileList.replace($('#notification').data('oldName'), $('#notification').data('newName')); FileList.replace($('#notification').data('oldName'), $('#notification').data('newName'), $('#notification').data('isNewFile'));
}); });
}); });
$('#notification .suggest').live('click', function() {
$('tr').filterAttr('data-file', $('#notification').data('oldName')).show();
$('#notification').fadeOut('400');
});
$('#notification .cancel').live('click', function() { $('#notification .cancel').live('click', function() {
$('#notification').fadeOut(); if ($('#notification').data('isNewFile')) {
FileList.deleteCanceled = false;
FileList.deleteFiles = [$('#notification').data('oldName')];
FileList.finishDelete(null, true);
}
}); });
FileList.useUndo=('onbeforeunload' in window) FileList.useUndo=('onbeforeunload' in window)
$(window).bind('beforeunload', function (){ $(window).bind('beforeunload', function (){

View File

@ -26,7 +26,7 @@ Files={
}); });
procesSelection(); procesSelection();
} }
} };
$(document).ready(function() { $(document).ready(function() {
$('#fileList tr').each(function(){ $('#fileList tr').each(function(){
//little hack to set unescape filenames in attribute //little hack to set unescape filenames in attribute
@ -40,8 +40,16 @@ $(document).ready(function() {
$('#file_action_panel').attr('activeAction', false); $('#file_action_panel').attr('activeAction', false);
//drag/drop of files //drag/drop of files
$('#fileList tr[data-write="true"] td.filename').draggable(dragOptions); $('#fileList tr td.filename').each(function(i,e){
$('#fileList tr[data-type="dir"][data-write="true"] td.filename').droppable(folderDropOptions); if ($(e).parent().data('permissions') & OC.PERMISSION_DELETE) {
$(e).draggable(dragOptions);
}
});
$('#fileList tr[data-type="dir"] td.filename').each(function(i,e){
if ($(e).parent().data('permissions') & OC.PERMISSION_CREATE){
$(e).droppable(folderDropOptions);
}
});
$('div.crumb:not(.last)').droppable(crumbDropOptions); $('div.crumb:not(.last)').droppable(crumbDropOptions);
$('ul#apps>li:first-child').data('dir',''); $('ul#apps>li:first-child').data('dir','');
if($('div.crumb').length){ if($('div.crumb').length){
@ -228,7 +236,14 @@ $(document).ready(function() {
var size=t('files','Pending'); var size=t('files','Pending');
} }
if(files && !dirName){ if(files && !dirName){
FileList.addFile(getUniqueName(files[i].name),size,date,true); var uniqueName = getUniqueName(files[i].name);
if (uniqueName != files[i].name) {
FileList.checkName(uniqueName, files[i].name, true);
var hidden = true;
} else {
var hidden = false;
}
FileList.addFile(uniqueName,size,date,true,hidden);
} else if(dirName) { } else if(dirName) {
var uploadtext = $('tr').filterAttr('data-type', 'dir').filterAttr('data-file', dirName).find('.uploadtext') var uploadtext = $('tr').filterAttr('data-type', 'dir').filterAttr('data-file', dirName).find('.uploadtext')
var currentUploads = parseInt(uploadtext.attr('currentUploads')); var currentUploads = parseInt(uploadtext.attr('currentUploads'));
@ -247,7 +262,14 @@ $(document).ready(function() {
} }
}else{ }else{
var filename=this.value.split('\\').pop(); //ie prepends C:\fakepath\ in front of the filename var filename=this.value.split('\\').pop(); //ie prepends C:\fakepath\ in front of the filename
FileList.addFile(getUniqueName(filename),'Pending',date,true); var uniqueName = getUniqueName(filename);
if (uniqueName != filename) {
FileList.checkName(uniqueName, filename, true);
var hidden = true;
} else {
var hidden = false;
}
FileList.addFile(uniqueName,'Pending',date,true,hidden);
} }
if($.support.xhrFileUpload) { if($.support.xhrFileUpload) {
for(var i=0;i<files.length;i++){ for(var i=0;i<files.length;i++){
@ -386,6 +408,21 @@ $(document).ready(function() {
}) })
}); });
$.assocArraySize = function(obj) {
// http://stackoverflow.com/a/6700/11236
var size = 0, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) size++;
}
return size;
};
// warn user not to leave the page while upload is in progress
$(window).bind('beforeunload', function(e) {
if ($.assocArraySize(uploadingFiles) > 0)
return t('files','File upload is in progress. Leaving the page now will cancel the upload.');
});
//add multiply file upload attribute to all browsers except konqueror (which crashes when it's used) //add multiply file upload attribute to all browsers except konqueror (which crashes when it's used)
if(navigator.userAgent.search(/konqueror/i)==-1){ if(navigator.userAgent.search(/konqueror/i)==-1){
$('.file_upload_start').attr('multiple','multiple') $('.file_upload_start').attr('multiple','multiple')
@ -452,21 +489,27 @@ $(document).ready(function() {
$(this).append(input); $(this).append(input);
input.focus(); input.focus();
input.change(function(){ input.change(function(){
var name=getUniqueName($(this).val()); if(type != 'web' && $(this).val().indexOf('/')!=-1){
if(type != 'web' && name.indexOf('/')!=-1){
$('#notification').text(t('files','Invalid name, \'/\' is not allowed.')); $('#notification').text(t('files','Invalid name, \'/\' is not allowed.'));
$('#notification').fadeIn(); $('#notification').fadeIn();
return; return;
} }
var name = getUniqueName($(this).val());
if (name != $(this).val()) {
FileList.checkName(name, $(this).val(), true);
var hidden = true;
} else {
var hidden = false;
}
switch(type){ switch(type){
case 'file': case 'file':
$.post( $.post(
OC.filePath('files','ajax','newfile.php'), OC.filePath('files','ajax','newfile.php'),
{dir:$('#dir').val(),filename:name,content:" \n"}, {dir:$('#dir').val(),filename:name},
function(result){ function(result){
if (result.status == 'success') { if (result.status == 'success') {
var date=new Date(); var date=new Date();
FileList.addFile(name,0,date); FileList.addFile(name,0,date,false,hidden);
var tr=$('tr').filterAttr('data-file',name); var tr=$('tr').filterAttr('data-file',name);
tr.data('mime','text/plain'); tr.data('mime','text/plain');
getMimeIcon('text/plain',function(path){ getMimeIcon('text/plain',function(path){
@ -485,7 +528,7 @@ $(document).ready(function() {
function(result){ function(result){
if (result.status == 'success') { if (result.status == 'success') {
var date=new Date(); var date=new Date();
FileList.addDir(name,0,date); FileList.addDir(name,0,date,hidden);
} else { } else {
OC.dialogs.alert(result.data.message, 'Error'); OC.dialogs.alert(result.data.message, 'Error');
} }
@ -516,7 +559,7 @@ $(document).ready(function() {
eventSource.listen('success',function(mime){ eventSource.listen('success',function(mime){
$('#uploadprogressbar').fadeOut(); $('#uploadprogressbar').fadeOut();
var date=new Date(); var date=new Date();
FileList.addFile(localName,0,date); FileList.addFile(localName,0,date,false,hidden);
var tr=$('tr').filterAttr('data-file',localName); var tr=$('tr').filterAttr('data-file',localName);
tr.data('mime',mime); tr.data('mime',mime);
getMimeIcon(mime,function(path){ getMimeIcon(mime,function(path){

View File

@ -10,16 +10,18 @@
"Delete" => "Suprimeix", "Delete" => "Suprimeix",
"already exists" => "ja existeix", "already exists" => "ja existeix",
"replace" => "substitueix", "replace" => "substitueix",
"suggest name" => "sugereix un nom",
"cancel" => "cancel·la", "cancel" => "cancel·la",
"replaced" => "substituït", "replaced" => "substituït",
"with" => "per",
"undo" => "desfés", "undo" => "desfés",
"with" => "per",
"deleted" => "esborrat", "deleted" => "esborrat",
"generating ZIP-file, it may take some time." => "s'estan generant fitxers ZIP, pot trigar una estona.", "generating ZIP-file, it may take some time." => "s'estan generant fitxers ZIP, pot trigar una estona.",
"Unable to upload your file as it is a directory or has 0 bytes" => "No es pot pujar el fitxer perquè és una carpeta o té 0 bytes", "Unable to upload your file as it is a directory or has 0 bytes" => "No es pot pujar el fitxer perquè és una carpeta o té 0 bytes",
"Upload Error" => "Error en la pujada", "Upload Error" => "Error en la pujada",
"Pending" => "Pendents", "Pending" => "Pendents",
"Upload cancelled." => "La pujada s'ha cancel·lat.", "Upload cancelled." => "La pujada s'ha cancel·lat.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Hi ha una pujada en curs. Si abandoneu la pàgina la pujada es cancel·larà.",
"Invalid name, '/' is not allowed." => "El nom no és vàlid, no es permet '/'.", "Invalid name, '/' is not allowed." => "El nom no és vàlid, no es permet '/'.",
"Size" => "Mida", "Size" => "Mida",
"Modified" => "Modificat", "Modified" => "Modificat",
@ -34,6 +36,7 @@
"Enable ZIP-download" => "Activa la baixada ZIP", "Enable ZIP-download" => "Activa la baixada ZIP",
"0 is unlimited" => "0 és sense límit", "0 is unlimited" => "0 és sense límit",
"Maximum input size for ZIP files" => "Mida màxima d'entrada per fitxers ZIP", "Maximum input size for ZIP files" => "Mida màxima d'entrada per fitxers ZIP",
"Save" => "Desa",
"New" => "Nou", "New" => "Nou",
"Text file" => "Fitxer de text", "Text file" => "Fitxer de text",
"Folder" => "Carpeta", "Folder" => "Carpeta",

View File

@ -1,51 +1,54 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"There is no error, the file uploaded with success" => "Soubor byl odeslán úspěšně", "There is no error, the file uploaded with success" => "Soubor byl odeslán úspěšně",
"The uploaded file exceeds the upload_max_filesize directive in php.ini" => "Odeslaný soubor přesáhl velikostí parametr upload_max_filesize v php.ini", "The uploaded file exceeds the upload_max_filesize directive in php.ini" => "Odeslaný soubor přesáhl svou velikostí parametr upload_max_filesize v php.ini",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Odeslaný soubor přesáhl velikostí parametr MAX_FILE_SIZE specifikovaný v HTML formuláři", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Odeslaný soubor přesáhl svou velikostí parametr MAX_FILE_SIZE specifikovaný v formuláři HTML",
"The uploaded file was only partially uploaded" => "Soubor byl odeslán pouze částečně", "The uploaded file was only partially uploaded" => "Soubor byl odeslán pouze částečně",
"No file was uploaded" => "Soubor nebyl odeslán", "No file was uploaded" => "Žádný soubor nebyl odeslán",
"Missing a temporary folder" => "Chybí adresář pro sočasné soubory", "Missing a temporary folder" => "Chybí adresář pro dočasné soubory",
"Failed to write to disk" => "Zápis na disk se nezdařil", "Failed to write to disk" => "Zápis na disk selhal",
"Files" => "Soubory", "Files" => "Soubory",
"Delete" => "Vymazat", "Delete" => "Smazat",
"already exists" => "již existuje", "already exists" => "již existuje",
"replace" => "zaměnit", "replace" => "nahradit",
"cancel" => "storno", "suggest name" => "navrhnout název",
"replaced" => "zaměněno", "cancel" => "zrušit",
"with" => "s", "replaced" => "nahrazeno",
"undo" => "zpět", "undo" => "zpět",
"with" => "s",
"deleted" => "smazáno", "deleted" => "smazáno",
"generating ZIP-file, it may take some time." => "generuji ZIP soubor, může to chvíli trvat", "generating ZIP-file, it may take some time." => "generuji ZIP soubor, může to nějakou dobu trvat.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Nemohu nahrát váš soubor neboť to je adresář a nebo má nulovou délku.", "Unable to upload your file as it is a directory or has 0 bytes" => "Nelze odeslat Váš soubor, protože je to adresář nebo má velikost 0 bajtů",
"Upload Error" => "Chyba při nahrávání", "Upload Error" => "Chyba odesílání",
"Pending" => "Očekává se", "Pending" => "Čekající",
"Upload cancelled." => "Nahrávání zrušeno", "Upload cancelled." => "Odesílání zrušeno.",
"Invalid name, '/' is not allowed." => "Špatné jméno, znak '/' není povolen", "File upload is in progress. Leaving the page now will cancel the upload." => "Probíhá odesílání souboru. Opuštění stránky vyústí ve zrušení nahrávání.",
"Invalid name, '/' is not allowed." => "Neplatný název, znak '/' není povolen",
"Size" => "Velikost", "Size" => "Velikost",
"Modified" => "Změněno", "Modified" => "Změněno",
"folder" => "adresář", "folder" => "složka",
"folders" => "adresáře", "folders" => "složky",
"file" => "soubor", "file" => "soubor",
"files" => "soubory", "files" => "soubory",
"File handling" => "Nastavení chování k souborům", "File handling" => "Zacházení se soubory",
"Maximum upload size" => "Maximální velikost ukládaných souborů", "Maximum upload size" => "Maximální velikost pro odesílání",
"max. possible: " => "největší možná:", "max. possible: " => "největší možná: ",
"Needed for multi-file and folder downloads." => "Potřeba pro vícesoborvé stahování a stahování adresářů", "Needed for multi-file and folder downloads." => "Potřebné pro více-souborové stahování a stahování složek.",
"Enable ZIP-download" => "Povolit ZIP-stahování", "Enable ZIP-download" => "Povolit ZIP-stahování",
"0 is unlimited" => "0 znamená bez omezení", "0 is unlimited" => "0 znamená bez omezení",
"Maximum input size for ZIP files" => "Maximální velikost vstupu pro ZIP soubory", "Maximum input size for ZIP files" => "Maximální velikost vstupu pro ZIP soubory",
"Save" => "Uložit",
"New" => "Nový", "New" => "Nový",
"Text file" => "Textový soubor", "Text file" => "Textový soubor",
"Folder" => "Adresář", "Folder" => "Složka",
"From url" => "Z url", "From url" => "Z url",
"Upload" => "Uložit", "Upload" => "Odeslat",
"Cancel upload" => "Zrušit upload", "Cancel upload" => "Zrušit odesílání",
"Nothing in here. Upload something!" => "Žádný obsah. Uložte si něco!", "Nothing in here. Upload something!" => "Žádný obsah. Nahrajte něco.",
"Name" => "Název", "Name" => "Název",
"Share" => "Sdílet", "Share" => "Sdílet",
"Download" => "Stáhnout", "Download" => "Stáhnout",
"Upload too large" => "Příliš velký soubor", "Upload too large" => "Odeslaný soubor je příliš velký",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Soubory, které se snažíte uložit, překračují maximální velikosti uploadu na tomto serveru.", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Soubory, které se snažíte odeslat, překračují limit velikosti odesílání na tomto serveru.",
"Files are being scanned, please wait." => "Soubory se prohledávají, prosím čekejte.", "Files are being scanned, please wait." => "Soubory se prohledávají, prosím čekejte.",
"Current scanning" => "Aktuální prohledávání" "Current scanning" => "Aktuální prohledávání"
); );

View File

@ -12,14 +12,15 @@
"replace" => "erstat", "replace" => "erstat",
"cancel" => "fortryd", "cancel" => "fortryd",
"replaced" => "erstattet", "replaced" => "erstattet",
"with" => "med",
"undo" => "fortryd", "undo" => "fortryd",
"with" => "med",
"deleted" => "Slettet", "deleted" => "Slettet",
"generating ZIP-file, it may take some time." => "genererer ZIP-fil, det kan tage lidt tid.", "generating ZIP-file, it may take some time." => "genererer ZIP-fil, det kan tage lidt tid.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Kunne ikke uploade din fil, da det enten er en mappe eller er tom", "Unable to upload your file as it is a directory or has 0 bytes" => "Kunne ikke uploade din fil, da det enten er en mappe eller er tom",
"Upload Error" => "Fejl ved upload", "Upload Error" => "Fejl ved upload",
"Pending" => "Afventer", "Pending" => "Afventer",
"Upload cancelled." => "Upload afbrudt.", "Upload cancelled." => "Upload afbrudt.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Fil upload kører. Hvis du forlader siden nu, vil uploadet blive annuleret.",
"Invalid name, '/' is not allowed." => "Ugyldigt navn, '/' er ikke tilladt.", "Invalid name, '/' is not allowed." => "Ugyldigt navn, '/' er ikke tilladt.",
"Size" => "Størrelse", "Size" => "Størrelse",
"Modified" => "Ændret", "Modified" => "Ændret",

View File

@ -1,7 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"There is no error, the file uploaded with success" => "Datei fehlerfrei hochgeladen.", "There is no error, the file uploaded with success" => "Datei fehlerfrei hochgeladen.",
"The uploaded file exceeds the upload_max_filesize directive in php.ini" => "Die Größe der hochzuladenden Datei überschreitet die upload_max_filesize-Richtlinie in php.ini", "The uploaded file exceeds the upload_max_filesize directive in php.ini" => "Die Größe der hochzuladenden Datei überschreitet die upload_max_filesize-Richtlinie in php.ini",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Die größe der hochzuladenden Datei überschreitet die MAX_FILE_SIZE-Richtlinie, die im HTML-Formular angegeben wurde", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Die Größe der hochzuladenden Datei überschreitet die MAX_FILE_SIZE-Richtlinie, die im HTML-Formular angegeben wurde",
"The uploaded file was only partially uploaded" => "Die Datei wurde nur teilweise hochgeladen.", "The uploaded file was only partially uploaded" => "Die Datei wurde nur teilweise hochgeladen.",
"No file was uploaded" => "Es wurde keine Datei hochgeladen.", "No file was uploaded" => "Es wurde keine Datei hochgeladen.",
"Missing a temporary folder" => "Temporärer Ordner fehlt.", "Missing a temporary folder" => "Temporärer Ordner fehlt.",
@ -10,17 +10,19 @@
"Delete" => "Löschen", "Delete" => "Löschen",
"already exists" => "ist bereits vorhanden", "already exists" => "ist bereits vorhanden",
"replace" => "ersetzen", "replace" => "ersetzen",
"suggest name" => "Name vorschlagen",
"cancel" => "abbrechen", "cancel" => "abbrechen",
"replaced" => "ersetzt", "replaced" => "ersetzt",
"with" => "mit",
"undo" => "rückgängig machen", "undo" => "rückgängig machen",
"with" => "mit",
"deleted" => "gelöscht", "deleted" => "gelöscht",
"generating ZIP-file, it may take some time." => "Erstelle ZIP-Datei. Dies kann eine Weile dauern.", "generating ZIP-file, it may take some time." => "Erstelle ZIP-Datei. Dies kann eine Weile dauern.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Ihre Datei kann nicht hochgeladen werden, da sie ein Verzeichnis ist oder 0 Bytes hat.", "Unable to upload your file as it is a directory or has 0 bytes" => "Ihre Datei kann nicht hochgeladen werden, da sie ein Verzeichnis ist oder 0 Bytes hat.",
"Upload Error" => "Fehler beim Hochladen", "Upload Error" => "Fehler beim Hochladen",
"Pending" => "Ausstehend", "Pending" => "Ausstehend",
"Upload cancelled." => "Hochladen abgebrochen.", "Upload cancelled." => "Hochladen abgebrochen.",
"Invalid name, '/' is not allowed." => "Ungültiger Name, \"/\" ist nicht erlaubt.", "File upload is in progress. Leaving the page now will cancel the upload." => "Dateiupload läuft. Wenn Sie die Seite jetzt verlassen, wird der Upload abgebrochen.",
"Invalid name, '/' is not allowed." => "Ungültiger Name: \"/\" ist nicht erlaubt.",
"Size" => "Größe", "Size" => "Größe",
"Modified" => "Bearbeitet", "Modified" => "Bearbeitet",
"folder" => "Ordner", "folder" => "Ordner",
@ -30,10 +32,11 @@
"File handling" => "Dateibehandlung", "File handling" => "Dateibehandlung",
"Maximum upload size" => "Maximale Upload-Größe", "Maximum upload size" => "Maximale Upload-Größe",
"max. possible: " => "maximal möglich:", "max. possible: " => "maximal möglich:",
"Needed for multi-file and folder downloads." => "Für Mehrfachdateien- und Ordnerdownloads benötigt:", "Needed for multi-file and folder downloads." => "Für Mehrfachdatei- und Ordnerdownloads benötigt:",
"Enable ZIP-download" => "ZIP-Download aktivieren", "Enable ZIP-download" => "ZIP-Download aktivieren",
"0 is unlimited" => "0 bedeutet unbegrenzt", "0 is unlimited" => "0 bedeutet unbegrenzt",
"Maximum input size for ZIP files" => "Maximale Größe für ZIP Dateien", "Maximum input size for ZIP files" => "Maximale Größe für ZIP-Dateien",
"Save" => "Speichern",
"New" => "Neu", "New" => "Neu",
"Text file" => "Textdatei", "Text file" => "Textdatei",
"Folder" => "Ordner", "Folder" => "Ordner",

View File

@ -12,8 +12,8 @@
"replace" => "αντικατέστησε", "replace" => "αντικατέστησε",
"cancel" => "ακύρωση", "cancel" => "ακύρωση",
"replaced" => "αντικαταστάθηκε", "replaced" => "αντικαταστάθηκε",
"with" => "με",
"undo" => "αναίρεση", "undo" => "αναίρεση",
"with" => "με",
"deleted" => "διαγράφηκε", "deleted" => "διαγράφηκε",
"generating ZIP-file, it may take some time." => "παραγωγή αρχείου ZIP, ίσως διαρκέσει αρκετά.", "generating ZIP-file, it may take some time." => "παραγωγή αρχείου ZIP, ίσως διαρκέσει αρκετά.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Αδυναμία στην μεταφόρτωση του αρχείου σας αφού είναι φάκελος ή έχει 0 bytes", "Unable to upload your file as it is a directory or has 0 bytes" => "Αδυναμία στην μεταφόρτωση του αρχείου σας αφού είναι φάκελος ή έχει 0 bytes",

View File

@ -12,8 +12,8 @@
"replace" => "anstataŭigi", "replace" => "anstataŭigi",
"cancel" => "nuligi", "cancel" => "nuligi",
"replaced" => "anstataŭigita", "replaced" => "anstataŭigita",
"with" => "kun",
"undo" => "malfari", "undo" => "malfari",
"with" => "kun",
"deleted" => "forigita", "deleted" => "forigita",
"generating ZIP-file, it may take some time." => "generanta ZIP-dosiero, ĝi povas daŭri iom da tempo", "generating ZIP-file, it may take some time." => "generanta ZIP-dosiero, ĝi povas daŭri iom da tempo",
"Unable to upload your file as it is a directory or has 0 bytes" => "Ne eblis alŝuti vian dosieron ĉar ĝi estas dosierujo aŭ havas 0 duumokojn", "Unable to upload your file as it is a directory or has 0 bytes" => "Ne eblis alŝuti vian dosieron ĉar ĝi estas dosierujo aŭ havas 0 duumokojn",

View File

@ -10,16 +10,18 @@
"Delete" => "Eliminado", "Delete" => "Eliminado",
"already exists" => "ya existe", "already exists" => "ya existe",
"replace" => "reemplazar", "replace" => "reemplazar",
"suggest name" => "sugerir nombre",
"cancel" => "cancelar", "cancel" => "cancelar",
"replaced" => "reemplazado", "replaced" => "reemplazado",
"with" => "con",
"undo" => "deshacer", "undo" => "deshacer",
"with" => "con",
"deleted" => "borrado", "deleted" => "borrado",
"generating ZIP-file, it may take some time." => "generando un fichero ZIP, puede llevar un tiempo.", "generating ZIP-file, it may take some time." => "generando un fichero ZIP, puede llevar un tiempo.",
"Unable to upload your file as it is a directory or has 0 bytes" => "No ha sido posible subir tu archivo porque es un directorio o tiene 0 bytes", "Unable to upload your file as it is a directory or has 0 bytes" => "No ha sido posible subir tu archivo porque es un directorio o tiene 0 bytes",
"Upload Error" => "Error al subir el archivo", "Upload Error" => "Error al subir el archivo",
"Pending" => "Pendiente", "Pending" => "Pendiente",
"Upload cancelled." => "Subida cancelada.", "Upload cancelled." => "Subida cancelada.",
"File upload is in progress. Leaving the page now will cancel the upload." => "La subida del archivo está en proceso. Salir de la página ahora cancelará la subida.",
"Invalid name, '/' is not allowed." => "Nombre no válido, '/' no está permitido.", "Invalid name, '/' is not allowed." => "Nombre no válido, '/' no está permitido.",
"Size" => "Tamaño", "Size" => "Tamaño",
"Modified" => "Modificado", "Modified" => "Modificado",
@ -34,6 +36,7 @@
"Enable ZIP-download" => "Habilitar descarga en ZIP", "Enable ZIP-download" => "Habilitar descarga en ZIP",
"0 is unlimited" => "0 es ilimitado", "0 is unlimited" => "0 es ilimitado",
"Maximum input size for ZIP files" => "Tamaño máximo para archivos ZIP de entrada", "Maximum input size for ZIP files" => "Tamaño máximo para archivos ZIP de entrada",
"Save" => "Guardar",
"New" => "Nuevo", "New" => "Nuevo",
"Text file" => "Archivo de texto", "Text file" => "Archivo de texto",
"Folder" => "Carpeta", "Folder" => "Carpeta",

View File

@ -12,8 +12,8 @@
"replace" => "asenda", "replace" => "asenda",
"cancel" => "loobu", "cancel" => "loobu",
"replaced" => "asendatud", "replaced" => "asendatud",
"with" => "millega",
"undo" => "tagasi", "undo" => "tagasi",
"with" => "millega",
"deleted" => "kustutatud", "deleted" => "kustutatud",
"generating ZIP-file, it may take some time." => "ZIP-faili loomine, see võib veidi aega võtta.", "generating ZIP-file, it may take some time." => "ZIP-faili loomine, see võib veidi aega võtta.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Sinu faili üleslaadimine ebaõnnestus, kuna see on kaust või selle suurus on 0 baiti", "Unable to upload your file as it is a directory or has 0 bytes" => "Sinu faili üleslaadimine ebaõnnestus, kuna see on kaust või selle suurus on 0 baiti",

View File

@ -12,8 +12,8 @@
"replace" => "ordeztu", "replace" => "ordeztu",
"cancel" => "ezeztatu", "cancel" => "ezeztatu",
"replaced" => "ordeztua", "replaced" => "ordeztua",
"with" => "honekin",
"undo" => "desegin", "undo" => "desegin",
"with" => "honekin",
"deleted" => "ezabatuta", "deleted" => "ezabatuta",
"generating ZIP-file, it may take some time." => "ZIP-fitxategia sortzen ari da, denbora har dezake", "generating ZIP-file, it may take some time." => "ZIP-fitxategia sortzen ari da, denbora har dezake",
"Unable to upload your file as it is a directory or has 0 bytes" => "Ezin da zure fitxategia igo, karpeta bat da edo 0 byt ditu", "Unable to upload your file as it is a directory or has 0 bytes" => "Ezin da zure fitxategia igo, karpeta bat da edo 0 byt ditu",

View File

@ -12,8 +12,8 @@
"replace" => "جایگزین", "replace" => "جایگزین",
"cancel" => "لغو", "cancel" => "لغو",
"replaced" => "جایگزین‌شده", "replaced" => "جایگزین‌شده",
"with" => "همراه",
"undo" => "بازگشت", "undo" => "بازگشت",
"with" => "همراه",
"deleted" => "حذف شده", "deleted" => "حذف شده",
"generating ZIP-file, it may take some time." => "در حال ساخت فایل فشرده ممکن است زمان زیادی به طول بیانجامد", "generating ZIP-file, it may take some time." => "در حال ساخت فایل فشرده ممکن است زمان زیادی به طول بیانجامد",
"Unable to upload your file as it is a directory or has 0 bytes" => "ناتوان در بارگذاری یا فایل یک پوشه است یا 0بایت دارد", "Unable to upload your file as it is a directory or has 0 bytes" => "ناتوان در بارگذاری یا فایل یک پوشه است یا 0بایت دارد",

View File

@ -10,16 +10,18 @@
"Delete" => "Poista", "Delete" => "Poista",
"already exists" => "on jo olemassa", "already exists" => "on jo olemassa",
"replace" => "korvaa", "replace" => "korvaa",
"suggest name" => "ehdota nimeä",
"cancel" => "peru", "cancel" => "peru",
"replaced" => "korvattu", "replaced" => "korvattu",
"with" => "käyttäen",
"undo" => "kumoa", "undo" => "kumoa",
"with" => "käyttäen",
"deleted" => "poistettu", "deleted" => "poistettu",
"generating ZIP-file, it may take some time." => "luodaan ZIP-tiedostoa, tämä saattaa kestää hetken.", "generating ZIP-file, it may take some time." => "luodaan ZIP-tiedostoa, tämä saattaa kestää hetken.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Tiedoston lähetys epäonnistui, koska sen koko on 0 tavua tai kyseessä on kansio", "Unable to upload your file as it is a directory or has 0 bytes" => "Tiedoston lähetys epäonnistui, koska sen koko on 0 tavua tai kyseessä on kansio",
"Upload Error" => "Lähetysvirhe.", "Upload Error" => "Lähetysvirhe.",
"Pending" => "Odottaa", "Pending" => "Odottaa",
"Upload cancelled." => "Lähetys peruttu.", "Upload cancelled." => "Lähetys peruttu.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Tiedoston lähetys on meneillään. Sivulta poistuminen nyt peruu tiedoston lähetyksen.",
"Invalid name, '/' is not allowed." => "Virheellinen nimi, merkki '/' ei ole sallittu.", "Invalid name, '/' is not allowed." => "Virheellinen nimi, merkki '/' ei ole sallittu.",
"Size" => "Koko", "Size" => "Koko",
"Modified" => "Muutettu", "Modified" => "Muutettu",
@ -34,6 +36,7 @@
"Enable ZIP-download" => "Ota ZIP-paketin lataaminen käytöön", "Enable ZIP-download" => "Ota ZIP-paketin lataaminen käytöön",
"0 is unlimited" => "0 on rajoittamaton", "0 is unlimited" => "0 on rajoittamaton",
"Maximum input size for ZIP files" => "ZIP-tiedostojen enimmäiskoko", "Maximum input size for ZIP files" => "ZIP-tiedostojen enimmäiskoko",
"Save" => "Tallenna",
"New" => "Uusi", "New" => "Uusi",
"Text file" => "Tekstitiedosto", "Text file" => "Tekstitiedosto",
"Folder" => "Kansio", "Folder" => "Kansio",
@ -46,5 +49,6 @@
"Download" => "Lataa", "Download" => "Lataa",
"Upload too large" => "Lähetettävä tiedosto on liian suuri", "Upload too large" => "Lähetettävä tiedosto on liian suuri",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Lähetettäväksi valitsemasi tiedostot ylittävät palvelimen salliman tiedostokoon rajan.", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Lähetettäväksi valitsemasi tiedostot ylittävät palvelimen salliman tiedostokoon rajan.",
"Files are being scanned, please wait." => "Tiedostoja tarkistetaan, odota hetki." "Files are being scanned, please wait." => "Tiedostoja tarkistetaan, odota hetki.",
"Current scanning" => "Tämänhetkinen tutkinta"
); );

View File

@ -12,14 +12,15 @@
"replace" => "remplacer", "replace" => "remplacer",
"cancel" => "annuler", "cancel" => "annuler",
"replaced" => "remplacé", "replaced" => "remplacé",
"with" => "avec",
"undo" => "annuler", "undo" => "annuler",
"with" => "avec",
"deleted" => "supprimé", "deleted" => "supprimé",
"generating ZIP-file, it may take some time." => "Générer un fichier ZIP, cela peut prendre du temps", "generating ZIP-file, it may take some time." => "Fichier ZIP en cours d'assemblage ; cela peut prendre du temps.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Impossible de charger vos fichiers car il s'agit d'un dossier ou le fichier fait 0 octet.", "Unable to upload your file as it is a directory or has 0 bytes" => "Impossible de charger vos fichiers car il s'agit d'un dossier ou le fichier fait 0 octet.",
"Upload Error" => "Erreur de chargement", "Upload Error" => "Erreur de chargement",
"Pending" => "En cours", "Pending" => "En cours",
"Upload cancelled." => "Chargement annulé", "Upload cancelled." => "Chargement annulé.",
"File upload is in progress. Leaving the page now will cancel the upload." => "L'envoi du fichier est en cours. Quitter cette page maintenant annulera l'envoi du fichier.",
"Invalid name, '/' is not allowed." => "Nom invalide, '/' n'est pas autorisé.", "Invalid name, '/' is not allowed." => "Nom invalide, '/' n'est pas autorisé.",
"Size" => "Taille", "Size" => "Taille",
"Modified" => "Modifié", "Modified" => "Modifié",
@ -34,18 +35,19 @@
"Enable ZIP-download" => "Activer le téléchargement ZIP", "Enable ZIP-download" => "Activer le téléchargement ZIP",
"0 is unlimited" => "0 est illimité", "0 is unlimited" => "0 est illimité",
"Maximum input size for ZIP files" => "Taille maximale pour les fichiers ZIP", "Maximum input size for ZIP files" => "Taille maximale pour les fichiers ZIP",
"Save" => "Sauvegarder",
"New" => "Nouveau", "New" => "Nouveau",
"Text file" => "Fichier texte", "Text file" => "Fichier texte",
"Folder" => "Dossier", "Folder" => "Dossier",
"From url" => "Depuis URL", "From url" => "Depuis URL",
"Upload" => "Envoyer", "Upload" => "Envoyer",
"Cancel upload" => "Annuler envoi", "Cancel upload" => "Annuler l'envoi",
"Nothing in here. Upload something!" => "Il n'y a rien ici ! Envoyez donc quelque chose :)", "Nothing in here. Upload something!" => "Il n'y a rien ici ! Envoyez donc quelque chose :)",
"Name" => "Nom", "Name" => "Nom",
"Share" => "Partager", "Share" => "Partager",
"Download" => "Téléchargement", "Download" => "Téléchargement",
"Upload too large" => "Fichier trop volumineux", "Upload too large" => "Fichier trop volumineux",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Les fichiers que vous essayez d'envoyer dépassent la taille maximale permise par ce serveur.", "The files you are trying to upload exceed the maximum size for file uploads on this server." => "Les fichiers que vous essayez d'envoyer dépassent la taille maximale permise par ce serveur.",
"Files are being scanned, please wait." => "Les fichiers sont analysés, patientez svp.", "Files are being scanned, please wait." => "Les fichiers sont en cours d'analyse, veuillez patienter.",
"Current scanning" => "Analyse en cours" "Current scanning" => "Analyse en cours"
); );

View File

@ -12,8 +12,8 @@
"replace" => "substituír", "replace" => "substituír",
"cancel" => "cancelar", "cancel" => "cancelar",
"replaced" => "substituído", "replaced" => "substituído",
"with" => "con",
"undo" => "desfacer", "undo" => "desfacer",
"with" => "con",
"deleted" => "eliminado", "deleted" => "eliminado",
"generating ZIP-file, it may take some time." => "xerando ficheiro ZIP, pode levar un anaco.", "generating ZIP-file, it may take some time." => "xerando ficheiro ZIP, pode levar un anaco.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Non se puido subir o ficheiro pois ou é un directorio ou ten 0 bytes", "Unable to upload your file as it is a directory or has 0 bytes" => "Non se puido subir o ficheiro pois ou é un directorio ou ten 0 bytes",

View File

@ -12,8 +12,8 @@
"replace" => "zamjeni", "replace" => "zamjeni",
"cancel" => "odustani", "cancel" => "odustani",
"replaced" => "zamjenjeno", "replaced" => "zamjenjeno",
"with" => "sa",
"undo" => "vrati", "undo" => "vrati",
"with" => "sa",
"deleted" => "izbrisano", "deleted" => "izbrisano",
"generating ZIP-file, it may take some time." => "generiranje ZIP datoteke, ovo može potrajati.", "generating ZIP-file, it may take some time." => "generiranje ZIP datoteke, ovo može potrajati.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Nemoguće poslati datoteku jer je prazna ili je direktorij", "Unable to upload your file as it is a directory or has 0 bytes" => "Nemoguće poslati datoteku jer je prazna ili je direktorij",

View File

@ -12,8 +12,8 @@
"replace" => "cserél", "replace" => "cserél",
"cancel" => "mégse", "cancel" => "mégse",
"replaced" => "kicserélve", "replaced" => "kicserélve",
"with" => "-val/-vel",
"undo" => "visszavon", "undo" => "visszavon",
"with" => "-val/-vel",
"deleted" => "törölve", "deleted" => "törölve",
"generating ZIP-file, it may take some time." => "ZIP-fájl generálása, ez eltarthat egy ideig.", "generating ZIP-file, it may take some time." => "ZIP-fájl generálása, ez eltarthat egy ideig.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Nem tölthető fel, mert mappa volt, vagy 0 byte méretű", "Unable to upload your file as it is a directory or has 0 bytes" => "Nem tölthető fel, mert mappa volt, vagy 0 byte méretű",

View File

@ -12,8 +12,8 @@
"replace" => "mengganti", "replace" => "mengganti",
"cancel" => "batalkan", "cancel" => "batalkan",
"replaced" => "diganti", "replaced" => "diganti",
"with" => "dengan",
"undo" => "batal dikerjakan", "undo" => "batal dikerjakan",
"with" => "dengan",
"deleted" => "dihapus", "deleted" => "dihapus",
"generating ZIP-file, it may take some time." => "membuat berkas ZIP, ini mungkin memakan waktu.", "generating ZIP-file, it may take some time." => "membuat berkas ZIP, ini mungkin memakan waktu.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Gagal mengunggah berkas anda karena berupa direktori atau mempunyai ukuran 0 byte", "Unable to upload your file as it is a directory or has 0 bytes" => "Gagal mengunggah berkas anda karena berupa direktori atau mempunyai ukuran 0 byte",

View File

@ -10,16 +10,18 @@
"Delete" => "Elimina", "Delete" => "Elimina",
"already exists" => "esiste già", "already exists" => "esiste già",
"replace" => "sostituisci", "replace" => "sostituisci",
"suggest name" => "suggerisci nome",
"cancel" => "annulla", "cancel" => "annulla",
"replaced" => "sostituito", "replaced" => "sostituito",
"with" => "con",
"undo" => "annulla", "undo" => "annulla",
"with" => "con",
"deleted" => "eliminati", "deleted" => "eliminati",
"generating ZIP-file, it may take some time." => "creazione file ZIP, potrebbe richiedere del tempo.", "generating ZIP-file, it may take some time." => "creazione file ZIP, potrebbe richiedere del tempo.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Impossibile inviare il file poiché è una cartella o ha dimensione 0 byte", "Unable to upload your file as it is a directory or has 0 bytes" => "Impossibile inviare il file poiché è una cartella o ha dimensione 0 byte",
"Upload Error" => "Errore di invio", "Upload Error" => "Errore di invio",
"Pending" => "In corso", "Pending" => "In corso",
"Upload cancelled." => "Invio annullato", "Upload cancelled." => "Invio annullato",
"File upload is in progress. Leaving the page now will cancel the upload." => "Caricamento del file in corso. La chiusura della pagina annullerà il caricamento.",
"Invalid name, '/' is not allowed." => "Nome non valido", "Invalid name, '/' is not allowed." => "Nome non valido",
"Size" => "Dimensione", "Size" => "Dimensione",
"Modified" => "Modificato", "Modified" => "Modificato",
@ -34,6 +36,7 @@
"Enable ZIP-download" => "Abilita scaricamento ZIP", "Enable ZIP-download" => "Abilita scaricamento ZIP",
"0 is unlimited" => "0 è illimitato", "0 is unlimited" => "0 è illimitato",
"Maximum input size for ZIP files" => "Dimensione massima per i file ZIP", "Maximum input size for ZIP files" => "Dimensione massima per i file ZIP",
"Save" => "Salva",
"New" => "Nuovo", "New" => "Nuovo",
"Text file" => "File di testo", "Text file" => "File di testo",
"Folder" => "Cartella", "Folder" => "Cartella",

View File

@ -12,14 +12,15 @@
"replace" => "置き換え", "replace" => "置き換え",
"cancel" => "キャンセル", "cancel" => "キャンセル",
"replaced" => "置換:", "replaced" => "置換:",
"with" => "",
"undo" => "元に戻す", "undo" => "元に戻す",
"with" => "",
"deleted" => "削除", "deleted" => "削除",
"generating ZIP-file, it may take some time." => "ZIPファイルを生成中です、しばらくお待ちください。", "generating ZIP-file, it may take some time." => "ZIPファイルを生成中です、しばらくお待ちください。",
"Unable to upload your file as it is a directory or has 0 bytes" => "アップロード使用としているファイルがディレクトリ、もしくはサイズが0バイトのため、アップロードできません。", "Unable to upload your file as it is a directory or has 0 bytes" => "アップロード使用としているファイルがディレクトリ、もしくはサイズが0バイトのため、アップロードできません。",
"Upload Error" => "アップロードエラー", "Upload Error" => "アップロードエラー",
"Pending" => "保留", "Pending" => "保留",
"Upload cancelled." => "アップロードはキャンセルされました。", "Upload cancelled." => "アップロードはキャンセルされました。",
"File upload is in progress. Leaving the page now will cancel the upload." => "ファイル転送を実行中です。今このページから移動するとアップロードが中止されます。",
"Invalid name, '/' is not allowed." => "無効な名前、'/' は使用できません。", "Invalid name, '/' is not allowed." => "無効な名前、'/' は使用できません。",
"Size" => "サイズ", "Size" => "サイズ",
"Modified" => "更新日時", "Modified" => "更新日時",
@ -34,6 +35,7 @@
"Enable ZIP-download" => "ZIP形式のダウンロードを有効にする", "Enable ZIP-download" => "ZIP形式のダウンロードを有効にする",
"0 is unlimited" => "0を指定した場合は無制限", "0 is unlimited" => "0を指定した場合は無制限",
"Maximum input size for ZIP files" => "ZIPファイルへの最大入力サイズ", "Maximum input size for ZIP files" => "ZIPファイルへの最大入力サイズ",
"Save" => "保存",
"New" => "新規", "New" => "新規",
"Text file" => "テキストファイル", "Text file" => "テキストファイル",
"Folder" => "フォルダ", "Folder" => "フォルダ",

View File

@ -8,7 +8,15 @@
"Failed to write to disk" => "디스크에 쓰지 못했습니다", "Failed to write to disk" => "디스크에 쓰지 못했습니다",
"Files" => "파일", "Files" => "파일",
"Delete" => "삭제", "Delete" => "삭제",
"already exists" => "이미 존재 합니다",
"replace" => "대체",
"cancel" => "취소",
"replaced" => "대체됨",
"undo" => "복구",
"with" => "",
"deleted" => "삭제",
"generating ZIP-file, it may take some time." => "ZIP파일 생성에 시간이 걸릴 수 있습니다.", "generating ZIP-file, it may take some time." => "ZIP파일 생성에 시간이 걸릴 수 있습니다.",
"Unable to upload your file as it is a directory or has 0 bytes" => "이 파일은 디렉토리이거나 0 바이트이기 때문에 업로드 할 수 없습니다.",
"Upload Error" => "업로드 에러", "Upload Error" => "업로드 에러",
"Pending" => "보류 중", "Pending" => "보류 중",
"Upload cancelled." => "업로드 취소.", "Upload cancelled." => "업로드 취소.",

View File

@ -8,8 +8,25 @@
"Failed to write to disk" => "Konnt net op den Disk schreiwen", "Failed to write to disk" => "Konnt net op den Disk schreiwen",
"Files" => "Dateien", "Files" => "Dateien",
"Delete" => "Läschen", "Delete" => "Läschen",
"already exists" => "existéiert schonn",
"replace" => "ersetzen",
"cancel" => "ofbriechen",
"replaced" => "ersat",
"undo" => "réckgängeg man",
"with" => "mat",
"deleted" => "geläscht",
"generating ZIP-file, it may take some time." => "Et gëtt eng ZIP-File generéiert, dëst ka bëssen daueren.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Kann deng Datei net eroplueden well et en Dossier ass oder 0 byte grouss ass.",
"Upload Error" => "Fehler beim eroplueden",
"Upload cancelled." => "Upload ofgebrach.",
"File upload is in progress. Leaving the page now will cancel the upload." => "File Upload am gaang. Wann's de des Säit verléiss gëtt den Upload ofgebrach.",
"Invalid name, '/' is not allowed." => "Ongültege Numm, '/' net erlaabt.",
"Size" => "Gréisst", "Size" => "Gréisst",
"Modified" => "Geännert", "Modified" => "Geännert",
"folder" => "Dossier",
"folders" => "Dossieren",
"file" => "Datei",
"files" => "Dateien",
"File handling" => "Fichier handling", "File handling" => "Fichier handling",
"Maximum upload size" => "Maximum Upload Gréisst ", "Maximum upload size" => "Maximum Upload Gréisst ",
"max. possible: " => "max. méiglech:", "max. possible: " => "max. méiglech:",

View File

@ -1,6 +1,17 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"No file was uploaded" => "Neviens fails netika augšuplādēts",
"Failed to write to disk" => "Nav iespējams saglabāt",
"Files" => "Faili", "Files" => "Faili",
"Delete" => "Izdzēst", "Delete" => "Izdzēst",
"already exists" => "tāds fails jau eksistē",
"replace" => "aizvietot",
"cancel" => "atcelt",
"replaced" => "aizvietots",
"undo" => "vienu soli atpakaļ",
"with" => "ar",
"deleted" => "izdzests",
"generating ZIP-file, it may take some time." => "lai uzģenerētu ZIP failu, kāds brīdis ir jāpagaida",
"Unable to upload your file as it is a directory or has 0 bytes" => "Nav iespējams augšuplādēt jūsu failu, jo tāds jau eksistē vai arī failam nav izmēra (0 baiti)",
"Upload Error" => "Augšuplādēšanas laikā radās kļūda", "Upload Error" => "Augšuplādēšanas laikā radās kļūda",
"Pending" => "Gaida savu kārtu", "Pending" => "Gaida savu kārtu",
"Upload cancelled." => "Augšuplāde ir atcelta", "Upload cancelled." => "Augšuplāde ir atcelta",
@ -12,9 +23,20 @@
"file" => "fails", "file" => "fails",
"files" => "faili", "files" => "faili",
"Maximum upload size" => "Maksimālais failu augšuplādes apjoms", "Maximum upload size" => "Maksimālais failu augšuplādes apjoms",
"max. possible: " => "maksīmālais iespējamais:",
"Enable ZIP-download" => "Iespējot ZIP lejuplādi",
"0 is unlimited" => "0 ir neierobežots",
"New" => "Jauns",
"Text file" => "Teksta fails",
"Folder" => "Mape",
"From url" => "No URL saites",
"Upload" => "Augšuplādet", "Upload" => "Augšuplādet",
"Cancel upload" => "Atcelt augšuplādi",
"Nothing in here. Upload something!" => "Te vēl nekas nav. Rīkojies, sāc augšuplādēt", "Nothing in here. Upload something!" => "Te vēl nekas nav. Rīkojies, sāc augšuplādēt",
"Name" => "Nosaukums", "Name" => "Nosaukums",
"Share" => "Līdzdalīt",
"Download" => "Lejuplādēt", "Download" => "Lejuplādēt",
"Upload too large" => "Fails ir par lielu lai to augšuplādetu" "Upload too large" => "Fails ir par lielu lai to augšuplādetu",
"Files are being scanned, please wait." => "Faili šobrīd tiek caurskatīti, nedaudz jāpagaida.",
"Current scanning" => "Šobrīd tiek pārbaudīti"
); );

View File

@ -12,8 +12,8 @@
"replace" => "erstatt", "replace" => "erstatt",
"cancel" => "avbryt", "cancel" => "avbryt",
"replaced" => "erstattet", "replaced" => "erstattet",
"with" => "med",
"undo" => "angre", "undo" => "angre",
"with" => "med",
"deleted" => "slettet", "deleted" => "slettet",
"generating ZIP-file, it may take some time." => "opprettet ZIP-fil, dette kan ta litt tid", "generating ZIP-file, it may take some time." => "opprettet ZIP-fil, dette kan ta litt tid",
"Unable to upload your file as it is a directory or has 0 bytes" => "Kan ikke laste opp filen din siden det er en mappe eller den har 0 bytes", "Unable to upload your file as it is a directory or has 0 bytes" => "Kan ikke laste opp filen din siden det er en mappe eller den har 0 bytes",

View File

@ -12,14 +12,15 @@
"replace" => "vervang", "replace" => "vervang",
"cancel" => "annuleren", "cancel" => "annuleren",
"replaced" => "vervangen", "replaced" => "vervangen",
"with" => "door",
"undo" => "ongedaan maken", "undo" => "ongedaan maken",
"with" => "door",
"deleted" => "verwijderd", "deleted" => "verwijderd",
"generating ZIP-file, it may take some time." => "aanmaken ZIP-file, dit kan enige tijd duren.", "generating ZIP-file, it may take some time." => "aanmaken ZIP-file, dit kan enige tijd duren.",
"Unable to upload your file as it is a directory or has 0 bytes" => "uploaden van de file mislukt, het is of een directory of de bestandsgrootte is 0 bytes", "Unable to upload your file as it is a directory or has 0 bytes" => "uploaden van de file mislukt, het is of een directory of de bestandsgrootte is 0 bytes",
"Upload Error" => "Upload Fout", "Upload Error" => "Upload Fout",
"Pending" => "Wachten", "Pending" => "Wachten",
"Upload cancelled." => "Uploaden geannuleerd.", "Upload cancelled." => "Uploaden geannuleerd.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Bestands upload is bezig. Wanneer de pagina nu verlaten wordt, stopt de upload.",
"Invalid name, '/' is not allowed." => "Ongeldige naam, '/' is niet toegestaan.", "Invalid name, '/' is not allowed." => "Ongeldige naam, '/' is niet toegestaan.",
"Size" => "Bestandsgrootte", "Size" => "Bestandsgrootte",
"Modified" => "Laatst aangepast", "Modified" => "Laatst aangepast",
@ -34,6 +35,7 @@
"Enable ZIP-download" => "Zet ZIP-download aan", "Enable ZIP-download" => "Zet ZIP-download aan",
"0 is unlimited" => "0 is ongelimiteerd", "0 is unlimited" => "0 is ongelimiteerd",
"Maximum input size for ZIP files" => "Maximale grootte voor ZIP bestanden", "Maximum input size for ZIP files" => "Maximale grootte voor ZIP bestanden",
"Save" => "Opslaan",
"New" => "Nieuw", "New" => "Nieuw",
"Text file" => "Tekstbestand", "Text file" => "Tekstbestand",
"Folder" => "Map", "Folder" => "Map",

View File

@ -10,16 +10,18 @@
"Delete" => "Usuwa element", "Delete" => "Usuwa element",
"already exists" => "Już istnieje", "already exists" => "Już istnieje",
"replace" => "zastap", "replace" => "zastap",
"suggest name" => "zasugeruj nazwę",
"cancel" => "anuluj", "cancel" => "anuluj",
"replaced" => "zastąpione", "replaced" => "zastąpione",
"with" => "z",
"undo" => "wróć", "undo" => "wróć",
"with" => "z",
"deleted" => "skasuj", "deleted" => "skasuj",
"generating ZIP-file, it may take some time." => "Generowanie pliku ZIP, może potrwać pewien czas.", "generating ZIP-file, it may take some time." => "Generowanie pliku ZIP, może potrwać pewien czas.",
"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", "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", "Upload Error" => "Błąd wczytywania",
"Pending" => "Oczekujące", "Pending" => "Oczekujące",
"Upload cancelled." => "Wczytywanie anulowane.", "Upload cancelled." => "Wczytywanie anulowane.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Wysyłanie pliku jest w toku. Teraz opuszczając stronę wysyłanie zostanie anulowane.",
"Invalid name, '/' is not allowed." => "Nieprawidłowa nazwa '/' jest niedozwolone.", "Invalid name, '/' is not allowed." => "Nieprawidłowa nazwa '/' jest niedozwolone.",
"Size" => "Rozmiar", "Size" => "Rozmiar",
"Modified" => "Czas modyfikacji", "Modified" => "Czas modyfikacji",
@ -34,6 +36,7 @@
"Enable ZIP-download" => "Włącz pobieranie ZIP-paczki", "Enable ZIP-download" => "Włącz pobieranie ZIP-paczki",
"0 is unlimited" => "0 jest nielimitowane", "0 is unlimited" => "0 jest nielimitowane",
"Maximum input size for ZIP files" => "Maksymalna wielkość pliku wejściowego ZIP ", "Maximum input size for ZIP files" => "Maksymalna wielkość pliku wejściowego ZIP ",
"Save" => "Zapisz",
"New" => "Nowy", "New" => "Nowy",
"Text file" => "Plik tekstowy", "Text file" => "Plik tekstowy",
"Folder" => "Katalog", "Folder" => "Katalog",

View File

@ -12,8 +12,8 @@
"replace" => "substituir", "replace" => "substituir",
"cancel" => "cancelar", "cancel" => "cancelar",
"replaced" => "substituido ", "replaced" => "substituido ",
"with" => "com",
"undo" => "desfazer", "undo" => "desfazer",
"with" => "com",
"deleted" => "deletado", "deleted" => "deletado",
"generating ZIP-file, it may take some time." => "gerando arquivo ZIP, isso pode levar um tempo.", "generating ZIP-file, it may take some time." => "gerando arquivo ZIP, isso pode levar um tempo.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Impossível enviar seus arquivo como diretório ou ele tem 0 bytes.", "Unable to upload your file as it is a directory or has 0 bytes" => "Impossível enviar seus arquivo como diretório ou ele tem 0 bytes.",

View File

@ -12,8 +12,8 @@
"replace" => "substituir", "replace" => "substituir",
"cancel" => "cancelar", "cancel" => "cancelar",
"replaced" => "substituido", "replaced" => "substituido",
"with" => "com",
"undo" => "desfazer", "undo" => "desfazer",
"with" => "com",
"deleted" => "apagado", "deleted" => "apagado",
"generating ZIP-file, it may take some time." => "a gerar o ficheiro ZIP, poderá demorar algum tempo.", "generating ZIP-file, it may take some time." => "a gerar o ficheiro ZIP, poderá demorar algum tempo.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Não é possivel fazer o upload do ficheiro devido a ser uma pasta ou ter 0 bytes", "Unable to upload your file as it is a directory or has 0 bytes" => "Não é possivel fazer o upload do ficheiro devido a ser uma pasta ou ter 0 bytes",

View File

@ -12,14 +12,15 @@
"replace" => "заменить", "replace" => "заменить",
"cancel" => "отмена", "cancel" => "отмена",
"replaced" => "заменён", "replaced" => "заменён",
"with" => "с",
"undo" => "отмена", "undo" => "отмена",
"with" => "с",
"deleted" => "удален", "deleted" => "удален",
"generating ZIP-file, it may take some time." => "создание ZIP-файла, это может занять некоторое время.", "generating ZIP-file, it may take some time." => "создание ZIP-файла, это может занять некоторое время.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Не удается загрузить файл размером 0 байт в каталог", "Unable to upload your file as it is a directory or has 0 bytes" => "Не удается загрузить файл размером 0 байт в каталог",
"Upload Error" => "Ошибка загрузки", "Upload Error" => "Ошибка загрузки",
"Pending" => "Ожидание", "Pending" => "Ожидание",
"Upload cancelled." => "Загрузка отменена.", "Upload cancelled." => "Загрузка отменена.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Файл в процессе загрузки. Покинув страницу вы прервёте загрузку.",
"Invalid name, '/' is not allowed." => "Неверное имя, '/' не допускается.", "Invalid name, '/' is not allowed." => "Неверное имя, '/' не допускается.",
"Size" => "Размер", "Size" => "Размер",
"Modified" => "Изменён", "Modified" => "Изменён",

View File

@ -10,16 +10,18 @@
"Delete" => "Izbriši", "Delete" => "Izbriši",
"already exists" => "že obstaja", "already exists" => "že obstaja",
"replace" => "nadomesti", "replace" => "nadomesti",
"suggest name" => "predlagaj ime",
"cancel" => "ekliči", "cancel" => "ekliči",
"replaced" => "nadomeščen", "replaced" => "nadomeščen",
"with" => "z",
"undo" => "razveljavi", "undo" => "razveljavi",
"with" => "z",
"deleted" => "izbrisano", "deleted" => "izbrisano",
"generating ZIP-file, it may take some time." => "Ustvarjam ZIP datoteko. To lahko traja nekaj časa.", "generating ZIP-file, it may take some time." => "Ustvarjam ZIP datoteko. To lahko traja nekaj časa.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Nalaganje ni mogoče, saj gre za mapo, ali pa ima datoteka velikost 0 bajtov.", "Unable to upload your file as it is a directory or has 0 bytes" => "Nalaganje ni mogoče, saj gre za mapo, ali pa ima datoteka velikost 0 bajtov.",
"Upload Error" => "Napaka pri nalaganju", "Upload Error" => "Napaka pri nalaganju",
"Pending" => "Na čakanju", "Pending" => "Na čakanju",
"Upload cancelled." => "Nalaganje je bilo preklicano.", "Upload cancelled." => "Nalaganje je bilo preklicano.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Nalaganje datoteke je v teku. Če zapustite to stran zdaj, boste nalaganje preklicali.",
"Invalid name, '/' is not allowed." => "Neveljavno ime. Znak '/' ni dovoljen.", "Invalid name, '/' is not allowed." => "Neveljavno ime. Znak '/' ni dovoljen.",
"Size" => "Velikost", "Size" => "Velikost",
"Modified" => "Spremenjeno", "Modified" => "Spremenjeno",
@ -34,6 +36,7 @@
"Enable ZIP-download" => "Omogoči ZIP-prejemanje", "Enable ZIP-download" => "Omogoči ZIP-prejemanje",
"0 is unlimited" => "0 je neskončno", "0 is unlimited" => "0 je neskončno",
"Maximum input size for ZIP files" => "Največja vhodna velikost za ZIP datoteke", "Maximum input size for ZIP files" => "Največja vhodna velikost za ZIP datoteke",
"Save" => "Shrani",
"New" => "Nova", "New" => "Nova",
"Text file" => "Besedilna datoteka", "Text file" => "Besedilna datoteka",
"Folder" => "Mapa", "Folder" => "Mapa",

View File

@ -10,16 +10,18 @@
"Delete" => "Radera", "Delete" => "Radera",
"already exists" => "finns redan", "already exists" => "finns redan",
"replace" => "ersätt", "replace" => "ersätt",
"suggest name" => "föreslå namn",
"cancel" => "avbryt", "cancel" => "avbryt",
"replaced" => "ersatt", "replaced" => "ersatt",
"with" => "med",
"undo" => "ångra", "undo" => "ångra",
"with" => "med",
"deleted" => "raderad", "deleted" => "raderad",
"generating ZIP-file, it may take some time." => "genererar ZIP-fil, det kan ta lite tid.", "generating ZIP-file, it may take some time." => "genererar ZIP-fil, det kan ta lite tid.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Kunde inte ladda upp dina filer eftersom det antingen är en mapp eller har 0 bytes.", "Unable to upload your file as it is a directory or has 0 bytes" => "Kunde inte ladda upp dina filer eftersom det antingen är en mapp eller har 0 bytes.",
"Upload Error" => "Uppladdningsfel", "Upload Error" => "Uppladdningsfel",
"Pending" => "Väntar", "Pending" => "Väntar",
"Upload cancelled." => "Uppladdning avbruten.", "Upload cancelled." => "Uppladdning avbruten.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Filuppladdning pågår. Lämnar du sidan så avbryts uppladdningen.",
"Invalid name, '/' is not allowed." => "Ogiltigt namn, '/' är inte tillåten.", "Invalid name, '/' is not allowed." => "Ogiltigt namn, '/' är inte tillåten.",
"Size" => "Storlek", "Size" => "Storlek",
"Modified" => "Ändrad", "Modified" => "Ändrad",
@ -34,6 +36,7 @@
"Enable ZIP-download" => "Aktivera ZIP-nerladdning", "Enable ZIP-download" => "Aktivera ZIP-nerladdning",
"0 is unlimited" => "0 är oändligt", "0 is unlimited" => "0 är oändligt",
"Maximum input size for ZIP files" => "Största tillåtna storlek för ZIP-filer", "Maximum input size for ZIP files" => "Största tillåtna storlek för ZIP-filer",
"Save" => "Spara",
"New" => "Ny", "New" => "Ny",
"Text file" => "Textfil", "Text file" => "Textfil",
"Folder" => "Mapp", "Folder" => "Mapp",

View File

@ -10,16 +10,18 @@
"Delete" => "ลบ", "Delete" => "ลบ",
"already exists" => "มีอยู่แล้ว", "already exists" => "มีอยู่แล้ว",
"replace" => "แทนที่", "replace" => "แทนที่",
"suggest name" => "แนะนำชื่อ",
"cancel" => "ยกเลิก", "cancel" => "ยกเลิก",
"replaced" => "แทนที่แล้ว", "replaced" => "แทนที่แล้ว",
"with" => "กับ",
"undo" => "เลิกทำ", "undo" => "เลิกทำ",
"with" => "กับ",
"deleted" => "ลบแล้ว", "deleted" => "ลบแล้ว",
"generating ZIP-file, it may take some time." => "กำลังสร้างไฟล์บีบอัด ZIP อาจใช้เวลาสักครู่", "generating ZIP-file, it may take some time." => "กำลังสร้างไฟล์บีบอัด ZIP อาจใช้เวลาสักครู่",
"Unable to upload your file as it is a directory or has 0 bytes" => "ไม่สามารถอัพโหลดไฟล์ของคุณได้ เนื่องจากไฟล์ดังกล่าวเป็นไดเร็กทอรี่หรือมีขนาด 0 ไบต์", "Unable to upload your file as it is a directory or has 0 bytes" => "ไม่สามารถอัพโหลดไฟล์ของคุณได้ เนื่องจากไฟล์ดังกล่าวเป็นไดเร็กทอรี่หรือมีขนาด 0 ไบต์",
"Upload Error" => "เกิดข้อผิดพลาดในการอัพโหลด", "Upload Error" => "เกิดข้อผิดพลาดในการอัพโหลด",
"Pending" => "อยู่ระหว่างดำเนินการ", "Pending" => "อยู่ระหว่างดำเนินการ",
"Upload cancelled." => "การอัพโหลดถูกยกเลิก", "Upload cancelled." => "การอัพโหลดถูกยกเลิก",
"File upload is in progress. Leaving the page now will cancel the upload." => "การอัพโหลดไฟล์กำลังอยู่ในระหว่างดำเนินการ การออกจากหน้าเว็บนี้จะทำให้การอัพโหลดถูกยกเลิก",
"Invalid name, '/' is not allowed." => "ชื่อที่ใช้ไม่ถูกต้อง '/' ไม่อนุญาตให้ใช้งาน", "Invalid name, '/' is not allowed." => "ชื่อที่ใช้ไม่ถูกต้อง '/' ไม่อนุญาตให้ใช้งาน",
"Size" => "ขนาด", "Size" => "ขนาด",
"Modified" => "ปรับปรุงล่าสุด", "Modified" => "ปรับปรุงล่าสุด",
@ -34,6 +36,7 @@
"Enable ZIP-download" => "อนุญาตให้ดาวน์โหลดเป็นไฟล์ ZIP ได้", "Enable ZIP-download" => "อนุญาตให้ดาวน์โหลดเป็นไฟล์ ZIP ได้",
"0 is unlimited" => "0 หมายถึงไม่จำกัด", "0 is unlimited" => "0 หมายถึงไม่จำกัด",
"Maximum input size for ZIP files" => "ขนาดไฟล์ ZIP สูงสุด", "Maximum input size for ZIP files" => "ขนาดไฟล์ ZIP สูงสุด",
"Save" => "บันทึก",
"New" => "อัพโหลดไฟล์ใหม่", "New" => "อัพโหลดไฟล์ใหม่",
"Text file" => "ไฟล์ข้อความ", "Text file" => "ไฟล์ข้อความ",
"Folder" => "แฟ้มเอกสาร", "Folder" => "แฟ้มเอกสาร",

View File

@ -8,13 +8,19 @@
"Failed to write to disk" => "Diske yazılamadı", "Failed to write to disk" => "Diske yazılamadı",
"Files" => "Dosyalar", "Files" => "Dosyalar",
"Delete" => "Sil", "Delete" => "Sil",
"already exists" => "zaten mevcut",
"replace" => "değiştir",
"cancel" => "iptal",
"replaced" => "değiştirildi",
"undo" => "geri al", "undo" => "geri al",
"with" => "ile",
"deleted" => "silindi", "deleted" => "silindi",
"generating ZIP-file, it may take some time." => "ZIP dosyası oluşturuluyor, biraz sürebilir.", "generating ZIP-file, it may take some time." => "ZIP dosyası oluşturuluyor, biraz sürebilir.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Dosyanızın boyutu 0 byte olduğundan veya bir dizin olduğundan yüklenemedi", "Unable to upload your file as it is a directory or has 0 bytes" => "Dosyanızın boyutu 0 byte olduğundan veya bir dizin olduğundan yüklenemedi",
"Upload Error" => "Yükleme hatası", "Upload Error" => "Yükleme hatası",
"Pending" => "Bekliyor", "Pending" => "Bekliyor",
"Upload cancelled." => "Yükleme iptal edildi.", "Upload cancelled." => "Yükleme iptal edildi.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Dosya yükleme işlemi sürüyor. Şimdi sayfadan ayrılırsanız işleminiz iptal olur.",
"Invalid name, '/' is not allowed." => "Geçersiz isim, '/' işaretine izin verilmiyor.", "Invalid name, '/' is not allowed." => "Geçersiz isim, '/' işaretine izin verilmiyor.",
"Size" => "Boyut", "Size" => "Boyut",
"Modified" => "Değiştirilme", "Modified" => "Değiştirilme",

View File

@ -12,8 +12,8 @@
"replace" => "替换", "replace" => "替换",
"cancel" => "取消", "cancel" => "取消",
"replaced" => "替换过了", "replaced" => "替换过了",
"with" => "随着",
"undo" => "撤销", "undo" => "撤销",
"with" => "随着",
"deleted" => "删除", "deleted" => "删除",
"generating ZIP-file, it may take some time." => "正在生成ZIP文件,这可能需要点时间", "generating ZIP-file, it may take some time." => "正在生成ZIP文件,这可能需要点时间",
"Unable to upload your file as it is a directory or has 0 bytes" => "不能上传你指定的文件,可能因为它是个文件夹或者大小为0", "Unable to upload your file as it is a directory or has 0 bytes" => "不能上传你指定的文件,可能因为它是个文件夹或者大小为0",

View File

@ -10,16 +10,18 @@
"Delete" => "删除", "Delete" => "删除",
"already exists" => "已经存在", "already exists" => "已经存在",
"replace" => "替换", "replace" => "替换",
"suggest name" => "建议名称",
"cancel" => "取消", "cancel" => "取消",
"replaced" => "已经替换", "replaced" => "已经替换",
"with" => "随着",
"undo" => "撤销", "undo" => "撤销",
"with" => "随着",
"deleted" => "已经删除", "deleted" => "已经删除",
"generating ZIP-file, it may take some time." => "正在生成 ZIP 文件,可能需要一些时间", "generating ZIP-file, it may take some time." => "正在生成 ZIP 文件,可能需要一些时间",
"Unable to upload your file as it is a directory or has 0 bytes" => "无法上传文件,因为它是一个目录或者大小为 0 字节", "Unable to upload your file as it is a directory or has 0 bytes" => "无法上传文件,因为它是一个目录或者大小为 0 字节",
"Upload Error" => "上传错误", "Upload Error" => "上传错误",
"Pending" => "操作等待中", "Pending" => "操作等待中",
"Upload cancelled." => "上传已取消", "Upload cancelled." => "上传已取消",
"File upload is in progress. Leaving the page now will cancel the upload." => "文件正在上传中。现在离开此页会导致上传动作被取消。",
"Invalid name, '/' is not allowed." => "非法的名称,不允许使用‘/’。", "Invalid name, '/' is not allowed." => "非法的名称,不允许使用‘/’。",
"Size" => "大小", "Size" => "大小",
"Modified" => "修改日期", "Modified" => "修改日期",
@ -34,6 +36,7 @@
"Enable ZIP-download" => "启用 ZIP 下载", "Enable ZIP-download" => "启用 ZIP 下载",
"0 is unlimited" => "0 为无限制", "0 is unlimited" => "0 为无限制",
"Maximum input size for ZIP files" => "ZIP 文件的最大输入大小", "Maximum input size for ZIP files" => "ZIP 文件的最大输入大小",
"Save" => "保存",
"New" => "新建", "New" => "新建",
"Text file" => "文本文件", "Text file" => "文本文件",
"Folder" => "文件夹", "Folder" => "文件夹",

View File

@ -8,6 +8,15 @@
"Failed to write to disk" => "寫入硬碟失敗", "Failed to write to disk" => "寫入硬碟失敗",
"Files" => "檔案", "Files" => "檔案",
"Delete" => "刪除", "Delete" => "刪除",
"already exists" => "已經存在",
"replace" => "取代",
"cancel" => "取消",
"generating ZIP-file, it may take some time." => "產生壓縮檔, 它可能需要一段時間.",
"Unable to upload your file as it is a directory or has 0 bytes" => "無法上傳您的檔案因為它可能是一個目錄或檔案大小為0",
"Upload Error" => "上傳發生錯誤",
"Upload cancelled." => "上傳取消",
"File upload is in progress. Leaving the page now will cancel the upload." => "檔案上傳中. 離開此頁面將會取消上傳.",
"Invalid name, '/' is not allowed." => "無效的名稱, '/'是不被允許的",
"Size" => "大小", "Size" => "大小",
"Modified" => "修改", "Modified" => "修改",
"File handling" => "檔案處理", "File handling" => "檔案處理",

View File

@ -36,7 +36,7 @@ OCP\Util::addscript( "files", "files" );
$dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
$files = array(); $files = array();
foreach( OC_Files::getdirectorycontent( $dir ) as $i ){ foreach( OC_Files::getdirectorycontent( $dir ) as $i ) {
$i["date"] = date( $CONFIG_DATEFORMAT, $i["mtime"] ); $i["date"] = date( $CONFIG_DATEFORMAT, $i["mtime"] );
$files[] = $i; $files[] = $i;
} }
@ -44,8 +44,8 @@ foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
// Make breadcrumb // Make breadcrumb
$breadcrumb = array(); $breadcrumb = array();
$pathtohere = "/"; $pathtohere = "/";
foreach( explode( "/", $dir ) as $i ){ foreach( explode( "/", $dir ) as $i ) {
if( $i != "" ){ if( $i != "" ) {
$pathtohere .= "$i/"; $pathtohere .= "$i/";
$breadcrumb[] = array( "dir" => $pathtohere, "name" => $i ); $breadcrumb[] = array( "dir" => $pathtohere, "name" => $i );
} }

View File

@ -11,6 +11,6 @@
<input name="maxZipInputSize" id="maxZipInputSize" style="width:180px;" value='<?php echo $_['maxZipInputSize'] ?>' title="<?php echo $l->t( '0 is unlimited' ); ?>"<?php if (!$_['allowZipDownload']) echo ' disabled="disabled"'; ?> /> <input name="maxZipInputSize" id="maxZipInputSize" style="width:180px;" value='<?php echo $_['maxZipInputSize'] ?>' title="<?php echo $l->t( '0 is unlimited' ); ?>"<?php if (!$_['allowZipDownload']) echo ' disabled="disabled"'; ?> />
<label for="maxZipInputSize"><?php echo $l->t( 'Maximum input size for ZIP files' ); ?> </label><br /> <label for="maxZipInputSize"><?php echo $l->t( 'Maximum input size for ZIP files' ); ?> </label><br />
<input type="submit" name="submitFilesAdminSettings" id="submitFilesAdminSettings" value="Save"/> <input type="submit" name="submitFilesAdminSettings" id="submitFilesAdminSettings" value="<?php echo $l->t( 'Save' ); ?>"/>
</fieldset> </fieldset>
</form> </form>

View File

@ -32,6 +32,7 @@
<?php else:?> <?php else:?>
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir"> <input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
<?php endif;?> <?php endif;?>
<input type="hidden" name="permissions" value="<?php echo $_['permissions']; ?>" id="permissions">
</div> </div>
<div id='notification'></div> <div id='notification'></div>
@ -53,7 +54,17 @@
</span> </span>
</th> </th>
<th id="headerSize"><?php echo $l->t( 'Size' ); ?></th> <th id="headerSize"><?php echo $l->t( 'Size' ); ?></th>
<th id="headerDate"><span id="modified"><?php echo $l->t( 'Modified' ); ?></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> <th id="headerDate">
<span id="modified"><?php echo $l->t( 'Modified' ); ?></span>
<?php if ($_['permissions'] & OCP\Share::PERMISSION_DELETE): ?>
<!-- NOTE: Temporary fix to allow unsharing of files in root of Shared folder -->
<?php if ($_['dir'] == '/Shared'): ?>
<span class="selectedActions"><a href="" class="delete"><?php echo $l->t('Unshare')?> <img class="svg" alt="<?php echo $l->t('Unshare')?>" src="<?php echo OCP\image_path("core", "actions/delete.svg"); ?>" /></a></span>
<?php else: ?>
<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>
<?php endif; ?>
<?php endif; ?>
</th>
</tr> </tr>
</thead> </thead>
<tbody id="fileList"> <tbody id="fileList">

View File

@ -10,7 +10,7 @@ OCP\Util::connectHook('OC_User','post_login','OC_Crypt','loginListener');
stream_wrapper_register('crypt','OC_CryptStream'); stream_wrapper_register('crypt','OC_CryptStream');
if(!isset($_SESSION['enckey']) and OCP\User::isLoggedIn()){//force the user to re-loggin if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled) if(!isset($_SESSION['enckey']) and OCP\User::isLoggedIn()) {//force the user to re-loggin if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled)
OCP\User::logout(); OCP\User::logout();
header("Location: ".OC::$WEBROOT.'/'); header("Location: ".OC::$WEBROOT.'/');
exit(); exit();

View File

@ -20,5 +20,5 @@ $(document).ready(function(){
$('#enable_encryption').change(function(){ $('#enable_encryption').change(function(){
var checked=$('#enable_encryption').is(':checked'); var checked=$('#enable_encryption').is(':checked');
OC.AppConfig.setValue('files_encryption','enable_encryption',(checked)?'true':'false'); OC.AppConfig.setValue('files_encryption','enable_encryption',(checked)?'true':'false');
}) });
}) });

View File

@ -1,6 +1,6 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Encryption" => "Kryptování", "Encryption" => "Šifrování",
"Exclude the following file types from encryption" => "Při kryptování vynechat následující typy souborů", "Exclude the following file types from encryption" => "Při šifrování vynechat následující typy souborů",
"None" => "Žádný", "None" => "Žádné",
"Enable Encryption" => "Povolit kryptování" "Enable Encryption" => "Povolit šifrování"
); );

View File

@ -0,0 +1,6 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Šifrovanie",
"Exclude the following file types from encryption" => "Vynechať nasledujúce súbory pri šifrovaní",
"None" => "Žiadne",
"Enable Encryption" => "Zapnúť šifrovanie"
);

View File

@ -0,0 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "加密",
"None" => "None",
"Enable Encryption" => "开启加密"
);

View File

@ -0,0 +1,6 @@
<?php $TRANSLATIONS = array(
"Encryption" => "加密",
"Exclude the following file types from encryption" => "下列的檔案類型不加密",
"None" => "",
"Enable Encryption" => "啟用加密"
);

View File

@ -31,7 +31,7 @@
// - IMPORTANT! Check if the block lenght of the encrypted data stays the same // - IMPORTANT! Check if the block lenght of the encrypted data stays the same
require_once('Crypt_Blowfish/Blowfish.php'); require_once 'Crypt_Blowfish/Blowfish.php';
/** /**
* This class is for crypting and decrypting * This class is for crypting and decrypting
@ -39,18 +39,18 @@ require_once('Crypt_Blowfish/Blowfish.php');
class OC_Crypt { class OC_Crypt {
static private $bf = null; static private $bf = null;
public static function loginListener($params){ public static function loginListener($params) {
self::init($params['uid'],$params['password']); self::init($params['uid'],$params['password']);
} }
public static function init($login,$password) { public static function init($login,$password) {
$view=new OC_FilesystemView('/'); $view=new OC_FilesystemView('/');
if(!$view->file_exists('/'.$login)){ if(!$view->file_exists('/'.$login)) {
$view->mkdir('/'.$login); $view->mkdir('/'.$login);
} }
OC_FileProxy::$enabled=false; OC_FileProxy::$enabled=false;
if(!$view->file_exists('/'.$login.'/encryption.key')){// does key exist? if(!$view->file_exists('/'.$login.'/encryption.key')) {// does key exist?
OC_Crypt::createkey($login,$password); OC_Crypt::createkey($login,$password);
} }
$key=$view->file_get_contents('/'.$login.'/encryption.key'); $key=$view->file_get_contents('/'.$login.'/encryption.key');
@ -66,14 +66,14 @@ class OC_Crypt {
* *
* if the key is left out, the default handeler will be used * if the key is left out, the default handeler will be used
*/ */
public static function getBlowfish($key=''){ public static function getBlowfish($key='') {
if($key){ if($key) {
return new Crypt_Blowfish($key); return new Crypt_Blowfish($key);
}else{ }else{
if(!isset($_SESSION['enckey'])){ if(!isset($_SESSION['enckey'])) {
return false; return false;
} }
if(!self::$bf){ if(!self::$bf) {
self::$bf=new Crypt_Blowfish($_SESSION['enckey']); self::$bf=new Crypt_Blowfish($_SESSION['enckey']);
} }
return self::$bf; return self::$bf;
@ -96,7 +96,7 @@ class OC_Crypt {
} }
public static function changekeypasscode($oldPassword, $newPassword) { public static function changekeypasscode($oldPassword, $newPassword) {
if(OCP\User::isLoggedIn()){ if(OCP\User::isLoggedIn()) {
$username=OCP\USER::getUser(); $username=OCP\USER::getUser();
$view=new OC_FilesystemView('/'.$username); $view=new OC_FilesystemView('/'.$username);
@ -179,7 +179,7 @@ class OC_Crypt {
while (!feof($handleread)) { while (!feof($handleread)) {
$content = fread($handleread, 8192); $content = fread($handleread, 8192);
$enccontent=OC_CRYPT::decrypt( $content, $key); $enccontent=OC_CRYPT::decrypt( $content, $key);
if(feof($handleread)){ if(feof($handleread)) {
$enccontent=rtrim($enccontent, "\0"); $enccontent=rtrim($enccontent, "\0");
} }
fwrite($handlewrite, $enccontent); fwrite($handlewrite, $enccontent);
@ -192,9 +192,9 @@ class OC_Crypt {
/** /**
* encrypt data in 8192b sized blocks * encrypt data in 8192b sized blocks
*/ */
public static function blockEncrypt($data, $key=''){ public static function blockEncrypt($data, $key='') {
$result=''; $result='';
while(strlen($data)){ while(strlen($data)) {
$result.=self::encrypt(substr($data,0,8192),$key); $result.=self::encrypt(substr($data,0,8192),$key);
$data=substr($data,8192); $data=substr($data,8192);
} }
@ -204,13 +204,13 @@ class OC_Crypt {
/** /**
* decrypt data in 8192b sized blocks * decrypt data in 8192b sized blocks
*/ */
public static function blockDecrypt($data, $key='',$maxLength=0){ public static function blockDecrypt($data, $key='',$maxLength=0) {
$result=''; $result='';
while(strlen($data)){ while(strlen($data)) {
$result.=self::decrypt(substr($data,0,8192),$key); $result.=self::decrypt(substr($data,0,8192),$key);
$data=substr($data,8192); $data=substr($data,8192);
} }
if($maxLength>0){ if($maxLength>0) {
return substr($result,0,$maxLength); return substr($result,0,$maxLength);
}else{ }else{
return rtrim($result, "\0"); return rtrim($result, "\0");

View File

@ -36,18 +36,18 @@ class OC_CryptStream{
private $size; private $size;
private static $rootView; private static $rootView;
public function stream_open($path, $mode, $options, &$opened_path){ public function stream_open($path, $mode, $options, &$opened_path) {
if(!self::$rootView){ if(!self::$rootView) {
self::$rootView=new OC_FilesystemView(''); self::$rootView=new OC_FilesystemView('');
} }
$path=str_replace('crypt://','',$path); $path=str_replace('crypt://','',$path);
if(dirname($path)=='streams' and isset(self::$sourceStreams[basename($path)])){ if(dirname($path)=='streams' and isset(self::$sourceStreams[basename($path)])) {
$this->source=self::$sourceStreams[basename($path)]['stream']; $this->source=self::$sourceStreams[basename($path)]['stream'];
$this->path=self::$sourceStreams[basename($path)]['path']; $this->path=self::$sourceStreams[basename($path)]['path'];
$this->size=self::$sourceStreams[basename($path)]['size']; $this->size=self::$sourceStreams[basename($path)]['size'];
}else{ }else{
$this->path=$path; $this->path=$path;
if($mode=='w' or $mode=='w+' or $mode=='wb' or $mode=='wb+'){ if($mode=='w' or $mode=='w+' or $mode=='wb' or $mode=='wb+') {
$this->size=0; $this->size=0;
}else{ }else{
$this->size=self::$rootView->filesize($path,$mode); $this->size=self::$rootView->filesize($path,$mode);
@ -55,55 +55,55 @@ class OC_CryptStream{
OC_FileProxy::$enabled=false;//disable fileproxies so we can open the source file OC_FileProxy::$enabled=false;//disable fileproxies so we can open the source file
$this->source=self::$rootView->fopen($path,$mode); $this->source=self::$rootView->fopen($path,$mode);
OC_FileProxy::$enabled=true; OC_FileProxy::$enabled=true;
if(!is_resource($this->source)){ if(!is_resource($this->source)) {
OCP\Util::writeLog('files_encryption','failed to open '.$path,OCP\Util::ERROR); OCP\Util::writeLog('files_encryption','failed to open '.$path,OCP\Util::ERROR);
} }
} }
if(is_resource($this->source)){ if(is_resource($this->source)) {
$this->meta=stream_get_meta_data($this->source); $this->meta=stream_get_meta_data($this->source);
} }
return is_resource($this->source); return is_resource($this->source);
} }
public function stream_seek($offset, $whence=SEEK_SET){ public function stream_seek($offset, $whence=SEEK_SET) {
$this->flush(); $this->flush();
fseek($this->source,$offset,$whence); fseek($this->source,$offset,$whence);
} }
public function stream_tell(){ public function stream_tell() {
return ftell($this->source); return ftell($this->source);
} }
public function stream_read($count){ public function stream_read($count) {
//$count will always be 8192 https://bugs.php.net/bug.php?id=21641 //$count will always be 8192 https://bugs.php.net/bug.php?id=21641
//This makes this function a lot simpler but will breake everything the moment it's fixed //This makes this function a lot simpler but will breake everything the moment it's fixed
$this->writeCache=''; $this->writeCache='';
if($count!=8192){ if($count!=8192) {
OCP\Util::writeLog('files_encryption','php bug 21641 no longer holds, decryption will not work',OCP\Util::FATAL); OCP\Util::writeLog('files_encryption','php bug 21641 no longer holds, decryption will not work',OCP\Util::FATAL);
die(); die();
} }
$pos=ftell($this->source); $pos=ftell($this->source);
$data=fread($this->source,8192); $data=fread($this->source,8192);
if(strlen($data)){ if(strlen($data)) {
$result=OC_Crypt::decrypt($data); $result=OC_Crypt::decrypt($data);
}else{ }else{
$result=''; $result='';
} }
$length=$this->size-$pos; $length=$this->size-$pos;
if($length<8192){ if($length<8192) {
$result=substr($result,0,$length); $result=substr($result,0,$length);
} }
return $result; return $result;
} }
public function stream_write($data){ public function stream_write($data) {
$length=strlen($data); $length=strlen($data);
$currentPos=ftell($this->source); $currentPos=ftell($this->source);
if($this->writeCache){ if($this->writeCache) {
$data=$this->writeCache.$data; $data=$this->writeCache.$data;
$this->writeCache=''; $this->writeCache='';
} }
if($currentPos%8192!=0){ if($currentPos%8192!=0) {
//make sure we always start on a block start //make sure we always start on a block start
fseek($this->source,-($currentPos%8192),SEEK_CUR); fseek($this->source,-($currentPos%8192),SEEK_CUR);
$encryptedBlock=fread($this->source,8192); $encryptedBlock=fread($this->source,8192);
@ -113,8 +113,8 @@ class OC_CryptStream{
fseek($this->source,-($currentPos%8192),SEEK_CUR); fseek($this->source,-($currentPos%8192),SEEK_CUR);
} }
$currentPos=ftell($this->source); $currentPos=ftell($this->source);
while($remainingLength=strlen($data)>0){ while($remainingLength=strlen($data)>0) {
if($remainingLength<8192){ if($remainingLength<8192) {
$this->writeCache=$data; $this->writeCache=$data;
$data=''; $data='';
}else{ }else{
@ -127,8 +127,8 @@ class OC_CryptStream{
return $length; return $length;
} }
public function stream_set_option($option,$arg1,$arg2){ public function stream_set_option($option,$arg1,$arg2) {
switch($option){ switch($option) {
case STREAM_OPTION_BLOCKING: case STREAM_OPTION_BLOCKING:
stream_set_blocking($this->source,$arg1); stream_set_blocking($this->source,$arg1);
break; break;
@ -140,33 +140,33 @@ class OC_CryptStream{
} }
} }
public function stream_stat(){ public function stream_stat() {
return fstat($this->source); return fstat($this->source);
} }
public function stream_lock($mode){ public function stream_lock($mode) {
flock($this->source,$mode); flock($this->source,$mode);
} }
public function stream_flush(){ public function stream_flush() {
return fflush($this->source); return fflush($this->source);
} }
public function stream_eof(){ public function stream_eof() {
return feof($this->source); return feof($this->source);
} }
private function flush(){ private function flush() {
if($this->writeCache){ if($this->writeCache) {
$encrypted=OC_Crypt::encrypt($this->writeCache); $encrypted=OC_Crypt::encrypt($this->writeCache);
fwrite($this->source,$encrypted); fwrite($this->source,$encrypted);
$this->writeCache=''; $this->writeCache='';
} }
} }
public function stream_close(){ public function stream_close() {
$this->flush(); $this->flush();
if($this->meta['mode']!='r' and $this->meta['mode']!='rb'){ if($this->meta['mode']!='r' and $this->meta['mode']!='rb') {
OC_FileCache::put($this->path,array('encrypted'=>true,'size'=>$this->size),''); OC_FileCache::put($this->path,array('encrypted'=>true,'size'=>$this->size),'');
} }
return fclose($this->source); return fclose($this->source);

View File

@ -34,21 +34,21 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
* @param string $path * @param string $path
* @return bool * @return bool
*/ */
private static function shouldEncrypt($path){ private static function shouldEncrypt($path) {
if(is_null(self::$enableEncryption)){ if(is_null(self::$enableEncryption)) {
self::$enableEncryption=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true'); self::$enableEncryption=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true');
} }
if(!self::$enableEncryption){ if(!self::$enableEncryption) {
return false; return false;
} }
if(is_null(self::$blackList)){ if(is_null(self::$blackList)) {
self::$blackList=explode(',',OCP\Config::getAppValue('files_encryption','type_blacklist','jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg')); self::$blackList=explode(',',OCP\Config::getAppValue('files_encryption','type_blacklist','jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
} }
if(self::isEncrypted($path)){ if(self::isEncrypted($path)) {
return true; return true;
} }
$extension=substr($path,strrpos($path,'.')+1); $extension=substr($path,strrpos($path,'.')+1);
if(array_search($extension,self::$blackList)===false){ if(array_search($extension,self::$blackList)===false) {
return true; return true;
} }
} }
@ -58,13 +58,13 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
* @param string $path * @param string $path
* @return bool * @return bool
*/ */
private static function isEncrypted($path){ private static function isEncrypted($path) {
$metadata=OC_FileCache_Cached::get($path,''); $metadata=OC_FileCache_Cached::get($path,'');
return isset($metadata['encrypted']) and (bool)$metadata['encrypted']; return isset($metadata['encrypted']) and (bool)$metadata['encrypted'];
} }
public function preFile_put_contents($path,&$data){ public function preFile_put_contents($path,&$data) {
if(self::shouldEncrypt($path)){ if(self::shouldEncrypt($path)) {
if (!is_resource($data)) {//stream put contents should have been converter to fopen if (!is_resource($data)) {//stream put contents should have been converter to fopen
$size=strlen($data); $size=strlen($data);
$data=OC_Crypt::blockEncrypt($data); $data=OC_Crypt::blockEncrypt($data);
@ -73,24 +73,24 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
} }
} }
public function postFile_get_contents($path,$data){ public function postFile_get_contents($path,$data) {
if(self::isEncrypted($path)){ if(self::isEncrypted($path)) {
$cached=OC_FileCache_Cached::get($path,''); $cached=OC_FileCache_Cached::get($path,'');
$data=OC_Crypt::blockDecrypt($data,'',$cached['size']); $data=OC_Crypt::blockDecrypt($data,'',$cached['size']);
} }
return $data; return $data;
} }
public function postFopen($path,&$result){ public function postFopen($path,&$result) {
if(!$result){ if(!$result) {
return $result; return $result;
} }
$meta=stream_get_meta_data($result); $meta=stream_get_meta_data($result);
if(self::isEncrypted($path)){ if(self::isEncrypted($path)) {
fclose($result); fclose($result);
$result=fopen('crypt://'.$path,$meta['mode']); $result=fopen('crypt://'.$path,$meta['mode']);
}elseif(self::shouldEncrypt($path) and $meta['mode']!='r' and $meta['mode']!='rb'){ }elseif(self::shouldEncrypt($path) and $meta['mode']!='r' and $meta['mode']!='rb') {
if(OC_Filesystem::file_exists($path) and OC_Filesystem::filesize($path)>0){ if(OC_Filesystem::file_exists($path) and OC_Filesystem::filesize($path)>0) {
//first encrypt the target file so we don't end up with a half encrypted file //first encrypt the target file so we don't end up with a half encrypted file
OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing',OCP\Util::DEBUG); OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing',OCP\Util::DEBUG);
$tmp=fopen('php://temp'); $tmp=fopen('php://temp');
@ -104,23 +104,23 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
return $result; return $result;
} }
public function postGetMimeType($path,$mime){ public function postGetMimeType($path,$mime) {
if(self::isEncrypted($path)){ if(self::isEncrypted($path)) {
$mime=OCP\Files::getMimeType('crypt://'.$path,'w'); $mime=OCP\Files::getMimeType('crypt://'.$path,'w');
} }
return $mime; return $mime;
} }
public function postStat($path,$data){ public function postStat($path,$data) {
if(self::isEncrypted($path)){ if(self::isEncrypted($path)) {
$cached=OC_FileCache_Cached::get($path,''); $cached=OC_FileCache_Cached::get($path,'');
$data['size']=$cached['size']; $data['size']=$cached['size'];
} }
return $data; return $data;
} }
public function postFileSize($path,$size){ public function postFileSize($path,$size) {
if(self::isEncrypted($path)){ if(self::isEncrypted($path)) {
$cached=OC_FileCache_Cached::get($path,''); $cached=OC_FileCache_Cached::get($path,'');
return $cached['size']; return $cached['size'];
}else{ }else{

View File

@ -7,6 +7,6 @@
<option selected="selected" value="<?php echo $type;?>"><?php echo $type;?></option> <option selected="selected" value="<?php echo $type;?>"><?php echo $type;?></option>
<?php endforeach;?> <?php endforeach;?>
</select> </select>
<input type='checkbox' id='enable_encryption' <?php if($_['encryption_enabled']){echo 'checked="checked"';} ?>></input><label for='enable_encryption'><?php echo $l->t('Enable Encryption')?></label> <input type='checkbox' id='enable_encryption' <?php if($_['encryption_enabled']) {echo 'checked="checked"';} ?>></input><label for='enable_encryption'><?php echo $l->t('Enable Encryption')?></label>
</fieldset> </fieldset>
</form> </form>

View File

@ -7,7 +7,7 @@
*/ */
class Test_Encryption extends UnitTestCase { class Test_Encryption extends UnitTestCase {
function testEncryption(){ function testEncryption() {
$key=uniqid(); $key=uniqid();
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php'; $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$source=file_get_contents($file); //nice large text file $source=file_get_contents($file); //nice large text file
@ -54,7 +54,7 @@ class Test_Encryption extends UnitTestCase {
} }
function testBinary(){ function testBinary() {
$key=uniqid(); $key=uniqid();
$file=__DIR__.'/binary'; $file=__DIR__.'/binary';

View File

@ -10,7 +10,7 @@ class Test_CryptProxy extends UnitTestCase {
private $oldConfig; private $oldConfig;
private $oldKey; private $oldKey;
public function setUp(){ public function setUp() {
$user=OC_User::getUser(); $user=OC_User::getUser();
$this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption','true'); $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption','true');
@ -40,14 +40,14 @@ class Test_CryptProxy extends UnitTestCase {
$rootView->mkdir('/'.$user.'/files'); $rootView->mkdir('/'.$user.'/files');
} }
public function tearDown(){ public function tearDown() {
OCP\Config::setAppValue('files_encryption','enable_encryption',$this->oldConfig); OCP\Config::setAppValue('files_encryption','enable_encryption',$this->oldConfig);
if(!is_null($this->oldKey)){ if(!is_null($this->oldKey)) {
$_SESSION['enckey']=$this->oldKey; $_SESSION['enckey']=$this->oldKey;
} }
} }
public function testSimple(){ public function testSimple() {
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php'; $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$original=file_get_contents($file); $original=file_get_contents($file);
@ -64,7 +64,7 @@ class Test_CryptProxy extends UnitTestCase {
} }
public function testView(){ public function testView() {
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php'; $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$original=file_get_contents($file); $original=file_get_contents($file);
@ -86,7 +86,7 @@ class Test_CryptProxy extends UnitTestCase {
$this->assertEqual($original,$fromFile); $this->assertEqual($original,$fromFile);
} }
public function testBinary(){ public function testBinary() {
$file=__DIR__.'/binary'; $file=__DIR__.'/binary';
$original=file_get_contents($file); $original=file_get_contents($file);

View File

@ -9,7 +9,7 @@
class Test_CryptStream extends UnitTestCase { class Test_CryptStream extends UnitTestCase {
private $tmpFiles=array(); private $tmpFiles=array();
function testStream(){ function testStream() {
$stream=$this->getStream('test1','w',strlen('foobar')); $stream=$this->getStream('test1','w',strlen('foobar'));
fwrite($stream,'foobar'); fwrite($stream,'foobar');
fclose($stream); fclose($stream);
@ -40,11 +40,11 @@ class Test_CryptStream extends UnitTestCase {
* @param int size * @param int size
* @return resource * @return resource
*/ */
function getStream($id,$mode,$size){ function getStream($id,$mode,$size) {
if($id===''){ if($id==='') {
$id=uniqid(); $id=uniqid();
} }
if(!isset($this->tmpFiles[$id])){ if(!isset($this->tmpFiles[$id])) {
$file=OCP\Files::tmpFile(); $file=OCP\Files::tmpFile();
$this->tmpFiles[$id]=$file; $this->tmpFiles[$id]=$file;
}else{ }else{
@ -55,7 +55,7 @@ class Test_CryptStream extends UnitTestCase {
return fopen('crypt://streams/'.$id,$mode); return fopen('crypt://streams/'.$id,$mode);
} }
function testBinary(){ function testBinary() {
$file=__DIR__.'/binary'; $file=__DIR__.'/binary';
$source=file_get_contents($file); $source=file_get_contents($file);

View File

@ -10,7 +10,7 @@ $(document).ready(function() {
var app_secret = $(this).find('.configuration [data-parameter="app_secret"]').val(); var app_secret = $(this).find('.configuration [data-parameter="app_secret"]').val();
var config = $(this).find('.configuration'); var config = $(this).find('.configuration');
if (app_key != '' && app_secret != '') { if (app_key != '' && app_secret != '') {
var pos = window.location.search.indexOf('oauth_token') + 12 var pos = window.location.search.indexOf('oauth_token') + 12;
var token = $(this).find('.configuration [data-parameter="token"]'); var token = $(this).find('.configuration [data-parameter="token"]');
if (pos != -1 && window.location.search.substr(pos, $(token).val().length) == $(token).val()) { if (pos != -1 && window.location.search.substr(pos, $(token).val().length) == $(token).val()) {
var token_secret = $(this).find('.configuration [data-parameter="token_secret"]'); var token_secret = $(this).find('.configuration [data-parameter="token_secret"]');
@ -73,7 +73,7 @@ $(document).ready(function() {
} }
}); });
} else { } else {
OC.dialogs.alert('Please provide a valid Dropbox app key and secret.', 'Error configuring Dropbox storage') OC.dialogs.alert('Please provide a valid Dropbox app key and secret.', 'Error configuring Dropbox storage');
} }
}); });

View File

@ -66,7 +66,7 @@ OC.MountConfig={
return true; return true;
} }
} }
} };
$(document).ready(function() { $(document).ready(function() {
$('.chzn-select').chosen(); $('.chzn-select').chosen();
@ -179,4 +179,4 @@ $(document).ready(function() {
} }
}); });
}); });

View File

@ -1,18 +1,18 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"External Storage" => "Externí úložiště", "External Storage" => "Externí úložiště",
"Mount point" => "Přípojný bod", "Mount point" => "Přípojný bod",
"Backend" => "Končící", "Backend" => "Podpůrná vrstva",
"Configuration" => "Konfigurace", "Configuration" => "Nastavení",
"Options" => "Nastavení", "Options" => "Možnosti",
"Applicable" => "Platný", "Applicable" => "Platný",
"Add mount point" => "Přidat přípojný bod", "Add mount point" => "Přidat bod připojení",
"None set" => "Nenastaveno", "None set" => "Nenastaveno",
"All Users" => "Všichni uživatelé", "All Users" => "Všichni uživatelé",
"Groups" => "Skupiny", "Groups" => "Skupiny",
"Users" => "Uživatelé", "Users" => "Uživatelé",
"Delete" => "Smazat", "Delete" => "Smazat",
"SSL root certificates" => "Kořenové SSL certifikáty", "SSL root certificates" => "Kořenové certifikáty SSL",
"Import Root Certificate" => "Import kořenového certifikátu", "Import Root Certificate" => "Importovat kořenového certifikátu",
"Enable User External Storage" => "Zapnout uživatelské externí úložiště", "Enable User External Storage" => "Zapnout externí uživatelské úložiště",
"Allow users to mount their own external storage" => "Povolit uživatelů připojit jejich vlastní externí úložiště" "Allow users to mount their own external storage" => "Povolit uživatelům připojení jejich vlastních externích úložišť"
); );

View File

@ -1,5 +1,6 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"External Storage" => "Almacenamiento externo", "External Storage" => "Almacenamiento externo",
"Mount point" => "Punto de montaje",
"Backend" => "Motor", "Backend" => "Motor",
"Configuration" => "Configuración", "Configuration" => "Configuración",
"Options" => "Opciones", "Options" => "Opciones",
@ -9,5 +10,9 @@
"All Users" => "Todos los usuarios", "All Users" => "Todos los usuarios",
"Groups" => "Grupos", "Groups" => "Grupos",
"Users" => "Usuarios", "Users" => "Usuarios",
"Delete" => "Eliiminar" "Delete" => "Eliiminar",
"SSL root certificates" => "Raíz de certificados SSL ",
"Import Root Certificate" => "Importar certificado raíz",
"Enable User External Storage" => "Habilitar almacenamiento de usuario externo",
"Allow users to mount their own external storage" => "Permitir a los usuarios montar su propio almacenamiento externo"
); );

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"External Storage" => "Kanpoko Biltegiratzea", "External Storage" => "Kanpoko Biltegiratzea",
"Mount point" => "Montatze puntua", "Mount point" => "Montatze puntua",
"Backend" => "Motorra",
"Configuration" => "Konfigurazioa", "Configuration" => "Konfigurazioa",
"Options" => "Aukerak", "Options" => "Aukerak",
"Add mount point" => "Gehitu muntatze puntua", "Add mount point" => "Gehitu muntatze puntua",

View File

@ -4,6 +4,7 @@
"Backend" => "Taustaosa", "Backend" => "Taustaosa",
"Configuration" => "Asetukset", "Configuration" => "Asetukset",
"Options" => "Valinnat", "Options" => "Valinnat",
"Applicable" => "Sovellettavissa",
"Add mount point" => "Lisää liitospiste", "Add mount point" => "Lisää liitospiste",
"None set" => "Ei asetettu", "None set" => "Ei asetettu",
"All Users" => "Kaikki käyttäjät", "All Users" => "Kaikki käyttäjät",
@ -12,5 +13,6 @@
"Delete" => "Poista", "Delete" => "Poista",
"SSL root certificates" => "SSL-juurivarmenteet", "SSL root certificates" => "SSL-juurivarmenteet",
"Import Root Certificate" => "Tuo juurivarmenne", "Import Root Certificate" => "Tuo juurivarmenne",
"Enable User External Storage" => "Ota käyttöön ulkopuoliset tallennuspaikat",
"Allow users to mount their own external storage" => "Salli käyttäjien liittää omia erillisiä tallennusvälineitä" "Allow users to mount their own external storage" => "Salli käyttäjien liittää omia erillisiä tallennusvälineitä"
); );

View File

@ -0,0 +1,13 @@
<?php $TRANSLATIONS = array(
"External Storage" => "אחסון חיצוני",
"Configuration" => "הגדרות",
"Options" => "אפשרויות",
"All Users" => "כל המשתמשים",
"Groups" => "קבוצות",
"Users" => "משתמשים",
"Delete" => "מחיקה",
"SSL root certificates" => "שורש אישורי אבטחת SSL ",
"Import Root Certificate" => "ייבוא אישור אבטחת שורש",
"Enable User External Storage" => "הפעלת אחסון חיצוני למשתמשים",
"Allow users to mount their own external storage" => "יאפשר למשתמשים לעגן את האחסון החיצוני שלהם"
);

View File

@ -11,8 +11,8 @@
"Groups" => "Gruppi", "Groups" => "Gruppi",
"Users" => "Utenti", "Users" => "Utenti",
"Delete" => "Elimina", "Delete" => "Elimina",
"SSL root certificates" => "Certificato principale per SSL", "SSL root certificates" => "Certificati SSL radice",
"Import Root Certificate" => "Importa certificato principale", "Import Root Certificate" => "Importa certificato radice",
"Enable User External Storage" => "Abilita la memoria esterna dell'utente", "Enable User External Storage" => "Abilita la memoria esterna dell'utente",
"Allow users to mount their own external storage" => "Consente agli utenti di montare la propria memoria esterna" "Allow users to mount their own external storage" => "Consenti agli utenti di montare la propria memoria esterna"
); );

View File

@ -0,0 +1,18 @@
<?php $TRANSLATIONS = array(
"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 užívatelia",
"Groups" => "Skupiny",
"Users" => "Užívatelia",
"Delete" => "Odstrániť",
"SSL root certificates" => "Koreňové SSL certifikáty",
"Import Root Certificate" => "Importovať koreňový certifikát",
"Enable User External Storage" => "Povoliť externé úložisko",
"Allow users to mount their own external storage" => "Povoliť užívateľom pripojiť ich vlastné externé úložisko"
);

View File

@ -1,283 +1,281 @@
<?php <?php
/** /**
* ownCloud * ownCloud
* *
* @author Michael Gapczynski * @author Michael Gapczynski
* @copyright 2012 Michael Gapczynski mtgap@owncloud.com * @copyright 2012 Michael Gapczynski mtgap@owncloud.com
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
* version 3 of the License, or any later version. * version 3 of the License, or any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
* *
* You should have received a copy of the GNU Affero General Public * 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/>. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/ */
/** /**
* Class to configure the config/mount.php and data/$user/mount.php files * Class to configure the config/mount.php and data/$user/mount.php files
*/ */
class OC_Mount_Config { class OC_Mount_Config {
const MOUNT_TYPE_GLOBAL = 'global'; const MOUNT_TYPE_GLOBAL = 'global';
const MOUNT_TYPE_GROUP = 'group'; const MOUNT_TYPE_GROUP = 'group';
const MOUNT_TYPE_USER = 'user'; const MOUNT_TYPE_USER = 'user';
/** /**
* Get details on each of the external storage backends, used for the mount config UI * Get details on each of the external storage backends, used for the mount config UI
* If a custom UI is needed, add the key 'custom' and a javascript file with that name will be loaded * If a custom UI is needed, add the key 'custom' and a javascript file with that name will be loaded
* If the configuration parameter should be secret, add a '*' to the beginning of the value * If the configuration parameter should be secret, add a '*' to the beginning of the value
* If the configuration parameter is a boolean, add a '!' to the beginning of the value * If the configuration parameter is a boolean, add a '!' to the beginning of the value
* If the configuration parameter is optional, add a '&' to the beginning of the value * If the configuration parameter is optional, add a '&' to the beginning of the value
* If the configuration parameter is hidden, add a '#' to the begining of the value * If the configuration parameter is hidden, add a '#' to the begining of the value
* @return array * @return array
*/ */
public static function getBackends() { public static function getBackends() {
return array( return array(
'OC_Filestorage_Local' => array('backend' => 'Local', 'configuration' => array('datadir' => 'Location')), 'OC_Filestorage_Local' => array('backend' => 'Local', 'configuration' => array('datadir' => 'Location')),
'OC_Filestorage_AmazonS3' => array('backend' => 'Amazon S3', 'configuration' => array('key' => 'Key', 'secret' => '*Secret', 'bucket' => 'Bucket')), 'OC_Filestorage_AmazonS3' => array('backend' => 'Amazon S3', 'configuration' => array('key' => 'Key', 'secret' => '*Secret', 'bucket' => 'Bucket')),
'OC_Filestorage_Dropbox' => array('backend' => 'Dropbox', 'configuration' => array('configured' => '#configured','app_key' => 'App key', 'app_secret' => 'App secret', 'token' => '#token', 'token_secret' => '#token_secret'), 'custom' => 'dropbox'), 'OC_Filestorage_Dropbox' => array('backend' => 'Dropbox', 'configuration' => array('configured' => '#configured','app_key' => 'App key', 'app_secret' => 'App secret', 'token' => '#token', 'token_secret' => '#token_secret'), 'custom' => 'dropbox'),
'OC_Filestorage_FTP' => array('backend' => 'FTP', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root', 'secure' => '!Secure ftps://')), 'OC_Filestorage_FTP' => array('backend' => 'FTP', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root', 'secure' => '!Secure ftps://')),
'OC_Filestorage_Google' => array('backend' => 'Google Drive', 'configuration' => array('configured' => '#configured', 'token' => '#token', 'token_secret' => '#token secret'), 'custom' => 'google'), 'OC_Filestorage_Google' => array('backend' => 'Google Drive', 'configuration' => array('configured' => '#configured', 'token' => '#token', 'token_secret' => '#token secret'), 'custom' => 'google'),
'OC_Filestorage_SWIFT' => array('backend' => 'OpenStack Swift', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'token' => '*Token', 'root' => '&Root', 'secure' => '!Secure ftps://')), 'OC_Filestorage_SWIFT' => array('backend' => 'OpenStack Swift', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'token' => '*Token', 'root' => '&Root', 'secure' => '!Secure ftps://')),
'OC_Filestorage_SMB' => array('backend' => 'SMB', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'share' => 'Share', 'root' => '&Root')), 'OC_Filestorage_SMB' => array('backend' => 'SMB', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'share' => 'Share', 'root' => '&Root')),
'OC_Filestorage_DAV' => array('backend' => 'WebDAV', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root', 'secure' => '!Secure https://')) 'OC_Filestorage_DAV' => array('backend' => 'WebDAV', 'configuration' => array('host' => 'URL', 'user' => 'Username', 'password' => '*Password', 'root' => '&Root', 'secure' => '!Secure https://'))
); );
} }
/** /**
* Get the system mount points * Get the system mount points
* The returned array is not in the same format as getUserMountPoints() * The returned array is not in the same format as getUserMountPoints()
* @return array * @return array
*/ */
public static function getSystemMountPoints() { public static function getSystemMountPoints() {
$mountPoints = self::readData(false); $mountPoints = self::readData(false);
$backends = self::getBackends(); $backends = self::getBackends();
$system = array(); $system = array();
if (isset($mountPoints[self::MOUNT_TYPE_GROUP])) { if (isset($mountPoints[self::MOUNT_TYPE_GROUP])) {
foreach ($mountPoints[self::MOUNT_TYPE_GROUP] as $group => $mounts) { foreach ($mountPoints[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
foreach ($mounts as $mountPoint => $mount) { foreach ($mounts as $mountPoint => $mount) {
// Remove '/$user/files/' from mount point // Remove '/$user/files/' from mount point
$mountPoint = substr($mountPoint, 13); $mountPoint = substr($mountPoint, 13);
// Merge the mount point into the current mount points // Merge the mount point into the current mount points
if (isset($system[$mountPoint]) && $system[$mountPoint]['configuration'] == $mount['options']) { if (isset($system[$mountPoint]) && $system[$mountPoint]['configuration'] == $mount['options']) {
$system[$mountPoint]['applicable']['groups'] = array_merge($system[$mountPoint]['applicable']['groups'], array($group)); $system[$mountPoint]['applicable']['groups'] = array_merge($system[$mountPoint]['applicable']['groups'], array($group));
} else { } else {
$system[$mountPoint] = array('class' => $mount['class'], 'backend' => $backends[$mount['class']]['backend'], 'configuration' => $mount['options'], 'applicable' => array('groups' => array($group), 'users' => array())); $system[$mountPoint] = array('class' => $mount['class'], 'backend' => $backends[$mount['class']]['backend'], 'configuration' => $mount['options'], 'applicable' => array('groups' => array($group), 'users' => array()));
} }
} }
} }
} }
if (isset($mountPoints[self::MOUNT_TYPE_USER])) { if (isset($mountPoints[self::MOUNT_TYPE_USER])) {
foreach ($mountPoints[self::MOUNT_TYPE_USER] as $user => $mounts) { foreach ($mountPoints[self::MOUNT_TYPE_USER] as $user => $mounts) {
foreach ($mounts as $mountPoint => $mount) { foreach ($mounts as $mountPoint => $mount) {
// Remove '/$user/files/' from mount point // Remove '/$user/files/' from mount point
$mountPoint = substr($mountPoint, 13); $mountPoint = substr($mountPoint, 13);
// Merge the mount point into the current mount points // Merge the mount point into the current mount points
if (isset($system[$mountPoint]) && $system[$mountPoint]['configuration'] == $mount['options']) { if (isset($system[$mountPoint]) && $system[$mountPoint]['configuration'] == $mount['options']) {
$system[$mountPoint]['applicable']['users'] = array_merge($system[$mountPoint]['applicable']['users'], array($user)); $system[$mountPoint]['applicable']['users'] = array_merge($system[$mountPoint]['applicable']['users'], array($user));
} else { } else {
$system[$mountPoint] = array('class' => $mount['class'], 'backend' => $backends[$mount['class']]['backend'], 'configuration' => $mount['options'], 'applicable' => array('groups' => array(), 'users' => array($user))); $system[$mountPoint] = array('class' => $mount['class'], 'backend' => $backends[$mount['class']]['backend'], 'configuration' => $mount['options'], 'applicable' => array('groups' => array(), 'users' => array($user)));
} }
} }
} }
} }
return $system; return $system;
} }
/** /**
* Get the personal mount points of the current user * Get the personal mount points of the current user
* The returned array is not in the same format as getUserMountPoints() * The returned array is not in the same format as getUserMountPoints()
* @return array * @return array
*/ */
public static function getPersonalMountPoints() { public static function getPersonalMountPoints() {
$mountPoints = self::readData(true); $mountPoints = self::readData(true);
$backends = self::getBackends(); $backends = self::getBackends();
$uid = OCP\User::getUser(); $uid = OCP\User::getUser();
$personal = array(); $personal = array();
if (isset($mountPoints[self::MOUNT_TYPE_USER][$uid])) { if (isset($mountPoints[self::MOUNT_TYPE_USER][$uid])) {
foreach ($mountPoints[self::MOUNT_TYPE_USER][$uid] as $mountPoint => $mount) { foreach ($mountPoints[self::MOUNT_TYPE_USER][$uid] as $mountPoint => $mount) {
// Remove '/uid/files/' from mount point // 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']);
} }
} }
return $personal; return $personal;
} }
/** /**
* Add a mount point to the filesystem * Add a mount point to the filesystem
* @param string Mount point * @param string Mount point
* @param string Backend class * @param string Backend class
* @param array Backend parameters for the class * @param array Backend parameters for the class
* @param string MOUNT_TYPE_GROUP | MOUNT_TYPE_USER * @param string MOUNT_TYPE_GROUP | MOUNT_TYPE_USER
* @param string User or group to apply mount to * @param string User or group to apply mount to
* @param bool Personal or system mount point i.e. is this being called from the personal or admin page * @param bool Personal or system mount point i.e. is this being called from the personal or admin page
* @return bool * @return bool
*/ */
public static function addMountPoint($mountPoint, $class, $classOptions, $mountType, $applicable, $isPersonal = false) { public static function addMountPoint($mountPoint, $class, $classOptions, $mountType, $applicable, $isPersonal = false) {
if ($isPersonal) { if ($isPersonal) {
// Verify that the mount point applies for the current user // Verify that the mount point applies for the current user
// Prevent non-admin users from mounting local storage // Prevent non-admin users from mounting local storage
if ($applicable != OCP\User::getUser() || $class == 'OC_Filestorage_Local') { if ($applicable != OCP\User::getUser() || $class == 'OC_Filestorage_Local') {
return false; return false;
} }
$mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/'); $mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/');
} else { } else {
$mountPoint = '/$user/files/'.ltrim($mountPoint, '/'); $mountPoint = '/$user/files/'.ltrim($mountPoint, '/');
} }
$mount = array($applicable => array($mountPoint => array('class' => $class, 'options' => $classOptions))); $mount = array($applicable => array($mountPoint => array('class' => $class, 'options' => $classOptions)));
$mountPoints = self::readData($isPersonal); $mountPoints = self::readData($isPersonal);
// Merge the new mount point into the current mount points // Merge the new mount point into the current mount points
if (isset($mountPoints[$mountType])) { if (isset($mountPoints[$mountType])) {
if (isset($mountPoints[$mountType][$applicable])) { if (isset($mountPoints[$mountType][$applicable])) {
$mountPoints[$mountType][$applicable] = array_merge($mountPoints[$mountType][$applicable], $mount[$applicable]); $mountPoints[$mountType][$applicable] = array_merge($mountPoints[$mountType][$applicable], $mount[$applicable]);
} else { } else {
$mountPoints[$mountType] = array_merge($mountPoints[$mountType], $mount); $mountPoints[$mountType] = array_merge($mountPoints[$mountType], $mount);
} }
} else { } else {
$mountPoints[$mountType] = $mount; $mountPoints[$mountType] = $mount;
} }
self::writeData($isPersonal, $mountPoints); self::writeData($isPersonal, $mountPoints);
return true; return true;
} }
/** /**
* *
* @param string Mount point * @param string Mount point
* @param string MOUNT_TYPE_GROUP | MOUNT_TYPE_USER * @param string MOUNT_TYPE_GROUP | MOUNT_TYPE_USER
* @param string User or group to remove mount from * @param string User or group to remove mount from
* @param bool Personal or system mount point * @param bool Personal or system mount point
* @return bool * @return bool
*/ */
public static function removeMountPoint($mountPoint, $mountType, $applicable, $isPersonal = false) { public static function removeMountPoint($mountPoint, $mountType, $applicable, $isPersonal = false) {
// Verify that the mount point applies for the current user // Verify that the mount point applies for the current user
if ($isPersonal) { if ($isPersonal) {
if ($applicable != OCP\User::getUser()) { if ($applicable != OCP\User::getUser()) {
return false; return false;
} }
$mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/'); $mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/');
} else { } else {
$mountPoint = '/$user/files/'.ltrim($mountPoint, '/'); $mountPoint = '/$user/files/'.ltrim($mountPoint, '/');
} }
$mountPoints = self::readData($isPersonal); $mountPoints = self::readData($isPersonal);
// Remove mount point // Remove mount point
unset($mountPoints[$mountType][$applicable][$mountPoint]); unset($mountPoints[$mountType][$applicable][$mountPoint]);
// Unset parent arrays if empty // Unset parent arrays if empty
if (empty($mountPoints[$mountType][$applicable])) { if (empty($mountPoints[$mountType][$applicable])) {
unset($mountPoints[$mountType][$applicable]); unset($mountPoints[$mountType][$applicable]);
if (empty($mountPoints[$mountType])) { if (empty($mountPoints[$mountType])) {
unset($mountPoints[$mountType]); unset($mountPoints[$mountType]);
} }
} }
self::writeData($isPersonal, $mountPoints); self::writeData($isPersonal, $mountPoints);
return true; return true;
} }
/** /**
* Read the mount points in the config file into an array * Read the mount points in the config file into an array
* @param bool Personal or system config file * @param bool Personal or system config file
* @return array * @return array
*/ */
private static function readData($isPersonal) { private static function readData($isPersonal) {
if ($isPersonal) { if ($isPersonal) {
$file = OC::$SERVERROOT.'/data/'.OCP\User::getUser().'/mount.php'; $file = OC_User::getHome(OCP\User::getUser()).'/mount.php';
} else { } else {
$file = OC::$SERVERROOT.'/config/mount.php'; $file = OC::$SERVERROOT.'/config/mount.php';
} }
if (is_file($file)) { if (is_file($file)) {
$mountPoints = include($file); $mountPoints = include($file);
if (is_array($mountPoints)) { if (is_array($mountPoints)) {
return $mountPoints; return $mountPoints;
} }
} }
return array(); return array();
} }
/** /**
* Write the mount points to the config file * Write the mount points to the config file
* @param bool Personal or system config file * @param bool Personal or system config file
* @param array Mount points * @param array Mount points
*/ */
private static function writeData($isPersonal, $data) { private static function writeData($isPersonal, $data) {
if ($isPersonal) { if ($isPersonal) {
$file = OC::$SERVERROOT.'/data/'.OCP\User::getUser().'/mount.php'; $file = OC_User::getHome(OCP\User::getUser()).'/mount.php';
} else { } else {
$file = OC::$SERVERROOT.'/config/mount.php'; $file = OC::$SERVERROOT.'/config/mount.php';
} }
$content = "<?php return array (\n"; $content = "<?php return array (\n";
if (isset($data[self::MOUNT_TYPE_GROUP])) { if (isset($data[self::MOUNT_TYPE_GROUP])) {
$content .= "\t'group' => array (\n"; $content .= "\t'group' => array (\n";
foreach ($data[self::MOUNT_TYPE_GROUP] as $group => $mounts) { foreach ($data[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
$content .= "\t\t'".$group."' => array (\n"; $content .= "\t\t'".$group."' => array (\n";
foreach ($mounts as $mountPoint => $mount) { foreach ($mounts as $mountPoint => $mount) {
$content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).",\n"; $content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
} }
$content .= "\t\t),\n"; $content .= "\t\t),\n";
} }
$content .= "\t),\n"; $content .= "\t),\n";
} }
if (isset($data[self::MOUNT_TYPE_USER])) { if (isset($data[self::MOUNT_TYPE_USER])) {
$content .= "\t'user' => array (\n"; $content .= "\t'user' => array (\n";
foreach ($data[self::MOUNT_TYPE_USER] as $user => $mounts) { foreach ($data[self::MOUNT_TYPE_USER] as $user => $mounts) {
$content .= "\t\t'".$user."' => array (\n"; $content .= "\t\t'".$user."' => array (\n";
foreach ($mounts as $mountPoint => $mount) { foreach ($mounts as $mountPoint => $mount) {
$content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).",\n"; $content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
} }
$content .= "\t\t),\n"; $content .= "\t\t),\n";
} }
$content .= "\t),\n"; $content .= "\t),\n";
} }
$content .= ");\n?>"; $content .= ");\n?>";
@file_put_contents($file, $content); @file_put_contents($file, $content);
} }
/** /**
* Returns all user uploaded ssl root certificates * Returns all user uploaded ssl root certificates
* @return array * @return array
*/ */
public static function getCertificates() { public static function getCertificates() {
$view = \OCP\Files::getStorage('files_external'); $view = \OCP\Files::getStorage('files_external');
$path=\OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath("").'uploads/'; $path=\OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath("").'uploads/';
if (!is_dir($path)) mkdir($path); if (!is_dir($path)) mkdir($path);
$result = array(); $result = array();
$handle = opendir($path); $handle = opendir($path);
while (false !== ($file = readdir($handle))) { while (false !== ($file = readdir($handle))) {
if($file != '.' && $file != '..') $result[] = $file; if($file != '.' && $file != '..') $result[] = $file;
} }
return $result; return $result;
} }
/** /**
* creates certificate bundle * creates certificate bundle
*/ */
public static function createCertificateBundle() { public static function createCertificateBundle() {
$view = \OCP\Files::getStorage("files_external"); $view = \OCP\Files::getStorage("files_external");
$path = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath(""); $path = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath("");
$certs = OC_Mount_Config::getCertificates(); $certs = OC_Mount_Config::getCertificates();
$fh_certs = fopen($path."/rootcerts.crt", 'w'); $fh_certs = fopen($path."/rootcerts.crt", 'w');
foreach ($certs as $cert) { foreach ($certs as $cert) {
$file=$path.'/uploads/'.$cert; $file=$path.'/uploads/'.$cert;
$fh = fopen($file, "r"); $fh = fopen($file, "r");
$data = fread($fh, filesize($file)); $data = fread($fh, filesize($file));
fclose($fh); fclose($fh);
if (strpos($data, 'BEGIN CERTIFICATE')) { if (strpos($data, 'BEGIN CERTIFICATE')) {
fwrite($fh_certs, $data); fwrite($fh_certs, $data);
} }
} }
fclose($fh_certs); fclose($fh_certs);
return true; return true;
} }
} }
?>

View File

@ -15,13 +15,13 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
private static $tempFiles=array(); private static $tempFiles=array();
public function __construct($params){ public function __construct($params) {
$this->host=$params['host']; $this->host=$params['host'];
$this->user=$params['user']; $this->user=$params['user'];
$this->password=$params['password']; $this->password=$params['password'];
$this->secure=isset($params['secure'])?(bool)$params['secure']:false; $this->secure=isset($params['secure'])?(bool)$params['secure']:false;
$this->root=isset($params['root'])?$params['root']:'/'; $this->root=isset($params['root'])?$params['root']:'/';
if(!$this->root || $this->root[0]!='/'){ if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root; $this->root='/'.$this->root;
} }
//create the root folder if necesary //create the root folder if necesary
@ -35,16 +35,16 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
* @param string path * @param string path
* @return string * @return string
*/ */
public function constructUrl($path){ public function constructUrl($path) {
$url='ftp'; $url='ftp';
if($this->secure){ if($this->secure) {
$url.='s'; $url.='s';
} }
$url.='://'.$this->user.':'.$this->password.'@'.$this->host.$this->root.$path; $url.='://'.$this->user.':'.$this->password.'@'.$this->host.$this->root.$path;
return $url; return $url;
} }
public function fopen($path,$mode){ public function fopen($path,$mode) {
switch($mode){ switch($mode) {
case 'r': case 'r':
case 'rb': case 'rb':
case 'w': case 'w':
@ -63,14 +63,14 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
case 'c': case 'c':
case 'c+': case 'c+':
//emulate these //emulate these
if(strrpos($path,'.')!==false){ if(strrpos($path,'.')!==false) {
$ext=substr($path,strrpos($path,'.')); $ext=substr($path,strrpos($path,'.'));
}else{ }else{
$ext=''; $ext='';
} }
$tmpFile=OCP\Files::tmpFile($ext); $tmpFile=OCP\Files::tmpFile($ext);
OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack'); OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
if($this->file_exists($path)){ if($this->file_exists($path)) {
$this->getFile($path,$tmpFile); $this->getFile($path,$tmpFile);
} }
self::$tempFiles[$tmpFile]=$path; self::$tempFiles[$tmpFile]=$path;
@ -78,8 +78,8 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
} }
} }
public function writeBack($tmpFile){ public function writeBack($tmpFile) {
if(isset(self::$tempFiles[$tmpFile])){ if(isset(self::$tempFiles[$tmpFile])) {
$this->uploadFile($tmpFile,self::$tempFiles[$tmpFile]); $this->uploadFile($tmpFile,self::$tempFiles[$tmpFile]);
unlink($tmpFile); unlink($tmpFile);
} }

View File

@ -6,7 +6,7 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
require_once('smb4php/smb.php'); require_once 'smb4php/smb.php';
class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
private $password; private $password;
@ -15,40 +15,40 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
private $root; private $root;
private $share; private $share;
public function __construct($params){ public function __construct($params) {
$this->host=$params['host']; $this->host=$params['host'];
$this->user=$params['user']; $this->user=$params['user'];
$this->password=$params['password']; $this->password=$params['password'];
$this->share=$params['share']; $this->share=$params['share'];
$this->root=isset($params['root'])?$params['root']:'/'; $this->root=isset($params['root'])?$params['root']:'/';
if(!$this->root || $this->root[0]!='/'){ if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root; $this->root='/'.$this->root;
} }
if(substr($this->root,-1,1)!='/'){ if(substr($this->root,-1,1)!='/') {
$this->root.='/'; $this->root.='/';
} }
if(!$this->share || $this->share[0]!='/'){ if(!$this->share || $this->share[0]!='/') {
$this->share='/'.$this->share; $this->share='/'.$this->share;
} }
if(substr($this->share,-1,1)=='/'){ if(substr($this->share,-1,1)=='/') {
$this->share=substr($this->share,0,-1); $this->share=substr($this->share,0,-1);
} }
//create the root folder if necesary //create the root folder if necesary
if(!$this->is_dir('')){ if(!$this->is_dir('')) {
$this->mkdir(''); $this->mkdir('');
} }
} }
public function constructUrl($path){ public function constructUrl($path) {
if(substr($path,-1)=='/'){ if(substr($path,-1)=='/') {
$path=substr($path,0,-1); $path=substr($path,0,-1);
} }
return 'smb://'.$this->user.':'.$this->password.'@'.$this->host.$this->share.$this->root.$path; return 'smb://'.$this->user.':'.$this->password.'@'.$this->host.$this->share.$this->root.$path;
} }
public function stat($path){ public function stat($path) {
if(!$path and $this->root=='/'){//mtime doesn't work for shares if(!$path and $this->root=='/') {//mtime doesn't work for shares
$mtime=$this->shareMTime(); $mtime=$this->shareMTime();
$stat=stat($this->constructUrl($path)); $stat=stat($this->constructUrl($path));
$stat['mtime']=$mtime; $stat['mtime']=$mtime;
@ -58,7 +58,7 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
} }
} }
public function filetype($path){ public function filetype($path) {
return (bool)@$this->opendir($path);//using opendir causes the same amount of requests and caches the content of the folder in one go return (bool)@$this->opendir($path);//using opendir causes the same amount of requests and caches the content of the folder in one go
} }
@ -67,8 +67,8 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
* @param int $time * @param int $time
* @return bool * @return bool
*/ */
public function hasUpdated($path,$time){ public function hasUpdated($path,$time) {
if(!$path and $this->root=='/'){ if(!$path and $this->root=='/') {
//mtime doesn't work for shares, but giving the nature of the backend, doing a full update is still just fast enough //mtime doesn't work for shares, but giving the nature of the backend, doing a full update is still just fast enough
return true; return true;
}else{ }else{
@ -80,13 +80,13 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
/** /**
* get the best guess for the modification time of the share * get the best guess for the modification time of the share
*/ */
private function shareMTime(){ private function shareMTime() {
$dh=$this->opendir(''); $dh=$this->opendir('');
$lastCtime=0; $lastCtime=0;
while($file=readdir($dh)){ while($file=readdir($dh)) {
if($file!='.' and $file!='..'){ if($file!='.' and $file!='..') {
$ctime=$this->filemtime($file); $ctime=$this->filemtime($file);
if($ctime>$lastCtime){ if($ctime>$lastCtime) {
$lastCtime=$ctime; $lastCtime=$ctime;
} }
} }

View File

@ -10,12 +10,12 @@
abstract class OC_FileStorage_StreamWrapper extends OC_Filestorage_Common{ abstract class OC_FileStorage_StreamWrapper extends OC_Filestorage_Common{
abstract public function constructUrl($path); abstract public function constructUrl($path);
public function mkdir($path){ public function mkdir($path) {
return mkdir($this->constructUrl($path)); return mkdir($this->constructUrl($path));
} }
public function rmdir($path){ public function rmdir($path) {
if($this->file_exists($path)){ if($this->file_exists($path)) {
$succes=rmdir($this->constructUrl($path)); $succes=rmdir($this->constructUrl($path));
clearstatcache(); clearstatcache();
return $succes; return $succes;
@ -24,42 +24,42 @@ abstract class OC_FileStorage_StreamWrapper extends OC_Filestorage_Common{
} }
} }
public function opendir($path){ public function opendir($path) {
return opendir($this->constructUrl($path)); return opendir($this->constructUrl($path));
} }
public function filetype($path){ public function filetype($path) {
return filetype($this->constructUrl($path)); return filetype($this->constructUrl($path));
} }
public function isReadable($path){ public function isReadable($path) {
return true;//not properly supported return true;//not properly supported
} }
public function isUpdatable($path){ public function isUpdatable($path) {
return true;//not properly supported return true;//not properly supported
} }
public function file_exists($path){ public function file_exists($path) {
return file_exists($this->constructUrl($path)); return file_exists($this->constructUrl($path));
} }
public function unlink($path){ public function unlink($path) {
$succes=unlink($this->constructUrl($path)); $succes=unlink($this->constructUrl($path));
clearstatcache(); clearstatcache();
return $succes; return $succes;
} }
public function fopen($path,$mode){ public function fopen($path,$mode) {
return fopen($this->constructUrl($path),$mode); return fopen($this->constructUrl($path),$mode);
} }
public function free_space($path){ public function free_space($path) {
return 0; return 0;
} }
public function touch($path,$mtime=null){ public function touch($path,$mtime=null) {
if(is_null($mtime)){ if(is_null($mtime)) {
$fh=$this->fopen($path,'a'); $fh=$this->fopen($path,'a');
fwrite($fh,''); fwrite($fh,'');
fclose($fh); fclose($fh);
@ -68,19 +68,19 @@ abstract class OC_FileStorage_StreamWrapper extends OC_Filestorage_Common{
} }
} }
public function getFile($path,$target){ public function getFile($path,$target) {
return copy($this->constructUrl($path),$target); return copy($this->constructUrl($path),$target);
} }
public function uploadFile($path,$target){ public function uploadFile($path,$target) {
return copy($path,$this->constructUrl($target)); return copy($path,$this->constructUrl($target));
} }
public function rename($path1,$path2){ public function rename($path1,$path2) {
return rename($this->constructUrl($path1),$this->constructUrl($path2)); return rename($this->constructUrl($path1),$this->constructUrl($path2));
} }
public function stat($path){ public function stat($path) {
return stat($this->constructUrl($path)); return stat($this->constructUrl($path));
} }

View File

@ -6,7 +6,7 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
require_once('php-cloudfiles/cloudfiles.php'); require_once 'php-cloudfiles/cloudfiles.php';
class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
private $host; private $host;
@ -38,7 +38,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string path * @param string path
* @return string * @return string
*/ */
private function getContainerName($path){ private function getContainerName($path) {
$path=trim($this->root.$path,'/'); $path=trim($this->root.$path,'/');
return str_replace('/','\\',$path); return str_replace('/','\\',$path);
} }
@ -48,18 +48,18 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string path * @param string path
* @return CF_Container * @return CF_Container
*/ */
private function getContainer($path){ private function getContainer($path) {
if($path=='' or $path=='/'){ if($path=='' or $path=='/') {
return $this->rootContainer; return $this->rootContainer;
} }
if(isset($this->containers[$path])){ if(isset($this->containers[$path])) {
return $this->containers[$path]; return $this->containers[$path];
} }
try{ try{
$container=$this->conn->get_container($this->getContainerName($path)); $container=$this->conn->get_container($this->getContainerName($path));
$this->containers[$path]=$container; $this->containers[$path]=$container;
return $container; return $container;
}catch(NoSuchContainerException $e){ }catch(NoSuchContainerException $e) {
return null; return null;
} }
} }
@ -69,15 +69,15 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string path * @param string path
* @return CF_Container * @return CF_Container
*/ */
private function createContainer($path){ private function createContainer($path) {
if($path=='' or $path=='/'){ if($path=='' or $path=='/') {
return $this->conn->create_container($this->getContainerName($path)); return $this->conn->create_container($this->getContainerName($path));
} }
$parent=dirname($path); $parent=dirname($path);
if($parent=='' or $parent=='/'){ if($parent=='' or $parent=='/') {
$parentContainer=$this->rootContainer; $parentContainer=$this->rootContainer;
}else{ }else{
if(!$this->containerExists($parent)){ if(!$this->containerExists($parent)) {
$parentContainer=$this->createContainer($parent); $parentContainer=$this->createContainer($parent);
}else{ }else{
$parentContainer=$this->getContainer($parent); $parentContainer=$this->getContainer($parent);
@ -92,19 +92,19 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string path * @param string path
* @return CF_Object * @return CF_Object
*/ */
private function getObject($path){ private function getObject($path) {
if(isset($this->objects[$path])){ if(isset($this->objects[$path])) {
return $this->objects[$path]; return $this->objects[$path];
} }
$container=$this->getContainer(dirname($path)); $container=$this->getContainer(dirname($path));
if(is_null($container)){ if(is_null($container)) {
return null; return null;
}else{ }else{
try{ try{
$obj=$container->get_object(basename($path)); $obj=$container->get_object(basename($path));
$this->objects[$path]=$obj; $this->objects[$path]=$obj;
return $obj; return $obj;
}catch(NoSuchObjectException $e){ }catch(NoSuchObjectException $e) {
return null; return null;
} }
} }
@ -115,12 +115,12 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param CF_Container * @param CF_Container
* @return array * @return array
*/ */
private function getObjects($container){ private function getObjects($container) {
if(is_null($container)){ if(is_null($container)) {
return array(); return array();
}else{ }else{
$files=$container->get_objects(); $files=$container->get_objects();
foreach($files as &$file){ foreach($files as &$file) {
$file=$file->name; $file=$file->name;
} }
return $files; return $files;
@ -132,9 +132,9 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string path * @param string path
* @return CF_Object * @return CF_Object
*/ */
private function createObject($path){ private function createObject($path) {
$container=$this->getContainer(dirname($path)); $container=$this->getContainer(dirname($path));
if(!is_null($container)){ if(!is_null($container)) {
$container=$this->createContainer($path); $container=$this->createContainer($path);
} }
return $container->create_object(basename($path)); return $container->create_object(basename($path));
@ -145,7 +145,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string * @param string
* @return bool * @return bool
*/ */
private function objectExists($path){ private function objectExists($path) {
return !is_null($this->getObject($path)); return !is_null($this->getObject($path));
} }
@ -154,7 +154,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string path * @param string path
* @return bool * @return bool
*/ */
private function containerExists($path){ private function containerExists($path) {
return !is_null($this->getContainer($path)); return !is_null($this->getContainer($path));
} }
@ -163,18 +163,18 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param CF_Container container * @param CF_Container container
* @return array * @return array
*/ */
private function getSubContainers($container){ private function getSubContainers($container) {
$tmpFile=OCP\Files::tmpFile(); $tmpFile=OCP\Files::tmpFile();
$obj=$this->getSubContainerFile($container); $obj=$this->getSubContainerFile($container);
try{ try{
$obj->save_to_filename($tmpFile); $obj->save_to_filename($tmpFile);
}catch(Exception $e){ }catch(Exception $e) {
return array(); return array();
} }
$obj->save_to_filename($tmpFile); $obj->save_to_filename($tmpFile);
$containers=file($tmpFile); $containers=file($tmpFile);
unlink($tmpFile); unlink($tmpFile);
foreach($containers as &$sub){ foreach($containers as &$sub) {
$sub=trim($sub); $sub=trim($sub);
} }
return $containers; return $containers;
@ -186,8 +186,8 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string name * @param string name
* @return bool * @return bool
*/ */
private function addSubContainer($container,$name){ private function addSubContainer($container,$name) {
if(!$name){ if(!$name) {
return false; return false;
} }
$tmpFile=OCP\Files::tmpFile(); $tmpFile=OCP\Files::tmpFile();
@ -195,17 +195,17 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
try{ try{
$obj->save_to_filename($tmpFile); $obj->save_to_filename($tmpFile);
$containers=file($tmpFile); $containers=file($tmpFile);
foreach($containers as &$sub){ foreach($containers as &$sub) {
$sub=trim($sub); $sub=trim($sub);
} }
if(array_search($name,$containers)!==false){ if(array_search($name,$containers)!==false) {
unlink($tmpFile); unlink($tmpFile);
return false; return false;
}else{ }else{
$fh=fopen($tmpFile,'a'); $fh=fopen($tmpFile,'a');
fwrite($fh,$name."\n"); fwrite($fh,$name."\n");
} }
}catch(Exception $e){ }catch(Exception $e) {
$containers=array(); $containers=array();
file_put_contents($tmpFile,$name."\n"); file_put_contents($tmpFile,$name."\n");
} }
@ -221,8 +221,8 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string name * @param string name
* @return bool * @return bool
*/ */
private function removeSubContainer($container,$name){ private function removeSubContainer($container,$name) {
if(!$name){ if(!$name) {
return false; return false;
} }
$tmpFile=OCP\Files::tmpFile(); $tmpFile=OCP\Files::tmpFile();
@ -230,14 +230,14 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
try{ try{
$obj->save_to_filename($tmpFile); $obj->save_to_filename($tmpFile);
$containers=file($tmpFile); $containers=file($tmpFile);
}catch(Exception $e){ }catch(Exception $e) {
return false; return false;
} }
foreach($containers as &$sub){ foreach($containers as &$sub) {
$sub=trim($sub); $sub=trim($sub);
} }
$i=array_search($name,$containers); $i=array_search($name,$containers);
if($i===false){ if($i===false) {
unlink($tmpFile); unlink($tmpFile);
return false; return false;
}else{ }else{
@ -255,21 +255,21 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param CF_Container container * @param CF_Container container
* @return CF_Object * @return CF_Object
*/ */
private function getSubContainerFile($container){ private function getSubContainerFile($container) {
try{ try{
return $container->get_object(self::SUBCONTAINER_FILE); return $container->get_object(self::SUBCONTAINER_FILE);
}catch(NoSuchObjectException $e){ }catch(NoSuchObjectException $e) {
return $container->create_object(self::SUBCONTAINER_FILE); return $container->create_object(self::SUBCONTAINER_FILE);
} }
} }
public function __construct($params){ public function __construct($params) {
$this->token=$params['token']; $this->token=$params['token'];
$this->host=$params['host']; $this->host=$params['host'];
$this->user=$params['user']; $this->user=$params['user'];
$this->root=isset($params['root'])?$params['root']:'/'; $this->root=isset($params['root'])?$params['root']:'/';
$this->secure=isset($params['secure'])?(bool)$params['secure']:true; $this->secure=isset($params['secure'])?(bool)$params['secure']:true;
if(!$this->root || $this->root[0]!='/'){ if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root; $this->root='/'.$this->root;
} }
$this->auth = new CF_Authentication($this->user, $this->token, null, $this->host); $this->auth = new CF_Authentication($this->user, $this->token, null, $this->host);
@ -277,7 +277,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
$this->conn = new CF_Connection($this->auth); $this->conn = new CF_Connection($this->auth);
if(!$this->containerExists($this->root)){ if(!$this->containerExists($this->root)) {
$this->rootContainer=$this->createContainer('/'); $this->rootContainer=$this->createContainer('/');
}else{ }else{
$this->rootContainer=$this->getContainer('/'); $this->rootContainer=$this->getContainer('/');
@ -285,8 +285,8 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
} }
public function mkdir($path){ public function mkdir($path) {
if($this->containerExists($path)){ if($this->containerExists($path)) {
return false; return false;
}else{ }else{
$this->createContainer($path); $this->createContainer($path);
@ -294,12 +294,12 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
} }
} }
public function rmdir($path){ public function rmdir($path) {
if(!$this->containerExists($path)){ if(!$this->containerExists($path)) {
return false; return false;
}else{ }else{
$this->emptyContainer($path); $this->emptyContainer($path);
if($path!='' and $path!='/'){ if($path!='' and $path!='/') {
$parentContainer=$this->getContainer(dirname($path)); $parentContainer=$this->getContainer(dirname($path));
$this->removeSubContainer($parentContainer,basename($path)); $this->removeSubContainer($parentContainer,basename($path));
} }
@ -310,14 +310,14 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
} }
} }
private function emptyContainer($path){ private function emptyContainer($path) {
$container=$this->getContainer($path); $container=$this->getContainer($path);
if(is_null($container)){ if(is_null($container)) {
return; return;
} }
$subContainers=$this->getSubContainers($container); $subContainers=$this->getSubContainers($container);
foreach($subContainers as $sub){ foreach($subContainers as $sub) {
if($sub){ if($sub) {
$this->emptyContainer($path.'/'.$sub); $this->emptyContainer($path.'/'.$sub);
$this->conn->delete_container($this->getContainerName($path.'/'.$sub)); $this->conn->delete_container($this->getContainerName($path.'/'.$sub));
unset($this->containers[$path.'/'.$sub]); unset($this->containers[$path.'/'.$sub]);
@ -325,17 +325,17 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
} }
$objects=$this->getObjects($container); $objects=$this->getObjects($container);
foreach($objects as $object){ foreach($objects as $object) {
$container->delete_object($object); $container->delete_object($object);
unset($this->objects[$path.'/'.$object]); unset($this->objects[$path.'/'.$object]);
} }
} }
public function opendir($path){ public function opendir($path) {
$container=$this->getContainer($path); $container=$this->getContainer($path);
$files=$this->getObjects($container); $files=$this->getObjects($container);
$i=array_search(self::SUBCONTAINER_FILE,$files); $i=array_search(self::SUBCONTAINER_FILE,$files);
if($i!==false){ if($i!==false) {
unset($files[$i]); unset($files[$i]);
} }
$subContainers=$this->getSubContainers($container); $subContainers=$this->getSubContainers($container);
@ -345,43 +345,43 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
return opendir('fakedir://'.$id); return opendir('fakedir://'.$id);
} }
public function filetype($path){ public function filetype($path) {
if($this->containerExists($path)){ if($this->containerExists($path)) {
return 'dir'; return 'dir';
}else{ }else{
return 'file'; return 'file';
} }
} }
public function isReadable($path){ public function isReadable($path) {
return true; return true;
} }
public function isUpdatable($path){ public function isUpdatable($path) {
return true; return true;
} }
public function file_exists($path){ public function file_exists($path) {
if($this->is_dir($path)){ if($this->is_dir($path)) {
return true; return true;
}else{ }else{
return $this->objectExists($path); return $this->objectExists($path);
} }
} }
public function file_get_contents($path){ public function file_get_contents($path) {
$obj=$this->getObject($path); $obj=$this->getObject($path);
if(is_null($obj)){ if(is_null($obj)) {
return false; return false;
} }
return $obj->read(); return $obj->read();
} }
public function file_put_contents($path,$content){ public function file_put_contents($path,$content) {
$obj=$this->getObject($path); $obj=$this->getObject($path);
if(is_null($obj)){ if(is_null($obj)) {
$container=$this->getContainer(dirname($path)); $container=$this->getContainer(dirname($path));
if(is_null($container)){ if(is_null($container)) {
return false; return false;
} }
$obj=$container->create_object(basename($path)); $obj=$container->create_object(basename($path));
@ -390,8 +390,8 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
return $obj->write($content); return $obj->write($content);
} }
public function unlink($path){ public function unlink($path) {
if($this->objectExists($path)){ if($this->objectExists($path)) {
$container=$this->getContainer(dirname($path)); $container=$this->getContainer(dirname($path));
$container->delete_object(basename($path)); $container->delete_object(basename($path));
unset($this->objects[$path]); unset($this->objects[$path]);
@ -400,12 +400,12 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
} }
} }
public function fopen($path,$mode){ public function fopen($path,$mode) {
$obj=$this->getObject($path); $obj=$this->getObject($path);
if(is_null($obj)){ if(is_null($obj)) {
return false; return false;
} }
switch($mode){ switch($mode) {
case 'r': case 'r':
case 'rb': case 'rb':
$fp = fopen('php://temp', 'r+'); $fp = fopen('php://temp', 'r+');
@ -432,23 +432,23 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
} }
} }
public function writeBack($tmpFile){ public function writeBack($tmpFile) {
if(isset(self::$tempFiles[$tmpFile])){ if(isset(self::$tempFiles[$tmpFile])) {
$this->fromTmpFile($tmpFile,self::$tempFiles[$tmpFile]); $this->fromTmpFile($tmpFile,self::$tempFiles[$tmpFile]);
unlink($tmpFile); unlink($tmpFile);
} }
} }
public function free_space($path){ public function free_space($path) {
return 0; return 0;
} }
public function touch($path,$mtime=null){ public function touch($path,$mtime=null) {
$obj=$this->getObject($path); $obj=$this->getObject($path);
if(is_null($obj)){ if(is_null($obj)) {
return false; return false;
} }
if(is_null($mtime)){ if(is_null($mtime)) {
$mtime=time(); $mtime=time();
} }
@ -457,36 +457,36 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
$obj->sync_metadata(); $obj->sync_metadata();
} }
public function rename($path1,$path2){ public function rename($path1,$path2) {
$sourceContainer=$this->getContainer(dirname($path1)); $sourceContainer=$this->getContainer(dirname($path1));
$targetContainer=$this->getContainer(dirname($path2)); $targetContainer=$this->getContainer(dirname($path2));
$result=$sourceContainer->move_object_to(basename($path1),$targetContainer,basename($path2)); $result=$sourceContainer->move_object_to(basename($path1),$targetContainer,basename($path2));
unset($this->objects[$path1]); unset($this->objects[$path1]);
if($result){ if($result) {
$targetObj=$this->getObject($path2); $targetObj=$this->getObject($path2);
$this->resetMTime($targetObj); $this->resetMTime($targetObj);
} }
return $result; return $result;
} }
public function copy($path1,$path2){ public function copy($path1,$path2) {
$sourceContainer=$this->getContainer(dirname($path1)); $sourceContainer=$this->getContainer(dirname($path1));
$targetContainer=$this->getContainer(dirname($path2)); $targetContainer=$this->getContainer(dirname($path2));
$result=$sourceContainer->copy_object_to(basename($path1),$targetContainer,basename($path2)); $result=$sourceContainer->copy_object_to(basename($path1),$targetContainer,basename($path2));
if($result){ if($result) {
$targetObj=$this->getObject($path2); $targetObj=$this->getObject($path2);
$this->resetMTime($targetObj); $this->resetMTime($targetObj);
} }
return $result; return $result;
} }
public function stat($path){ public function stat($path) {
$obj=$this->getObject($path); $obj=$this->getObject($path);
if(is_null($obj)){ if(is_null($obj)) {
return false; return false;
} }
if(isset($obj->metadata['Mtime']) and $obj->metadata['Mtime']>-1){ if(isset($obj->metadata['Mtime']) and $obj->metadata['Mtime']>-1) {
$mtime=$obj->metadata['Mtime']; $mtime=$obj->metadata['Mtime'];
}else{ }else{
$mtime=strtotime($obj->last_modified); $mtime=strtotime($obj->last_modified);
@ -498,9 +498,9 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
); );
} }
private function getTmpFile($path){ private function getTmpFile($path) {
$obj=$this->getObject($path); $obj=$this->getObject($path);
if(!is_null($obj)){ if(!is_null($obj)) {
$tmpFile=OCP\Files::tmpFile(); $tmpFile=OCP\Files::tmpFile();
$obj->save_to_filename($tmpFile); $obj->save_to_filename($tmpFile);
return $tmpFile; return $tmpFile;
@ -509,9 +509,9 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
} }
} }
private function fromTmpFile($tmpFile,$path){ private function fromTmpFile($tmpFile,$path) {
$obj=$this->getObject($path); $obj=$this->getObject($path);
if(is_null($obj)){ if(is_null($obj)) {
$obj=$this->createObject($path); $obj=$this->createObject($path);
} }
$obj->load_from_filename($tmpFile); $obj->load_from_filename($tmpFile);
@ -522,8 +522,8 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* remove custom mtime metadata * remove custom mtime metadata
* @param CF_Object obj * @param CF_Object obj
*/ */
private function resetMTime($obj){ private function resetMTime($obj) {
if(isset($obj->metadata['Mtime'])){ if(isset($obj->metadata['Mtime'])) {
$obj->metadata['Mtime']=-1; $obj->metadata['Mtime']=-1;
$obj->sync_metadata(); $obj->sync_metadata();
} }

View File

@ -19,7 +19,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
private static $tempFiles=array(); private static $tempFiles=array();
public function __construct($params){ public function __construct($params) {
$host = $params['host']; $host = $params['host'];
//remove leading http[s], will be generated in createBaseUri() //remove leading http[s], will be generated in createBaseUri()
if (substr($host,0,8) == "https://") $host = substr($host, 8); if (substr($host,0,8) == "https://") $host = substr($host, 8);
@ -29,10 +29,10 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
$this->password=$params['password']; $this->password=$params['password'];
$this->secure=(isset($params['secure']) && $params['secure'] == 'true')?true:false; $this->secure=(isset($params['secure']) && $params['secure'] == 'true')?true:false;
$this->root=isset($params['root'])?$params['root']:'/'; $this->root=isset($params['root'])?$params['root']:'/';
if(!$this->root || $this->root[0]!='/'){ if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root; $this->root='/'.$this->root;
} }
if(substr($this->root,-1,1)!='/'){ if(substr($this->root,-1,1)!='/') {
$this->root.='/'; $this->root.='/';
} }
@ -54,26 +54,26 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
$this->mkdir(''); $this->mkdir('');
} }
private function createBaseUri(){ private function createBaseUri() {
$baseUri='http'; $baseUri='http';
if($this->secure){ if($this->secure) {
$baseUri.='s'; $baseUri.='s';
} }
$baseUri.='://'.$this->host.$this->root; $baseUri.='://'.$this->host.$this->root;
return $baseUri; return $baseUri;
} }
public function mkdir($path){ public function mkdir($path) {
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
return $this->simpleResponse('MKCOL',$path,null,201); return $this->simpleResponse('MKCOL',$path,null,201);
} }
public function rmdir($path){ public function rmdir($path) {
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
return $this->simpleResponse('DELETE',$path,null,204); return $this->simpleResponse('DELETE',$path,null,204);
} }
public function opendir($path){ public function opendir($path) {
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
try{ try{
$response=$this->client->propfind($path, array(),1); $response=$this->client->propfind($path, array(),1);
@ -81,54 +81,54 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
OC_FakeDirStream::$dirs[$id]=array(); OC_FakeDirStream::$dirs[$id]=array();
$files=array_keys($response); $files=array_keys($response);
array_shift($files);//the first entry is the current directory array_shift($files);//the first entry is the current directory
foreach($files as $file){ foreach($files as $file) {
$file = urldecode(basename($file)); $file = urldecode(basename($file));
OC_FakeDirStream::$dirs[$id][]=$file; OC_FakeDirStream::$dirs[$id][]=$file;
} }
return opendir('fakedir://'.$id); return opendir('fakedir://'.$id);
}catch(Exception $e){ }catch(Exception $e) {
return false; return false;
} }
} }
public function filetype($path){ public function filetype($path) {
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
try{ try{
$response=$this->client->propfind($path, array('{DAV:}resourcetype')); $response=$this->client->propfind($path, array('{DAV:}resourcetype'));
$responseType=$response["{DAV:}resourcetype"]->resourceType; $responseType=$response["{DAV:}resourcetype"]->resourceType;
return (count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file'; return (count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file';
}catch(Exception $e){ }catch(Exception $e) {
error_log($e->getMessage()); error_log($e->getMessage());
\OCP\Util::writeLog("webdav client", \OCP\Util::sanitizeHTML($e->getMessage()), \OCP\Util::ERROR); \OCP\Util::writeLog("webdav client", \OCP\Util::sanitizeHTML($e->getMessage()), \OCP\Util::ERROR);
return false; return false;
} }
} }
public function isReadable($path){ public function isReadable($path) {
return true;//not properly supported return true;//not properly supported
} }
public function isUpdatable($path){ public function isUpdatable($path) {
return true;//not properly supported return true;//not properly supported
} }
public function file_exists($path){ public function file_exists($path) {
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
try{ try{
$this->client->propfind($path, array('{DAV:}resourcetype')); $this->client->propfind($path, array('{DAV:}resourcetype'));
return true;//no 404 exception return true;//no 404 exception
}catch(Exception $e){ }catch(Exception $e) {
return false; return false;
} }
} }
public function unlink($path){ public function unlink($path) {
return $this->simpleResponse('DELETE',$path,null,204); return $this->simpleResponse('DELETE',$path,null,204);
} }
public function fopen($path,$mode){ public function fopen($path,$mode) {
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
switch($mode){ switch($mode) {
case 'r': case 'r':
case 'rb': case 'rb':
//straight up curl instead of sabredav here, sabredav put's the entire get result in memory //straight up curl instead of sabredav here, sabredav put's the entire get result in memory
@ -155,14 +155,14 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
case 'c': case 'c':
case 'c+': case 'c+':
//emulate these //emulate these
if(strrpos($path,'.')!==false){ if(strrpos($path,'.')!==false) {
$ext=substr($path,strrpos($path,'.')); $ext=substr($path,strrpos($path,'.'));
}else{ }else{
$ext=''; $ext='';
} }
$tmpFile=OCP\Files::tmpFile($ext); $tmpFile=OCP\Files::tmpFile($ext);
OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack'); OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
if($this->file_exists($path)){ if($this->file_exists($path)) {
$this->getFile($path,$tmpFile); $this->getFile($path,$tmpFile);
} }
self::$tempFiles[$tmpFile]=$path; self::$tempFiles[$tmpFile]=$path;
@ -170,41 +170,41 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
} }
} }
public function writeBack($tmpFile){ public function writeBack($tmpFile) {
if(isset(self::$tempFiles[$tmpFile])){ if(isset(self::$tempFiles[$tmpFile])) {
$this->uploadFile($tmpFile,self::$tempFiles[$tmpFile]); $this->uploadFile($tmpFile,self::$tempFiles[$tmpFile]);
unlink($tmpFile); unlink($tmpFile);
} }
} }
public function free_space($path){ public function free_space($path) {
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
try{ try{
$response=$this->client->propfind($path, array('{DAV:}quota-available-bytes')); $response=$this->client->propfind($path, array('{DAV:}quota-available-bytes'));
if(isset($response['{DAV:}quota-available-bytes'])){ if(isset($response['{DAV:}quota-available-bytes'])) {
return (int)$response['{DAV:}quota-available-bytes']; return (int)$response['{DAV:}quota-available-bytes'];
}else{ }else{
return 0; return 0;
} }
}catch(Exception $e){ }catch(Exception $e) {
return 0; return 0;
} }
} }
public function touch($path,$mtime=null){ public function touch($path,$mtime=null) {
if(is_null($mtime)){ if(is_null($mtime)) {
$mtime=time(); $mtime=time();
} }
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
$this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime)); $this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
} }
public function getFile($path,$target){ public function getFile($path,$target) {
$source=$this->fopen($path,'r'); $source=$this->fopen($path,'r');
file_put_contents($target,$source); file_put_contents($target,$source);
} }
public function uploadFile($path,$target){ public function uploadFile($path,$target) {
$source=fopen($path,'r'); $source=fopen($path,'r');
$curl = curl_init(); $curl = curl_init();
@ -218,13 +218,13 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
curl_close ($curl); curl_close ($curl);
} }
public function rename($path1,$path2){ public function rename($path1,$path2) {
$path1=$this->cleanPath($path1); $path1=$this->cleanPath($path1);
$path2=$this->root.$this->cleanPath($path2); $path2=$this->root.$this->cleanPath($path2);
try{ try{
$response=$this->client->request('MOVE',$path1,null,array('Destination'=>$path2)); $response=$this->client->request('MOVE',$path1,null,array('Destination'=>$path2));
return true; return true;
}catch(Exception $e){ }catch(Exception $e) {
echo $e; echo $e;
echo 'fail'; echo 'fail';
var_dump($response); var_dump($response);
@ -232,13 +232,13 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
} }
} }
public function copy($path1,$path2){ public function copy($path1,$path2) {
$path1=$this->cleanPath($path1); $path1=$this->cleanPath($path1);
$path2=$this->root.$this->cleanPath($path2); $path2=$this->root.$this->cleanPath($path2);
try{ try{
$response=$this->client->request('COPY',$path1,null,array('Destination'=>$path2)); $response=$this->client->request('COPY',$path1,null,array('Destination'=>$path2));
return true; return true;
}catch(Exception $e){ }catch(Exception $e) {
echo $e; echo $e;
echo 'fail'; echo 'fail';
var_dump($response); var_dump($response);
@ -246,7 +246,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
} }
} }
public function stat($path){ public function stat($path) {
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
try{ try{
$response=$this->client->propfind($path, array('{DAV:}getlastmodified','{DAV:}getcontentlength')); $response=$this->client->propfind($path, array('{DAV:}getlastmodified','{DAV:}getcontentlength'));
@ -255,43 +255,43 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
'size'=>(int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0, 'size'=>(int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0,
'ctime'=>-1, 'ctime'=>-1,
); );
}catch(Exception $e){ }catch(Exception $e) {
return array(); return array();
} }
} }
public function getMimeType($path){ public function getMimeType($path) {
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
try{ try{
$response=$this->client->propfind($path, array('{DAV:}getcontenttype','{DAV:}resourcetype')); $response=$this->client->propfind($path, array('{DAV:}getcontenttype','{DAV:}resourcetype'));
$responseType=$response["{DAV:}resourcetype"]->resourceType; $responseType=$response["{DAV:}resourcetype"]->resourceType;
$type=(count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file'; $type=(count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file';
if($type=='dir'){ if($type=='dir') {
return 'httpd/unix-directory'; return 'httpd/unix-directory';
}elseif(isset($response['{DAV:}getcontenttype'])){ }elseif(isset($response['{DAV:}getcontenttype'])) {
return $response['{DAV:}getcontenttype']; return $response['{DAV:}getcontenttype'];
}else{ }else{
return false; return false;
} }
}catch(Exception $e){ }catch(Exception $e) {
return false; return false;
} }
} }
private function cleanPath($path){ private function cleanPath($path) {
if(!$path || $path[0]=='/'){ if(!$path || $path[0]=='/') {
return substr($path,1); return substr($path,1);
}else{ }else{
return $path; return $path;
} }
} }
private function simpleResponse($method,$path,$body,$expected){ private function simpleResponse($method,$path,$body,$expected) {
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
try{ try{
$response=$this->client->request($method,$path,$body); $response=$this->client->request($method,$path,$body);
return $response['statusCode']==$expected; return $response['statusCode']==$expected;
}catch(Exception $e){ }catch(Exception $e) {
return false; return false;
} }
} }

View File

@ -7,21 +7,21 @@
*/ */
$config=include('apps/files_external/tests/config.php'); $config=include('apps/files_external/tests/config.php');
if(!is_array($config) or !isset($config['ftp']) or !$config['ftp']['run']){ if(!is_array($config) or !isset($config['ftp']) or !$config['ftp']['run']) {
abstract class Test_Filestorage_FTP extends Test_FileStorage{} abstract class Test_Filestorage_FTP extends Test_FileStorage{}
return; return;
}else{ }else{
class Test_Filestorage_FTP extends Test_FileStorage { class Test_Filestorage_FTP extends Test_FileStorage {
private $config; private $config;
public function setUp(){ public function setUp() {
$id=uniqid(); $id=uniqid();
$this->config=include('apps/files_external/tests/config.php'); $this->config=include('apps/files_external/tests/config.php');
$this->config['ftp']['root'].='/'.$id;//make sure we have an new empty folder to work in $this->config['ftp']['root'].='/'.$id;//make sure we have an new empty folder to work in
$this->instance=new OC_Filestorage_FTP($this->config['ftp']); $this->instance=new OC_Filestorage_FTP($this->config['ftp']);
} }
public function tearDown(){ public function tearDown() {
OCP\Files::rmdirr($this->instance->constructUrl('')); OCP\Files::rmdirr($this->instance->constructUrl(''));
} }
} }

View File

@ -21,7 +21,7 @@
*/ */
$config=include('apps/files_external/tests/config.php'); $config=include('apps/files_external/tests/config.php');
if(!is_array($config) or !isset($config['google']) or !$config['google']['run']){ if(!is_array($config) or !isset($config['google']) or !$config['google']['run']) {
abstract class Test_Filestorage_Google extends Test_FileStorage{} abstract class Test_Filestorage_Google extends Test_FileStorage{}
return; return;
}else{ }else{
@ -29,14 +29,14 @@ if(!is_array($config) or !isset($config['google']) or !$config['google']['run'])
private $config; private $config;
public function setUp(){ public function setUp() {
$id=uniqid(); $id=uniqid();
$this->config=include('apps/files_external/tests/config.php'); $this->config=include('apps/files_external/tests/config.php');
$this->config['google']['root'].='/'.$id;//make sure we have an new empty folder to work in $this->config['google']['root'].='/'.$id;//make sure we have an new empty folder to work in
$this->instance=new OC_Filestorage_Google($this->config['google']); $this->instance=new OC_Filestorage_Google($this->config['google']);
} }
public function tearDown(){ public function tearDown() {
$this->instance->rmdir('/'); $this->instance->rmdir('/');
} }
} }

View File

@ -8,21 +8,21 @@
$config=include('apps/files_external/tests/config.php'); $config=include('apps/files_external/tests/config.php');
if(!is_array($config) or !isset($config['smb']) or !$config['smb']['run']){ if(!is_array($config) or !isset($config['smb']) or !$config['smb']['run']) {
abstract class Test_Filestorage_SMB extends Test_FileStorage{} abstract class Test_Filestorage_SMB extends Test_FileStorage{}
return; return;
}else{ }else{
class Test_Filestorage_SMB extends Test_FileStorage { class Test_Filestorage_SMB extends Test_FileStorage {
private $config; private $config;
public function setUp(){ public function setUp() {
$id=uniqid(); $id=uniqid();
$this->config=include('apps/files_external/tests/config.php'); $this->config=include('apps/files_external/tests/config.php');
$this->config['smb']['root'].=$id;//make sure we have an new empty folder to work in $this->config['smb']['root'].=$id;//make sure we have an new empty folder to work in
$this->instance=new OC_Filestorage_SMB($this->config['smb']); $this->instance=new OC_Filestorage_SMB($this->config['smb']);
} }
public function tearDown(){ public function tearDown() {
OCP\Files::rmdirr($this->instance->constructUrl('')); OCP\Files::rmdirr($this->instance->constructUrl(''));
} }
} }

View File

@ -7,14 +7,14 @@
*/ */
$config=include('apps/files_external/tests/config.php'); $config=include('apps/files_external/tests/config.php');
if(!is_array($config) or !isset($config['swift']) or !$config['swift']['run']){ if(!is_array($config) or !isset($config['swift']) or !$config['swift']['run']) {
abstract class Test_Filestorage_SWIFT extends Test_FileStorage{} abstract class Test_Filestorage_SWIFT extends Test_FileStorage{}
return; return;
}else{ }else{
class Test_Filestorage_SWIFT extends Test_FileStorage { class Test_Filestorage_SWIFT extends Test_FileStorage {
private $config; private $config;
public function setUp(){ public function setUp() {
$id=uniqid(); $id=uniqid();
$this->config=include('apps/files_external/tests/config.php'); $this->config=include('apps/files_external/tests/config.php');
$this->config['swift']['root'].='/'.$id;//make sure we have an new empty folder to work in $this->config['swift']['root'].='/'.$id;//make sure we have an new empty folder to work in
@ -22,7 +22,7 @@ if(!is_array($config) or !isset($config['swift']) or !$config['swift']['run']){
} }
public function tearDown(){ public function tearDown() {
$this->instance->rmdir(''); $this->instance->rmdir('');
} }

View File

@ -1,6 +0,0 @@
<?php
require_once 'files_external/lib/config.php';
echo "<pre>";
print_r(OC_Mount_Config::getSystemMountPoints());
echo "</pre>";
// OC_Mount_Config::addMountPoint('Photos', 'OC_Filestorage_SWIFT', array('host' => 'gapinthecloud.com', 'user' => 'Gap', 'token' => '23423afdasFJEW22', 'secure' => 'true', 'root' => ''), OC_Mount_Config::MOUNT_TYPE_GROUP, 'admin', false);

View File

@ -7,21 +7,21 @@
*/ */
$config=include('apps/files_external/tests/config.php'); $config=include('apps/files_external/tests/config.php');
if(!is_array($config) or !isset($config['webdav']) or !$config['webdav']['run']){ if(!is_array($config) or !isset($config['webdav']) or !$config['webdav']['run']) {
abstract class Test_Filestorage_DAV extends Test_FileStorage{} abstract class Test_Filestorage_DAV extends Test_FileStorage{}
return; return;
}else{ }else{
class Test_Filestorage_DAV extends Test_FileStorage { class Test_Filestorage_DAV extends Test_FileStorage {
private $config; private $config;
public function setUp(){ public function setUp() {
$id=uniqid(); $id=uniqid();
$this->config=include('apps/files_external/tests/config.php'); $this->config=include('apps/files_external/tests/config.php');
$this->config['webdav']['root'].='/'.$id;//make sure we have an new empty folder to work in $this->config['webdav']['root'].='/'.$id;//make sure we have an new empty folder to work in
$this->instance=new OC_Filestorage_DAV($this->config['webdav']); $this->instance=new OC_Filestorage_DAV($this->config['webdav']);
} }
public function tearDown(){ public function tearDown() {
$this->instance->rmdir('/'); $this->instance->rmdir('/');
} }
} }

View File

@ -1,7 +1,8 @@
body { background:#ddd; } body { background:#ddd; }
#header { position:fixed; top:0; left:0; right:0; z-index:100; height:2.5em; line-height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; } #header { position:fixed; top:0; left:0; right:0; z-index:100; height:2.5em; line-height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; }
#details { color:#fff; } #details { color:#fff; }
#download { margin-left:2em; font-weight:bold; color:#fff; } #header #download { margin-left:2em; font-weight:bold; color:#fff; }
#preview { min-height:30em; margin:50px auto; border-bottom:1px solid #f8f8f8; background:#eee; text-align:center; } #preview { min-height:30em; margin:50px auto; padding-top:2em; border-bottom:1px solid #f8f8f8; background:#eee; text-align:center; }
#noPreview { display:none; padding-top:5em; }
p.info { width:22em; text-align: center; margin:2em auto; color:#777; text-shadow:#fff 0 1px 0; } p.info { width:22em; text-align: center; margin:2em auto; color:#777; text-shadow:#fff 0 1px 0; }
p.info a { font-weight:bold; color:#777; } p.info a { font-weight:bold; color:#777; }

View File

@ -10,8 +10,12 @@ $(document).ready(function() {
// Show file preview if previewer is available, images are already handled by the template // Show file preview if previewer is available, images are already handled by the template
if (mimetype.substr(0, mimetype.indexOf('/')) != 'image') { if (mimetype.substr(0, mimetype.indexOf('/')) != 'image') {
// Trigger default action if not download TODO // Trigger default action if not download TODO
var action = FileActions.getDefault(mimetype, 'file', FileActions.PERMISSION_READ); var action = FileActions.getDefault(mimetype, 'file', OC.PERMISSION_READ);
action($('#filename').val()); if (typeof action === 'undefined') {
$('#noPreview').show();
} else {
action($('#filename').val());
}
} }
} }

View File

@ -2,7 +2,7 @@ $(document).ready(function() {
if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined') { if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined') {
OC.Share.loadIcons('file'); OC.Share.loadIcons('file');
FileActions.register('all', 'Share', FileActions.PERMISSION_READ, function(filename) { FileActions.register('all', 'Share', OC.PERMISSION_READ, function(filename) {
// Return the correct sharing icon // Return the correct sharing icon
if (scanFiles.scanning) { return; } // workaround to prevent additional http request block scanning feedback if (scanFiles.scanning) { return; } // workaround to prevent additional http request block scanning feedback
if ($('#dir').val() == '/') { if ($('#dir').val() == '/') {

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Mida", "Password" => "Contrasenya",
"Modified" => "Modificat", "Submit" => "Envia",
"Delete all" => "Esborra-ho tot", "Download" => "Baixa",
"Delete" => "Elimina" "No preview available for" => "No hi ha vista prèvia disponible per a",
"web services under your control" => "controleu els vostres serveis web"
); );

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Velikost", "Password" => "Heslo",
"Modified" => "Upraveno", "Submit" => "Odeslat",
"Delete all" => "Smazat vše", "Download" => "Stáhnout",
"Delete" => "Smazat" "No preview available for" => "Náhled není dostupný pro",
"web services under your control" => "služby webu pod Vaší kontrolou"
); );

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Größe", "Password" => "Passwort",
"Modified" => "Geändert", "Submit" => "Absenden",
"Delete all" => "Alle löschen", "Download" => "Download",
"Delete" => "Löschen" "No preview available for" => "Es ist keine Vorschau verfügbar für",
"web services under your control" => "Web-Services unter Ihrer Kontrolle"
); );

View File

@ -1,6 +1,4 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Μέγεθος", "Password" => "Συνθηματικό",
"Modified" => "Τροποποιήθηκε", "Submit" => "Καταχώρηση"
"Delete all" => "Διαγραφή όλων",
"Delete" => "Διαγραφή"
); );

View File

@ -1,3 +1,4 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Delete" => "Forigi" "Password" => "Pasvorto",
"Submit" => "Sendi"
); );

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Tamaño", "Password" => "Contraseña",
"Modified" => "Modificado", "Submit" => "Enviar",
"Delete all" => "Eliminar todo", "Download" => "Descargar",
"Delete" => "Eliminar" "No preview available for" => "No hay vista previa disponible para",
"web services under your control" => "Servicios web bajo su control"
); );

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Tamaina", "Password" => "Pasahitza",
"Modified" => "Aldatuta", "Submit" => "Bidali",
"Delete all" => "Ezabatu dena", "Download" => "Deskargatu",
"Delete" => "Ezabatu" "No preview available for" => "Ez dago aurrebista eskuragarririk hauentzat ",
"web services under your control" => "web zerbitzuak zure kontrolpean"
); );

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Koko", "Password" => "Salasana",
"Modified" => "Muokattu", "Submit" => "Lähetä",
"Delete all" => "Poista kaikki", "Download" => "Lataa",
"Delete" => "Poista" "No preview available for" => "Ei esikatselua kohteelle",
"web services under your control" => "verkkopalvelut hallinnassasi"
); );

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Taille", "Password" => "Mot de passe",
"Modified" => "Modifié", "Submit" => "Envoyer",
"Delete all" => "Tout effacer", "Download" => "Télécharger",
"Delete" => "Effacement" "No preview available for" => "Pas d'aperçu disponible pour",
"web services under your control" => "services web sous votre contrôle"
); );

View File

@ -0,0 +1,7 @@
<?php $TRANSLATIONS = array(
"Password" => "ססמה",
"Submit" => "שליחה",
"Download" => "הורדה",
"No preview available for" => "אין תצוגה מקדימה זמינה עבור",
"web services under your control" => "שירותי רשת תחת השליטה שלך"
);

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Dimensione", "Password" => "Password",
"Modified" => "Modificato", "Submit" => "Invia",
"Delete all" => "Elimina tutto", "Download" => "Scarica",
"Delete" => "Eliminazione" "No preview available for" => "Nessuna anteprima disponibile per",
"web services under your control" => "servizi web nelle tue mani"
); );

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "サイズ", "Password" => "パスワード",
"Modified" => "変更", "Submit" => "送信",
"Delete all" => "すべて削除", "Download" => "ダウンロード",
"Delete" => "削除" "No preview available for" => "プレビューはありません",
"web services under your control" => "管理下のウェブサービス"
); );

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Grootte", "Password" => "Wachtwoord",
"Modified" => "Aangepast", "Submit" => "Verzenden",
"Delete all" => "Verwijder alles", "Download" => "Downloaden",
"Delete" => "Vewijder" "No preview available for" => "Geen voorbeeldweergave beschikbaar voor",
"web services under your control" => "Webdiensten in eigen beheer"
); );

View File

@ -1,6 +1,7 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Rozmiar", "Password" => "Hasło",
"Modified" => "Zmodyfikowane", "Submit" => "Wyślij",
"Delete all" => "Usuń wszystko", "Download" => "Pobierz",
"Delete" => "Usuń" "No preview available for" => "Podgląd nie jest dostępny dla",
"web services under your control" => "Kontrolowane serwisy"
); );

View File

@ -1,6 +1,6 @@
<?php $TRANSLATIONS = array( <?php $TRANSLATIONS = array(
"Size" => "Размер", "Password" => "Пароль",
"Modified" => "Изменён", "Submit" => "Отправить",
"Delete all" => "Удалить все", "Download" => "Скачать",
"Delete" => "Удалить" "web services under your control" => "веб-сервисы под вашим управлением"
); );

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