summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-01-28 11:18:04 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-01-28 11:18:04 +0100
commit8067a1394e3dab551e65ec8abd12e673a811bf40 (patch)
treefd18fac68c7ca62ee50142e771f0da70a9c0925d /apps
parentdbb0d0407324830f4a7ff51781c535c1cb0d2a06 (diff)
parent857b15db3739fe8fbbad4df0f10e9b48ba1f90c2 (diff)
downloadnextcloud-server-8067a1394e3dab551e65ec8abd12e673a811bf40.tar.gz
nextcloud-server-8067a1394e3dab551e65ec8abd12e673a811bf40.zip
fix merge conflicts
Diffstat (limited to 'apps')
-rw-r--r--apps/files/admin.php4
-rw-r--r--apps/files/ajax/delete.php23
-rw-r--r--apps/files/ajax/getstoragestats.php9
-rw-r--r--apps/files/ajax/upload.php87
-rw-r--r--apps/files/download.php3
-rw-r--r--apps/files/index.php8
-rw-r--r--apps/files/js/filelist.js69
-rw-r--r--apps/files/js/files.js75
-rw-r--r--apps/files/l10n/ar.php2
-rw-r--r--apps/files/l10n/bg_BG.php2
-rw-r--r--apps/files/l10n/bn_BD.php3
-rw-r--r--apps/files/l10n/ca.php7
-rw-r--r--apps/files/l10n/cs_CZ.php3
-rw-r--r--apps/files/l10n/da.php2
-rw-r--r--apps/files/l10n/de.php3
-rw-r--r--apps/files/l10n/de_DE.php3
-rw-r--r--apps/files/l10n/el.php4
-rw-r--r--apps/files/l10n/eo.php3
-rw-r--r--apps/files/l10n/es.php3
-rw-r--r--apps/files/l10n/es_AR.php3
-rw-r--r--apps/files/l10n/et_EE.php2
-rw-r--r--apps/files/l10n/eu.php7
-rw-r--r--apps/files/l10n/fa.php30
-rw-r--r--apps/files/l10n/fi_FI.php3
-rw-r--r--apps/files/l10n/fr.php4
-rw-r--r--apps/files/l10n/gl.php3
-rw-r--r--apps/files/l10n/he.php2
-rw-r--r--apps/files/l10n/hr.php2
-rw-r--r--apps/files/l10n/hu_HU.php4
-rw-r--r--apps/files/l10n/ia.php2
-rw-r--r--apps/files/l10n/id.php2
-rw-r--r--apps/files/l10n/is.php3
-rw-r--r--apps/files/l10n/it.php6
-rw-r--r--apps/files/l10n/ja_JP.php4
-rw-r--r--apps/files/l10n/ka_GE.php2
-rw-r--r--apps/files/l10n/ko.php3
-rw-r--r--apps/files/l10n/ku_IQ.php2
-rw-r--r--apps/files/l10n/lb.php3
-rw-r--r--apps/files/l10n/lt_LT.php2
-rw-r--r--apps/files/l10n/lv.php2
-rw-r--r--apps/files/l10n/mk.php2
-rw-r--r--apps/files/l10n/ms_MY.php2
-rw-r--r--apps/files/l10n/nb_NO.php2
-rw-r--r--apps/files/l10n/nl.php3
-rw-r--r--apps/files/l10n/nn_NO.php2
-rw-r--r--apps/files/l10n/oc.php2
-rw-r--r--apps/files/l10n/pl.php3
-rw-r--r--apps/files/l10n/pt_BR.php2
-rw-r--r--apps/files/l10n/pt_PT.php7
-rw-r--r--apps/files/l10n/ro.php5
-rw-r--r--apps/files/l10n/ru.php3
-rw-r--r--apps/files/l10n/ru_RU.php2
-rw-r--r--apps/files/l10n/si_LK.php2
-rw-r--r--apps/files/l10n/sk_SK.php10
-rw-r--r--apps/files/l10n/sl.php2
-rw-r--r--apps/files/l10n/sr.php2
-rw-r--r--apps/files/l10n/sr@latin.php2
-rw-r--r--apps/files/l10n/sv.php7
-rw-r--r--apps/files/l10n/ta_LK.php2
-rw-r--r--apps/files/l10n/th_TH.php10
-rw-r--r--apps/files/l10n/tr.php10
-rw-r--r--apps/files/l10n/uk.php2
-rw-r--r--apps/files/l10n/vi.php2
-rw-r--r--apps/files/l10n/zh_CN.GB2312.php2
-rw-r--r--apps/files/l10n/zh_CN.php4
-rw-r--r--apps/files/l10n/zh_TW.php4
-rw-r--r--apps/files/lib/helper.php20
-rw-r--r--apps/files/settings.php4
-rw-r--r--apps/files/templates/index.php2
-rw-r--r--apps/files/templates/part.list.php8
-rw-r--r--apps/files_encryption/ajax/mode.php38
-rw-r--r--apps/files_encryption/appinfo/app.php38
-rw-r--r--apps/files_encryption/appinfo/database.xml24
-rw-r--r--apps/files_encryption/appinfo/info.xml6
-rw-r--r--apps/files_encryption/appinfo/version2
-rw-r--r--apps/files_encryption/hooks/hooks.php143
-rw-r--r--apps/files_encryption/js/settings-personal.js38
-rw-r--r--apps/files_encryption/js/settings.js34
-rw-r--r--apps/files_encryption/l10n/ar.php3
-rw-r--r--apps/files_encryption/l10n/bg_BG.php5
-rw-r--r--apps/files_encryption/l10n/bn_BD.php5
-rw-r--r--apps/files_encryption/l10n/ca.php14
-rw-r--r--apps/files_encryption/l10n/cs_CZ.php14
-rw-r--r--apps/files_encryption/l10n/da.php3
-rw-r--r--apps/files_encryption/l10n/de.php3
-rw-r--r--apps/files_encryption/l10n/de_DE.php6
-rw-r--r--apps/files_encryption/l10n/el.php7
-rw-r--r--apps/files_encryption/l10n/eo.php3
-rw-r--r--apps/files_encryption/l10n/es.php6
-rw-r--r--apps/files_encryption/l10n/es_AR.php3
-rw-r--r--apps/files_encryption/l10n/et_EE.php3
-rw-r--r--apps/files_encryption/l10n/eu.php3
-rw-r--r--apps/files_encryption/l10n/fa.php3
-rw-r--r--apps/files_encryption/l10n/fi_FI.php3
-rw-r--r--apps/files_encryption/l10n/fr.php14
-rw-r--r--apps/files_encryption/l10n/gl.php3
-rw-r--r--apps/files_encryption/l10n/he.php5
-rw-r--r--apps/files_encryption/l10n/hu_HU.php5
-rw-r--r--apps/files_encryption/l10n/id.php3
-rw-r--r--apps/files_encryption/l10n/is.php5
-rw-r--r--apps/files_encryption/l10n/it.php14
-rw-r--r--apps/files_encryption/l10n/ja_JP.php14
-rw-r--r--apps/files_encryption/l10n/ko.php3
-rw-r--r--apps/files_encryption/l10n/ku_IQ.php3
-rw-r--r--apps/files_encryption/l10n/lt_LT.php3
-rw-r--r--apps/files_encryption/l10n/mk.php3
-rw-r--r--apps/files_encryption/l10n/nb_NO.php3
-rw-r--r--apps/files_encryption/l10n/nl.php3
-rw-r--r--apps/files_encryption/l10n/pl.php3
-rw-r--r--apps/files_encryption/l10n/pt_BR.php3
-rw-r--r--apps/files_encryption/l10n/pt_PT.php14
-rw-r--r--apps/files_encryption/l10n/ro.php14
-rw-r--r--apps/files_encryption/l10n/ru.php3
-rw-r--r--apps/files_encryption/l10n/ru_RU.php3
-rw-r--r--apps/files_encryption/l10n/si_LK.php3
-rw-r--r--apps/files_encryption/l10n/sk_SK.php3
-rw-r--r--apps/files_encryption/l10n/sl.php3
-rw-r--r--apps/files_encryption/l10n/sr.php3
-rw-r--r--apps/files_encryption/l10n/sv.php14
-rw-r--r--apps/files_encryption/l10n/ta_LK.php3
-rw-r--r--apps/files_encryption/l10n/th_TH.php14
-rw-r--r--apps/files_encryption/l10n/tr.php5
-rw-r--r--apps/files_encryption/l10n/uk.php3
-rw-r--r--apps/files_encryption/l10n/vi.php3
-rw-r--r--apps/files_encryption/l10n/zh_CN.GB2312.php3
-rw-r--r--apps/files_encryption/l10n/zh_CN.php3
-rw-r--r--apps/files_encryption/l10n/zh_TW.php14
-rwxr-xr-x[-rw-r--r--]apps/files_encryption/lib/crypt.php952
-rw-r--r--apps/files_encryption/lib/cryptstream.php177
-rwxr-xr-xapps/files_encryption/lib/keymanager.php365
-rw-r--r--apps/files_encryption/lib/proxy.php295
-rw-r--r--apps/files_encryption/lib/session.php66
-rw-r--r--apps/files_encryption/lib/stream.php464
-rw-r--r--apps/files_encryption/lib/util.php330
-rw-r--r--apps/files_encryption/settings-personal.php29
-rw-r--r--apps/files_encryption/settings.php19
-rw-r--r--apps/files_encryption/templates/settings-personal.php45
-rw-r--r--apps/files_encryption/templates/settings.php85
-rw-r--r--apps/files_encryption/test/binary (renamed from apps/files_encryption/tests/binary)bin9734 -> 9734 bytes
-rwxr-xr-xapps/files_encryption/test/crypt.php667
-rw-r--r--apps/files_encryption/test/keymanager.php132
-rw-r--r--apps/files_encryption/test/legacy-encrypted-text.txtbin0 -> 3360 bytes
-rw-r--r--apps/files_encryption/test/proxy.php220
-rw-r--r--apps/files_encryption/test/stream.php226
-rwxr-xr-xapps/files_encryption/test/util.php210
-rw-r--r--apps/files_encryption/test/zeros (renamed from apps/files_encryption/tests/zeros)bin10238 -> 10238 bytes
-rw-r--r--apps/files_encryption/tests/encryption.php72
-rw-r--r--apps/files_encryption/tests/proxy.php117
-rw-r--r--apps/files_encryption/tests/stream.php85
-rw-r--r--apps/files_external/l10n/ro.php8
-rw-r--r--apps/files_external/l10n/th_TH.php2
-rw-r--r--apps/files_external/tests/ftp.php8
-rw-r--r--apps/files_sharing/js/share.js3
-rw-r--r--apps/files_sharing/l10n/lb.php3
-rw-r--r--apps/files_sharing/l10n/sr.php3
-rw-r--r--apps/files_sharing/l10n/zh_TW.php3
-rw-r--r--apps/files_sharing/templates/public.php8
-rw-r--r--apps/files_versions/l10n/lb.php5
-rw-r--r--apps/user_ldap/l10n/fr.php8
-rw-r--r--apps/user_ldap/l10n/lb.php1
-rw-r--r--apps/user_ldap/l10n/ro.php4
-rw-r--r--apps/user_ldap/l10n/sv.php4
-rw-r--r--apps/user_ldap/l10n/th_TH.php5
-rw-r--r--apps/user_ldap/tests/group_ldap.php2
-rw-r--r--apps/user_webdavauth/l10n/fr.php4
-rw-r--r--apps/user_webdavauth/l10n/ro.php4
-rw-r--r--apps/user_webdavauth/l10n/sk_SK.php3
-rw-r--r--apps/user_webdavauth/l10n/sv.php4
-rw-r--r--apps/user_webdavauth/l10n/th_TH.php4
-rw-r--r--apps/user_webdavauth/l10n/zh_CN.php4
170 files changed, 4649 insertions, 1133 deletions
diff --git a/apps/files/admin.php b/apps/files/admin.php
index f747f8645f6..02c3147dba5 100644
--- a/apps/files/admin.php
+++ b/apps/files/admin.php
@@ -21,10 +21,6 @@
*
*/
-
-// Init owncloud
-
-
OCP\User::checkAdminUser();
$htaccessWorking=(getenv('htaccessWorking')=='true');
diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php
index 293543c547f..575b8c8d9ea 100644
--- a/apps/files/ajax/delete.php
+++ b/apps/files/ajax/delete.php
@@ -14,27 +14,18 @@ $files = json_decode($files);
$filesWithError = '';
$success = true;
//Now delete
-foreach($files as $file) {
- if( !OC_Files::delete( $dir, $file )) {
+foreach ($files as $file) {
+ if (!OC_Files::delete($dir, $file)) {
$filesWithError .= $file . "\n";
$success = false;
}
}
-// updated max file size after upload
-$l=new OC_L10N('files');
-$maxUploadFilesize=OCP\Util::maxUploadFilesize($dir);
-$maxHumanFilesize=OCP\Util::humanFileSize($maxUploadFilesize);
-$maxHumanFilesize=$l->t('Upload') . ' max. '.$maxHumanFilesize;
+// get array with updated storage stats (e.g. max file size) after upload
+$storageStats = \OCA\files\lib\Helper::buildFileStorageStatistics($dir);
-if($success) {
- OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $files,
- 'uploadMaxFilesize'=>$maxUploadFilesize,
- 'maxHumanFilesize'=>$maxHumanFilesize
- )));
+if ($success) {
+ OCP\JSON::success(array("data" => array_merge(array("dir" => $dir, "files" => $files), $storageStats)));
} else {
- OCP\JSON::error(array("data" => array( "message" => "Could not delete:\n" . $filesWithError,
- 'uploadMaxFilesize'=>$maxUploadFilesize,
- 'maxHumanFilesize'=>$maxHumanFilesize
- )));
+ OCP\JSON::error(array("data" => array_merge(array("message" => "Could not delete:\n" . $filesWithError), $storageStats)));
}
diff --git a/apps/files/ajax/getstoragestats.php b/apps/files/ajax/getstoragestats.php
index e55e346ed67..7a2b642a9bd 100644
--- a/apps/files/ajax/getstoragestats.php
+++ b/apps/files/ajax/getstoragestats.php
@@ -5,12 +5,5 @@ $RUNTIME_APPTYPES = array('filesystem');
OCP\JSON::checkLoggedIn();
-$l=new OC_L10N('files');
-$maxUploadFilesize = OCP\Util::maxUploadFilesize($dir);
-$maxHumanFilesize = OCP\Util::humanFileSize($maxUploadFilesize);
-$maxHumanFilesize = $l->t('Upload') . ' max. ' . $maxHumanFilesize;
-
// send back json
-OCP\JSON::success(array('data' => array('uploadMaxFilesize' => $maxUploadFilesize,
- 'maxHumanFilesize' => $maxHumanFilesize
-)));
+OCP\JSON::success(array('data' => \OCA\files\lib\Helper::buildFileStorageStatistics('/')));
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index 93398019608..415524be629 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -8,90 +8,73 @@ OCP\JSON::setContentTypeHeader('text/plain');
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
-$l=OC_L10N::get('files');
+$l = OC_L10N::get('files');
-// current max upload size
-$l=new OC_L10N('files');
-$maxUploadFilesize=OCP\Util::maxUploadFilesize($dir);
-$maxHumanFilesize=OCP\Util::humanFileSize($maxUploadFilesize);
-$maxHumanFilesize=$l->t('Upload') . ' max. '.$maxHumanFilesize;
+// get array with current storage stats (e.g. max file size)
+$storageStats = \OCA\files\lib\Helper::buildFileStorageStatistics($dir);
if (!isset($_FILES['files'])) {
- OCP\JSON::error(array('data' => array( 'message' => $l->t( 'No file was uploaded. Unknown error' ),
- 'uploadMaxFilesize'=>$maxUploadFilesize,
- 'maxHumanFilesize'=>$maxHumanFilesize
- )));
+ OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('No file was uploaded. Unknown error')), $storageStats)));
exit();
}
foreach ($_FILES['files']['error'] as $error) {
if ($error != 0) {
$errors = array(
- UPLOAD_ERR_OK=>$l->t('There is no error, the file uploaded with success'),
- UPLOAD_ERR_INI_SIZE=>$l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ')
- .ini_get('upload_max_filesize'),
- UPLOAD_ERR_FORM_SIZE=>$l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified'
- .' in the HTML form'),
- UPLOAD_ERR_PARTIAL=>$l->t('The uploaded file was only partially uploaded'),
- UPLOAD_ERR_NO_FILE=>$l->t('No file was uploaded'),
- UPLOAD_ERR_NO_TMP_DIR=>$l->t('Missing a temporary folder'),
- UPLOAD_ERR_CANT_WRITE=>$l->t('Failed to write to disk'),
+ UPLOAD_ERR_OK => $l->t('There is no error, the file uploaded with success'),
+ UPLOAD_ERR_INI_SIZE => $l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ')
+ . ini_get('upload_max_filesize'),
+ UPLOAD_ERR_FORM_SIZE => $l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified'
+ . ' in the HTML form'),
+ UPLOAD_ERR_PARTIAL => $l->t('The uploaded file was only partially uploaded'),
+ UPLOAD_ERR_NO_FILE => $l->t('No file was uploaded'),
+ UPLOAD_ERR_NO_TMP_DIR => $l->t('Missing a temporary folder'),
+ UPLOAD_ERR_CANT_WRITE => $l->t('Failed to write to disk'),
);
- OCP\JSON::error(array('data' => array( 'message' => $errors[$error],
- 'uploadMaxFilesize'=>$maxUploadFilesize,
- 'maxHumanFilesize'=>$maxHumanFilesize
- )));
+ OCP\JSON::error(array('data' => array_merge(array('message' => $errors[$error]), $storageStats)));
exit();
}
}
-$files=$_FILES['files'];
+$files = $_FILES['files'];
$dir = $_POST['dir'];
-$error='';
+$error = '';
-$totalSize=0;
-foreach($files['size'] as $size) {
- $totalSize+=$size;
+$totalSize = 0;
+foreach ($files['size'] as $size) {
+ $totalSize += $size;
}
-if($totalSize>OC_Filesystem::free_space($dir)) {
- OCP\JSON::error(array('data' => array( 'message' => $l->t( 'Not enough space available' ),
- 'uploadMaxFilesize'=>$maxUploadFilesize,
- 'maxHumanFilesize'=>$maxHumanFilesize)));
+if ($totalSize > OC_Filesystem::free_space($dir)) {
+ OCP\JSON::error(array('data' => array_merge(array('message' => $l->t('Not enough storage available')), $storageStats)));
exit();
}
-$result=array();
-if(strpos($dir, '..') === false) {
- $fileCount=count($files['name']);
- for($i=0;$i<$fileCount;$i++) {
+$result = array();
+if (strpos($dir, '..') === false) {
+ $fileCount = count($files['name']);
+ for ($i = 0; $i < $fileCount; $i++) {
$target = OCP\Files::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
// $path needs to be normalized - this failed within drag'n'drop upload to a sub-folder
$target = OC_Filesystem::normalizePath($target);
- 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::get($target);
$id = OC_FileCache::getId($target);
+
// updated max file size after upload
- $maxUploadFilesize=OCP\Util::maxUploadFilesize($dir);
- $maxHumanFilesize=OCP\Util::humanFileSize($maxUploadFilesize);
- $maxHumanFilesize=$l->t('Upload') . ' max. '.$maxHumanFilesize;
+ $storageStats = \OCA\files\lib\Helper::buildFileStorageStatistics($dir);
- $result[]=array( 'status' => 'success',
- 'mime'=>$meta['mimetype'],
- 'size'=>$meta['size'],
- 'id'=>$id,
- 'name'=>basename($target),
- 'uploadMaxFilesize'=>$maxUploadFilesize,
- 'maxHumanFilesize'=>$maxHumanFilesize
+ $result[] = array_merge(array('status' => 'success',
+ 'mime' => $meta['mimetype'],
+ 'size' => $meta['size'],
+ 'id' => $id,
+ 'name' => basename($target)), $storageStats
);
}
}
OCP\JSON::encodedPrint($result);
exit();
} else {
- $error=$l->t( 'Invalid directory.' );
+ $error = $l->t('Invalid directory.');
}
-OCP\JSON::error(array('data' => array('message' => $error,
- 'uploadMaxFilesize'=>$maxUploadFilesize,
- 'maxHumanFilesize'=>$maxHumanFilesize
-)));
+OCP\JSON::error(array('data' => array_merge(array('message' => $error), $storageStats)));
diff --git a/apps/files/download.php b/apps/files/download.php
index e2149cd4135..1b70b1e38f8 100644
--- a/apps/files/download.php
+++ b/apps/files/download.php
@@ -21,9 +21,6 @@
*
*/
-// Init owncloud
-
-
// Check if we are a user
OCP\User::checkLoggedIn();
diff --git a/apps/files/index.php b/apps/files/index.php
index 8861be72283..7ac201c8732 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -76,6 +76,7 @@ $list = new OCP\Template('files', 'part.list', '');
$list->assign('files', $files, false);
$list->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir=', false);
$list->assign('downloadURL', OCP\Util::linkTo('files', 'download.php') . '?file=', false);
+$list->assign('disableSharing', false);
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
$breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir=', false);
@@ -83,6 +84,9 @@ $breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files', 'index.php') . '?dir
$maxUploadFilesize=OCP\Util::maxUploadFilesize($dir);
$permissions = OCP\PERMISSION_READ;
+if (OC_Filesystem::isCreatable($dir . '/')) {
+ $permissions |= OCP\PERMISSION_CREATE;
+}
if (OC_Filesystem::isUpdatable($dir . '/')) {
$permissions |= OCP\PERMISSION_UPDATE;
}
@@ -93,6 +97,9 @@ if (OC_Filesystem::isSharable($dir . '/')) {
$permissions |= OCP\PERMISSION_SHARE;
}
+// information about storage capacities
+$storageInfo=OC_Helper::getStorageInfo();
+
$tmpl = new OCP\Template('files', 'index', 'user');
$tmpl->assign('fileList', $list->fetchPage(), false);
$tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage(), false);
@@ -104,4 +111,5 @@ $tmpl->assign('trash', \OCP\App::isEnabled('files_trashbin'));
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
+$tmpl->assign('usedSpacePercent', (int)$storageInfo['relative']);
$tmpl->printPage();
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index a9e88249644..afa2923a8c8 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -201,15 +201,14 @@ var FileList={
},
checkName:function(oldName, newName, isNewFile) {
if (isNewFile || $('tr').filterAttr('data-file', newName).length > 0) {
- if (isNewFile) {
- $('#notification').html(t('files', '{new_name} already exists', {new_name: escapeHTML(newName)})+'<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(t('files', '{new_name} already exists', {new_name: escapeHTML(newName)})+'<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();
+ if (isNewFile) {
+ OC.Notification.showHtml(t('files', '{new_name} already exists', {new_name: escapeHTML(newName)})+'<span class="replace">'+t('files', 'replace')+'</span><span class="suggest">'+t('files', 'suggest name')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
+ } else {
+ OC.Notification.showHtml(t('files', '{new_name} already exists', {new_name: escapeHTML(newName)})+'<span class="replace">'+t('files', 'replace')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
+ }
return true;
} else {
return false;
@@ -251,11 +250,10 @@ var FileList={
FileList.finishReplace();
};
if (isNewFile) {
- $('#notification').html(t('files', 'replaced {new_name}', {new_name: newName})+'<span class="undo">'+t('files', 'undo')+'</span>');
+ OC.Notification.showHtml(t('files', 'replaced {new_name}', {new_name: newName})+'<span class="undo">'+t('files', 'undo')+'</span>');
} else {
- $('#notification').html(t('files', 'replaced {new_name} with {old_name}', {new_name: newName}, {old_name: oldName})+'<span class="undo">'+t('files', 'undo')+'</span>');
+ OC.Notification.showHtml(t('files', 'replaced {new_name} with {old_name}', {new_name: newName}, {old_name: oldName})+'<span class="undo">'+t('files', 'undo')+'</span>');
}
- $('#notification').fadeIn();
},
finishReplace:function() {
if (!FileList.replaceCanceled && FileList.replaceOldName && FileList.replaceNewName) {
@@ -277,6 +275,49 @@ var FileList={
if (FileList.lastAction) {
FileList.lastAction();
}
+<<<<<<< HEAD
+=======
+
+ FileList.prepareDeletion(files);
+
+ if (!FileList.useUndo) {
+ FileList.lastAction();
+ } else {
+ // NOTE: Temporary fix to change the text to unshared for files in root of Shared folder
+ if ($('#dir').val() == '/Shared') {
+ OC.Notification.showHtml(t('files', 'unshared {files}', {'files': escapeHTML(files)})+'<span class="undo">'+t('files', 'undo')+'</span>');
+ } else {
+ OC.Notification.showHtml(t('files', 'deleted {files}', {'files': escapeHTML(files)})+'<span class="undo">'+t('files', 'undo')+'</span>');
+ }
+ }
+ },
+ finishDelete:function(ready,sync){
+ if(!FileList.deleteCanceled && FileList.deleteFiles){
+ var fileNames=JSON.stringify(FileList.deleteFiles);
+ $.ajax({
+ url: OC.filePath('files', 'ajax', 'delete.php'),
+ async:!sync,
+ type:'post',
+ data: {dir:$('#dir').val(),files:fileNames},
+ complete: function(data){
+ boolOperationFinished(data, function(){
+ OC.Notification.hide();
+ $.each(FileList.deleteFiles,function(index,file){
+ FileList.remove(file);
+ });
+ FileList.deleteCanceled=true;
+ FileList.deleteFiles=null;
+ FileList.lastAction = null;
+ if(ready){
+ ready();
+ }
+ });
+ }
+ });
+ }
+ },
+ prepareDeletion:function(files){
+>>>>>>> origin/master
if(files.substr){
files=[files];
}
@@ -323,16 +364,16 @@ $(document).ready(function(){
FileList.replaceIsNewFile = null;
}
FileList.lastAction = null;
- $('#notification').fadeOut('400');
+ OC.Notification.hide();
});
$('#notification .replace').live('click', function() {
- $('#notification').fadeOut('400', function() {
- FileList.replace($('#notification').data('oldName'), $('#notification').data('newName'), $('#notification').data('isNewFile'));
- });
+ OC.Notification.hide(function() {
+ 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');
+ OC.Notification.hide();
});
$('#notification .cancel').live('click', function() {
if ($('#notification').data('isNewFile')) {
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 795e065c0f3..ee7ba88fd1f 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -32,26 +32,28 @@ Files={
}
if(response.data !== undefined && response.data.uploadMaxFilesize !== undefined) {
$('#max_upload').val(response.data.uploadMaxFilesize);
- $('#data-upload-form a').attr('original-title', response.data.maxHumanFilesize);
+ $('#upload.button').attr('original-title', response.data.maxHumanFilesize);
+ $('#usedSpacePercent').val(response.data.usedSpacePercent);
+ Files.displayStorageWarnings();
}
if(response[0] == undefined) {
return;
}
if(response[0].uploadMaxFilesize !== undefined) {
$('#max_upload').val(response[0].uploadMaxFilesize);
- $('#data-upload-form a').attr('original-title', response[0].maxHumanFilesize);
+ $('#upload.button').attr('original-title', response[0].maxHumanFilesize);
+ $('#usedSpacePercent').val(response[0].usedSpacePercent);
+ Files.displayStorageWarnings();
}
},
isFileNameValid:function (name) {
if (name === '.') {
- $('#notification').text(t('files', '\'.\' is an invalid file name.'));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files', '\'.\' is an invalid file name.'));
return false;
}
if (name.length == 0) {
- $('#notification').text(t('files', 'File name cannot be empty.'));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files', 'File name cannot be empty.'));
return false;
}
@@ -59,13 +61,26 @@ Files={
var invalid_characters = ['\\', '/', '<', '>', ':', '"', '|', '?', '*'];
for (var i = 0; i < invalid_characters.length; i++) {
if (name.indexOf(invalid_characters[i]) != -1) {
- $('#notification').text(t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed."));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed."));
return false;
}
}
- $('#notification').fadeOut();
+ OC.Notification.hide();
return true;
+ },
+ displayStorageWarnings: function() {
+ if (!OC.Notification.isHidden()) {
+ return;
+ }
+
+ var usedSpacePercent = $('#usedSpacePercent').val();
+ if (usedSpacePercent > 98) {
+ OC.Notification.show(t('files', 'Your storage is full, files can not be updated or synced anymore!'));
+ return;
+ }
+ if (usedSpacePercent > 90) {
+ OC.Notification.show(t('files', 'Your storage is almost full ({usedSpacePercent}%)', {usedSpacePercent: usedSpacePercent}));
+ }
}
};
$(document).ready(function() {
@@ -206,8 +221,7 @@ $(document).ready(function() {
$('.download').click('click',function(event) {
var files=getSelectedFiles('name').join(';');
var dir=$('#dir').val()||'/';
- $('#notification').text(t('files','Your download is being prepared. This might take some time if the files are big.'));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files','Your download is being prepared. This might take some time if the files are big.'));
// use special download URL if provided, e.g. for public shared files
if ( (downloadURL = document.getElementById("downloadURL")) ) {
window.location=downloadURL.value+"&download&files="+files;
@@ -336,8 +350,7 @@ $(document).ready(function() {
var response;
response=jQuery.parseJSON(result);
if(response[0] == undefined || response[0].status != 'success') {
- $('#notification').text(t('files', response.data.message));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files', response.data.message));
}
Files.updateMaxUploadFilesize(response);
var file=response[0];
@@ -377,9 +390,7 @@ $(document).ready(function() {
uploadtext.text(t('files', '{count} files uploading', {count: currentUploads}));
}
delete uploadingFiles[dirName][fileName];
- $('#notification').hide();
- $('#notification').text(t('files', 'Upload cancelled.'));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files', 'Upload cancelled.'));
}
});
//TODO test with filenames containing slashes
@@ -406,20 +417,17 @@ $(document).ready(function() {
FileList.loadingDone(file.name, file.id);
} else {
Files.cancelUpload(this.files[0].name);
- $('#notification').text(t('files', response.data.message));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files', response.data.message));
$('#fileList > tr').not('[data-mime]').fadeOut();
$('#fileList > tr').not('[data-mime]').remove();
}
- })
- .error(function(jqXHR, textStatus, errorThrown) {
- if(errorThrown === 'abort') {
- Files.cancelUpload(this.files[0].name);
- $('#notification').hide();
- $('#notification').text(t('files', 'Upload cancelled.'));
- $('#notification').fadeIn();
- }
- });
+ })
+ .error(function(jqXHR, textStatus, errorThrown) {
+ if(errorThrown === 'abort') {
+ Files.cancelUpload(this.files[0].name);
+ OC.Notification.show(t('files', 'Upload cancelled.'));
+ }
+ });
uploadingFiles[uniqueName] = jqXHR;
}
}
@@ -440,8 +448,7 @@ $(document).ready(function() {
FileList.loadingDone(file.name, file.id);
} else {
//TODO Files.cancelUpload(/*where do we get the filename*/);
- $('#notification').text(t('files', response.data.message));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files', response.data.message));
$('#fileList > tr').not('[data-mime]').fadeOut();
$('#fileList > tr').not('[data-mime]').remove();
}
@@ -561,14 +568,12 @@ $(document).ready(function() {
event.preventDefault();
var newname=input.val();
if(type == 'web' && newname.length == 0) {
- $('#notification').text(t('files', 'URL cannot be empty.'));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files', 'URL cannot be empty.'));
return false;
} else if (type != 'web' && !Files.isFileNameValid(newname)) {
return false;
} else if( type == 'folder' && $('#dir').val() == '/' && newname == 'Shared') {
- $('#notification').text(t('files','Invalid folder name. Usage of \'Shared\' is reserved by Owncloud'));
- $('#notification').fadeIn();
+ OC.Notification.show(t('files','Invalid folder name. Usage of \'Shared\' is reserved by Owncloud'));
return false;
}
if (FileList.lastAction) {
@@ -739,6 +744,10 @@ $(document).ready(function() {
resizeBreadcrumbs(true);
+ // display storage warnings
+ setTimeout ( "Files.displayStorageWarnings()", 100 );
+ OC.Notification.setDefault(Files.displayStorageWarnings);
+
// file space size sync
function update_storage_statistics() {
$.getJSON(OC.filePath('files','ajax','getstoragestats.php'),function(response) {
diff --git a/apps/files/l10n/ar.php b/apps/files/l10n/ar.php
index d468b102875..b741815be45 100644
--- a/apps/files/l10n/ar.php
+++ b/apps/files/l10n/ar.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "إرفع",
"There is no error, the file uploaded with success" => "تم ترفيع الملفات بنجاح.",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "حجم الملف الذي تريد ترفيعه أعلى مما MAX_FILE_SIZE يسمح به في واجهة ال HTML.",
"The uploaded file was only partially uploaded" => "تم ترفيع جزء من الملفات الذي تريد ترفيعها فقط",
@@ -12,6 +11,7 @@
"Name" => "الاسم",
"Size" => "حجم",
"Modified" => "معدل",
+"Upload" => "إرفع",
"Maximum upload size" => "الحد الأقصى لحجم الملفات التي يمكن رفعها",
"Save" => "حفظ",
"New" => "جديد",
diff --git a/apps/files/l10n/bg_BG.php b/apps/files/l10n/bg_BG.php
index a8c2dc97e00..ae49f516999 100644
--- a/apps/files/l10n/bg_BG.php
+++ b/apps/files/l10n/bg_BG.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Качване",
"Missing a temporary folder" => "Липсва временна папка",
"Files" => "Файлове",
"Delete" => "Изтриване",
@@ -11,6 +10,7 @@
"Name" => "Име",
"Size" => "Размер",
"Modified" => "Променено",
+"Upload" => "Качване",
"Maximum upload size" => "Максимален размер за качване",
"0 is unlimited" => "Ползвайте 0 за без ограничения",
"Save" => "Запис",
diff --git a/apps/files/l10n/bn_BD.php b/apps/files/l10n/bn_BD.php
index e8e19c6898f..d59463bb7a0 100644
--- a/apps/files/l10n/bn_BD.php
+++ b/apps/files/l10n/bn_BD.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "আপলোড",
"Could not move %s - File with this name already exists" => "%s কে স্থানান্তর করা সম্ভব হলো না - এই নামের ফাইল বিদ্যমান",
"Could not move %s" => "%s কে স্থানান্তর করা সম্ভব হলো না",
"Unable to rename file" => "ফাইলের নাম পরিবর্তন করা সম্ভব হলো না",
@@ -11,7 +10,6 @@
"No file was uploaded" => "কোন ফাইল আপলোড করা হয় নি",
"Missing a temporary folder" => "অস্থায়ী ফোল্ডার খোয়া গিয়েছে",
"Failed to write to disk" => "ডিস্কে লিখতে ব্যর্থ",
-"Not enough space available" => "যথেষ্ঠ পরিমাণ স্থান নেই",
"Invalid directory." => "ভুল ডিরেক্টরি",
"Files" => "ফাইল",
"Unshare" => "ভাগাভাগি বাতিল ",
@@ -48,6 +46,7 @@
"{count} folders" => "{count} টি ফোল্ডার",
"1 file" => "১টি ফাইল",
"{count} files" => "{count} টি ফাইল",
+"Upload" => "আপলোড",
"File handling" => "ফাইল হ্যার্ডলিং",
"Maximum upload size" => "আপলোডের সর্বোচ্চ আকার",
"max. possible: " => "অনুমোদিত সর্বোচ্চ আকার",
diff --git a/apps/files/l10n/ca.php b/apps/files/l10n/ca.php
index be330fb82c2..ceec0264788 100644
--- a/apps/files/l10n/ca.php
+++ b/apps/files/l10n/ca.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Puja",
"Could not move %s - File with this name already exists" => "No s'ha pogut moure %s - Ja hi ha un fitxer amb aquest nom",
"Could not move %s" => " No s'ha pogut moure %s",
"Unable to rename file" => "No es pot canviar el nom del fitxer",
@@ -11,7 +10,7 @@
"No file was uploaded" => "El fitxer no s'ha pujat",
"Missing a temporary folder" => "S'ha perdut un fitxer temporal",
"Failed to write to disk" => "Ha fallat en escriure al disc",
-"Not enough space available" => "No hi ha prou espai disponible",
+"Not enough storage available" => "No hi ha prou espai disponible",
"Invalid directory." => "Directori no vàlid.",
"Files" => "Fitxers",
"Unshare" => "Deixa de compartir",
@@ -29,6 +28,9 @@
"'.' is an invalid file name." => "'.' és un nom no vàlid per un fitxer.",
"File name cannot be empty." => "El nom del fitxer no pot ser buit.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "El nóm no és vàlid, '\\', '/', '<', '>', ':', '\"', '|', '?' i '*' no estan permesos.",
+"Your storage is full, files can not be updated or synced anymore!" => "El vostre espai d'emmagatzemament és ple, els fitxers ja no es poden actualitzar o sincronitzar!",
+"Your storage is almost full ({usedSpacePercent}%)" => "El vostre espai d'emmagatzemament és gairebé ple ({usedSpacePercent}%)",
+"Your download is being prepared. This might take some time if the files are big." => "S'està preparant la baixada. Pot trigar una estona si els fitxers són grans.",
"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",
"Close" => "Tanca",
@@ -48,6 +50,7 @@
"{count} folders" => "{count} carpetes",
"1 file" => "1 fitxer",
"{count} files" => "{count} fitxers",
+"Upload" => "Puja",
"File handling" => "Gestió de fitxers",
"Maximum upload size" => "Mida màxima de pujada",
"max. possible: " => "màxim possible:",
diff --git a/apps/files/l10n/cs_CZ.php b/apps/files/l10n/cs_CZ.php
index a8d82ba5111..7a93c502b58 100644
--- a/apps/files/l10n/cs_CZ.php
+++ b/apps/files/l10n/cs_CZ.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Odeslat",
"Could not move %s - File with this name already exists" => "Nelze přesunout %s - existuje soubor se stejným názvem",
"Could not move %s" => "Nelze přesunout %s",
"Unable to rename file" => "Nelze přejmenovat soubor",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Žádný soubor nebyl odeslán",
"Missing a temporary folder" => "Chybí adresář pro dočasné soubory",
"Failed to write to disk" => "Zápis na disk selhal",
-"Not enough space available" => "Nedostatek dostupného místa",
"Invalid directory." => "Neplatný adresář",
"Files" => "Soubory",
"Unshare" => "Zrušit sdílení",
@@ -49,6 +47,7 @@
"{count} folders" => "{count} složky",
"1 file" => "1 soubor",
"{count} files" => "{count} soubory",
+"Upload" => "Odeslat",
"File handling" => "Zacházení se soubory",
"Maximum upload size" => "Maximální velikost pro odesílání",
"max. possible: " => "největší možná: ",
diff --git a/apps/files/l10n/da.php b/apps/files/l10n/da.php
index 010af12e960..c5e3647a7f4 100644
--- a/apps/files/l10n/da.php
+++ b/apps/files/l10n/da.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Upload",
"No file was uploaded. Unknown error" => "Ingen fil blev uploadet. Ukendt fejl.",
"There is no error, the file uploaded with success" => "Der er ingen fejl, filen blev uploadet med success",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Den uploadede fil overstiger upload_max_filesize direktivet i php.ini",
@@ -40,6 +39,7 @@
"{count} folders" => "{count} mapper",
"1 file" => "1 fil",
"{count} files" => "{count} filer",
+"Upload" => "Upload",
"File handling" => "Filhåndtering",
"Maximum upload size" => "Maksimal upload-størrelse",
"max. possible: " => "max. mulige: ",
diff --git a/apps/files/l10n/de.php b/apps/files/l10n/de.php
index c851f7df2a7..84aed12b5c1 100644
--- a/apps/files/l10n/de.php
+++ b/apps/files/l10n/de.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Hochladen",
"Could not move %s - File with this name already exists" => "Konnte %s nicht verschieben - Datei mit diesem Namen existiert bereits.",
"Could not move %s" => "Konnte %s nicht verschieben",
"Unable to rename file" => "Konnte Datei nicht umbenennen",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Es wurde keine Datei hochgeladen.",
"Missing a temporary folder" => "Temporärer Ordner fehlt.",
"Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte",
-"Not enough space available" => "Nicht genug Speicherplatz verfügbar",
"Invalid directory." => "Ungültiges Verzeichnis",
"Files" => "Dateien",
"Unshare" => "Nicht mehr freigeben",
@@ -49,6 +47,7 @@
"{count} folders" => "{count} Ordner",
"1 file" => "1 Datei",
"{count} files" => "{count} Dateien",
+"Upload" => "Hochladen",
"File handling" => "Dateibehandlung",
"Maximum upload size" => "Maximale Upload-Größe",
"max. possible: " => "maximal möglich:",
diff --git a/apps/files/l10n/de_DE.php b/apps/files/l10n/de_DE.php
index 281685b78df..d9c95573992 100644
--- a/apps/files/l10n/de_DE.php
+++ b/apps/files/l10n/de_DE.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Hochladen",
"Could not move %s - File with this name already exists" => "Konnte %s nicht verschieben - Datei mit diesem Namen existiert bereits",
"Could not move %s" => "Konnte %s nicht verschieben",
"Unable to rename file" => "Konnte Datei nicht umbenennen",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Es wurde keine Datei hochgeladen.",
"Missing a temporary folder" => "Der temporäre Ordner fehlt.",
"Failed to write to disk" => "Fehler beim Schreiben auf die Festplatte",
-"Not enough space available" => "Nicht genügend Speicherplatz verfügbar",
"Invalid directory." => "Ungültiges Verzeichnis.",
"Files" => "Dateien",
"Unshare" => "Nicht mehr freigeben",
@@ -49,6 +47,7 @@
"{count} folders" => "{count} Ordner",
"1 file" => "1 Datei",
"{count} files" => "{count} Dateien",
+"Upload" => "Hochladen",
"File handling" => "Dateibehandlung",
"Maximum upload size" => "Maximale Upload-Größe",
"max. possible: " => "maximal möglich:",
diff --git a/apps/files/l10n/el.php b/apps/files/l10n/el.php
index 274367b32a5..e3fbb892ff0 100644
--- a/apps/files/l10n/el.php
+++ b/apps/files/l10n/el.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Αποστολή",
"Could not move %s - File with this name already exists" => "Αδυναμία μετακίνησης του %s - υπάρχει ήδη αρχείο με αυτό το όνομα",
"Could not move %s" => "Αδυναμία μετακίνησης του %s",
"Unable to rename file" => "Αδυναμία μετονομασίας αρχείου",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Κανένα αρχείο δεν στάλθηκε",
"Missing a temporary folder" => "Λείπει ο προσωρινός φάκελος",
"Failed to write to disk" => "Αποτυχία εγγραφής στο δίσκο",
-"Not enough space available" => "Δεν υπάρχει αρκετός διαθέσιμος χώρος",
"Invalid directory." => "Μη έγκυρος φάκελος.",
"Files" => "Αρχεία",
"Unshare" => "Διακοπή κοινής χρήσης",
@@ -29,6 +27,7 @@
"'.' is an invalid file name." => "'.' είναι μη έγκυρο όνομα αρχείου.",
"File name cannot be empty." => "Το όνομα αρχείου δεν πρέπει να είναι κενό.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Μη έγκυρο όνομα, '\\', '/', '<', '>', ':', '\"', '|', '?' και '*' δεν επιτρέπονται.",
+"Your download is being prepared. This might take some time if the files are big." => "Η λήψη προετοιμάζεται. Αυτό μπορεί να πάρει ώρα εάν τα αρχεία έχουν μεγάλο μέγεθος.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Αδυναμία στην αποστολή του αρχείου σας αφού είναι φάκελος ή έχει 0 bytes",
"Upload Error" => "Σφάλμα Αποστολής",
"Close" => "Κλείσιμο",
@@ -48,6 +47,7 @@
"{count} folders" => "{count} φάκελοι",
"1 file" => "1 αρχείο",
"{count} files" => "{count} αρχεία",
+"Upload" => "Αποστολή",
"File handling" => "Διαχείριση αρχείων",
"Maximum upload size" => "Μέγιστο μέγεθος αποστολής",
"max. possible: " => "μέγιστο δυνατό:",
diff --git a/apps/files/l10n/eo.php b/apps/files/l10n/eo.php
index 0aebf9c034e..fc4367c55a3 100644
--- a/apps/files/l10n/eo.php
+++ b/apps/files/l10n/eo.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Alŝuti",
"Could not move %s - File with this name already exists" => "Ne eblis movi %s: dosiero kun ĉi tiu nomo jam ekzistas",
"Could not move %s" => "Ne eblis movi %s",
"Unable to rename file" => "Ne eblis alinomigi dosieron",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Neniu dosiero estas alŝutita",
"Missing a temporary folder" => "Mankas tempa dosierujo",
"Failed to write to disk" => "Malsukcesis skribo al disko",
-"Not enough space available" => "Ne haveblas sufiĉa spaco",
"Invalid directory." => "Nevalida dosierujo.",
"Files" => "Dosieroj",
"Unshare" => "Malkunhavigi",
@@ -49,6 +47,7 @@
"{count} folders" => "{count} dosierujoj",
"1 file" => "1 dosiero",
"{count} files" => "{count} dosierujoj",
+"Upload" => "Alŝuti",
"File handling" => "Dosieradministro",
"Maximum upload size" => "Maksimuma alŝutogrando",
"max. possible: " => "maks. ebla: ",
diff --git a/apps/files/l10n/es.php b/apps/files/l10n/es.php
index c76431ef383..1620208559f 100644
--- a/apps/files/l10n/es.php
+++ b/apps/files/l10n/es.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Subir",
"Could not move %s - File with this name already exists" => "No se puede mover %s - Ya existe un archivo con ese nombre",
"Could not move %s" => "No se puede mover %s",
"Unable to rename file" => "No se puede renombrar el archivo",
@@ -11,7 +10,6 @@
"No file was uploaded" => "No se ha subido ningún archivo",
"Missing a temporary folder" => "Falta un directorio temporal",
"Failed to write to disk" => "La escritura en disco ha fallado",
-"Not enough space available" => "No hay suficiente espacio disponible",
"Invalid directory." => "Directorio invalido.",
"Files" => "Archivos",
"Unshare" => "Dejar de compartir",
@@ -49,6 +47,7 @@
"{count} folders" => "{count} carpetas",
"1 file" => "1 archivo",
"{count} files" => "{count} archivos",
+"Upload" => "Subir",
"File handling" => "Tratamiento de archivos",
"Maximum upload size" => "Tamaño máximo de subida",
"max. possible: " => "máx. posible:",
diff --git a/apps/files/l10n/es_AR.php b/apps/files/l10n/es_AR.php
index 418844007b2..cd8347a14ad 100644
--- a/apps/files/l10n/es_AR.php
+++ b/apps/files/l10n/es_AR.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Subir",
"Could not move %s - File with this name already exists" => "No se pudo mover %s - Un archivo con este nombre ya existe",
"Could not move %s" => "No se pudo mover %s ",
"Unable to rename file" => "No fue posible cambiar el nombre al archivo",
@@ -11,7 +10,6 @@
"No file was uploaded" => "El archivo no fue subido",
"Missing a temporary folder" => "Falta un directorio temporal",
"Failed to write to disk" => "Error al escribir en el disco",
-"Not enough space available" => "No hay suficiente espacio disponible",
"Invalid directory." => "Directorio invalido.",
"Files" => "Archivos",
"Unshare" => "Dejar de compartir",
@@ -49,6 +47,7 @@
"{count} folders" => "{count} directorios",
"1 file" => "1 archivo",
"{count} files" => "{count} archivos",
+"Upload" => "Subir",
"File handling" => "Tratamiento de archivos",
"Maximum upload size" => "Tamaño máximo de subida",
"max. possible: " => "máx. posible:",
diff --git a/apps/files/l10n/et_EE.php b/apps/files/l10n/et_EE.php
index 8305cf0edea..1df237baa82 100644
--- a/apps/files/l10n/et_EE.php
+++ b/apps/files/l10n/et_EE.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Lae üles",
"No file was uploaded. Unknown error" => "Ühtegi faili ei laetud üles. Tundmatu viga",
"There is no error, the file uploaded with success" => "Ühtegi viga pole, fail on üles laetud",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Üles laetud faili suurus ületab HTML vormis määratud upload_max_filesize suuruse",
@@ -39,6 +38,7 @@
"{count} folders" => "{count} kausta",
"1 file" => "1 fail",
"{count} files" => "{count} faili",
+"Upload" => "Lae üles",
"File handling" => "Failide käsitlemine",
"Maximum upload size" => "Maksimaalne üleslaadimise suurus",
"max. possible: " => "maks. võimalik: ",
diff --git a/apps/files/l10n/eu.php b/apps/files/l10n/eu.php
index a1cb5632121..8b8f6d2bd17 100644
--- a/apps/files/l10n/eu.php
+++ b/apps/files/l10n/eu.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Igo",
"Could not move %s - File with this name already exists" => "Ezin da %s mugitu - Izen hau duen fitxategia dagoeneko existitzen da",
"Could not move %s" => "Ezin dira fitxategiak mugitu %s",
"Unable to rename file" => "Ezin izan da fitxategia berrizendatu",
@@ -11,7 +10,7 @@
"No file was uploaded" => "Ez da fitxategirik igo",
"Missing a temporary folder" => "Aldi baterako karpeta falta da",
"Failed to write to disk" => "Errore bat izan da diskoan idazterakoan",
-"Not enough space available" => "Ez dago leku nahikorik.",
+"Not enough storage available" => "Ez dago behar aina leku erabilgarri,",
"Invalid directory." => "Baliogabeko karpeta.",
"Files" => "Fitxategiak",
"Unshare" => "Ez elkarbanatu",
@@ -29,6 +28,9 @@
"'.' is an invalid file name." => "'.' ez da fitxategi izen baliogarria.",
"File name cannot be empty." => "Fitxategi izena ezin da hutsa izan.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "IZen aliogabea, '\\', '/', '<', '>', ':', '\"', '|', '?' eta '*' ez daude baimenduta.",
+"Your storage is full, files can not be updated or synced anymore!" => "Zure biltegiratzea beterik dago, ezingo duzu aurrerantzean fitxategirik igo edo sinkronizatu!",
+"Your storage is almost full ({usedSpacePercent}%)" => "Zure biltegiratzea nahiko beterik dago (%{usedSpacePercent})",
+"Your download is being prepared. This might take some time if the files are big." => "Zure deskarga prestatu egin behar da. Denbora bat har lezake fitxategiak handiak badira. ",
"Unable to upload your file as it is a directory or has 0 bytes" => "Ezin da zure fitxategia igo, karpeta bat da edo 0 byt ditu",
"Upload Error" => "Igotzean errore bat suertatu da",
"Close" => "Itxi",
@@ -48,6 +50,7 @@
"{count} folders" => "{count} karpeta",
"1 file" => "fitxategi bat",
"{count} files" => "{count} fitxategi",
+"Upload" => "Igo",
"File handling" => "Fitxategien kudeaketa",
"Maximum upload size" => "Igo daitekeen gehienezko tamaina",
"max. possible: " => "max, posiblea:",
diff --git a/apps/files/l10n/fa.php b/apps/files/l10n/fa.php
index 24059bdeaba..3d3bfad1f9b 100644
--- a/apps/files/l10n/fa.php
+++ b/apps/files/l10n/fa.php
@@ -1,26 +1,53 @@
<?php $TRANSLATIONS = array(
-"Upload" => "بارگذاری",
+"Could not move %s - File with this name already exists" => "%s نمی تواند حرکت کند - در حال حاضر پرونده با این نام وجود دارد. ",
+"Could not move %s" => "%s نمی تواند حرکت کند ",
+"Unable to rename file" => "قادر به تغییر نام پرونده نیست.",
"No file was uploaded. Unknown error" => "هیچ فایلی آپلود نشد.خطای ناشناس",
"There is no error, the file uploaded with success" => "هیچ خطایی وجود ندارد فایل با موفقیت بار گذاری شد",
+"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "پرونده آپلود شده بیش ازدستور ماکزیمم_حجم فایل_برای آپلود در php.ini استفاده کرده است.",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "حداکثر حجم مجاز برای بارگذاری از طریق HTML \nMAX_FILE_SIZE",
"The uploaded file was only partially uploaded" => "مقدار کمی از فایل بارگذاری شده",
"No file was uploaded" => "هیچ فایلی بارگذاری نشده",
"Missing a temporary folder" => "یک پوشه موقت گم شده است",
"Failed to write to disk" => "نوشتن بر روی دیسک سخت ناموفق بود",
+"Invalid directory." => "فهرست راهنما نامعتبر می باشد.",
"Files" => "فایل ها",
+"Unshare" => "لغو اشتراک",
"Delete" => "پاک کردن",
"Rename" => "تغییرنام",
+"{new_name} already exists" => "{نام _جدید} در حال حاضر وجود دارد.",
"replace" => "جایگزین",
+"suggest name" => "پیشنهاد نام",
"cancel" => "لغو",
+"replaced {new_name}" => "{نام _جدید} جایگزین شد ",
"undo" => "بازگشت",
+"replaced {new_name} with {old_name}" => "{نام_جدید} با { نام_قدیمی} جایگزین شد.",
+"unshared {files}" => "{ فایل های } قسمت نشده",
+"deleted {files}" => "{ فایل های } پاک شده",
+"'.' is an invalid file name." => "'.' یک نام پرونده نامعتبر است.",
+"File name cannot be empty." => "نام پرونده نمی تواند خالی باشد.",
+"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "نام نامعتبر ، '\\', '/', '<', '>', ':', '\"', '|', '?' و '*' مجاز نمی باشند.",
+"Your download is being prepared. This might take some time if the files are big." => "دانلود شما در حال آماده شدن است. در صورتیکه پرونده ها بزرگ باشند ممکن است مدتی طول بکشد.",
"Unable to upload your file as it is a directory or has 0 bytes" => "ناتوان در بارگذاری یا فایل یک پوشه است یا 0بایت دارد",
"Upload Error" => "خطا در بار گذاری",
"Close" => "بستن",
"Pending" => "در انتظار",
+"1 file uploading" => "1 پرونده آپلود شد.",
+"{count} files uploading" => "{ شمار } فایل های در حال آپلود",
"Upload cancelled." => "بار گذاری لغو شد",
+"File upload is in progress. Leaving the page now will cancel the upload." => "آپلودکردن پرونده در حال پیشرفت است. در صورت خروج از صفحه آپلود لغو میگردد. ",
+"URL cannot be empty." => "URL نمی تواند خالی باشد.",
+"Invalid folder name. Usage of 'Shared' is reserved by Owncloud" => "نام پوشه نامعتبر است. استفاده از \" به اشتراک گذاشته شده \" متعلق به سایت Owncloud است.",
+"{count} files scanned" => "{ شمار } فایل های اسکن شده",
+"error while scanning" => "خطا در حال انجام اسکن ",
"Name" => "نام",
"Size" => "اندازه",
"Modified" => "تغییر یافته",
+"1 folder" => "1 پوشه",
+"{count} folders" => "{ شمار} پوشه ها",
+"1 file" => "1 پرونده",
+"{count} files" => "{ شمار } فایل ها",
+"Upload" => "بارگذاری",
"File handling" => "اداره پرونده ها",
"Maximum upload size" => "حداکثر اندازه بارگزاری",
"max. possible: " => "حداکثرمقدارممکن:",
@@ -32,6 +59,7 @@
"New" => "جدید",
"Text file" => "فایل متنی",
"Folder" => "پوشه",
+"From link" => "از پیوند",
"Cancel upload" => "متوقف کردن بار گذاری",
"Nothing in here. Upload something!" => "اینجا هیچ چیز نیست.",
"Download" => "بارگیری",
diff --git a/apps/files/l10n/fi_FI.php b/apps/files/l10n/fi_FI.php
index fac93b1246b..ce236a30edb 100644
--- a/apps/files/l10n/fi_FI.php
+++ b/apps/files/l10n/fi_FI.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Lähetä",
"Could not move %s - File with this name already exists" => "Kohteen %s siirto ei onnistunut - Tiedosto samalla nimellä on jo olemassa",
"Could not move %s" => "Kohteen %s siirto ei onnistunut",
"Unable to rename file" => "Tiedoston nimeäminen uudelleen ei onnistunut",
@@ -10,7 +9,6 @@
"No file was uploaded" => "Yhtäkään tiedostoa ei lähetetty",
"Missing a temporary folder" => "Väliaikaiskansiota ei ole olemassa",
"Failed to write to disk" => "Levylle kirjoitus epäonnistui",
-"Not enough space available" => "Tilaa ei ole riittävästi",
"Invalid directory." => "Virheellinen kansio.",
"Files" => "Tiedostot",
"Unshare" => "Peru jakaminen",
@@ -39,6 +37,7 @@
"{count} folders" => "{count} kansiota",
"1 file" => "1 tiedosto",
"{count} files" => "{count} tiedostoa",
+"Upload" => "Lähetä",
"File handling" => "Tiedostonhallinta",
"Maximum upload size" => "Lähetettävän tiedoston suurin sallittu koko",
"max. possible: " => "suurin mahdollinen:",
diff --git a/apps/files/l10n/fr.php b/apps/files/l10n/fr.php
index 162c2e2dfda..6229b7e3a4d 100644
--- a/apps/files/l10n/fr.php
+++ b/apps/files/l10n/fr.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Envoyer",
"Could not move %s - File with this name already exists" => "Impossible de déplacer %s - Un fichier possédant ce nom existe déjà",
"Could not move %s" => "Impossible de déplacer %s",
"Unable to rename file" => "Impossible de renommer le fichier",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Aucun fichier n'a été téléversé",
"Missing a temporary folder" => "Il manque un répertoire temporaire",
"Failed to write to disk" => "Erreur d'écriture sur le disque",
-"Not enough space available" => "Espace disponible insuffisant",
"Invalid directory." => "Dossier invalide.",
"Files" => "Fichiers",
"Unshare" => "Ne plus partager",
@@ -29,6 +27,7 @@
"'.' is an invalid file name." => "'.' n'est pas un nom de fichier valide.",
"File name cannot be empty." => "Le nom de fichier ne peut être vide.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nom invalide, les caractères '\\', '/', '<', '>', ':', '\"', '|', '?' et '*' ne sont pas autorisés.",
+"Your download is being prepared. This might take some time if the files are big." => "Votre téléchargement est cours de préparation. Ceci peut nécessiter un certain temps si les fichiers sont volumineux.",
"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",
"Close" => "Fermer",
@@ -48,6 +47,7 @@
"{count} folders" => "{count} dossiers",
"1 file" => "1 fichier",
"{count} files" => "{count} fichiers",
+"Upload" => "Envoyer",
"File handling" => "Gestion des fichiers",
"Maximum upload size" => "Taille max. d'envoi",
"max. possible: " => "Max. possible :",
diff --git a/apps/files/l10n/gl.php b/apps/files/l10n/gl.php
index d24680eaa86..3bac12b351e 100644
--- a/apps/files/l10n/gl.php
+++ b/apps/files/l10n/gl.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Enviar",
"Could not move %s - File with this name already exists" => "Non se moveu %s - Xa existe un ficheiro con ese nome.",
"Could not move %s" => "Non se puido mover %s",
"Unable to rename file" => "Non se pode renomear o ficheiro",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Non se enviou ningún ficheiro",
"Missing a temporary folder" => "Falta un cartafol temporal",
"Failed to write to disk" => "Erro ao escribir no disco",
-"Not enough space available" => "O espazo dispoñíbel é insuficiente",
"Invalid directory." => "O directorio é incorrecto.",
"Files" => "Ficheiros",
"Unshare" => "Deixar de compartir",
@@ -48,6 +46,7 @@
"{count} folders" => "{count} cartafoles",
"1 file" => "1 ficheiro",
"{count} files" => "{count} ficheiros",
+"Upload" => "Enviar",
"File handling" => "Manexo de ficheiro",
"Maximum upload size" => "Tamaño máximo de envío",
"max. possible: " => "máx. posible: ",
diff --git a/apps/files/l10n/he.php b/apps/files/l10n/he.php
index 8acc544cf5f..62b397e129e 100644
--- a/apps/files/l10n/he.php
+++ b/apps/files/l10n/he.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "העלאה",
"No file was uploaded. Unknown error" => "לא הועלה קובץ. טעות בלתי מזוהה.",
"There is no error, the file uploaded with success" => "לא אירעה תקלה, הקבצים הועלו בהצלחה",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "הקבצים שנשלחו חורגים מהגודל שצוין בהגדרה upload_max_filesize שבקובץ php.ini:",
@@ -40,6 +39,7 @@
"{count} folders" => "{count} תיקיות",
"1 file" => "קובץ אחד",
"{count} files" => "{count} קבצים",
+"Upload" => "העלאה",
"File handling" => "טיפול בקבצים",
"Maximum upload size" => "גודל העלאה מקסימלי",
"max. possible: " => "המרבי האפשרי: ",
diff --git a/apps/files/l10n/hr.php b/apps/files/l10n/hr.php
index a9a7354d1d6..7000caf0d17 100644
--- a/apps/files/l10n/hr.php
+++ b/apps/files/l10n/hr.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Pošalji",
"There is no error, the file uploaded with success" => "Datoteka je poslana uspješno i bez pogrešaka",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Poslana datoteka izlazi iz okvira MAX_FILE_SIZE direktive postavljene u HTML obrascu",
"The uploaded file was only partially uploaded" => "Datoteka je poslana samo djelomično",
@@ -25,6 +24,7 @@
"Name" => "Naziv",
"Size" => "Veličina",
"Modified" => "Zadnja promjena",
+"Upload" => "Pošalji",
"File handling" => "datoteka za rukovanje",
"Maximum upload size" => "Maksimalna veličina prijenosa",
"max. possible: " => "maksimalna moguća: ",
diff --git a/apps/files/l10n/hu_HU.php b/apps/files/l10n/hu_HU.php
index 57cc0a86302..922b4f3097b 100644
--- a/apps/files/l10n/hu_HU.php
+++ b/apps/files/l10n/hu_HU.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Feltöltés",
"Could not move %s - File with this name already exists" => "%s áthelyezése nem sikerült - már létezik másik fájl ezzel a névvel",
"Could not move %s" => "Nem sikerült %s áthelyezése",
"Unable to rename file" => "Nem lehet átnevezni a fájlt",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Nem töltődött fel semmi",
"Missing a temporary folder" => "Hiányzik egy ideiglenes mappa",
"Failed to write to disk" => "Nem sikerült a lemezre történő írás",
-"Not enough space available" => "Nincs elég szabad hely",
"Invalid directory." => "Érvénytelen mappa.",
"Files" => "Fájlok",
"Unshare" => "Megosztás visszavonása",
@@ -29,6 +27,7 @@
"'.' is an invalid file name." => "'.' fájlnév érvénytelen.",
"File name cannot be empty." => "A fájlnév nem lehet semmi.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Érvénytelen elnevezés. Ezek a karakterek nem használhatók: '\\', '/', '<', '>', ':', '\"', '|', '?' és '*'",
+"Your download is being prepared. This might take some time if the files are big." => "Készül a letöltendő állomány. Ez eltarthat egy ideig, ha nagyok a fájlok.",
"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ű",
"Upload Error" => "Feltöltési hiba",
"Close" => "Bezárás",
@@ -48,6 +47,7 @@
"{count} folders" => "{count} mappa",
"1 file" => "1 fájl",
"{count} files" => "{count} fájl",
+"Upload" => "Feltöltés",
"File handling" => "Fájlkezelés",
"Maximum upload size" => "Maximális feltölthető fájlméret",
"max. possible: " => "max. lehetséges: ",
diff --git a/apps/files/l10n/ia.php b/apps/files/l10n/ia.php
index a7babb27d9e..ae614c1bf5d 100644
--- a/apps/files/l10n/ia.php
+++ b/apps/files/l10n/ia.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Incargar",
"The uploaded file was only partially uploaded" => "Le file incargate solmente esseva incargate partialmente",
"No file was uploaded" => "Nulle file esseva incargate",
"Missing a temporary folder" => "Manca un dossier temporari",
@@ -9,6 +8,7 @@
"Name" => "Nomine",
"Size" => "Dimension",
"Modified" => "Modificate",
+"Upload" => "Incargar",
"Maximum upload size" => "Dimension maxime de incargamento",
"Save" => "Salveguardar",
"New" => "Nove",
diff --git a/apps/files/l10n/id.php b/apps/files/l10n/id.php
index 46d9ad1a75a..3ebb9983291 100644
--- a/apps/files/l10n/id.php
+++ b/apps/files/l10n/id.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Unggah",
"There is no error, the file uploaded with success" => "Tidak ada galat, berkas sukses diunggah",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "File yang diunggah melampaui directive MAX_FILE_SIZE yang disebutan dalam form HTML.",
"The uploaded file was only partially uploaded" => "Berkas hanya diunggah sebagian",
@@ -21,6 +20,7 @@
"Name" => "Nama",
"Size" => "Ukuran",
"Modified" => "Dimodifikasi",
+"Upload" => "Unggah",
"File handling" => "Penanganan berkas",
"Maximum upload size" => "Ukuran unggah maksimum",
"max. possible: " => "Kemungkinan maks:",
diff --git a/apps/files/l10n/is.php b/apps/files/l10n/is.php
index c3adf0984e5..297853c8161 100644
--- a/apps/files/l10n/is.php
+++ b/apps/files/l10n/is.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Senda inn",
"Could not move %s - File with this name already exists" => "Gat ekki fært %s - Skrá með þessu nafni er þegar til",
"Could not move %s" => "Gat ekki fært %s",
"Unable to rename file" => "Gat ekki endurskýrt skrá",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Engin skrá skilaði sér",
"Missing a temporary folder" => "Vantar bráðabirgðamöppu",
"Failed to write to disk" => "Tókst ekki að skrifa á disk",
-"Not enough space available" => "Ekki nægt pláss tiltækt",
"Invalid directory." => "Ógild mappa.",
"Files" => "Skrár",
"Unshare" => "Hætta deilingu",
@@ -48,6 +46,7 @@
"{count} folders" => "{count} möppur",
"1 file" => "1 skrá",
"{count} files" => "{count} skrár",
+"Upload" => "Senda inn",
"File handling" => "Meðhöndlun skrár",
"Maximum upload size" => "Hámarks stærð innsendingar",
"max. possible: " => "hámark mögulegt: ",
diff --git a/apps/files/l10n/it.php b/apps/files/l10n/it.php
index 9e211ae21ac..63bc71d6729 100644
--- a/apps/files/l10n/it.php
+++ b/apps/files/l10n/it.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Carica",
"Could not move %s - File with this name already exists" => "Impossibile spostare %s - un file con questo nome esiste già",
"Could not move %s" => "Impossibile spostare %s",
"Unable to rename file" => "Impossibile rinominare il file",
@@ -11,7 +10,7 @@
"No file was uploaded" => "Nessun file è stato caricato",
"Missing a temporary folder" => "Cartella temporanea mancante",
"Failed to write to disk" => "Scrittura su disco non riuscita",
-"Not enough space available" => "Spazio disponibile insufficiente",
+"Not enough storage available" => "Spazio di archiviazione insufficiente",
"Invalid directory." => "Cartella non valida.",
"Files" => "File",
"Unshare" => "Rimuovi condivisione",
@@ -29,6 +28,8 @@
"'.' is an invalid file name." => "'.' non è un nome file valido.",
"File name cannot be empty." => "Il nome del file non può essere vuoto.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome non valido, '\\', '/', '<', '>', ':', '\"', '|', '?' e '*' non sono consentiti.",
+"Your storage is full, files can not be updated or synced anymore!" => "Lo spazio di archiviazione è pieno, i file non possono essere più aggiornati o sincronizzati!",
+"Your storage is almost full ({usedSpacePercent}%)" => "Lo spazio di archiviazione è quasi pieno ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Il tuo scaricamento è in fase di preparazione. Ciò potrebbe richiedere del tempo se i file sono grandi.",
"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",
@@ -49,6 +50,7 @@
"{count} folders" => "{count} cartelle",
"1 file" => "1 file",
"{count} files" => "{count} file",
+"Upload" => "Carica",
"File handling" => "Gestione file",
"Maximum upload size" => "Dimensione massima upload",
"max. possible: " => "numero mass.: ",
diff --git a/apps/files/l10n/ja_JP.php b/apps/files/l10n/ja_JP.php
index 750b4644d7c..5d4bf93e5eb 100644
--- a/apps/files/l10n/ja_JP.php
+++ b/apps/files/l10n/ja_JP.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "アップロード",
"Could not move %s - File with this name already exists" => "%s を移動できませんでした ― この名前のファイルはすでに存在します",
"Could not move %s" => "%s を移動できませんでした",
"Unable to rename file" => "ファイル名の変更ができません",
@@ -11,7 +10,6 @@
"No file was uploaded" => "ファイルはアップロードされませんでした",
"Missing a temporary folder" => "テンポラリフォルダが見つかりません",
"Failed to write to disk" => "ディスクへの書き込みに失敗しました",
-"Not enough space available" => "利用可能なスペースが十分にありません",
"Invalid directory." => "無効なディレクトリです。",
"Files" => "ファイル",
"Unshare" => "共有しない",
@@ -29,6 +27,7 @@
"'.' is an invalid file name." => "'.' は無効なファイル名です。",
"File name cannot be empty." => "ファイル名を空にすることはできません。",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "無効な名前、'\\', '/', '<', '>', ':', '\"', '|', '?', '*' は使用できません。",
+"Your download is being prepared. This might take some time if the files are big." => "ダウンロードの準備中です。ファイルサイズが大きい場合は少し時間がかかるかもしれません。",
"Unable to upload your file as it is a directory or has 0 bytes" => "ディレクトリもしくは0バイトのファイルはアップロードできません",
"Upload Error" => "アップロードエラー",
"Close" => "閉じる",
@@ -48,6 +47,7 @@
"{count} folders" => "{count} フォルダ",
"1 file" => "1 ファイル",
"{count} files" => "{count} ファイル",
+"Upload" => "アップロード",
"File handling" => "ファイル操作",
"Maximum upload size" => "最大アップロードサイズ",
"max. possible: " => "最大容量: ",
diff --git a/apps/files/l10n/ka_GE.php b/apps/files/l10n/ka_GE.php
index 3f5a532f6bd..08225c114d1 100644
--- a/apps/files/l10n/ka_GE.php
+++ b/apps/files/l10n/ka_GE.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "ატვირთვა",
"There is no error, the file uploaded with success" => "ჭოცდომა არ დაფიქსირდა, ფაილი წარმატებით აიტვირთა",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "ატვირთული ფაილი აჭარბებს MAX_FILE_SIZE დირექტივას, რომელიც მითითებულია HTML ფორმაში",
"The uploaded file was only partially uploaded" => "ატვირთული ფაილი მხოლოდ ნაწილობრივ აიტვირთა",
@@ -36,6 +35,7 @@
"{count} folders" => "{count} საქაღალდე",
"1 file" => "1 ფაილი",
"{count} files" => "{count} ფაილი",
+"Upload" => "ატვირთვა",
"File handling" => "ფაილის დამუშავება",
"Maximum upload size" => "მაქსიმუმ ატვირთის ზომა",
"max. possible: " => "მაქს. შესაძლებელი:",
diff --git a/apps/files/l10n/ko.php b/apps/files/l10n/ko.php
index 891b036761d..cd95d61e4dc 100644
--- a/apps/files/l10n/ko.php
+++ b/apps/files/l10n/ko.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "업로드",
"Could not move %s - File with this name already exists" => "%s 항목을 이동시키지 못하였음 - 파일 이름이 이미 존재함",
"Could not move %s" => "%s 항목을 이딩시키지 못하였음",
"Unable to rename file" => "파일 이름바꾸기 할 수 없음",
@@ -11,7 +10,6 @@
"No file was uploaded" => "업로드된 파일 없음",
"Missing a temporary folder" => "임시 폴더가 사라짐",
"Failed to write to disk" => "디스크에 쓰지 못했습니다",
-"Not enough space available" => "여유공간이 부족합니다",
"Invalid directory." => "올바르지 않은 디렉토리입니다.",
"Files" => "파일",
"Unshare" => "공유 해제",
@@ -48,6 +46,7 @@
"{count} folders" => "폴더 {count}개",
"1 file" => "파일 1개",
"{count} files" => "파일 {count}개",
+"Upload" => "업로드",
"File handling" => "파일 처리",
"Maximum upload size" => "최대 업로드 크기",
"max. possible: " => "최대 가능:",
diff --git a/apps/files/l10n/ku_IQ.php b/apps/files/l10n/ku_IQ.php
index ddd2c142788..5c5a3d6bd8f 100644
--- a/apps/files/l10n/ku_IQ.php
+++ b/apps/files/l10n/ku_IQ.php
@@ -1,8 +1,8 @@
<?php $TRANSLATIONS = array(
-"Upload" => "بارکردن",
"Close" => "داخستن",
"URL cannot be empty." => "ناونیشانی به‌سته‌ر نابێت به‌تاڵ بێت.",
"Name" => "ناو",
+"Upload" => "بارکردن",
"Save" => "پاشکه‌وتکردن",
"Folder" => "بوخچه",
"Download" => "داگرتن"
diff --git a/apps/files/l10n/lb.php b/apps/files/l10n/lb.php
index b041079f0d8..79ef4bc9417 100644
--- a/apps/files/l10n/lb.php
+++ b/apps/files/l10n/lb.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Eroplueden",
"There is no error, the file uploaded with success" => "Keen Feeler, Datei ass komplett ropgelueden ginn",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Déi ropgelueden Datei ass méi grouss wei d'MAX_FILE_SIZE Eegenschaft déi an der HTML form uginn ass",
"The uploaded file was only partially uploaded" => "Déi ropgelueden Datei ass nëmmen hallef ropgelueden ginn",
@@ -7,6 +6,7 @@
"Missing a temporary folder" => "Et feelt en temporären Dossier",
"Failed to write to disk" => "Konnt net op den Disk schreiwen",
"Files" => "Dateien",
+"Unshare" => "Net méi deelen",
"Delete" => "Läschen",
"replace" => "ersetzen",
"cancel" => "ofbriechen",
@@ -19,6 +19,7 @@
"Name" => "Numm",
"Size" => "Gréisst",
"Modified" => "Geännert",
+"Upload" => "Eroplueden",
"File handling" => "Fichier handling",
"Maximum upload size" => "Maximum Upload Gréisst ",
"max. possible: " => "max. méiglech:",
diff --git a/apps/files/l10n/lt_LT.php b/apps/files/l10n/lt_LT.php
index 22490f8e9fd..da209619e2a 100644
--- a/apps/files/l10n/lt_LT.php
+++ b/apps/files/l10n/lt_LT.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Įkelti",
"There is no error, the file uploaded with success" => "Klaidų nėra, failas įkeltas sėkmingai",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Įkeliamo failo dydis viršija MAX_FILE_SIZE parametrą, kuris yra nustatytas HTML formoje",
"The uploaded file was only partially uploaded" => "Failas buvo įkeltas tik dalinai",
@@ -36,6 +35,7 @@
"{count} folders" => "{count} aplankalai",
"1 file" => "1 failas",
"{count} files" => "{count} failai",
+"Upload" => "Įkelti",
"File handling" => "Failų tvarkymas",
"Maximum upload size" => "Maksimalus įkeliamo failo dydis",
"max. possible: " => "maks. galima:",
diff --git a/apps/files/l10n/lv.php b/apps/files/l10n/lv.php
index 589b7020c4a..b175b19bba9 100644
--- a/apps/files/l10n/lv.php
+++ b/apps/files/l10n/lv.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Augšuplādet",
"There is no error, the file uploaded with success" => "Viss kārtībā, augšupielāde veiksmīga",
"No file was uploaded" => "Neviens fails netika augšuplādēts",
"Missing a temporary folder" => "Trūkst pagaidu mapes",
@@ -20,6 +19,7 @@
"Name" => "Nosaukums",
"Size" => "Izmērs",
"Modified" => "Izmainīts",
+"Upload" => "Augšuplādet",
"File handling" => "Failu pārvaldība",
"Maximum upload size" => "Maksimālais failu augšuplādes apjoms",
"max. possible: " => "maksīmālais iespējamais:",
diff --git a/apps/files/l10n/mk.php b/apps/files/l10n/mk.php
index 2916e86a94d..0ca08d6bc6a 100644
--- a/apps/files/l10n/mk.php
+++ b/apps/files/l10n/mk.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Подигни",
"No file was uploaded. Unknown error" => "Ниту еден фајл не се вчита. Непозната грешка",
"There is no error, the file uploaded with success" => "Нема грешка, датотеката беше подигната успешно",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Подигнатата датотека ја надминува upload_max_filesize директивата во php.ini:",
@@ -40,6 +39,7 @@
"{count} folders" => "{count} папки",
"1 file" => "1 датотека",
"{count} files" => "{count} датотеки",
+"Upload" => "Подигни",
"File handling" => "Ракување со датотеки",
"Maximum upload size" => "Максимална големина за подигање",
"max. possible: " => "макс. можно:",
diff --git a/apps/files/l10n/ms_MY.php b/apps/files/l10n/ms_MY.php
index 23a2783cd9a..4ac26d80918 100644
--- a/apps/files/l10n/ms_MY.php
+++ b/apps/files/l10n/ms_MY.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Muat naik",
"No file was uploaded. Unknown error" => "Tiada fail dimuatnaik. Ralat tidak diketahui.",
"There is no error, the file uploaded with success" => "Tiada ralat, fail berjaya dimuat naik.",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Fail yang dimuat naik melebihi MAX_FILE_SIZE yang dinyatakan dalam form HTML ",
@@ -19,6 +18,7 @@
"Name" => "Nama ",
"Size" => "Saiz",
"Modified" => "Dimodifikasi",
+"Upload" => "Muat naik",
"File handling" => "Pengendalian fail",
"Maximum upload size" => "Saiz maksimum muat naik",
"max. possible: " => "maksimum:",
diff --git a/apps/files/l10n/nb_NO.php b/apps/files/l10n/nb_NO.php
index 48b873e1ef0..8bb7cfb2f9c 100644
--- a/apps/files/l10n/nb_NO.php
+++ b/apps/files/l10n/nb_NO.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Last opp",
"No file was uploaded. Unknown error" => "Ingen filer ble lastet opp. Ukjent feil.",
"There is no error, the file uploaded with success" => "Det er ingen feil. Filen ble lastet opp.",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Filstørrelsen overskrider maksgrensen på MAX_FILE_SIZE som ble oppgitt i HTML-skjemaet",
@@ -38,6 +37,7 @@
"{count} folders" => "{count} mapper",
"1 file" => "1 fil",
"{count} files" => "{count} filer",
+"Upload" => "Last opp",
"File handling" => "Filhåndtering",
"Maximum upload size" => "Maksimum opplastingsstørrelse",
"max. possible: " => "max. mulige:",
diff --git a/apps/files/l10n/nl.php b/apps/files/l10n/nl.php
index 4a9685e06c9..c78ac346d13 100644
--- a/apps/files/l10n/nl.php
+++ b/apps/files/l10n/nl.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Upload",
"Could not move %s - File with this name already exists" => "Kon %s niet verplaatsen - Er bestaat al een bestand met deze naam",
"Could not move %s" => "Kon %s niet verplaatsen",
"Unable to rename file" => "Kan bestand niet hernoemen",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Geen bestand geüpload",
"Missing a temporary folder" => "Een tijdelijke map mist",
"Failed to write to disk" => "Schrijven naar schijf mislukt",
-"Not enough space available" => "Niet genoeg ruimte beschikbaar",
"Invalid directory." => "Ongeldige directory.",
"Files" => "Bestanden",
"Unshare" => "Stop delen",
@@ -49,6 +47,7 @@
"{count} folders" => "{count} mappen",
"1 file" => "1 bestand",
"{count} files" => "{count} bestanden",
+"Upload" => "Upload",
"File handling" => "Bestand",
"Maximum upload size" => "Maximale bestandsgrootte voor uploads",
"max. possible: " => "max. mogelijk: ",
diff --git a/apps/files/l10n/nn_NO.php b/apps/files/l10n/nn_NO.php
index 8abbe1b6cd3..8a4ab91ea7e 100644
--- a/apps/files/l10n/nn_NO.php
+++ b/apps/files/l10n/nn_NO.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Last opp",
"There is no error, the file uploaded with success" => "Ingen feil, fila vart lasta opp",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Den opplasta fila er større enn variabelen MAX_FILE_SIZE i HTML-skjemaet",
"The uploaded file was only partially uploaded" => "Fila vart berre delvis lasta opp",
@@ -11,6 +10,7 @@
"Name" => "Namn",
"Size" => "Storleik",
"Modified" => "Endra",
+"Upload" => "Last opp",
"Maximum upload size" => "Maksimal opplastingsstorleik",
"Save" => "Lagre",
"New" => "Ny",
diff --git a/apps/files/l10n/oc.php b/apps/files/l10n/oc.php
index 87ec98e4cf8..76c8d6b655a 100644
--- a/apps/files/l10n/oc.php
+++ b/apps/files/l10n/oc.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Amontcarga",
"There is no error, the file uploaded with success" => "Amontcargament capitat, pas d'errors",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Lo fichièr amontcargat es mai gròs que la directiva «MAX_FILE_SIZE» especifiada dins lo formulari HTML",
"The uploaded file was only partially uploaded" => "Lo fichièr foguèt pas completament amontcargat",
@@ -24,6 +23,7 @@
"Name" => "Nom",
"Size" => "Talha",
"Modified" => "Modificat",
+"Upload" => "Amontcarga",
"File handling" => "Manejament de fichièr",
"Maximum upload size" => "Talha maximum d'amontcargament",
"max. possible: " => "max. possible: ",
diff --git a/apps/files/l10n/pl.php b/apps/files/l10n/pl.php
index 4166bac545d..477e14491f7 100644
--- a/apps/files/l10n/pl.php
+++ b/apps/files/l10n/pl.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Prześlij",
"Could not move %s - File with this name already exists" => "Nie można było przenieść %s - Plik o takiej nazwie już istnieje",
"Could not move %s" => "Nie można było przenieść %s",
"Unable to rename file" => "Nie można zmienić nazwy pliku",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Nie przesłano żadnego pliku",
"Missing a temporary folder" => "Brak katalogu tymczasowego",
"Failed to write to disk" => "Błąd zapisu na dysk",
-"Not enough space available" => "Za mało miejsca",
"Invalid directory." => "Zła ścieżka.",
"Files" => "Pliki",
"Unshare" => "Nie udostępniaj",
@@ -48,6 +46,7 @@
"{count} folders" => "{count} foldery",
"1 file" => "1 plik",
"{count} files" => "{count} pliki",
+"Upload" => "Prześlij",
"File handling" => "Zarządzanie plikami",
"Maximum upload size" => "Maksymalny rozmiar wysyłanego pliku",
"max. possible: " => "max. możliwych",
diff --git a/apps/files/l10n/pt_BR.php b/apps/files/l10n/pt_BR.php
index b199ded9fe0..33014297ee5 100644
--- a/apps/files/l10n/pt_BR.php
+++ b/apps/files/l10n/pt_BR.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Carregar",
"No file was uploaded. Unknown error" => "Nenhum arquivo foi transferido. Erro desconhecido",
"There is no error, the file uploaded with success" => "Não houve nenhum erro, o arquivo foi transferido com sucesso",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "O arquivo enviado excede a diretiva upload_max_filesize no php.ini: ",
@@ -40,6 +39,7 @@
"{count} folders" => "{count} pastas",
"1 file" => "1 arquivo",
"{count} files" => "{count} arquivos",
+"Upload" => "Carregar",
"File handling" => "Tratamento de Arquivo",
"Maximum upload size" => "Tamanho máximo para carregar",
"max. possible: " => "max. possível:",
diff --git a/apps/files/l10n/pt_PT.php b/apps/files/l10n/pt_PT.php
index d3f22513261..3ec34c449de 100644
--- a/apps/files/l10n/pt_PT.php
+++ b/apps/files/l10n/pt_PT.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Enviar",
"Could not move %s - File with this name already exists" => "Não foi possível mover o ficheiro %s - Já existe um ficheiro com esse nome",
"Could not move %s" => "Não foi possível move o ficheiro %s",
"Unable to rename file" => "Não foi possível renomear o ficheiro",
@@ -11,7 +10,7 @@
"No file was uploaded" => "Não foi enviado nenhum ficheiro",
"Missing a temporary folder" => "Falta uma pasta temporária",
"Failed to write to disk" => "Falhou a escrita no disco",
-"Not enough space available" => "Espaço em disco insuficiente!",
+"Not enough storage available" => "Não há espaço suficiente em disco",
"Invalid directory." => "Directório Inválido",
"Files" => "Ficheiros",
"Unshare" => "Deixar de partilhar",
@@ -29,6 +28,9 @@
"'.' is an invalid file name." => "'.' não é um nome de ficheiro válido!",
"File name cannot be empty." => "O nome do ficheiro não pode estar vazio.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome Inválido, os caracteres '\\', '/', '<', '>', ':', '\"', '|', '?' e '*' não são permitidos.",
+"Your storage is full, files can not be updated or synced anymore!" => "O seu armazenamento está cheio, os ficheiros não podem ser sincronizados.",
+"Your storage is almost full ({usedSpacePercent}%)" => "O seu espaço de armazenamento está quase cheiro ({usedSpacePercent}%)",
+"Your download is being prepared. This might take some time if the files are big." => "O seu download está a ser preparado. Este processo pode demorar algum tempo se os ficheiros forem grandes.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Não é possível fazer o envio do ficheiro devido a ser uma pasta ou ter 0 bytes",
"Upload Error" => "Erro no envio",
"Close" => "Fechar",
@@ -48,6 +50,7 @@
"{count} folders" => "{count} pastas",
"1 file" => "1 ficheiro",
"{count} files" => "{count} ficheiros",
+"Upload" => "Enviar",
"File handling" => "Manuseamento de ficheiros",
"Maximum upload size" => "Tamanho máximo de envio",
"max. possible: " => "max. possivel: ",
diff --git a/apps/files/l10n/ro.php b/apps/files/l10n/ro.php
index fdba003bf3e..424450e920f 100644
--- a/apps/files/l10n/ro.php
+++ b/apps/files/l10n/ro.php
@@ -1,5 +1,5 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Încarcă",
+"Could not move %s - File with this name already exists" => "Nu se poate de mutat %s - Fișier cu acest nume deja există",
"Could not move %s" => "Nu s-a putut muta %s",
"Unable to rename file" => "Nu s-a putut redenumi fișierul",
"No file was uploaded. Unknown error" => "Nici un fișier nu a fost încărcat. Eroare necunoscută",
@@ -10,7 +10,6 @@
"No file was uploaded" => "Niciun fișier încărcat",
"Missing a temporary folder" => "Lipsește un dosar temporar",
"Failed to write to disk" => "Eroare la scriere pe disc",
-"Not enough space available" => "Nu este suficient spațiu disponibil",
"Invalid directory." => "Director invalid.",
"Files" => "Fișiere",
"Unshare" => "Anulează partajarea",
@@ -28,6 +27,7 @@
"'.' is an invalid file name." => "'.' este un nume invalid de fișier.",
"File name cannot be empty." => "Numele fișierului nu poate rămâne gol.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nume invalid, '\\', '/', '<', '>', ':', '\"', '|', '?' si '*' nu sunt permise.",
+"Your download is being prepared. This might take some time if the files are big." => "Se pregătește descărcarea. Aceasta poate să dureze ceva timp dacă fișierele sunt mari.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Nu s-a putut încărca fișierul tău deoarece pare să fie un director sau are 0 bytes.",
"Upload Error" => "Eroare la încărcare",
"Close" => "Închide",
@@ -47,6 +47,7 @@
"{count} folders" => "{count} foldare",
"1 file" => "1 fisier",
"{count} files" => "{count} fisiere",
+"Upload" => "Încarcă",
"File handling" => "Manipulare fișiere",
"Maximum upload size" => "Dimensiune maximă admisă la încărcare",
"max. possible: " => "max. posibil:",
diff --git a/apps/files/l10n/ru.php b/apps/files/l10n/ru.php
index cb17476b9f8..ae103a9e810 100644
--- a/apps/files/l10n/ru.php
+++ b/apps/files/l10n/ru.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Загрузить",
"Could not move %s - File with this name already exists" => "Невозможно переместить %s - файл с таким именем уже существует",
"Could not move %s" => "Невозможно переместить %s",
"Unable to rename file" => "Невозможно переименовать файл",
@@ -11,7 +10,6 @@
"No file was uploaded" => "Файл не был загружен",
"Missing a temporary folder" => "Невозможно найти временную папку",
"Failed to write to disk" => "Ошибка записи на диск",
-"Not enough space available" => "Недостаточно свободного места",
"Invalid directory." => "Неправильный каталог.",
"Files" => "Файлы",
"Unshare" => "Отменить публикацию",
@@ -48,6 +46,7 @@
"{count} folders" => "{count} папок",
"1 file" => "1 файл",
"{count} files" => "{count} файлов",
+"Upload" => "Загрузить",
"File handling" => "Управление файлами",
"Maximum upload size" => "Максимальный размер загружаемого файла",
"max. possible: " => "макс. возможно: ",
diff --git a/apps/files/l10n/ru_RU.php b/apps/files/l10n/ru_RU.php
index 4f8bd1d5b95..60a7fd0f71e 100644
--- a/apps/files/l10n/ru_RU.php
+++ b/apps/files/l10n/ru_RU.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Загрузить ",
"No file was uploaded. Unknown error" => "Файл не был загружен. Неизвестная ошибка",
"There is no error, the file uploaded with success" => "Ошибка отсутствует, файл загружен успешно.",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Размер загружаемого файла превышает upload_max_filesize директиву в php.ini:",
@@ -40,6 +39,7 @@
"{count} folders" => "{количество} папок",
"1 file" => "1 файл",
"{count} files" => "{количество} файлов",
+"Upload" => "Загрузить ",
"File handling" => "Работа с файлами",
"Maximum upload size" => "Максимальный размер загружаемого файла",
"max. possible: " => "Максимально возможный",
diff --git a/apps/files/l10n/si_LK.php b/apps/files/l10n/si_LK.php
index 8b276bdaa8f..133737cb57a 100644
--- a/apps/files/l10n/si_LK.php
+++ b/apps/files/l10n/si_LK.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "උඩුගත කිරීම",
"No file was uploaded. Unknown error" => "ගොනුවක් උඩුගත නොවුනි. නොහැඳිනු දෝෂයක්",
"There is no error, the file uploaded with success" => "නිවැරදි ව ගොනුව උඩුගත කෙරිනි",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "උඩුගත කළ ගොනුවේ විශාලත්වය HTML පෝරමයේ නියම කළ ඇති MAX_FILE_SIZE විශාලත්වයට වඩා වැඩිය",
@@ -27,6 +26,7 @@
"Modified" => "වෙනස් කළ",
"1 folder" => "1 ෆොල්ඩරයක්",
"1 file" => "1 ගොනුවක්",
+"Upload" => "උඩුගත කිරීම",
"File handling" => "ගොනු පරිහරණය",
"Maximum upload size" => "උඩුගත කිරීමක උපරිම ප්‍රමාණය",
"max. possible: " => "හැකි උපරිමය:",
diff --git a/apps/files/l10n/sk_SK.php b/apps/files/l10n/sk_SK.php
index b28e2648fef..bae5670d061 100644
--- a/apps/files/l10n/sk_SK.php
+++ b/apps/files/l10n/sk_SK.php
@@ -1,5 +1,7 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Odoslať",
+"Could not move %s - File with this name already exists" => "Nie je možné presunúť %s - súbor s týmto menom už existuje",
+"Could not move %s" => "Nie je možné presunúť %s",
+"Unable to rename file" => "Nemožno premenovať súbor",
"No file was uploaded. Unknown error" => "Žiaden súbor nebol odoslaný. Neznáma chyba",
"There is no error, the file uploaded with success" => "Nenastala žiadna chyba, súbor bol úspešne nahraný",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Nahraný súbor predčil konfiguračnú direktívu upload_max_filesize v súbore php.ini:",
@@ -8,6 +10,7 @@
"No file was uploaded" => "Žiaden súbor nebol nahraný",
"Missing a temporary folder" => "Chýbajúci dočasný priečinok",
"Failed to write to disk" => "Zápis na disk sa nepodaril",
+"Invalid directory." => "Neplatný adresár",
"Files" => "Súbory",
"Unshare" => "Nezdielať",
"Delete" => "Odstrániť",
@@ -21,7 +24,10 @@
"replaced {new_name} with {old_name}" => "prepísaný {new_name} súborom {old_name}",
"unshared {files}" => "zdieľanie zrušené pre {files}",
"deleted {files}" => "zmazané {files}",
+"'.' is an invalid file name." => "'.' je neplatné meno súboru.",
+"File name cannot be empty." => "Meno súboru nemôže byť prázdne",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nesprávne meno, '\\', '/', '<', '>', ':', '\"', '|', '?' a '*' nie sú povolené hodnoty.",
+"Your download is being prepared. This might take some time if the files are big." => "Vaše sťahovanie sa pripravuje. Ak sú sťahované súbory veľké, môže to chvíľu trvať.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Nemôžem nahrať súbor lebo je to priečinok alebo má 0 bajtov.",
"Upload Error" => "Chyba odosielania",
"Close" => "Zavrieť",
@@ -31,6 +37,7 @@
"Upload cancelled." => "Odosielanie zrušené",
"File upload is in progress. Leaving the page now will cancel the upload." => "Opustenie stránky zruší práve prebiehajúce odosielanie súboru.",
"URL cannot be empty." => "URL nemôže byť prázdne",
+"Invalid folder name. Usage of 'Shared' is reserved by Owncloud" => "Neplatné meno adresára. Používanie mena 'Shared' je vyhradené len pre Owncloud",
"{count} files scanned" => "{count} súborov prehľadaných",
"error while scanning" => "chyba počas kontroly",
"Name" => "Meno",
@@ -40,6 +47,7 @@
"{count} folders" => "{count} priečinkov",
"1 file" => "1 súbor",
"{count} files" => "{count} súborov",
+"Upload" => "Odoslať",
"File handling" => "Nastavenie správanie k súborom",
"Maximum upload size" => "Maximálna veľkosť odosielaného súboru",
"max. possible: " => "najväčšie možné:",
diff --git a/apps/files/l10n/sl.php b/apps/files/l10n/sl.php
index 34544e3401c..fbc6ab83b8b 100644
--- a/apps/files/l10n/sl.php
+++ b/apps/files/l10n/sl.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Pošlji",
"No file was uploaded. Unknown error" => "Nobena datoteka ni naložena. Neznana napaka.",
"There is no error, the file uploaded with success" => "Datoteka je uspešno naložena brez napak.",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Naložena datoteka presega dovoljeno velikost. Le-ta je določena z vrstico upload_max_filesize v datoteki php.ini:",
@@ -40,6 +39,7 @@
"{count} folders" => "{count} map",
"1 file" => "1 datoteka",
"{count} files" => "{count} datotek",
+"Upload" => "Pošlji",
"File handling" => "Upravljanje z datotekami",
"Maximum upload size" => "Največja velikost za pošiljanja",
"max. possible: " => "največ mogoče:",
diff --git a/apps/files/l10n/sr.php b/apps/files/l10n/sr.php
index 3da6e27373f..71da2da4d14 100644
--- a/apps/files/l10n/sr.php
+++ b/apps/files/l10n/sr.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Отпреми",
"There is no error, the file uploaded with success" => "Није дошло до грешке. Датотека је успешно отпремљена.",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Отпремљена датотека прелази смерницу upload_max_filesize у датотеци php.ini:",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Отпремљена датотека прелази смерницу MAX_FILE_SIZE која је наведена у HTML обрасцу",
@@ -38,6 +37,7 @@
"{count} folders" => "{count} фасцикле/и",
"1 file" => "1 датотека",
"{count} files" => "{count} датотеке/а",
+"Upload" => "Отпреми",
"File handling" => "Управљање датотекама",
"Maximum upload size" => "Највећа величина датотеке",
"max. possible: " => "највећа величина:",
diff --git a/apps/files/l10n/sr@latin.php b/apps/files/l10n/sr@latin.php
index 117d437f0bb..0fda24532dc 100644
--- a/apps/files/l10n/sr@latin.php
+++ b/apps/files/l10n/sr@latin.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Pošalji",
"There is no error, the file uploaded with success" => "Nema greške, fajl je uspešno poslat",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Poslati fajl prevazilazi direktivu MAX_FILE_SIZE koja je navedena u HTML formi",
"The uploaded file was only partially uploaded" => "Poslati fajl je samo delimično otpremljen!",
@@ -11,6 +10,7 @@
"Name" => "Ime",
"Size" => "Veličina",
"Modified" => "Zadnja izmena",
+"Upload" => "Pošalji",
"Maximum upload size" => "Maksimalna veličina pošiljke",
"Save" => "Snimi",
"Nothing in here. Upload something!" => "Ovde nema ničeg. Pošaljite nešto!",
diff --git a/apps/files/l10n/sv.php b/apps/files/l10n/sv.php
index df75f15e7a7..5cb8d58e3a7 100644
--- a/apps/files/l10n/sv.php
+++ b/apps/files/l10n/sv.php
@@ -1,5 +1,7 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Ladda upp",
+"Could not move %s - File with this name already exists" => "Kunde inte flytta %s - Det finns redan en fil med detta namn",
+"Could not move %s" => "Kan inte flytta %s",
+"Unable to rename file" => "Kan inte byta namn på filen",
"No file was uploaded. Unknown error" => "Ingen fil uppladdad. Okänt fel",
"There is no error, the file uploaded with success" => "Inga fel uppstod. Filen laddades upp utan problem",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Den uppladdade filen överskrider upload_max_filesize direktivet php.ini:",
@@ -8,7 +10,6 @@
"No file was uploaded" => "Ingen fil blev uppladdad",
"Missing a temporary folder" => "Saknar en tillfällig mapp",
"Failed to write to disk" => "Misslyckades spara till disk",
-"Not enough space available" => "Inte tillräckligt med utrymme tillgängligt",
"Invalid directory." => "Felaktig mapp.",
"Files" => "Filer",
"Unshare" => "Sluta dela",
@@ -26,6 +27,7 @@
"'.' is an invalid file name." => "'.' är ett ogiltigt filnamn.",
"File name cannot be empty." => "Filnamn kan inte vara tomt.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ogiltigt namn, '\\', '/', '<', '>', ':', '\"', '|', '?' och '*' är inte tillåtet.",
+"Your download is being prepared. This might take some time if the files are big." => "Din nedladdning förbereds. Det kan ta tid om det är stora filer.",
"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",
"Close" => "Stäng",
@@ -45,6 +47,7 @@
"{count} folders" => "{count} mappar",
"1 file" => "1 fil",
"{count} files" => "{count} filer",
+"Upload" => "Ladda upp",
"File handling" => "Filhantering",
"Maximum upload size" => "Maximal storlek att ladda upp",
"max. possible: " => "max. möjligt:",
diff --git a/apps/files/l10n/ta_LK.php b/apps/files/l10n/ta_LK.php
index d7a9313d974..52916fed774 100644
--- a/apps/files/l10n/ta_LK.php
+++ b/apps/files/l10n/ta_LK.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "பதிவேற்றுக",
"No file was uploaded. Unknown error" => "ஒரு கோப்பும் பதிவேற்றப்படவில்லை. அறியப்படாத வழு",
"There is no error, the file uploaded with success" => "இங்கு வழு இல்லை, கோப்பு வெற்றிகரமாக பதிவேற்றப்பட்டது",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "பதிவேற்றப்பட்ட கோப்பானது HTML படிவத்தில் குறிப்பிடப்பட்டுள்ள MAX_FILE_SIZE directive ஐ விட கூடியது",
@@ -39,6 +38,7 @@
"{count} folders" => "{எண்ணிக்கை} கோப்புறைகள்",
"1 file" => "1 கோப்பு",
"{count} files" => "{எண்ணிக்கை} கோப்புகள்",
+"Upload" => "பதிவேற்றுக",
"File handling" => "கோப்பு கையாளுதல்",
"Maximum upload size" => "பதிவேற்றக்கூடிய ஆகக்கூடிய அளவு ",
"max. possible: " => "ஆகக் கூடியது:",
diff --git a/apps/files/l10n/th_TH.php b/apps/files/l10n/th_TH.php
index f2394f04495..de5c7bec833 100644
--- a/apps/files/l10n/th_TH.php
+++ b/apps/files/l10n/th_TH.php
@@ -1,5 +1,7 @@
<?php $TRANSLATIONS = array(
-"Upload" => "อัพโหลด",
+"Could not move %s - File with this name already exists" => "ไม่สามารถย้าย %s ได้ - ไฟล์ที่ใช้ชื่อนี้มีอยู่แล้ว",
+"Could not move %s" => "ไม่สามารถย้าย %s ได้",
+"Unable to rename file" => "ไม่สามารถเปลี่ยนชื่อไฟล์ได้",
"No file was uploaded. Unknown error" => "ยังไม่มีไฟล์ใดที่ถูกอัพโหลด เกิดข้อผิดพลาดที่ไม่ทราบสาเหตุ",
"There is no error, the file uploaded with success" => "ไม่มีข้อผิดพลาดใดๆ ไฟล์ถูกอัพโหลดเรียบร้อยแล้ว",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "ขนาดไฟล์ที่อัพโหลดมีขนาดเกิน upload_max_filesize ที่ระบุไว้ใน php.ini",
@@ -8,6 +10,7 @@
"No file was uploaded" => "ยังไม่มีไฟล์ที่ถูกอัพโหลด",
"Missing a temporary folder" => "แฟ้มเอกสารชั่วคราวเกิดการสูญหาย",
"Failed to write to disk" => "เขียนข้อมูลลงแผ่นดิสก์ล้มเหลว",
+"Invalid directory." => "ไดเร็กทอรี่ไม่ถูกต้อง",
"Files" => "ไฟล์",
"Unshare" => "ยกเลิกการแชร์ข้อมูล",
"Delete" => "ลบ",
@@ -21,7 +24,10 @@
"replaced {new_name} with {old_name}" => "แทนที่ {new_name} ด้วย {old_name} แล้ว",
"unshared {files}" => "ยกเลิกการแชร์แล้ว {files} ไฟล์",
"deleted {files}" => "ลบไฟล์แล้ว {files} ไฟล์",
+"'.' is an invalid file name." => "'.' เป็นชื่อไฟล์ที่ไม่ถูกต้อง",
+"File name cannot be empty." => "ชื่อไฟล์ไม่สามารถเว้นว่างได้",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "ชื่อที่ใช้ไม่ถูกต้อง, '\\', '/', '<', '>', ':', '\"', '|', '?' และ '*' ไม่ได้รับอนุญาตให้ใช้งานได้",
+"Your download is being prepared. This might take some time if the files are big." => "กำลังเตรียมดาวน์โหลดข้อมูล หากไฟล์มีขนาดใหญ่ อาจใช้เวลาสักครู่",
"Unable to upload your file as it is a directory or has 0 bytes" => "ไม่สามารถอัพโหลดไฟล์ของคุณได้ เนื่องจากไฟล์ดังกล่าวเป็นไดเร็กทอรี่หรือมีขนาด 0 ไบต์",
"Upload Error" => "เกิดข้อผิดพลาดในการอัพโหลด",
"Close" => "ปิด",
@@ -31,6 +37,7 @@
"Upload cancelled." => "การอัพโหลดถูกยกเลิก",
"File upload is in progress. Leaving the page now will cancel the upload." => "การอัพโหลดไฟล์กำลังอยู่ในระหว่างดำเนินการ การออกจากหน้าเว็บนี้จะทำให้การอัพโหลดถูกยกเลิก",
"URL cannot be empty." => "URL ไม่สามารถเว้นว่างได้",
+"Invalid folder name. Usage of 'Shared' is reserved by Owncloud" => "ชื่อโฟลเดอร์ไม่ถูกต้อง การใช้งาน 'แชร์' สงวนไว้สำหรับ Owncloud เท่านั้น",
"{count} files scanned" => "สแกนไฟล์แล้ว {count} ไฟล์",
"error while scanning" => "พบข้อผิดพลาดในระหว่างการสแกนไฟล์",
"Name" => "ชื่อ",
@@ -40,6 +47,7 @@
"{count} folders" => "{count} โฟลเดอร์",
"1 file" => "1 ไฟล์",
"{count} files" => "{count} ไฟล์",
+"Upload" => "อัพโหลด",
"File handling" => "การจัดกาไฟล์",
"Maximum upload size" => "ขนาดไฟล์สูงสุดที่อัพโหลดได้",
"max. possible: " => "จำนวนสูงสุดที่สามารถทำได้: ",
diff --git a/apps/files/l10n/tr.php b/apps/files/l10n/tr.php
index c49c7e47dd3..2eba20fd0ae 100644
--- a/apps/files/l10n/tr.php
+++ b/apps/files/l10n/tr.php
@@ -1,5 +1,7 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Yükle",
+"Could not move %s - File with this name already exists" => "%s taşınamadı. Bu isimde dosya zaten var.",
+"Could not move %s" => "%s taşınamadı",
+"Unable to rename file" => "Dosya adı değiştirilemedi",
"No file was uploaded. Unknown error" => "Dosya yüklenmedi. Bilinmeyen hata",
"There is no error, the file uploaded with success" => "Bir hata yok, dosya başarıyla yüklendi",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "php.ini dosyasında upload_max_filesize ile belirtilen dosya yükleme sınırı aşıldı.",
@@ -8,6 +10,7 @@
"No file was uploaded" => "Hiç dosya yüklenmedi",
"Missing a temporary folder" => "Geçici bir klasör eksik",
"Failed to write to disk" => "Diske yazılamadı",
+"Invalid directory." => "Geçersiz dizin.",
"Files" => "Dosyalar",
"Unshare" => "Paylaşılmayan",
"Delete" => "Sil",
@@ -21,7 +24,10 @@
"replaced {new_name} with {old_name}" => "{new_name} ismi {old_name} ile değiştirildi",
"unshared {files}" => "paylaşılmamış {files}",
"deleted {files}" => "silinen {files}",
+"'.' is an invalid file name." => "'.' geçersiz dosya adı.",
+"File name cannot be empty." => "Dosya adı boş olamaz.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Geçersiz isim, '\\', '/', '<', '>', ':', '\"', '|', '?' ve '*' karakterlerine izin verilmemektedir.",
+"Your download is being prepared. This might take some time if the files are big." => "İndirmeniz hazırlanıyor. Dosya büyük ise biraz zaman alabilir.",
"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ı",
"Close" => "Kapat",
@@ -31,6 +37,7 @@
"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.",
"URL cannot be empty." => "URL boş olamaz.",
+"Invalid folder name. Usage of 'Shared' is reserved by Owncloud" => "Geçersiz dizin adı. Shared isminin kullanımı Owncloud tarafından rezerver edilmiştir.",
"{count} files scanned" => "{count} dosya tarandı",
"error while scanning" => "tararamada hata oluşdu",
"Name" => "Ad",
@@ -40,6 +47,7 @@
"{count} folders" => "{count} dizin",
"1 file" => "1 dosya",
"{count} files" => "{count} dosya",
+"Upload" => "Yükle",
"File handling" => "Dosya taşıma",
"Maximum upload size" => "Maksimum yükleme boyutu",
"max. possible: " => "mümkün olan en fazla: ",
diff --git a/apps/files/l10n/uk.php b/apps/files/l10n/uk.php
index f1279bc77c8..aafa035ea09 100644
--- a/apps/files/l10n/uk.php
+++ b/apps/files/l10n/uk.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Відвантажити",
"No file was uploaded. Unknown error" => "Не завантажено жодного файлу. Невідома помилка",
"There is no error, the file uploaded with success" => "Файл успішно вивантажено без помилок.",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Розмір звантаження перевищує upload_max_filesize параметра в php.ini: ",
@@ -40,6 +39,7 @@
"{count} folders" => "{count} папок",
"1 file" => "1 файл",
"{count} files" => "{count} файлів",
+"Upload" => "Відвантажити",
"File handling" => "Робота з файлами",
"Maximum upload size" => "Максимальний розмір відвантажень",
"max. possible: " => "макс.можливе:",
diff --git a/apps/files/l10n/vi.php b/apps/files/l10n/vi.php
index dcaf8900014..ce4f3a7973f 100644
--- a/apps/files/l10n/vi.php
+++ b/apps/files/l10n/vi.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "Tải lên",
"No file was uploaded. Unknown error" => "Không có tập tin nào được tải lên. Lỗi không xác định",
"There is no error, the file uploaded with success" => "Không có lỗi, các tập tin đã được tải lên thành công",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Kích thước những tập tin tải lên vượt quá MAX_FILE_SIZE đã được quy định",
@@ -39,6 +38,7 @@
"{count} folders" => "{count} thư mục",
"1 file" => "1 tập tin",
"{count} files" => "{count} tập tin",
+"Upload" => "Tải lên",
"File handling" => "Xử lý tập tin",
"Maximum upload size" => "Kích thước tối đa ",
"max. possible: " => "tối đa cho phép:",
diff --git a/apps/files/l10n/zh_CN.GB2312.php b/apps/files/l10n/zh_CN.GB2312.php
index 4416ce9a4a2..ae1b603369a 100644
--- a/apps/files/l10n/zh_CN.GB2312.php
+++ b/apps/files/l10n/zh_CN.GB2312.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "上传",
"No file was uploaded. Unknown error" => "没有上传文件。未知错误",
"There is no error, the file uploaded with success" => "没有任何错误,文件上传成功了",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "上传的文件超过了HTML表单指定的MAX_FILE_SIZE",
@@ -38,6 +37,7 @@
"{count} folders" => "{count} 个文件夹",
"1 file" => "1 个文件",
"{count} files" => "{count} 个文件",
+"Upload" => "上传",
"File handling" => "文件处理中",
"Maximum upload size" => "最大上传大小",
"max. possible: " => "最大可能",
diff --git a/apps/files/l10n/zh_CN.php b/apps/files/l10n/zh_CN.php
index 3e9a13b5194..2e0f938dcd8 100644
--- a/apps/files/l10n/zh_CN.php
+++ b/apps/files/l10n/zh_CN.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "上传",
"Could not move %s - File with this name already exists" => "无法移动 %s - 同名文件已存在",
"Could not move %s" => "无法移动 %s",
"Unable to rename file" => "无法重命名文件",
@@ -11,7 +10,6 @@
"No file was uploaded" => "文件没有上传",
"Missing a temporary folder" => "缺少临时目录",
"Failed to write to disk" => "写入磁盘失败",
-"Not enough space available" => "没有足够可用空间",
"Invalid directory." => "无效文件夹。",
"Files" => "文件",
"Unshare" => "取消分享",
@@ -29,6 +27,7 @@
"'.' is an invalid file name." => "'.' 是一个无效的文件名。",
"File name cannot be empty." => "文件名不能为空。",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "无效名称,'\\', '/', '<', '>', ':', '\"', '|', '?' 和 '*' 不被允许使用。",
+"Your download is being prepared. This might take some time if the files are big." => "下载正在准备中。如果文件较大可能会花费一些时间。",
"Unable to upload your file as it is a directory or has 0 bytes" => "无法上传文件,因为它是一个目录或者大小为 0 字节",
"Upload Error" => "上传错误",
"Close" => "关闭",
@@ -48,6 +47,7 @@
"{count} folders" => "{count} 个文件夹",
"1 file" => "1 个文件",
"{count} files" => "{count} 个文件",
+"Upload" => "上传",
"File handling" => "文件处理",
"Maximum upload size" => "最大上传大小",
"max. possible: " => "最大允许: ",
diff --git a/apps/files/l10n/zh_TW.php b/apps/files/l10n/zh_TW.php
index 61f8c288288..8d41a927355 100644
--- a/apps/files/l10n/zh_TW.php
+++ b/apps/files/l10n/zh_TW.php
@@ -1,5 +1,4 @@
<?php $TRANSLATIONS = array(
-"Upload" => "上傳",
"Could not move %s - File with this name already exists" => "無法移動 %s - 同名的檔案已經存在",
"Could not move %s" => "無法移動 %s",
"Unable to rename file" => "無法重新命名檔案",
@@ -11,7 +10,6 @@
"No file was uploaded" => "無已上傳檔案",
"Missing a temporary folder" => "遺失暫存資料夾",
"Failed to write to disk" => "寫入硬碟失敗",
-"Not enough space available" => "沒有足夠的可用空間",
"Invalid directory." => "無效的資料夾。",
"Files" => "檔案",
"Unshare" => "取消共享",
@@ -29,6 +27,7 @@
"'.' is an invalid file name." => "'.' 是不合法的檔名。",
"File name cannot be empty." => "檔名不能為空。",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "檔名不合法,不允許 '\\', '/', '<', '>', ':', '\"', '|', '?' 和 '*' 。",
+"Your download is being prepared. This might take some time if the files are big." => "正在準備您的下載,若您的檔案較大,將會需要更多時間。",
"Unable to upload your file as it is a directory or has 0 bytes" => "無法上傳您的檔案因為它可能是一個目錄或檔案大小為0",
"Upload Error" => "上傳發生錯誤",
"Close" => "關閉",
@@ -48,6 +47,7 @@
"{count} folders" => "{count} 個資料夾",
"1 file" => "1 個檔案",
"{count} files" => "{count} 個檔案",
+"Upload" => "上傳",
"File handling" => "檔案處理",
"Maximum upload size" => "最大上傳檔案大小",
"max. possible: " => "最大允許:",
diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php
new file mode 100644
index 00000000000..f2b1f142e9b
--- /dev/null
+++ b/apps/files/lib/helper.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace OCA\files\lib;
+
+class Helper
+{
+ public static function buildFileStorageStatistics($dir) {
+ $l = new \OC_L10N('files');
+ $maxUploadFilesize = \OCP\Util::maxUploadFilesize($dir);
+ $maxHumanFilesize = \OCP\Util::humanFileSize($maxUploadFilesize);
+ $maxHumanFilesize = $l->t('Upload') . ' max. ' . $maxHumanFilesize;
+
+ // information about storage capacities
+ $storageInfo = \OC_Helper::getStorageInfo();
+
+ return array('uploadMaxFilesize' => $maxUploadFilesize,
+ 'maxHumanFilesize' => $maxHumanFilesize,
+ 'usedSpacePercent' => (int)$storageInfo['relative']);
+ }
+}
diff --git a/apps/files/settings.php b/apps/files/settings.php
index 52ec9fd0fe3..ea730a5a727 100644
--- a/apps/files/settings.php
+++ b/apps/files/settings.php
@@ -21,10 +21,6 @@
*
*/
-
-// Init owncloud
-
-
// Check if we are a user
OCP\User::checkLoggedIn();
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index f6b4c29d5a2..2d4ed9ab2d9 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -54,7 +54,6 @@
<?php endif;?>
<input type="hidden" name="permissions" value="<?php echo $_['permissions']; ?>" id="permissions">
</div>
-<div id='notification'></div>
<?php if (isset($_['files']) and $_['isCreatable'] and count($_['files'])==0):?>
<div id="emptyfolder"><?php echo $l->t('Nothing in here. Upload something!')?></div>
@@ -119,3 +118,4 @@
<!-- config hints for javascript -->
<input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php echo $_['allowZipDownload']; ?>" />
+<input type="hidden" name="usedSpacePercent" id="usedSpacePercent" value="<?php echo $_['usedSpacePercent']; ?>" />
diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php
index 1970a80e1b7..f3f06d61d66 100644
--- a/apps/files/templates/part.list.php
+++ b/apps/files/templates/part.list.php
@@ -1,10 +1,4 @@
-<script type="text/javascript">
-<?php if ( array_key_exists('disableSharing', $_) && $_['disableSharing'] == true ) :?>
- var disableSharing = true;
-<?php else: ?>
- var disableSharing = false;
-<?php endif; ?>
-</script>
+<input type="hidden" id="disableSharing" data-status="<?php echo $_['disableSharing']; ?>">
<?php foreach($_['files'] as $file):
$simple_file_size = OCP\simple_file_size($file['size']);
diff --git a/apps/files_encryption/ajax/mode.php b/apps/files_encryption/ajax/mode.php
new file mode 100644
index 00000000000..64c5be94401
--- /dev/null
+++ b/apps/files_encryption/ajax/mode.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Copyright (c) 2012, Bjoern Schiessle <schiessle@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
+use OCA\Encryption\Keymanager;
+
+OCP\JSON::checkAppEnabled('files_encryption');
+OCP\JSON::checkLoggedIn();
+OCP\JSON::callCheck();
+
+$mode = $_POST['mode'];
+$changePasswd = false;
+$passwdChanged = false;
+
+if ( isset($_POST['newpasswd']) && isset($_POST['oldpasswd']) ) {
+ $oldpasswd = $_POST['oldpasswd'];
+ $newpasswd = $_POST['newpasswd'];
+ $changePasswd = true;
+ $passwdChanged = Keymanager::changePasswd($oldpasswd, $newpasswd);
+}
+
+$query = \OC_DB::prepare( "SELECT mode FROM *PREFIX*encryption WHERE uid = ?" );
+$result = $query->execute(array(\OCP\User::getUser()));
+
+if ($result->fetchRow()){
+ $query = OC_DB::prepare( 'UPDATE *PREFIX*encryption SET mode = ? WHERE uid = ?' );
+} else {
+ $query = OC_DB::prepare( 'INSERT INTO *PREFIX*encryption ( mode, uid ) VALUES( ?, ? )' );
+}
+
+if ( (!$changePasswd || $passwdChanged) && $query->execute(array($mode, \OCP\User::getUser())) ) {
+ OCP\JSON::success();
+} else {
+ OCP\JSON::error();
+} \ No newline at end of file
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index 2a30d0beb67..31b430d37a9 100644
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -1,21 +1,37 @@
<?php
-OC::$CLASSPATH['OC_Crypt'] = 'apps/files_encryption/lib/crypt.php';
-OC::$CLASSPATH['OC_CryptStream'] = 'apps/files_encryption/lib/cryptstream.php';
-OC::$CLASSPATH['OC_FileProxy_Encryption'] = 'apps/files_encryption/lib/proxy.php';
+OC::$CLASSPATH['OCA\Encryption\Crypt'] = 'apps/files_encryption/lib/crypt.php';
+OC::$CLASSPATH['OCA\Encryption\Hooks'] = 'apps/files_encryption/hooks/hooks.php';
+OC::$CLASSPATH['OCA\Encryption\Util'] = 'apps/files_encryption/lib/util.php';
+OC::$CLASSPATH['OCA\Encryption\Keymanager'] = 'apps/files_encryption/lib/keymanager.php';
+OC::$CLASSPATH['OCA\Encryption\Stream'] = 'apps/files_encryption/lib/stream.php';
+OC::$CLASSPATH['OCA\Encryption\Proxy'] = 'apps/files_encryption/lib/proxy.php';
+OC::$CLASSPATH['OCA\Encryption\Session'] = 'apps/files_encryption/lib/session.php';
-OC_FileProxy::register(new OC_FileProxy_Encryption());
+OC_FileProxy::register( new OCA\Encryption\Proxy() );
-OCP\Util::connectHook('OC_User', 'post_login', 'OC_Crypt', 'loginListener');
+OCP\Util::connectHook( 'OC_User','post_login', 'OCA\Encryption\Hooks', 'login' );
+OCP\Util::connectHook( 'OC_Webdav_Properties', 'update', 'OCA\Encryption\Hooks', 'updateKeyfile' );
+OCP\Util::connectHook( 'OC_User','post_setPassword','OCA\Encryption\Hooks' ,'setPassphrase' );
-stream_wrapper_register('crypt', 'OC_CryptStream');
+stream_wrapper_register( 'crypt', 'OCA\Encryption\Stream' );
-// 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()) {
+$session = new OCA\Encryption\Session();
+
+if (
+! $session->getPrivateKey( \OCP\USER::getUser() )
+&& OCP\User::isLoggedIn()
+&& OCA\Encryption\Crypt::mode() == 'server'
+) {
+
+ // Force the user to re-log in if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled)
OCP\User::logout();
- header("Location: ".OC::$WEBROOT.'/');
+
+ header( "Location: " . OC::$WEBROOT.'/' );
+
exit();
+
}
-OCP\App::registerAdmin('files_encryption', 'settings'); \ No newline at end of file
+OCP\App::registerAdmin( 'files_encryption', 'settings');
+OCP\App::registerPersonal( 'files_encryption', 'settings-personal' ); \ No newline at end of file
diff --git a/apps/files_encryption/appinfo/database.xml b/apps/files_encryption/appinfo/database.xml
new file mode 100644
index 00000000000..d294c35d63d
--- /dev/null
+++ b/apps/files_encryption/appinfo/database.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<database>
+ <name>*dbname*</name>
+ <create>true</create>
+ <overwrite>false</overwrite>
+ <charset>utf8</charset>
+ <table>
+ <name>*dbprefix*encryption</name>
+ <declaration>
+ <field>
+ <name>uid</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>64</length>
+ </field>
+ <field>
+ <name>mode</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>64</length>
+ </field>
+ </declaration>
+ </table>
+</database> \ No newline at end of file
diff --git a/apps/files_encryption/appinfo/info.xml b/apps/files_encryption/appinfo/info.xml
index 48a28fde78a..39ea155488f 100644
--- a/apps/files_encryption/appinfo/info.xml
+++ b/apps/files_encryption/appinfo/info.xml
@@ -2,10 +2,10 @@
<info>
<id>files_encryption</id>
<name>Encryption</name>
- <description>Server side encryption of files. DEPRECATED. This app is no longer supported and will be replaced with an improved version in ownCloud 5. Only enable this features if you want to read old encrypted data. Warning: You will lose your data if you enable this App and forget your password. Encryption is not yet compatible with LDAP.</description>
+ <description>Server side encryption of files. Warning: You will lose your data if you enable this App and forget your password. Encryption is not yet compatible with LDAP.</description>
<licence>AGPL</licence>
- <author>Robin Appelman</author>
- <require>4.9</require>
+ <author>Sam Tuke</author>
+ <require>4</require>
<shipped>true</shipped>
<types>
<filesystem/>
diff --git a/apps/files_encryption/appinfo/version b/apps/files_encryption/appinfo/version
index 2f4536184bc..7dff5b89211 100644
--- a/apps/files_encryption/appinfo/version
+++ b/apps/files_encryption/appinfo/version
@@ -1 +1 @@
-0.2 \ No newline at end of file
+0.2.1 \ No newline at end of file
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
new file mode 100644
index 00000000000..c2f97247835
--- /dev/null
+++ b/apps/files_encryption/hooks/hooks.php
@@ -0,0 +1,143 @@
+<?php
+/**
+ * ownCloud
+ *
+ * @author Sam Tuke
+ * @copyright 2012 Sam Tuke samtuke@owncloud.org
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Encryption;
+
+/**
+ * Class for hook specific logic
+ */
+
+class Hooks {
+
+ # TODO: use passphrase for encrypting private key that is separate to the login password
+
+ /**
+ * @brief Startup encryption backend upon user login
+ * @note This method should never be called for users using client side encryption
+ */
+ public static function login( $params ) {
+
+// if ( Crypt::mode( $params['uid'] ) == 'server' ) {
+
+ # TODO: use lots of dependency injection here
+
+ $view = new \OC_FilesystemView( '/' );
+
+ $util = new Util( $view, $params['uid'] );
+
+ if ( ! $util->ready() ) {
+
+ \OC_Log::write( 'Encryption library', 'User account "' . $params['uid'] . '" is not ready for encryption; configuration started' , \OC_Log::DEBUG );
+
+ return $util->setupServerSide( $params['password'] );
+
+ }
+
+ \OC_FileProxy::$enabled = false;
+
+ $encryptedKey = Keymanager::getPrivateKey( $view, $params['uid'] );
+
+ \OC_FileProxy::$enabled = true;
+
+ # TODO: dont manually encrypt the private keyfile - use the config options of openssl_pkey_export instead for better mobile compatibility
+
+ $privateKey = Crypt::symmetricDecryptFileContent( $encryptedKey, $params['password'] );
+
+ $session = new Session();
+
+ $session->setPrivateKey( $privateKey, $params['uid'] );
+
+ $view1 = new \OC_FilesystemView( '/' . $params['uid'] );
+
+ // Set legacy encryption key if it exists, to support
+ // depreciated encryption system
+ if (
+ $view1->file_exists( 'encryption.key' )
+ && $legacyKey = $view1->file_get_contents( 'encryption.key' )
+ ) {
+
+ $_SESSION['legacyenckey'] = Crypt::legacyDecrypt( $legacyKey, $params['password'] );
+
+ }
+// }
+
+ return true;
+
+ }
+
+ /**
+ * @brief Change a user's encryption passphrase
+ * @param array $params keys: uid, password
+ */
+ public static function setPassphrase( $params ) {
+
+ // Only attempt to change passphrase if server-side encryption
+ // is in use (client-side encryption does not have access to
+ // the necessary keys)
+ if ( Crypt::mode() == 'server' ) {
+
+ // Get existing decrypted private key
+ $privateKey = $_SESSION['privateKey'];
+
+ // Encrypt private key with new user pwd as passphrase
+ $encryptedPrivateKey = Crypt::symmetricEncryptFileContent( $privateKey, $params['password'] );
+
+ // Save private key
+ Keymanager::setPrivateKey( $encryptedPrivateKey );
+
+ # NOTE: Session does not need to be updated as the
+ # private key has not changed, only the passphrase
+ # used to decrypt it has changed
+
+ }
+
+ }
+
+ /**
+ * @brief update the encryption key of the file uploaded by the client
+ */
+ public static function updateKeyfile( $params ) {
+
+ if ( Crypt::mode() == 'client' ) {
+
+ if ( isset( $params['properties']['key'] ) ) {
+
+ Keymanager::setFileKey( $params['path'], $params['properties']['key'] );
+
+ } else {
+
+ \OC_Log::write(
+ 'Encryption library', "Client side encryption is enabled but the client doesn't provide a encryption key for the file!"
+ , \OC_Log::ERROR
+ );
+
+ error_log( "Client side encryption is enabled but the client doesn't provide an encryption key for the file!" );
+
+ }
+
+ }
+
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/apps/files_encryption/js/settings-personal.js b/apps/files_encryption/js/settings-personal.js
new file mode 100644
index 00000000000..1a53e99d2b4
--- /dev/null
+++ b/apps/files_encryption/js/settings-personal.js
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2012, Bjoern Schiessle <schiessle@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or later.
+ * See the COPYING-README file.
+ */
+
+$(document).ready(function(){
+ $('input[name=encryption_mode]').change(function(){
+ var prevmode = document.getElementById('prev_encryption_mode').value
+ var client=$('input[value="client"]:checked').val()
+ ,server=$('input[value="server"]:checked').val()
+ ,user=$('input[value="user"]:checked').val()
+ ,none=$('input[value="none"]:checked').val()
+ if (client) {
+ $.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'client' });
+ if (prevmode == 'server') {
+ OC.dialogs.info(t('encryption', 'Please switch to your ownCloud client and change your encryption password to complete the conversion.'), t('encryption', 'switched to client side encryption'));
+ }
+ } else if (server) {
+ if (prevmode == 'client') {
+ OC.dialogs.form([{text:'Login password', name:'newpasswd', type:'password'},{text:'Encryption password used on the client', name:'oldpasswd', type:'password'}],t('encryption', 'Change encryption password to login password'), function(data) {
+ $.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'server', newpasswd: data[0].value, oldpasswd: data[1].value }, function(result) {
+ if (result.status != 'success') {
+ document.getElementById(prevmode+'_encryption').checked = true;
+ OC.dialogs.alert(t('encryption', 'Please check your passwords and try again.'), t('encryption', 'Could not change your file encryption password to your login password'))
+ } else {
+ console.log("alles super");
+ }
+ }, true);
+ });
+ } else {
+ $.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'server' });
+ }
+ } else {
+ $.post(OC.filePath('files_encryption', 'ajax', 'mode.php'), { mode: 'none' });
+ }
+ })
+}) \ No newline at end of file
diff --git a/apps/files_encryption/js/settings.js b/apps/files_encryption/js/settings.js
index 6fc70eba7f6..60563bde859 100644
--- a/apps/files_encryption/js/settings.js
+++ b/apps/files_encryption/js/settings.js
@@ -11,14 +11,36 @@ $(document).ready(function(){
onuncheck:blackListChange,
createText:'...',
});
-
+
function blackListChange(){
var blackList=$('#encryption_blacklist').val().join(',');
OC.AppConfig.setValue('files_encryption','type_blacklist',blackList);
}
- $('#enable_encryption').change(function(){
- var checked=$('#enable_encryption').is(':checked');
- OC.AppConfig.setValue('files_encryption','enable_encryption',(checked)?'true':'false');
- });
-});
+ //TODO: Handle switch between client and server side encryption
+ $('input[name=encryption_mode]').change(function(){
+ var client=$('input[value="client"]:checked').val()
+ ,server=$('input[value="server"]:checked').val()
+ ,user=$('input[value="user"]:checked').val()
+ ,none=$('input[value="none"]:checked').val()
+ ,disable=false
+ if (client) {
+ OC.AppConfig.setValue('files_encryption','mode','client');
+ disable = true;
+ } else if (server) {
+ OC.AppConfig.setValue('files_encryption','mode','server');
+ disable = true;
+ } else if (user) {
+ OC.AppConfig.setValue('files_encryption','mode','user');
+ disable = true;
+ } else {
+ OC.AppConfig.setValue('files_encryption','mode','none');
+ }
+ if (disable) {
+ document.getElementById('server_encryption').disabled = true;
+ document.getElementById('client_encryption').disabled = true;
+ document.getElementById('user_encryption').disabled = true;
+ document.getElementById('none_encryption').disabled = true;
+ }
+ })
+}) \ No newline at end of file
diff --git a/apps/files_encryption/l10n/ar.php b/apps/files_encryption/l10n/ar.php
index 756a9d72799..f08585e485f 100644
--- a/apps/files_encryption/l10n/ar.php
+++ b/apps/files_encryption/l10n/ar.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "التشفير",
"Exclude the following file types from encryption" => "استبعد أنواع الملفات التالية من التشفير",
-"None" => "لا شيء",
-"Enable Encryption" => "تفعيل التشفير"
+"None" => "لا شيء"
);
diff --git a/apps/files_encryption/l10n/bg_BG.php b/apps/files_encryption/l10n/bg_BG.php
index cb1613ef375..4ceee127af1 100644
--- a/apps/files_encryption/l10n/bg_BG.php
+++ b/apps/files_encryption/l10n/bg_BG.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Криптиране",
-"Enable Encryption" => "Включване на криптирането",
-"None" => "Няма",
-"Exclude the following file types from encryption" => "Изключване на следните файлови типове от криптирането"
+"Exclude the following file types from encryption" => "Изключване на следните файлови типове от криптирането",
+"None" => "Няма"
);
diff --git a/apps/files_encryption/l10n/bn_BD.php b/apps/files_encryption/l10n/bn_BD.php
index c8f041d7622..29c486b8ca0 100644
--- a/apps/files_encryption/l10n/bn_BD.php
+++ b/apps/files_encryption/l10n/bn_BD.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "সংকেতায়ন",
-"Enable Encryption" => "সংকেতায়ন সক্রিয় কর",
-"None" => "কোনটিই নয়",
-"Exclude the following file types from encryption" => "সংকেতায়ন থেকে নিম্নোক্ত ধরণসমূহ বাদ দাও"
+"Exclude the following file types from encryption" => "সংকেতায়ন থেকে নিম্নোক্ত ধরণসমূহ বাদ দাও",
+"None" => "কোনটিই নয়"
);
diff --git a/apps/files_encryption/l10n/ca.php b/apps/files_encryption/l10n/ca.php
index 8e087b34620..56c81e747f7 100644
--- a/apps/files_encryption/l10n/ca.php
+++ b/apps/files_encryption/l10n/ca.php
@@ -1,6 +1,16 @@
<?php $TRANSLATIONS = array(
+"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "Connecteu-vos al client ownCloud i canvieu la contrasenya d'encriptació per completar la conversió.",
+"switched to client side encryption" => "s'ha commutat a l'encriptació per part del client",
+"Change encryption password to login password" => "Canvia la contrasenya d'encriptació per la d'accés",
+"Please check your passwords and try again." => "Comproveu les contrasenyes i proveu-ho de nou.",
+"Could not change your file encryption password to your login password" => "No s'ha pogut canviar la contrasenya d'encriptació de fitxers per la d'accés",
+"Choose encryption mode:" => "Escolliu el mode d'encriptació:",
+"Client side encryption (most secure but makes it impossible to access your data from the web interface)" => "Encriptació per part del client (més segura però fa impossible l'accés a les dades des de la interfície web)",
+"Server side encryption (allows you to access your files from the web interface and the desktop client)" => "Encriptació per part del servidor (permet accedir als fitxers des de la interfície web i des del client d'escriptori)",
+"None (no encryption at all)" => "Cap (sense encriptació)",
+"Important: Once you selected an encryption mode there is no way to change it back" => "Important: quan seleccioneu un mode d'encriptació no hi ha manera de canviar-lo de nou",
+"User specific (let the user decide)" => "Específic per usuari (permet que l'usuari ho decideixi)",
"Encryption" => "Encriptatge",
"Exclude the following file types from encryption" => "Exclou els tipus de fitxers següents de l'encriptatge",
-"None" => "Cap",
-"Enable Encryption" => "Activa l'encriptatge"
+"None" => "Cap"
);
diff --git a/apps/files_encryption/l10n/cs_CZ.php b/apps/files_encryption/l10n/cs_CZ.php
index 9be2be98092..5948a9b82e8 100644
--- a/apps/files_encryption/l10n/cs_CZ.php
+++ b/apps/files_encryption/l10n/cs_CZ.php
@@ -1,6 +1,16 @@
<?php $TRANSLATIONS = array(
+"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "Prosím přejděte na svého klienta ownCloud a nastavte šifrovací heslo pro dokončení konverze.",
+"switched to client side encryption" => "přepnuto na šifrování na straně klienta",
+"Change encryption password to login password" => "Změnit šifrovací heslo na přihlašovací",
+"Please check your passwords and try again." => "Zkontrolujte, prosím, své heslo a zkuste to znovu.",
+"Could not change your file encryption password to your login password" => "Nelze změnit šifrovací heslo na přihlašovací.",
+"Choose encryption mode:" => "Vyberte režim šifrování:",
+"Client side encryption (most secure but makes it impossible to access your data from the web interface)" => "Šifrování na straně klienta (nejbezpečnější ale neumožňuje vám přistupovat k souborům z webového rozhraní)",
+"Server side encryption (allows you to access your files from the web interface and the desktop client)" => "Šifrování na straně serveru (umožňuje vám přistupovat k souborům pomocí webového rozhraní i aplikací)",
+"None (no encryption at all)" => "Žádný (vůbec žádné šifrování)",
+"Important: Once you selected an encryption mode there is no way to change it back" => "Důležité: jak si jednou vyberete režim šifrování nelze jej opětovně změnit",
+"User specific (let the user decide)" => "Definován uživatelem (umožní uživateli si vybrat)",
"Encryption" => "Šifrování",
"Exclude the following file types from encryption" => "Při šifrování vynechat následující typy souborů",
-"None" => "Žádné",
-"Enable Encryption" => "Povolit šifrování"
+"None" => "Žádné"
);
diff --git a/apps/files_encryption/l10n/da.php b/apps/files_encryption/l10n/da.php
index 144c9f97084..1b4664ce1cb 100644
--- a/apps/files_encryption/l10n/da.php
+++ b/apps/files_encryption/l10n/da.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Kryptering",
"Exclude the following file types from encryption" => "Ekskluder følgende filtyper fra kryptering",
-"None" => "Ingen",
-"Enable Encryption" => "Aktivér kryptering"
+"None" => "Ingen"
);
diff --git a/apps/files_encryption/l10n/de.php b/apps/files_encryption/l10n/de.php
index d486a82322b..34c596dc4bb 100644
--- a/apps/files_encryption/l10n/de.php
+++ b/apps/files_encryption/l10n/de.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Verschlüsselung",
"Exclude the following file types from encryption" => "Die folgenden Dateitypen von der Verschlüsselung ausnehmen",
-"None" => "Keine",
-"Enable Encryption" => "Verschlüsselung aktivieren"
+"None" => "Keine"
);
diff --git a/apps/files_encryption/l10n/de_DE.php b/apps/files_encryption/l10n/de_DE.php
index d486a82322b..261c52a75f7 100644
--- a/apps/files_encryption/l10n/de_DE.php
+++ b/apps/files_encryption/l10n/de_DE.php
@@ -1,6 +1,8 @@
<?php $TRANSLATIONS = array(
+"Choose encryption mode:" => "Wählen Sie die Verschlüsselungsart:",
+"None (no encryption at all)" => "Keine (ohne Verschlüsselung)",
+"User specific (let the user decide)" => "Benutzerspezifisch (der Benutzer kann entscheiden)",
"Encryption" => "Verschlüsselung",
"Exclude the following file types from encryption" => "Die folgenden Dateitypen von der Verschlüsselung ausnehmen",
-"None" => "Keine",
-"Enable Encryption" => "Verschlüsselung aktivieren"
+"None" => "Keine"
);
diff --git a/apps/files_encryption/l10n/el.php b/apps/files_encryption/l10n/el.php
index 40a7c6a3672..50b812c82df 100644
--- a/apps/files_encryption/l10n/el.php
+++ b/apps/files_encryption/l10n/el.php
@@ -1,6 +1,9 @@
<?php $TRANSLATIONS = array(
+"Change encryption password to login password" => "Αλλαγή συνθηματικού κρυπτογράφησης στο συνθηματικό εισόδου ",
+"Please check your passwords and try again." => "Παρακαλώ ελέγξτε το συνθηματικό σας και προσπαθήστε ξανά.",
+"Could not change your file encryption password to your login password" => "Αδυναμία αλλαγής συνθηματικού κρυπτογράφησης αρχείων στο συνθηματικό εισόδου σας",
+"Choose encryption mode:" => "Επιλογή κατάστασης κρυπτογράφησης:",
"Encryption" => "Κρυπτογράφηση",
"Exclude the following file types from encryption" => "Εξαίρεση των παρακάτω τύπων αρχείων από την κρυπτογράφηση",
-"None" => "Καμία",
-"Enable Encryption" => "Ενεργοποίηση Κρυπτογράφησης"
+"None" => "Καμία"
);
diff --git a/apps/files_encryption/l10n/eo.php b/apps/files_encryption/l10n/eo.php
index af3c9ae98e4..c6f82dcb8a0 100644
--- a/apps/files_encryption/l10n/eo.php
+++ b/apps/files_encryption/l10n/eo.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Ĉifrado",
"Exclude the following file types from encryption" => "Malinkluzivigi la jenajn dosiertipojn el ĉifrado",
-"None" => "Nenio",
-"Enable Encryption" => "Kapabligi ĉifradon"
+"None" => "Nenio"
);
diff --git a/apps/files_encryption/l10n/es.php b/apps/files_encryption/l10n/es.php
index b7e7601b35f..89ccb852978 100644
--- a/apps/files_encryption/l10n/es.php
+++ b/apps/files_encryption/l10n/es.php
@@ -1,6 +1,8 @@
<?php $TRANSLATIONS = array(
+"switched to client side encryption" => "Cambiar a encriptación en lado cliente",
+"Please check your passwords and try again." => "Por favor revise su contraseña e intentelo de nuevo.",
+"Choose encryption mode:" => "Elegir el modo de encriptado:",
"Encryption" => "Cifrado",
"Exclude the following file types from encryption" => "Excluir del cifrado los siguientes tipos de archivo",
-"None" => "Ninguno",
-"Enable Encryption" => "Habilitar cifrado"
+"None" => "Ninguno"
);
diff --git a/apps/files_encryption/l10n/es_AR.php b/apps/files_encryption/l10n/es_AR.php
index a15c37e730e..31898f50fde 100644
--- a/apps/files_encryption/l10n/es_AR.php
+++ b/apps/files_encryption/l10n/es_AR.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Encriptación",
"Exclude the following file types from encryption" => "Exceptuar de la encriptación los siguientes tipos de archivo",
-"None" => "Ninguno",
-"Enable Encryption" => "Habilitar encriptación"
+"None" => "Ninguno"
);
diff --git a/apps/files_encryption/l10n/et_EE.php b/apps/files_encryption/l10n/et_EE.php
index a7cd9395bf0..0c0ef231145 100644
--- a/apps/files_encryption/l10n/et_EE.php
+++ b/apps/files_encryption/l10n/et_EE.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Krüpteerimine",
"Exclude the following file types from encryption" => "Järgnevaid failitüüpe ära krüpteeri",
-"None" => "Pole",
-"Enable Encryption" => "Luba krüpteerimine"
+"None" => "Pole"
);
diff --git a/apps/files_encryption/l10n/eu.php b/apps/files_encryption/l10n/eu.php
index 57b6a4927bf..2bb1a46954c 100644
--- a/apps/files_encryption/l10n/eu.php
+++ b/apps/files_encryption/l10n/eu.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Enkriptazioa",
"Exclude the following file types from encryption" => "Ez enkriptatu hurrengo fitxategi motak",
-"None" => "Bat ere ez",
-"Enable Encryption" => "Gaitu enkriptazioa"
+"None" => "Bat ere ez"
);
diff --git a/apps/files_encryption/l10n/fa.php b/apps/files_encryption/l10n/fa.php
index 01582e48e60..0cdee74f5a9 100644
--- a/apps/files_encryption/l10n/fa.php
+++ b/apps/files_encryption/l10n/fa.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "رمزگذاری",
"Exclude the following file types from encryption" => "نادیده گرفتن فایل های زیر برای رمز گذاری",
-"None" => "هیچ‌کدام",
-"Enable Encryption" => "فعال کردن رمزگذاری"
+"None" => "هیچ‌کدام"
);
diff --git a/apps/files_encryption/l10n/fi_FI.php b/apps/files_encryption/l10n/fi_FI.php
index 5796499a26c..433ae890ef6 100644
--- a/apps/files_encryption/l10n/fi_FI.php
+++ b/apps/files_encryption/l10n/fi_FI.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Salaus",
"Exclude the following file types from encryption" => "Jätä seuraavat tiedostotyypit salaamatta",
-"None" => "Ei mitään",
-"Enable Encryption" => "Käytä salausta"
+"None" => "Ei mitään"
);
diff --git a/apps/files_encryption/l10n/fr.php b/apps/files_encryption/l10n/fr.php
index c9367d1a312..41e37134d4e 100644
--- a/apps/files_encryption/l10n/fr.php
+++ b/apps/files_encryption/l10n/fr.php
@@ -1,6 +1,16 @@
<?php $TRANSLATIONS = array(
+"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "Veuillez vous connecter depuis votre client de synchronisation ownCloud et changer votre mot de passe de chiffrement pour finaliser la conversion.",
+"switched to client side encryption" => "Mode de chiffrement changé en chiffrement côté client",
+"Change encryption password to login password" => "Convertir le mot de passe de chiffrement en mot de passe de connexion",
+"Please check your passwords and try again." => "Veuillez vérifier vos mots de passe et réessayer.",
+"Could not change your file encryption password to your login password" => "Impossible de convertir votre mot de passe de chiffrement en mot de passe de connexion",
+"Choose encryption mode:" => "Choix du type de chiffrement :",
+"Client side encryption (most secure but makes it impossible to access your data from the web interface)" => "Chiffrement côté client (plus sécurisé, mais ne permet pas l'accès à vos données depuis l'interface web)",
+"Server side encryption (allows you to access your files from the web interface and the desktop client)" => "Chiffrement côté serveur (vous permet d'accéder à vos fichiers depuis l'interface web et depuis le client de synchronisation)",
+"None (no encryption at all)" => "Aucun (pas de chiffrement)",
+"Important: Once you selected an encryption mode there is no way to change it back" => "Important : Une fois le mode de chiffrement choisi, il est impossible de revenir en arrière",
+"User specific (let the user decide)" => "Propre à l'utilisateur (laisse le choix à l'utilisateur)",
"Encryption" => "Chiffrement",
"Exclude the following file types from encryption" => "Ne pas chiffrer les fichiers dont les types sont les suivants",
-"None" => "Aucun",
-"Enable Encryption" => "Activer le chiffrement"
+"None" => "Aucun"
);
diff --git a/apps/files_encryption/l10n/gl.php b/apps/files_encryption/l10n/gl.php
index 91d155ccad3..42fcfce1cc0 100644
--- a/apps/files_encryption/l10n/gl.php
+++ b/apps/files_encryption/l10n/gl.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Cifrado",
"Exclude the following file types from encryption" => "Excluír os seguintes tipos de ficheiro do cifrado",
-"None" => "Nada",
-"Enable Encryption" => "Activar o cifrado"
+"None" => "Nada"
);
diff --git a/apps/files_encryption/l10n/he.php b/apps/files_encryption/l10n/he.php
index 0332d59520a..9adb6d2b92a 100644
--- a/apps/files_encryption/l10n/he.php
+++ b/apps/files_encryption/l10n/he.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "הצפנה",
-"Enable Encryption" => "הפעל הצפנה",
-"None" => "כלום",
-"Exclude the following file types from encryption" => "הוצא את סוגי הקבצים הבאים מהצפנה"
+"Exclude the following file types from encryption" => "הוצא את סוגי הקבצים הבאים מהצפנה",
+"None" => "כלום"
);
diff --git a/apps/files_encryption/l10n/hu_HU.php b/apps/files_encryption/l10n/hu_HU.php
index 8ea0f731736..1ef1effd41e 100644
--- a/apps/files_encryption/l10n/hu_HU.php
+++ b/apps/files_encryption/l10n/hu_HU.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Titkosítás",
-"Enable Encryption" => "A titkosítás engedélyezése",
-"None" => "Egyik sem",
-"Exclude the following file types from encryption" => "A következő fájltípusok kizárása a titkosításból"
+"Exclude the following file types from encryption" => "A következő fájltípusok kizárása a titkosításból",
+"None" => "Egyik sem"
);
diff --git a/apps/files_encryption/l10n/id.php b/apps/files_encryption/l10n/id.php
index 824ae883041..20f33b87829 100644
--- a/apps/files_encryption/l10n/id.php
+++ b/apps/files_encryption/l10n/id.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "enkripsi",
"Exclude the following file types from encryption" => "pengecualian untuk tipe file berikut dari enkripsi",
-"None" => "tidak ada",
-"Enable Encryption" => "aktifkan enkripsi"
+"None" => "tidak ada"
);
diff --git a/apps/files_encryption/l10n/is.php b/apps/files_encryption/l10n/is.php
index 3210ecb4f8a..a2559cf2b76 100644
--- a/apps/files_encryption/l10n/is.php
+++ b/apps/files_encryption/l10n/is.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Dulkóðun",
-"Enable Encryption" => "Virkja dulkóðun",
-"None" => "Ekkert",
-"Exclude the following file types from encryption" => "Undanskilja eftirfarandi skráartegundir frá dulkóðun"
+"Exclude the following file types from encryption" => "Undanskilja eftirfarandi skráartegundir frá dulkóðun",
+"None" => "Ekkert"
);
diff --git a/apps/files_encryption/l10n/it.php b/apps/files_encryption/l10n/it.php
index 5136b061797..0c394564e0f 100644
--- a/apps/files_encryption/l10n/it.php
+++ b/apps/files_encryption/l10n/it.php
@@ -1,6 +1,16 @@
<?php $TRANSLATIONS = array(
+"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "Passa al tuo client ownCloud e cambia la password di cifratura per completare la conversione.",
+"switched to client side encryption" => "passato alla cifratura lato client",
+"Change encryption password to login password" => "Converti la password di cifratura nella password di accesso",
+"Please check your passwords and try again." => "Controlla la password e prova ancora.",
+"Could not change your file encryption password to your login password" => "Impossibile convertire la password di cifratura nella password di accesso",
+"Choose encryption mode:" => "Scegli la modalità di cifratura.",
+"Client side encryption (most secure but makes it impossible to access your data from the web interface)" => "Cifratura lato client (più sicura ma rende impossibile accedere ai propri dati dall'interfaccia web)",
+"Server side encryption (allows you to access your files from the web interface and the desktop client)" => "Cifratura lato server (ti consente di accedere ai tuoi file dall'interfaccia web e dal client desktop)",
+"None (no encryption at all)" => "Nessuna (senza alcuna cifratura)",
+"Important: Once you selected an encryption mode there is no way to change it back" => "Importante: una volta selezionata la modalità di cifratura non sarà possibile tornare indietro",
+"User specific (let the user decide)" => "Specificato dall'utente (lascia decidere all'utente)",
"Encryption" => "Cifratura",
"Exclude the following file types from encryption" => "Escludi i seguenti tipi di file dalla cifratura",
-"None" => "Nessuna",
-"Enable Encryption" => "Abilita cifratura"
+"None" => "Nessuna"
);
diff --git a/apps/files_encryption/l10n/ja_JP.php b/apps/files_encryption/l10n/ja_JP.php
index 2c3e5410de3..4100908e00c 100644
--- a/apps/files_encryption/l10n/ja_JP.php
+++ b/apps/files_encryption/l10n/ja_JP.php
@@ -1,6 +1,16 @@
<?php $TRANSLATIONS = array(
+"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "変換を完了するために、ownCloud クライアントに切り替えて、暗号化パスワードを変更してください。",
+"switched to client side encryption" => "クライアントサイドの暗号化に切り替えました",
+"Change encryption password to login password" => "暗号化パスワードをログインパスワードに変更",
+"Please check your passwords and try again." => "パスワードを確認してもう一度行なってください。",
+"Could not change your file encryption password to your login password" => "ファイル暗号化パスワードをログインパスワードに変更できませんでした。",
+"Choose encryption mode:" => "暗号化モードを選択:",
+"Client side encryption (most secure but makes it impossible to access your data from the web interface)" => "クライアントサイドの暗号化(最もセキュアですが、WEBインターフェースからデータにアクセスできなくなります)",
+"Server side encryption (allows you to access your files from the web interface and the desktop client)" => "サーバサイド暗号化(WEBインターフェースおよびデスクトップクライアントからファイルにアクセスすることができます)",
+"None (no encryption at all)" => "暗号化無し(何も暗号化しません)",
+"Important: Once you selected an encryption mode there is no way to change it back" => "重要: 一度暗号化を選択してしまうと、もとに戻す方法はありません",
+"User specific (let the user decide)" => "ユーザ指定(ユーザが選べるようにする)",
"Encryption" => "暗号化",
"Exclude the following file types from encryption" => "暗号化から除外するファイルタイプ",
-"None" => "なし",
-"Enable Encryption" => "暗号化を有効にする"
+"None" => "なし"
);
diff --git a/apps/files_encryption/l10n/ko.php b/apps/files_encryption/l10n/ko.php
index 4702753435e..68d60c1ae30 100644
--- a/apps/files_encryption/l10n/ko.php
+++ b/apps/files_encryption/l10n/ko.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "암호화",
"Exclude the following file types from encryption" => "다음 파일 형식은 암호화하지 않음",
-"None" => "없음",
-"Enable Encryption" => "암호화 사용"
+"None" => "없음"
);
diff --git a/apps/files_encryption/l10n/ku_IQ.php b/apps/files_encryption/l10n/ku_IQ.php
index bd8977ac515..06bb9b93251 100644
--- a/apps/files_encryption/l10n/ku_IQ.php
+++ b/apps/files_encryption/l10n/ku_IQ.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "نهێنیکردن",
"Exclude the following file types from encryption" => "به‌ربه‌ست کردنی ئه‌م جۆره‌ په‌ڕگانه له‌ نهێنیکردن",
-"None" => "هیچ",
-"Enable Encryption" => "چالاکردنی نهێنیکردن"
+"None" => "هیچ"
);
diff --git a/apps/files_encryption/l10n/lt_LT.php b/apps/files_encryption/l10n/lt_LT.php
index b939df164c8..22cbe7a4ffa 100644
--- a/apps/files_encryption/l10n/lt_LT.php
+++ b/apps/files_encryption/l10n/lt_LT.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Šifravimas",
"Exclude the following file types from encryption" => "Nešifruoti pasirinkto tipo failų",
-"None" => "Nieko",
-"Enable Encryption" => "Įjungti šifravimą"
+"None" => "Nieko"
);
diff --git a/apps/files_encryption/l10n/mk.php b/apps/files_encryption/l10n/mk.php
index dfcaed9f37e..7ccf8ac2d5b 100644
--- a/apps/files_encryption/l10n/mk.php
+++ b/apps/files_encryption/l10n/mk.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Енкрипција",
"Exclude the following file types from encryption" => "Исклучи ги следните типови на датотеки од енкрипција",
-"None" => "Ништо",
-"Enable Encryption" => "Овозможи енкрипција"
+"None" => "Ништо"
);
diff --git a/apps/files_encryption/l10n/nb_NO.php b/apps/files_encryption/l10n/nb_NO.php
index e65df7b6ce3..2ec6670e928 100644
--- a/apps/files_encryption/l10n/nb_NO.php
+++ b/apps/files_encryption/l10n/nb_NO.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Kryptering",
"Exclude the following file types from encryption" => "Ekskluder følgende filer fra kryptering",
-"None" => "Ingen",
-"Enable Encryption" => "Slå på kryptering"
+"None" => "Ingen"
);
diff --git a/apps/files_encryption/l10n/nl.php b/apps/files_encryption/l10n/nl.php
index 1ea56006fc3..7c09009cba9 100644
--- a/apps/files_encryption/l10n/nl.php
+++ b/apps/files_encryption/l10n/nl.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Versleuteling",
"Exclude the following file types from encryption" => "Versleutel de volgende bestand types niet",
-"None" => "Geen",
-"Enable Encryption" => "Zet versleuteling aan"
+"None" => "Geen"
);
diff --git a/apps/files_encryption/l10n/pl.php b/apps/files_encryption/l10n/pl.php
index 5cfc707450e..896086108ec 100644
--- a/apps/files_encryption/l10n/pl.php
+++ b/apps/files_encryption/l10n/pl.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Szyfrowanie",
"Exclude the following file types from encryption" => "Wyłącz następujące typy plików z szyfrowania",
-"None" => "Brak",
-"Enable Encryption" => "Włącz szyfrowanie"
+"None" => "Brak"
);
diff --git a/apps/files_encryption/l10n/pt_BR.php b/apps/files_encryption/l10n/pt_BR.php
index 5c02f52217f..086d073cf5c 100644
--- a/apps/files_encryption/l10n/pt_BR.php
+++ b/apps/files_encryption/l10n/pt_BR.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Criptografia",
"Exclude the following file types from encryption" => "Excluir os seguintes tipos de arquivo da criptografia",
-"None" => "Nenhuma",
-"Enable Encryption" => "Habilitar Criptografia"
+"None" => "Nenhuma"
);
diff --git a/apps/files_encryption/l10n/pt_PT.php b/apps/files_encryption/l10n/pt_PT.php
index 570462b414f..b6eedcdc509 100644
--- a/apps/files_encryption/l10n/pt_PT.php
+++ b/apps/files_encryption/l10n/pt_PT.php
@@ -1,6 +1,16 @@
<?php $TRANSLATIONS = array(
+"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "Por favor, use o seu cliente de sincronização do ownCloud e altere a sua password de encriptação para concluír a conversão.",
+"switched to client side encryption" => "Alterado para encriptação do lado do cliente",
+"Change encryption password to login password" => "Alterar a password de encriptação para a password de login",
+"Please check your passwords and try again." => "Por favor verifique as suas paswords e tente de novo.",
+"Could not change your file encryption password to your login password" => "Não foi possível alterar a password de encriptação de ficheiros para a sua password de login",
+"Choose encryption mode:" => "Escolha o método de encriptação",
+"Client side encryption (most secure but makes it impossible to access your data from the web interface)" => "Encriptação do lado do cliente (mais seguro mas torna possível o acesso aos dados através do interface web)",
+"Server side encryption (allows you to access your files from the web interface and the desktop client)" => "Encriptação do lado do servidor (permite o acesso aos seus ficheiros através do interface web e do cliente de sincronização)",
+"None (no encryption at all)" => "Nenhuma (sem encriptação)",
+"Important: Once you selected an encryption mode there is no way to change it back" => "Importante: Uma vez escolhido o modo de encriptação, não existe maneira de o alterar!",
+"User specific (let the user decide)" => "Escolhido pelo utilizador",
"Encryption" => "Encriptação",
"Exclude the following file types from encryption" => "Excluir da encriptação os seguintes tipo de ficheiros",
-"None" => "Nenhum",
-"Enable Encryption" => "Activar Encriptação"
+"None" => "Nenhum"
);
diff --git a/apps/files_encryption/l10n/ro.php b/apps/files_encryption/l10n/ro.php
index 97f3f262d76..f958692dd8d 100644
--- a/apps/files_encryption/l10n/ro.php
+++ b/apps/files_encryption/l10n/ro.php
@@ -1,6 +1,16 @@
<?php $TRANSLATIONS = array(
+"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "Te rugăm să mergi în clientul ownCloud și să schimbi parola pentru a finisa conversia",
+"switched to client side encryption" => "setat la encriptare locală",
+"Change encryption password to login password" => "Schimbă parola de ecriptare în parolă de acces",
+"Please check your passwords and try again." => "Verifică te rog parolele și înceracă din nou.",
+"Could not change your file encryption password to your login password" => "Nu s-a putut schimba parola de encripție a fișierelor ca parolă de acces",
+"Choose encryption mode:" => "Alege tipul de ecripție",
+"Client side encryption (most secure but makes it impossible to access your data from the web interface)" => "Encripție locală (cea mai sigură, dar face ca datele să nu mai fie accesibile din interfața web)",
+"Server side encryption (allows you to access your files from the web interface and the desktop client)" => "Encripție pe server (permite să accesezi datele tale din interfața web și din clientul pentru calculator)",
+"None (no encryption at all)" => "Fără (nici un fel de ecriptare)",
+"Important: Once you selected an encryption mode there is no way to change it back" => "Important: Din moment ce ai setat un mod de encriptare, nu mai există metode de a-l schimba înapoi",
+"User specific (let the user decide)" => "Spefic fiecărui utilizator (lasă utilizatorul să decidă)",
"Encryption" => "Încriptare",
"Exclude the following file types from encryption" => "Exclude următoarele tipuri de fișiere de la încriptare",
-"None" => "Niciuna",
-"Enable Encryption" => "Activare încriptare"
+"None" => "Niciuna"
);
diff --git a/apps/files_encryption/l10n/ru.php b/apps/files_encryption/l10n/ru.php
index 3a7e84b6d01..14115c12683 100644
--- a/apps/files_encryption/l10n/ru.php
+++ b/apps/files_encryption/l10n/ru.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Шифрование",
"Exclude the following file types from encryption" => "Исключить шифрование следующих типов файлов",
-"None" => "Ничего",
-"Enable Encryption" => "Включить шифрование"
+"None" => "Ничего"
);
diff --git a/apps/files_encryption/l10n/ru_RU.php b/apps/files_encryption/l10n/ru_RU.php
index 1328b0d0359..4321fb8a8a3 100644
--- a/apps/files_encryption/l10n/ru_RU.php
+++ b/apps/files_encryption/l10n/ru_RU.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Шифрование",
"Exclude the following file types from encryption" => "Исключите следующие типы файлов из шифрования",
-"None" => "Ни один",
-"Enable Encryption" => "Включить шифрование"
+"None" => "Ни один"
);
diff --git a/apps/files_encryption/l10n/si_LK.php b/apps/files_encryption/l10n/si_LK.php
index a29884afffd..2d61bec45b8 100644
--- a/apps/files_encryption/l10n/si_LK.php
+++ b/apps/files_encryption/l10n/si_LK.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "ගුප්ත කේතනය",
"Exclude the following file types from encryption" => "මෙම ගොනු වර්ග ගුප්ත කේතනය කිරීමෙන් බැහැරව තබන්න",
-"None" => "කිසිවක් නැත",
-"Enable Encryption" => "ගුප්ත කේතනය සක්‍රිය කරන්න"
+"None" => "කිසිවක් නැත"
);
diff --git a/apps/files_encryption/l10n/sk_SK.php b/apps/files_encryption/l10n/sk_SK.php
index 598f1294f6e..5aebb6e35bd 100644
--- a/apps/files_encryption/l10n/sk_SK.php
+++ b/apps/files_encryption/l10n/sk_SK.php
@@ -1,6 +1,5 @@
<?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"
+"None" => "Žiadne"
);
diff --git a/apps/files_encryption/l10n/sl.php b/apps/files_encryption/l10n/sl.php
index f62fe781c6a..db963ef2f8d 100644
--- a/apps/files_encryption/l10n/sl.php
+++ b/apps/files_encryption/l10n/sl.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Šifriranje",
"Exclude the following file types from encryption" => "Navedene vrste datotek naj ne bodo šifrirane",
-"None" => "Brez",
-"Enable Encryption" => "Omogoči šifriranje"
+"None" => "Brez"
);
diff --git a/apps/files_encryption/l10n/sr.php b/apps/files_encryption/l10n/sr.php
index 4718780ee52..198bcc94ef9 100644
--- a/apps/files_encryption/l10n/sr.php
+++ b/apps/files_encryption/l10n/sr.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Шифровање",
"Exclude the following file types from encryption" => "Не шифруј следеће типове датотека",
-"None" => "Ништа",
-"Enable Encryption" => "Омогући шифровање"
+"None" => "Ништа"
);
diff --git a/apps/files_encryption/l10n/sv.php b/apps/files_encryption/l10n/sv.php
index 0a477f83460..9b6ce141782 100644
--- a/apps/files_encryption/l10n/sv.php
+++ b/apps/files_encryption/l10n/sv.php
@@ -1,6 +1,16 @@
<?php $TRANSLATIONS = array(
+"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "Vänligen växla till ownCloud klienten och ändra ditt krypteringslösenord för att slutföra omvandlingen.",
+"switched to client side encryption" => "Bytte till kryptering på klientsidan",
+"Change encryption password to login password" => "Ändra krypteringslösenord till loginlösenord",
+"Please check your passwords and try again." => "Kontrollera dina lösenord och försök igen.",
+"Could not change your file encryption password to your login password" => "Kunde inte ändra ditt filkrypteringslösenord till ditt loginlösenord",
+"Choose encryption mode:" => "Välj krypteringsläge:",
+"Client side encryption (most secure but makes it impossible to access your data from the web interface)" => "Kryptering på klientsidan (säkraste men gör det omöjligt att komma åt dina filer med en webbläsare)",
+"Server side encryption (allows you to access your files from the web interface and the desktop client)" => "Kryptering på serversidan (kan komma åt dina filer från webbläsare och datorklient)",
+"None (no encryption at all)" => "Ingen (ingen kryptering alls)",
+"Important: Once you selected an encryption mode there is no way to change it back" => "Viktigt: När du har valt ett krypteringsläge finns det inget sätt att ändra tillbaka",
+"User specific (let the user decide)" => "Användarspecifik (låter användaren bestämma)",
"Encryption" => "Kryptering",
"Exclude the following file types from encryption" => "Exkludera följande filtyper från kryptering",
-"None" => "Ingen",
-"Enable Encryption" => "Aktivera kryptering"
+"None" => "Ingen"
);
diff --git a/apps/files_encryption/l10n/ta_LK.php b/apps/files_encryption/l10n/ta_LK.php
index 1d1ef74007e..aab628b5519 100644
--- a/apps/files_encryption/l10n/ta_LK.php
+++ b/apps/files_encryption/l10n/ta_LK.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "மறைக்குறியீடு",
"Exclude the following file types from encryption" => "மறைக்குறியாக்கலில் பின்வரும் கோப்பு வகைகளை நீக்கவும்",
-"None" => "ஒன்றுமில்லை",
-"Enable Encryption" => "மறைக்குறியாக்கலை இயலுமைப்படுத்துக"
+"None" => "ஒன்றுமில்லை"
);
diff --git a/apps/files_encryption/l10n/th_TH.php b/apps/files_encryption/l10n/th_TH.php
index c2685de6e3a..f8c19456ab3 100644
--- a/apps/files_encryption/l10n/th_TH.php
+++ b/apps/files_encryption/l10n/th_TH.php
@@ -1,6 +1,16 @@
<?php $TRANSLATIONS = array(
+"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "กรุณาสลับไปที่โปรแกรมไคลเอนต์ ownCloud ของคุณ แล้วเปลี่ยนรหัสผ่านสำหรับการเข้ารหัสเพื่อแปลงข้อมูลให้เสร็จสมบูรณ์",
+"switched to client side encryption" => "สลับไปใช้การเข้ารหัสจากโปรแกรมไคลเอนต์",
+"Change encryption password to login password" => "เปลี่ยนรหัสผ่านสำหรับเข้ารหัสไปเป็นรหัสผ่านสำหรับการเข้าสู่ระบบ",
+"Please check your passwords and try again." => "กรุณาตรวจสอบรหัสผ่านของคุณแล้วลองใหม่อีกครั้ง",
+"Could not change your file encryption password to your login password" => "ไม่สามารถเปลี่ยนรหัสผ่านสำหรับการเข้ารหัสไฟล์ของคุณไปเป็นรหัสผ่านสำหรับการเข้าสู่ระบบของคุณได้",
+"Choose encryption mode:" => "เลือกรูปแบบการเข้ารหัส:",
+"Client side encryption (most secure but makes it impossible to access your data from the web interface)" => "การเข้ารหัสด้วยโปรแกรมไคลเอนต์ (ปลอดภัยที่สุด แต่จะทำให้คุณไม่สามารถเข้าถึงข้อมูลต่างๆจากหน้าจอเว็บไซต์ได้)",
+"Server side encryption (allows you to access your files from the web interface and the desktop client)" => "การเข้ารหัสจากทางฝั่งเซิร์ฟเวอร์ (อนุญาตให้คุณเข้าถึงไฟล์ของคุณจากหน้าจอเว็บไซต์ และโปรแกรมไคลเอนต์จากเครื่องเดสก์ท็อปได้)",
+"None (no encryption at all)" => "ไม่ต้อง (ไม่มีการเข้ารหัสเลย)",
+"Important: Once you selected an encryption mode there is no way to change it back" => "ข้อความสำคัญ: หลังจากที่คุณได้เลือกรูปแบบการเข้ารหัสแล้ว จะไม่สามารถเปลี่ยนกลับมาใหม่ได้อีก",
+"User specific (let the user decide)" => "ให้ผู้ใช้งานเลือกเอง (ปล่อยให้ผู้ใช้งานตัดสินใจเอง)",
"Encryption" => "การเข้ารหัส",
"Exclude the following file types from encryption" => "ไม่ต้องรวมชนิดของไฟล์ดังต่อไปนี้จากการเข้ารหัส",
-"None" => "ไม่ต้อง",
-"Enable Encryption" => "เปิดใช้งานการเข้ารหัส"
+"None" => "ไม่ต้อง"
);
diff --git a/apps/files_encryption/l10n/tr.php b/apps/files_encryption/l10n/tr.php
index 474ee42b842..07f78d148c8 100644
--- a/apps/files_encryption/l10n/tr.php
+++ b/apps/files_encryption/l10n/tr.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Şifreleme",
-"Enable Encryption" => "Şifrelemeyi Etkinleştir",
-"None" => "Hiçbiri",
-"Exclude the following file types from encryption" => "Aşağıdaki dosya tiplerini şifrelemeye dahil etme"
+"Exclude the following file types from encryption" => "Aşağıdaki dosya tiplerini şifrelemeye dahil etme",
+"None" => "Hiçbiri"
);
diff --git a/apps/files_encryption/l10n/uk.php b/apps/files_encryption/l10n/uk.php
index 3c15bb28436..e3589215658 100644
--- a/apps/files_encryption/l10n/uk.php
+++ b/apps/files_encryption/l10n/uk.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Шифрування",
"Exclude the following file types from encryption" => "Не шифрувати файли наступних типів",
-"None" => "Жоден",
-"Enable Encryption" => "Включити шифрування"
+"None" => "Жоден"
);
diff --git a/apps/files_encryption/l10n/vi.php b/apps/files_encryption/l10n/vi.php
index 6365084fdc6..218285b675a 100644
--- a/apps/files_encryption/l10n/vi.php
+++ b/apps/files_encryption/l10n/vi.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "Mã hóa",
"Exclude the following file types from encryption" => "Loại trừ các loại tập tin sau đây từ mã hóa",
-"None" => "Không có gì hết",
-"Enable Encryption" => "BẬT mã hóa"
+"None" => "Không có gì hết"
);
diff --git a/apps/files_encryption/l10n/zh_CN.GB2312.php b/apps/files_encryption/l10n/zh_CN.GB2312.php
index 297444fcf55..31a3d3b49b8 100644
--- a/apps/files_encryption/l10n/zh_CN.GB2312.php
+++ b/apps/files_encryption/l10n/zh_CN.GB2312.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "加密",
"Exclude the following file types from encryption" => "从加密中排除如下文件类型",
-"None" => "无",
-"Enable Encryption" => "启用加密"
+"None" => "无"
);
diff --git a/apps/files_encryption/l10n/zh_CN.php b/apps/files_encryption/l10n/zh_CN.php
index 1e1247d15ff..aa4817b590c 100644
--- a/apps/files_encryption/l10n/zh_CN.php
+++ b/apps/files_encryption/l10n/zh_CN.php
@@ -1,6 +1,5 @@
<?php $TRANSLATIONS = array(
"Encryption" => "加密",
"Exclude the following file types from encryption" => "从加密中排除列出的文件类型",
-"None" => "None",
-"Enable Encryption" => "开启加密"
+"None" => "None"
);
diff --git a/apps/files_encryption/l10n/zh_TW.php b/apps/files_encryption/l10n/zh_TW.php
index 4c62130cf4f..146724def08 100644
--- a/apps/files_encryption/l10n/zh_TW.php
+++ b/apps/files_encryption/l10n/zh_TW.php
@@ -1,6 +1,16 @@
<?php $TRANSLATIONS = array(
+"Please switch to your ownCloud client and change your encryption password to complete the conversion." => "請至您的 ownCloud 客戶端程式修改您的加密密碼以完成轉換。",
+"switched to client side encryption" => "已切換為客戶端加密",
+"Change encryption password to login password" => "將加密密碼修改為登入密碼",
+"Please check your passwords and try again." => "請檢查您的密碼並再試一次。",
+"Could not change your file encryption password to your login password" => "無法變更您的檔案加密密碼為登入密碼",
+"Choose encryption mode:" => "選擇加密模式:",
+"Client side encryption (most secure but makes it impossible to access your data from the web interface)" => "客戶端加密 (最安全但是會使您無法從網頁界面存取您的檔案)",
+"Server side encryption (allows you to access your files from the web interface and the desktop client)" => "伺服器端加密 (您可以從網頁界面及客戶端程式存取您的檔案)",
+"None (no encryption at all)" => "無 (不加密)",
+"Important: Once you selected an encryption mode there is no way to change it back" => "重要:一旦您選擇了加密就無法再改回來",
+"User specific (let the user decide)" => "使用者自訂 (讓使用者自己決定)",
"Encryption" => "加密",
"Exclude the following file types from encryption" => "下列的檔案類型不加密",
-"None" => "無",
-"Enable Encryption" => "啟用加密"
+"None" => "無"
);
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index 666fedb4e1b..fddc89dae54 100644..100755
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -1,220 +1,732 @@
-<?php
-/**
- * ownCloud
- *
- * @author Frank Karlitschek
- * @copyright 2012 Frank Karlitschek frank@owncloud.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-
-// Todo:
-// - Crypt/decrypt button in the userinterface
-// - Setting if crypto should be on by default
-// - Add a setting "Don´t encrypt files larger than xx because of performance reasons"
-// - Transparent decrypt/encrypt in filesystem.php. Autodetect if a file is encrypted (.encrypted extension)
-// - Don't use a password directly as encryption key, but a key which is stored on the server and encrypted with the
-// user password. -> password change faster
-// - IMPORTANT! Check if the block lenght of the encrypted data stays the same
-
-
-require_once 'Crypt_Blowfish/Blowfish.php';
-
-/**
- * This class is for crypting and decrypting
- */
-class OC_Crypt {
- static private $bf = null;
-
- public static function loginListener($params) {
- self::init($params['uid'], $params['password']);
- }
-
- public static function init($login, $password) {
- $view=new OC_FilesystemView('/');
- if ( ! $view->file_exists('/'.$login)) {
- $view->mkdir('/'.$login);
- }
-
- OC_FileProxy::$enabled=false;
- if ( ! $view->file_exists('/'.$login.'/encryption.key')) {// does key exist?
- OC_Crypt::createkey($login, $password);
- }
- $key=$view->file_get_contents('/'.$login.'/encryption.key');
- OC_FileProxy::$enabled=true;
- $_SESSION['enckey']=OC_Crypt::decrypt($key, $password);
- }
-
-
- /**
- * get the blowfish encryption handeler for a key
- * @param string $key (optional)
- * @return Crypt_Blowfish
- *
- * if the key is left out, the default handeler will be used
- */
- public static function getBlowfish($key='') {
- if ($key) {
- return new Crypt_Blowfish($key);
- } else {
- if ( ! isset($_SESSION['enckey'])) {
- return false;
- }
- if ( ! self::$bf) {
- self::$bf=new Crypt_Blowfish($_SESSION['enckey']);
- }
- return self::$bf;
- }
- }
-
- public static function createkey($username, $passcode) {
- // generate a random key
- $key=mt_rand(10000, 99999).mt_rand(10000, 99999).mt_rand(10000, 99999).mt_rand(10000, 99999);
-
- // encrypt the key with the passcode of the user
- $enckey=OC_Crypt::encrypt($key, $passcode);
-
- // Write the file
- $proxyEnabled=OC_FileProxy::$enabled;
- OC_FileProxy::$enabled=false;
- $view=new OC_FilesystemView('/'.$username);
- $view->file_put_contents('/encryption.key', $enckey);
- OC_FileProxy::$enabled=$proxyEnabled;
- }
-
- public static function changekeypasscode($oldPassword, $newPassword) {
- if (OCP\User::isLoggedIn()) {
- $username=OCP\USER::getUser();
- $view=new OC_FilesystemView('/'.$username);
-
- // read old key
- $key=$view->file_get_contents('/encryption.key');
-
- // decrypt key with old passcode
- $key=OC_Crypt::decrypt($key, $oldPassword);
-
- // encrypt again with new passcode
- $key=OC_Crypt::encrypt($key, $newPassword);
-
- // store the new key
- $view->file_put_contents('/encryption.key', $key );
- }
- }
-
- /**
- * @brief encrypts an content
- * @param $content the cleartext message you want to encrypt
- * @param $key the encryption key (optional)
- * @returns encrypted content
- *
- * This function encrypts an content
- */
- public static function encrypt( $content, $key='') {
- $bf = self::getBlowfish($key);
- return $bf->encrypt($content);
- }
-
- /**
- * @brief decryption of an content
- * @param $content the cleartext message you want to decrypt
- * @param $key the encryption key (optional)
- * @returns cleartext content
- *
- * This function decrypts an content
- */
- public static function decrypt( $content, $key='') {
- $bf = self::getBlowfish($key);
- $data=$bf->decrypt($content);
- return $data;
- }
-
- /**
- * @brief encryption of a file
- * @param string $source
- * @param string $target
- * @param string $key the decryption key
- *
- * This function encrypts a file
- */
- public static function encryptFile( $source, $target, $key='') {
- $handleread = fopen($source, "rb");
- if ($handleread!=false) {
- $handlewrite = fopen($target, "wb");
- while (!feof($handleread)) {
- $content = fread($handleread, 8192);
- $enccontent=OC_CRYPT::encrypt( $content, $key);
- fwrite($handlewrite, $enccontent);
- }
- fclose($handlewrite);
- fclose($handleread);
- }
- }
-
-
- /**
- * @brief decryption of a file
- * @param string $source
- * @param string $target
- * @param string $key the decryption key
- *
- * This function decrypts a file
- */
- public static function decryptFile( $source, $target, $key='') {
- $handleread = fopen($source, "rb");
- if ($handleread!=false) {
- $handlewrite = fopen($target, "wb");
- while (!feof($handleread)) {
- $content = fread($handleread, 8192);
- $enccontent=OC_CRYPT::decrypt( $content, $key);
- if (feof($handleread)) {
- $enccontent=rtrim($enccontent, "\0");
- }
- fwrite($handlewrite, $enccontent);
- }
- fclose($handlewrite);
- fclose($handleread);
- }
- }
-
- /**
- * encrypt data in 8192b sized blocks
- */
- public static function blockEncrypt($data, $key='') {
- $result='';
- while (strlen($data)) {
- $result.=self::encrypt(substr($data, 0, 8192), $key);
- $data=substr($data, 8192);
- }
- return $result;
- }
-
- /**
- * decrypt data in 8192b sized blocks
- */
- public static function blockDecrypt($data, $key='', $maxLength=0) {
- $result='';
- while (strlen($data)) {
- $result.=self::decrypt(substr($data, 0, 8192), $key);
- $data=substr($data, 8192);
- }
- if ($maxLength>0) {
- return substr($result, 0, $maxLength);
- } else {
- return rtrim($result, "\0");
- }
- }
-}
+<?php
+/**
+ * ownCloud
+ *
+ * @author Sam Tuke, Frank Karlitschek, Robin Appelman
+ * @copyright 2012 Sam Tuke samtuke@owncloud.com,
+ * Robin Appelman icewind@owncloud.com, Frank Karlitschek
+ * frank@owncloud.org
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Encryption;
+
+require_once 'Crypt_Blowfish/Blowfish.php';
+
+// Todo:
+// - Crypt/decrypt button in the userinterface
+// - Setting if crypto should be on by default
+// - Add a setting "Don´t encrypt files larger than xx because of performance reasons"
+// - Transparent decrypt/encrypt in filesystem.php. Autodetect if a file is encrypted (.encrypted extension)
+// - Don't use a password directly as encryption key. but a key which is stored on the server and encrypted with the user password. -> password change faster
+// - IMPORTANT! Check if the block lenght of the encrypted data stays the same
+
+/**
+ * Class for common cryptography functionality
+ */
+
+class Crypt {
+
+ /**
+ * @brief return encryption mode client or server side encryption
+ * @param string user name (use system wide setting if name=null)
+ * @return string 'client' or 'server'
+ */
+ public static function mode( $user = null ) {
+
+// $mode = \OC_Appconfig::getValue( 'files_encryption', 'mode', 'none' );
+//
+// if ( $mode == 'user') {
+// if ( !$user ) {
+// $user = \OCP\User::getUser();
+// }
+// $mode = 'none';
+// if ( $user ) {
+// $query = \OC_DB::prepare( "SELECT mode FROM *PREFIX*encryption WHERE uid = ?" );
+// $result = $query->execute(array($user));
+// if ($row = $result->fetchRow()){
+// $mode = $row['mode'];
+// }
+// }
+// }
+//
+// return $mode;
+
+ return 'server';
+
+ }
+
+ /**
+ * @brief Create a new encryption keypair
+ * @return array publicKey, privatekey
+ */
+ public static function createKeypair() {
+
+ $res = openssl_pkey_new();
+
+ // Get private key
+ openssl_pkey_export( $res, $privateKey );
+
+ // Get public key
+ $publicKey = openssl_pkey_get_details( $res );
+
+ $publicKey = $publicKey['key'];
+
+ return( array( 'publicKey' => $publicKey, 'privateKey' => $privateKey ) );
+
+ }
+
+ /**
+ * @brief Add arbitrary padding to encrypted data
+ * @param string $data data to be padded
+ * @return padded data
+ * @note In order to end up with data exactly 8192 bytes long we must add two letters. It is impossible to achieve exactly 8192 length blocks with encryption alone, hence padding is added to achieve the required length.
+ */
+ public static function addPadding( $data ) {
+
+ $padded = $data . 'xx';
+
+ return $padded;
+
+ }
+
+ /**
+ * @brief Remove arbitrary padding to encrypted data
+ * @param string $padded padded data to remove padding from
+ * @return unpadded data on success, false on error
+ */
+ public static function removePadding( $padded ) {
+
+ if ( substr( $padded, -2 ) == 'xx' ) {
+
+ $data = substr( $padded, 0, -2 );
+
+ return $data;
+
+ } else {
+
+ # TODO: log the fact that unpadded data was submitted for removal of padding
+ return false;
+
+ }
+
+ }
+
+ /**
+ * @brief Check if a file's contents contains an IV and is symmetrically encrypted
+ * @return true / false
+ * @note see also OCA\Encryption\Util->isEncryptedPath()
+ */
+ public static function isEncryptedContent( $content ) {
+
+ if ( !$content ) {
+
+ return false;
+
+ }
+
+ $noPadding = self::removePadding( $content );
+
+ // Fetch encryption metadata from end of file
+ $meta = substr( $noPadding, -22 );
+
+ // Fetch IV from end of file
+ $iv = substr( $meta, -16 );
+
+ // Fetch identifier from start of metadata
+ $identifier = substr( $meta, 0, 6 );
+
+ if ( $identifier == '00iv00') {
+
+ return true;
+
+ } else {
+
+ return false;
+
+ }
+
+ }
+
+ /**
+ * Check if a file is encrypted according to database file cache
+ * @param string $path
+ * @return bool
+ */
+ public static function isEncryptedMeta( $path ) {
+
+ # TODO: Use DI to get OC_FileCache_Cached out of here
+
+ // Fetch all file metadata from DB
+ $metadata = \OC_FileCache_Cached::get( $path, '' );
+
+ // Return encryption status
+ return isset( $metadata['encrypted'] ) and ( bool )$metadata['encrypted'];
+
+ }
+
+ /**
+ * @brief Check if a file is encrypted via legacy system
+ * @return true / false
+ */
+ public static function isLegacyEncryptedContent( $content ) {
+
+ // Fetch all file metadata from DB
+ $metadata = \OC_FileCache_Cached::get( $content, '' );
+
+ // If a file is flagged with encryption in DB, but isn't a valid content + IV combination, it's probably using the legacy encryption system
+ if (
+ $content
+ and isset( $metadata['encrypted'] )
+ and $metadata['encrypted'] === true
+ and !self::isEncryptedContent( $content )
+ ) {
+
+ return true;
+
+ } else {
+
+ return false;
+
+ }
+
+ }
+
+ /**
+ * @brief Symmetrically encrypt a string
+ * @returns encrypted file
+ */
+ public static function encrypt( $plainContent, $iv, $passphrase = '' ) {
+
+ if ( $encryptedContent = openssl_encrypt( $plainContent, 'AES-128-CFB', $passphrase, false, $iv ) ) {
+
+ return $encryptedContent;
+
+ } else {
+
+ \OC_Log::write( 'Encryption library', 'Encryption (symmetric) of content failed' , \OC_Log::ERROR );
+
+ return false;
+
+ }
+
+ }
+
+ /**
+ * @brief Symmetrically decrypt a string
+ * @returns decrypted file
+ */
+ public static function decrypt( $encryptedContent, $iv, $passphrase ) {
+
+ if ( $plainContent = openssl_decrypt( $encryptedContent, 'AES-128-CFB', $passphrase, false, $iv ) ) {
+
+ return $plainContent;
+
+
+ } else {
+
+ throw new \Exception( 'Encryption library: Decryption (symmetric) of content failed' );
+
+ return false;
+
+ }
+
+ }
+
+ /**
+ * @brief Concatenate encrypted data with its IV and padding
+ * @param string $content content to be concatenated
+ * @param string $iv IV to be concatenated
+ * @returns string concatenated content
+ */
+ public static function concatIv ( $content, $iv ) {
+
+ $combined = $content . '00iv00' . $iv;
+
+ return $combined;
+
+ }
+
+ /**
+ * @brief Split concatenated data and IV into respective parts
+ * @param string $catFile concatenated data to be split
+ * @returns array keys: encrypted, iv
+ */
+ public static function splitIv ( $catFile ) {
+
+ // Fetch encryption metadata from end of file
+ $meta = substr( $catFile, -22 );
+
+ // Fetch IV from end of file
+ $iv = substr( $meta, -16 );
+
+ // Remove IV and IV identifier text to expose encrypted content
+ $encrypted = substr( $catFile, 0, -22 );
+
+ $split = array(
+ 'encrypted' => $encrypted
+ , 'iv' => $iv
+ );
+
+ return $split;
+
+ }
+
+ /**
+ * @brief Symmetrically encrypts a string and returns keyfile content
+ * @param $plainContent content to be encrypted in keyfile
+ * @returns encrypted content combined with IV
+ * @note IV need not be specified, as it will be stored in the returned keyfile
+ * and remain accessible therein.
+ */
+ public static function symmetricEncryptFileContent( $plainContent, $passphrase = '' ) {
+
+ if ( !$plainContent ) {
+
+ return false;
+
+ }
+
+ $iv = self::generateIv();
+
+ if ( $encryptedContent = self::encrypt( $plainContent, $iv, $passphrase ) ) {
+
+ // Combine content to encrypt with IV identifier and actual IV
+ $catfile = self::concatIv( $encryptedContent, $iv );
+
+ $padded = self::addPadding( $catfile );
+
+ return $padded;
+
+ } else {
+
+ \OC_Log::write( 'Encryption library', 'Encryption (symmetric) of keyfile content failed' , \OC_Log::ERROR );
+
+ return false;
+
+ }
+
+ }
+
+
+ /**
+ * @brief Symmetrically decrypts keyfile content
+ * @param string $source
+ * @param string $target
+ * @param string $key the decryption key
+ * @returns decrypted content
+ *
+ * This function decrypts a file
+ */
+ public static function symmetricDecryptFileContent( $keyfileContent, $passphrase = '' ) {
+
+ if ( !$keyfileContent ) {
+
+ throw new \Exception( 'Encryption library: no data provided for decryption' );
+
+ }
+
+ // Remove padding
+ $noPadding = self::removePadding( $keyfileContent );
+
+ // Split into enc data and catfile
+ $catfile = self::splitIv( $noPadding );
+
+ if ( $plainContent = self::decrypt( $catfile['encrypted'], $catfile['iv'], $passphrase ) ) {
+
+ return $plainContent;
+
+ }
+
+ }
+
+ /**
+ * @brief Creates symmetric keyfile content using a generated key
+ * @param string $plainContent content to be encrypted
+ * @returns array keys: key, encrypted
+ * @note symmetricDecryptFileContent() can be used to decrypt files created using this method
+ *
+ * This function decrypts a file
+ */
+ public static function symmetricEncryptFileContentKeyfile( $plainContent ) {
+
+ $key = self::generateKey();
+
+ if( $encryptedContent = self::symmetricEncryptFileContent( $plainContent, $key ) ) {
+
+ return array(
+ 'key' => $key
+ , 'encrypted' => $encryptedContent
+ );
+
+ } else {
+
+ return false;
+
+ }
+
+ }
+
+ /**
+ * @brief Create asymmetrically encrypted keyfile content using a generated key
+ * @param string $plainContent content to be encrypted
+ * @returns array keys: key, encrypted
+ * @note symmetricDecryptFileContent() can be used to decrypt files created using this method
+ *
+ * This function decrypts a file
+ */
+ public static function multiKeyEncrypt( $plainContent, array $publicKeys ) {
+
+ $envKeys = array();
+
+ if( openssl_seal( $plainContent, $sealed, $envKeys, $publicKeys ) ) {
+
+ return array(
+ 'keys' => $envKeys
+ , 'encrypted' => $sealed
+ );
+
+ } else {
+
+ return false;
+
+ }
+
+ }
+
+ /**
+ * @brief Asymmetrically encrypt a file using multiple public keys
+ * @param string $plainContent content to be encrypted
+ * @returns string $plainContent decrypted string
+ * @note symmetricDecryptFileContent() can be used to decrypt files created using this method
+ *
+ * This function decrypts a file
+ */
+ public static function multiKeyDecrypt( $encryptedContent, $envKey, $privateKey ) {
+
+ if ( !$encryptedContent ) {
+
+ return false;
+
+ }
+
+ if ( openssl_open( $encryptedContent, $plainContent, $envKey, $privateKey ) ) {
+
+ return $plainContent;
+
+ } else {
+
+ \OC_Log::write( 'Encryption library', 'Decryption (asymmetric) of sealed content failed' , \OC_Log::ERROR );
+
+ return false;
+
+ }
+
+ }
+
+ /**
+ * @brief Asymetrically encrypt a string using a public key
+ * @returns encrypted file
+ */
+ public static function keyEncrypt( $plainContent, $publicKey ) {
+
+ openssl_public_encrypt( $plainContent, $encryptedContent, $publicKey );
+
+ return $encryptedContent;
+
+ }
+
+ /**
+ * @brief Asymetrically decrypt a file using a private key
+ * @returns decrypted file
+ */
+ public static function keyDecrypt( $encryptedContent, $privatekey ) {
+
+ openssl_private_decrypt( $encryptedContent, $plainContent, $privatekey );
+
+ return $plainContent;
+
+ }
+
+ /**
+ * @brief Encrypts content symmetrically and generates keyfile asymmetrically
+ * @returns array containing catfile and new keyfile.
+ * keys: data, key
+ * @note this method is a wrapper for combining other crypt class methods
+ */
+ public static function keyEncryptKeyfile( $plainContent, $publicKey ) {
+
+ // Encrypt plain data, generate keyfile & encrypted file
+ $cryptedData = self::symmetricEncryptFileContentKeyfile( $plainContent );
+
+ // Encrypt keyfile
+ $cryptedKey = self::keyEncrypt( $cryptedData['key'], $publicKey );
+
+ return array( 'data' => $cryptedData['encrypted'], 'key' => $cryptedKey );
+
+ }
+
+ /**
+ * @brief Takes catfile, keyfile, and private key, and
+ * performs decryption
+ * @returns decrypted content
+ * @note this method is a wrapper for combining other crypt class methods
+ */
+ public static function keyDecryptKeyfile( $catfile, $keyfile, $privateKey ) {
+
+ // Decrypt the keyfile with the user's private key
+ $decryptedKeyfile = self::keyDecrypt( $keyfile, $privateKey );
+
+ // Decrypt the catfile symmetrically using the decrypted keyfile
+ $decryptedData = self::symmetricDecryptFileContent( $catfile, $decryptedKeyfile );
+
+ return $decryptedData;
+
+ }
+
+ /**
+ * @brief Symmetrically encrypt a file by combining encrypted component data blocks
+ */
+ public static function symmetricBlockEncryptFileContent( $plainContent, $key ) {
+
+ $crypted = '';
+
+ $remaining = $plainContent;
+
+ $testarray = array();
+
+ while( strlen( $remaining ) ) {
+
+ //echo "\n\n\$block = ".substr( $remaining, 0, 6126 );
+
+ // Encrypt a chunk of unencrypted data and add it to the rest
+ $block = self::symmetricEncryptFileContent( substr( $remaining, 0, 6126 ), $key );
+
+ $padded = self::addPadding( $block );
+
+ $crypted .= $block;
+
+ $testarray[] = $block;
+
+ // Remove the data already encrypted from remaining unencrypted data
+ $remaining = substr( $remaining, 6126 );
+
+ }
+
+ //echo "hags ";
+
+ //echo "\n\n\n\$crypted = $crypted\n\n\n";
+
+ //print_r($testarray);
+
+ return $crypted;
+
+ }
+
+
+ /**
+ * @brief Symmetrically decrypt a file by combining encrypted component data blocks
+ */
+ public static function symmetricBlockDecryptFileContent( $crypted, $key ) {
+
+ $decrypted = '';
+
+ $remaining = $crypted;
+
+ $testarray = array();
+
+ while( strlen( $remaining ) ) {
+
+ $testarray[] = substr( $remaining, 0, 8192 );
+
+ // Decrypt a chunk of unencrypted data and add it to the rest
+ $decrypted .= self::symmetricDecryptFileContent( $remaining, $key );
+
+ // Remove the data already encrypted from remaining unencrypted data
+ $remaining = substr( $remaining, 8192 );
+
+ }
+
+ //echo "\n\n\$testarray = "; print_r($testarray);
+
+ return $decrypted;
+
+ }
+
+ /**
+ * @brief Generates a pseudo random initialisation vector
+ * @return String $iv generated IV
+ */
+ public static function generateIv() {
+
+ if ( $random = openssl_random_pseudo_bytes( 12, $strong ) ) {
+
+ if ( !$strong ) {
+
+ // If OpenSSL indicates randomness is insecure, log error
+ \OC_Log::write( 'Encryption library', 'Insecure symmetric key was generated using openssl_random_pseudo_bytes()' , \OC_Log::WARN );
+
+ }
+
+ // We encode the iv purely for string manipulation
+ // purposes - it gets decoded before use
+ $iv = base64_encode( $random );
+
+ return $iv;
+
+ } else {
+
+ throw new Exception( 'Generating IV failed' );
+
+ }
+
+ }
+
+ /**
+ * @brief Generate a pseudo random 1024kb ASCII key
+ * @returns $key Generated key
+ */
+ public static function generateKey() {
+
+ // Generate key
+ if ( $key = base64_encode( openssl_random_pseudo_bytes( 183, $strong ) ) ) {
+
+ if ( !$strong ) {
+
+ // If OpenSSL indicates randomness is insecure, log error
+ throw new Exception ( 'Encryption library, Insecure symmetric key was generated using openssl_random_pseudo_bytes()' );
+
+ }
+
+ return $key;
+
+ } else {
+
+ return false;
+
+ }
+
+ }
+
+ public static function changekeypasscode($oldPassword, $newPassword) {
+
+ if(\OCP\User::isLoggedIn()){
+ $key = Keymanager::getPrivateKey( $user, $view );
+ if ( ($key = Crypt::symmetricDecryptFileContent($key,$oldpasswd)) ) {
+ if ( ($key = Crypt::symmetricEncryptFileContent($key, $newpasswd)) ) {
+ Keymanager::setPrivateKey($key);
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @brief Get the blowfish encryption handeler for a key
+ * @param $key string (optional)
+ * @return Crypt_Blowfish blowfish object
+ *
+ * if the key is left out, the default handeler will be used
+ */
+ public static function getBlowfish( $key = '' ) {
+
+ if ( $key ) {
+
+ return new \Crypt_Blowfish( $key );
+
+ } else {
+
+ return false;
+
+ }
+
+ }
+
+ public static function legacyCreateKey( $passphrase ) {
+
+ // Generate a random integer
+ $key = mt_rand( 10000, 99999 ) . mt_rand( 10000, 99999 ) . mt_rand( 10000, 99999 ) . mt_rand( 10000, 99999 );
+
+ // Encrypt the key with the passphrase
+ $legacyEncKey = self::legacyEncrypt( $key, $passphrase );
+
+ return $legacyEncKey;
+
+ }
+
+ /**
+ * @brief encrypts content using legacy blowfish system
+ * @param $content the cleartext message you want to encrypt
+ * @param $key the encryption key (optional)
+ * @returns encrypted content
+ *
+ * This function encrypts an content
+ */
+ public static function legacyEncrypt( $content, $passphrase = '' ) {
+
+ $bf = self::getBlowfish( $passphrase );
+
+ return $bf->encrypt( $content );
+
+ }
+
+ /**
+ * @brief decrypts content using legacy blowfish system
+ * @param $content the cleartext message you want to decrypt
+ * @param $key the encryption key (optional)
+ * @returns cleartext content
+ *
+ * This function decrypts an content
+ */
+ public static function legacyDecrypt( $content, $passphrase = '' ) {
+
+ $bf = self::getBlowfish( $passphrase );
+
+ $decrypted = $bf->decrypt( $content );
+
+ $trimmed = rtrim( $decrypted, "\0" );
+
+ return $trimmed;
+
+ }
+
+ public static function legacyKeyRecryptKeyfile( $legacyEncryptedContent, $legacyPassphrase, $publicKey, $newPassphrase ) {
+
+ $decrypted = self::legacyDecrypt( $legacyEncryptedContent, $legacyPassphrase );
+
+ $recrypted = self::keyEncryptKeyfile( $decrypted, $publicKey );
+
+ return $recrypted;
+
+ }
+
+ /**
+ * @brief Re-encryptes a legacy blowfish encrypted file using AES with integrated IV
+ * @param $legacyContent the legacy encrypted content to re-encrypt
+ * @returns cleartext content
+ *
+ * This function decrypts an content
+ */
+ public static function legacyRecrypt( $legacyContent, $legacyPassphrase, $newPassphrase ) {
+
+ # TODO: write me
+
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php
deleted file mode 100644
index d516c0c21b2..00000000000
--- a/apps/files_encryption/lib/cryptstream.php
+++ /dev/null
@@ -1,177 +0,0 @@
-<?php
-/**
- * ownCloud
- *
- * @author Robin Appelman
- * @copyright 2011 Robin Appelman icewind1991@gmail.com
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-/**
- * transparently encrypted filestream
- *
- * you can use it as wrapper around an existing stream by setting
- * OC_CryptStream::$sourceStreams['foo']=array('path'=>$path, 'stream'=>$stream)
- * and then fopen('crypt://streams/foo');
- */
-
-class OC_CryptStream{
- public static $sourceStreams=array();
- private $source;
- private $path;
- private $meta=array();//header/meta for source stream
- private $writeCache;
- private $size;
- private static $rootView;
-
- public function stream_open($path, $mode, $options, &$opened_path) {
- if ( ! self::$rootView) {
- self::$rootView=new OC_FilesystemView('');
- }
- $path=str_replace('crypt://', '', $path);
- if (dirname($path)=='streams' and isset(self::$sourceStreams[basename($path)])) {
- $this->source=self::$sourceStreams[basename($path)]['stream'];
- $this->path=self::$sourceStreams[basename($path)]['path'];
- $this->size=self::$sourceStreams[basename($path)]['size'];
- } else {
- $this->path=$path;
- if ($mode=='w' or $mode=='w+' or $mode=='wb' or $mode=='wb+') {
- $this->size=0;
- } else {
- $this->size=self::$rootView->filesize($path, $mode);
- }
- OC_FileProxy::$enabled=false;//disable fileproxies so we can open the source file
- $this->source=self::$rootView->fopen($path, $mode);
- OC_FileProxy::$enabled=true;
- if ( ! is_resource($this->source)) {
- OCP\Util::writeLog('files_encryption', 'failed to open '.$path, OCP\Util::ERROR);
- }
- }
- if (is_resource($this->source)) {
- $this->meta=stream_get_meta_data($this->source);
- }
- return is_resource($this->source);
- }
-
- public function stream_seek($offset, $whence=SEEK_SET) {
- $this->flush();
- fseek($this->source, $offset, $whence);
- }
-
- public function stream_tell() {
- return ftell($this->source);
- }
-
- public function stream_read($count) {
- //$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->writeCache='';
- if ($count!=8192) {
- OCP\Util::writeLog('files_encryption',
- 'php bug 21641 no longer holds, decryption will not work',
- OCP\Util::FATAL);
- die();
- }
- $pos=ftell($this->source);
- $data=fread($this->source, 8192);
- if (strlen($data)) {
- $result=OC_Crypt::decrypt($data);
- } else {
- $result='';
- }
- $length=$this->size-$pos;
- if ($length<8192) {
- $result=substr($result, 0, $length);
- }
- return $result;
- }
-
- public function stream_write($data) {
- $length=strlen($data);
- $currentPos=ftell($this->source);
- if ($this->writeCache) {
- $data=$this->writeCache.$data;
- $this->writeCache='';
- }
- if ($currentPos%8192!=0) {
- //make sure we always start on a block start
- fseek($this->source, -($currentPos%8192), SEEK_CUR);
- $encryptedBlock=fread($this->source, 8192);
- fseek($this->source, -($currentPos%8192), SEEK_CUR);
- $block=OC_Crypt::decrypt($encryptedBlock);
- $data=substr($block, 0, $currentPos%8192).$data;
- fseek($this->source, -($currentPos%8192), SEEK_CUR);
- }
- $currentPos=ftell($this->source);
- while ($remainingLength=strlen($data)>0) {
- if ($remainingLength<8192) {
- $this->writeCache=$data;
- $data='';
- } else {
- $encrypted=OC_Crypt::encrypt(substr($data, 0, 8192));
- fwrite($this->source, $encrypted);
- $data=substr($data, 8192);
- }
- }
- $this->size=max($this->size, $currentPos+$length);
- return $length;
- }
-
- public function stream_set_option($option, $arg1, $arg2) {
- switch($option) {
- case STREAM_OPTION_BLOCKING:
- stream_set_blocking($this->source, $arg1);
- break;
- case STREAM_OPTION_READ_TIMEOUT:
- stream_set_timeout($this->source, $arg1, $arg2);
- break;
- case STREAM_OPTION_WRITE_BUFFER:
- stream_set_write_buffer($this->source, $arg1, $arg2);
- }
- }
-
- public function stream_stat() {
- return fstat($this->source);
- }
-
- public function stream_lock($mode) {
- flock($this->source, $mode);
- }
-
- public function stream_flush() {
- return fflush($this->source);
- }
-
- public function stream_eof() {
- return feof($this->source);
- }
-
- private function flush() {
- if ($this->writeCache) {
- $encrypted=OC_Crypt::encrypt($this->writeCache);
- fwrite($this->source, $encrypted);
- $this->writeCache='';
- }
- }
-
- public function stream_close() {
- $this->flush();
- if ($this->meta['mode']!='r' and $this->meta['mode']!='rb') {
- OC_FileCache::put($this->path, array('encrypted'=>true, 'size'=>$this->size), '');
- }
- return fclose($this->source);
- }
-}
diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php
new file mode 100755
index 00000000000..706e1c2661e
--- /dev/null
+++ b/apps/files_encryption/lib/keymanager.php
@@ -0,0 +1,365 @@
+<?php
+/***
+ * ownCloud
+ *
+ * @author Bjoern Schiessle
+ * @copyright 2012 Bjoern Schiessle <schiessle@owncloud.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Encryption;
+
+/**
+ * @brief Class to manage storage and retrieval of encryption keys
+ * @note Where a method requires a view object, it's root must be '/'
+ */
+class Keymanager {
+
+ # TODO: make all dependencies (including static classes) explicit, such as ocfsview objects, by adding them as method arguments (dependency injection)
+
+ /**
+ * @brief retrieve the ENCRYPTED private key from a user
+ *
+ * @return string private key or false
+ * @note the key returned by this method must be decrypted before use
+ */
+ public static function getPrivateKey( \OC_FilesystemView $view, $user ) {
+
+ $path = '/' . $user . '/' . 'files_encryption' . '/' . $user.'.private.key';
+
+ $key = $view->file_get_contents( $path );
+
+ return $key;
+ }
+
+ /**
+ * @brief retrieve public key for a specified user
+ * @return string public key or false
+ */
+ public static function getPublicKey( \OC_FilesystemView $view, $userId ) {
+
+ return $view->file_get_contents( '/public-keys/' . '/' . $userId . '.public.key' );
+
+ }
+
+ /**
+ * @brief retrieve both keys from a user (private and public)
+ * @return array keys: privateKey, publicKey
+ */
+ public static function getUserKeys( \OC_FilesystemView $view, $userId ) {
+
+ return array(
+ 'publicKey' => self::getPublicKey( $view, $userId )
+ , 'privateKey' => self::getPrivateKey( $view, $userId )
+ );
+
+ }
+
+ /**
+ * @brief Retrieve public keys of all users with access to a file
+ * @param string $path Path to file
+ * @return array of public keys for the given file
+ * @note Checks that the sharing app is enabled should be performed
+ * by client code, that isn't checked here
+ */
+ public static function getPublicKeys( \OC_FilesystemView $view, $userId, $filePath ) {
+
+ $path = ltrim( $path, '/' );
+
+ $filepath = '/' . $userId . '/files/' . $filePath;
+
+ // Check if sharing is enabled
+ if ( OC_App::isEnabled( 'files_sharing' ) ) {
+
+// // Check if file was shared with other users
+// $query = \OC_DB::prepare( "
+// SELECT
+// uid_owner
+// , source
+// , target
+// , uid_shared_with
+// FROM
+// `*PREFIX*sharing`
+// WHERE
+// ( target = ? AND uid_shared_with = ? )
+// OR source = ?
+// " );
+//
+// $result = $query->execute( array ( $filepath, $userId, $filepath ) );
+//
+// $users = array();
+//
+// if ( $row = $result->fetchRow() )
+// {
+// $source = $row['source'];
+// $owner = $row['uid_owner'];
+// $users[] = $owner;
+// // get the uids of all user with access to the file
+// $query = \OC_DB::prepare( "SELECT source, uid_shared_with FROM `*PREFIX*sharing` WHERE source = ?" );
+// $result = $query->execute( array ($source));
+// while ( ($row = $result->fetchRow()) ) {
+// $users[] = $row['uid_shared_with'];
+//
+// }
+//
+// }
+
+ } else {
+
+ // check if it is a file owned by the user and not shared at all
+ $userview = new \OC_FilesystemView( '/'.$userId.'/files/' );
+
+ if ( $userview->file_exists( $path ) ) {
+
+ $users[] = $userId;
+
+ }
+
+ }
+
+ $view = new \OC_FilesystemView( '/public-keys/' );
+
+ $keylist = array();
+
+ $count = 0;
+
+ foreach ( $users as $user ) {
+
+ $keylist['key'.++$count] = $view->file_get_contents( $user.'.public.key' );
+
+ }
+
+ return $keylist;
+
+ }
+
+ /**
+ * @brief retrieve keyfile for an encrypted file
+ * @param string file name
+ * @return string file key or false
+ * @note The keyfile returned is asymmetrically encrypted. Decryption
+ * of the keyfile must be performed by client code
+ */
+ public static function getFileKey( \OC_FilesystemView $view, $userId, $filePath ) {
+
+ $filePath_f = ltrim( $filePath, '/' );
+
+// // update $keypath and $userId if path point to a file shared by someone else
+// $query = \OC_DB::prepare( "SELECT uid_owner, source, target FROM `*PREFIX*sharing` WHERE target = ? AND uid_shared_with = ?" );
+//
+// $result = $query->execute( array ('/'.$userId.'/files/'.$keypath, $userId));
+//
+// if ($row = $result->fetchRow()) {
+//
+// $keypath = $row['source'];
+// $keypath_parts = explode( '/', $keypath );
+// $userId = $keypath_parts[1];
+// $keypath = str_replace( '/' . $userId . '/files/', '', $keypath );
+//
+// }
+
+ return $view->file_get_contents( '/' . $userId . '/files_encryption/keyfiles/' . $filePath_f . '.key' );
+
+ }
+
+ /**
+ * @brief retrieve file encryption key
+ *
+ * @param string file name
+ * @return string file key or false
+ */
+ public static function deleteFileKey( $path, $staticUserClass = 'OCP\User' ) {
+
+ $keypath = ltrim( $path, '/' );
+ $user = $staticUserClass::getUser();
+
+ // update $keypath and $user if path point to a file shared by someone else
+// $query = \OC_DB::prepare( "SELECT uid_owner, source, target FROM `*PREFIX*sharing` WHERE target = ? AND uid_shared_with = ?" );
+//
+// $result = $query->execute( array ('/'.$user.'/files/'.$keypath, $user));
+//
+// if ($row = $result->fetchRow()) {
+//
+// $keypath = $row['source'];
+// $keypath_parts = explode( '/', $keypath );
+// $user = $keypath_parts[1];
+// $keypath = str_replace( '/' . $user . '/files/', '', $keypath );
+//
+// }
+
+ $view = new \OC_FilesystemView('/'.$user.'/files_encryption/keyfiles/');
+
+ return $view->unlink( $keypath . '.key' );
+
+ }
+
+ /**
+ * @brief store private key from the user
+ * @param string key
+ * @return bool
+ * @note Encryption of the private key must be performed by client code
+ * as no encryption takes place here
+ */
+ public static function setPrivateKey( $key ) {
+
+ $user = \OCP\User::getUser();
+
+ $view = new \OC_FilesystemView( '/' . $user . '/files_encryption' );
+
+ \OC_FileProxy::$enabled = false;
+
+ if ( !$view->file_exists( '' ) ) $view->mkdir( '' );
+
+ return $view->file_put_contents( $user . '.private.key', $key );
+
+ \OC_FileProxy::$enabled = true;
+
+ }
+
+ /**
+ * @brief store private keys from the user
+ *
+ * @param string privatekey
+ * @param string publickey
+ * @return bool true/false
+ */
+ public static function setUserKeys($privatekey, $publickey) {
+
+ return (self::setPrivateKey($privatekey) && self::setPublicKey($publickey));
+
+ }
+
+ /**
+ * @brief store public key of the user
+ *
+ * @param string key
+ * @return bool true/false
+ */
+ public static function setPublicKey( $key ) {
+
+ $view = new \OC_FilesystemView( '/public-keys' );
+
+ \OC_FileProxy::$enabled = false;
+
+ if ( !$view->file_exists( '' ) ) $view->mkdir( '' );
+
+ return $view->file_put_contents( \OCP\User::getUser() . '.public.key', $key );
+
+ \OC_FileProxy::$enabled = true;
+
+ }
+
+ /**
+ * @brief store file encryption key
+ *
+ * @param string $path relative path of the file, including filename
+ * @param string $key
+ * @return bool true/false
+ * @note The keyfile is not encrypted here. Client code must
+ * asymmetrically encrypt the keyfile before passing it to this method
+ */
+ public static function setFileKey( $path, $key, $view = Null, $dbClassName = '\OC_DB') {
+
+ $targetPath = ltrim( $path, '/' );
+ $user = \OCP\User::getUser();
+
+// // update $keytarget and $user if key belongs to a file shared by someone else
+// $query = $dbClassName::prepare( "SELECT uid_owner, source, target FROM `*PREFIX*sharing` WHERE target = ? AND uid_shared_with = ?" );
+//
+// $result = $query->execute( array ( '/'.$user.'/files/'.$targetPath, $user ) );
+//
+// if ( $row = $result->fetchRow( ) ) {
+//
+// $targetPath = $row['source'];
+//
+// $targetPath_parts = explode( '/', $targetPath );
+//
+// $user = $targetPath_parts[1];
+//
+// $rootview = new \OC_FilesystemView( '/' );
+//
+// if ( ! $rootview->is_writable( $targetPath ) ) {
+//
+// \OC_Log::write( 'Encryption library', "File Key not updated because you don't have write access for the corresponding file", \OC_Log::ERROR );
+//
+// return false;
+//
+// }
+//
+// $targetPath = str_replace( '/'.$user.'/files/', '', $targetPath );
+//
+// //TODO: check for write permission on shared file once the new sharing API is in place
+//
+// }
+
+ $path_parts = pathinfo( $targetPath );
+
+ if ( !$view ) {
+
+ $view = new \OC_FilesystemView( '/' );
+
+ }
+
+ $view->chroot( '/' . $user . '/files_encryption/keyfiles' );
+
+ // If the file resides within a subdirectory, create it
+ if (
+ isset( $path_parts['dirname'] )
+ && ! $view->file_exists( $path_parts['dirname'] )
+ ) {
+
+ $view->mkdir( $path_parts['dirname'] );
+
+ }
+
+ // Save the keyfile in parallel directory
+ return $view->file_put_contents( '/' . $targetPath . '.key', $key );
+
+ }
+
+ /**
+ * @brief change password of private encryption key
+ *
+ * @param string $oldpasswd old password
+ * @param string $newpasswd new password
+ * @return bool true/false
+ */
+ public static function changePasswd($oldpasswd, $newpasswd) {
+
+ if ( \OCP\User::checkPassword(\OCP\User::getUser(), $newpasswd) ) {
+ return Crypt::changekeypasscode($oldpasswd, $newpasswd);
+ }
+ return false;
+
+ }
+
+ /**
+ * @brief Fetch the legacy encryption key from user files
+ * @param string $login used to locate the legacy key
+ * @param string $passphrase used to decrypt the legacy key
+ * @return true / false
+ *
+ * if the key is left out, the default handeler will be used
+ */
+ public function getLegacyKey() {
+
+ $user = \OCP\User::getUser();
+ $view = new \OC_FilesystemView( '/' . $user );
+ return $view->file_get_contents( 'encryption.key' );
+
+ }
+
+} \ No newline at end of file
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index e8dbd95c29d..52f47dba294 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -3,8 +3,9 @@
/**
* ownCloud
*
-* @author Robin Appelman
-* @copyright 2011 Robin Appelman icewind1991@gmail.com
+* @author Sam Tuke, Robin Appelman
+* @copyright 2012 Sam Tuke samtuke@owncloud.com, Robin Appelman
+* icewind1991@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -21,111 +22,267 @@
*
*/
-/**
- * transparent encryption
- */
+namespace OCA\Encryption;
-class OC_FileProxy_Encryption extends OC_FileProxy{
- private static $blackList=null; //mimetypes blacklisted from encryption
- private static $enableEncryption=null;
+class Proxy extends \OC_FileProxy {
+ private static $blackList = null; //mimetypes blacklisted from encryption
+
+ private static $enableEncryption = null;
+
/**
- * check if a file should be encrypted during write
+ * Check if a file requires encryption
* @param string $path
* @return bool
+ *
+ * Tests if server side encryption is enabled, and file is allowed by blacklists
*/
- private static function shouldEncrypt($path) {
- if (is_null(self::$enableEncryption)) {
- self::$enableEncryption=(OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true')=='true');
+ private static function shouldEncrypt( $path ) {
+
+ if ( is_null( self::$enableEncryption ) ) {
+
+ if (
+ \OCP\Config::getAppValue( 'files_encryption', 'enable_encryption', 'true' ) == 'true'
+ && Crypt::mode() == 'server'
+ ) {
+
+ self::$enableEncryption = true;
+
+ } else {
+
+ self::$enableEncryption = false;
+
+ }
+
}
- if ( ! self::$enableEncryption) {
+
+ if ( !self::$enableEncryption ) {
+
return false;
+
}
- 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'));
+
+ 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' ) );
+
}
- if (self::isEncrypted($path)) {
+
+ if ( Crypt::isEncryptedContent( $path ) ) {
+
return true;
+
}
- $extension=substr($path, strrpos($path, '.')+1);
- if (array_search($extension, self::$blackList)===false) {
+
+ $extension = substr( $path, strrpos( $path,'.' ) +1 );
+
+ if ( array_search( $extension, self::$blackList ) === false ){
+
return true;
+
}
+
+ return false;
}
-
- /**
- * check if a file is encrypted
- * @param string $path
- * @return bool
- */
- private static function isEncrypted($path) {
- $metadata=OC_FileCache_Cached::get($path, '');
- return isset($metadata['encrypted']) and (bool)$metadata['encrypted'];
- }
-
- public function preFile_put_contents($path,&$data) {
- if (self::shouldEncrypt($path)) {
- if ( ! is_resource($data)) {//stream put contents should have been converter to fopen
- $size=strlen($data);
- $data=OC_Crypt::blockEncrypt($data);
- OC_FileCache::put($path, array('encrypted'=>true,'size'=>$size), '');
+
+ public function preFile_put_contents( $path, &$data ) {
+
+ if ( self::shouldEncrypt( $path ) ) {
+
+ if ( !is_resource( $data ) ) { //stream put contents should have been converted to fopen
+
+ $userId = \OCP\USER::getUser();
+
+ $rootView = new \OC_FilesystemView( '/' );
+
+ // Set the filesize for userland, before encrypting
+ $size = strlen( $data );
+
+ // Disable encryption proxy to prevent recursive calls
+ \OC_FileProxy::$enabled = false;
+
+ // Encrypt plain data and fetch key
+ $encrypted = Crypt::keyEncryptKeyfile( $data, Keymanager::getPublicKey( $rootView, $userId ) );
+
+ // Replace plain content with encrypted content by reference
+ $data = $encrypted['data'];
+
+ $filePath = explode( '/', $path );
+
+ $filePath = array_slice( $filePath, 3 );
+
+ $filePath = '/' . implode( '/', $filePath );
+
+ # TODO: make keyfile dir dynamic from app config
+ $view = new \OC_FilesystemView( '/' . $userId . '/files_encryption/keyfiles' );
+
+ // Save keyfile for newly encrypted file in parallel directory tree
+ Keymanager::setFileKey( $filePath, $encrypted['key'], $view, '\OC_DB' );
+
+ // Update the file cache with file info
+ \OC_FileCache::put( $path, array( 'encrypted'=>true, 'size' => $size ), '' );
+
+ // Re-enable proxy - our work is done
+ \OC_FileProxy::$enabled = true;
+
}
}
+
}
+
+ /**
+ * @param string $path Path of file from which has been read
+ * @param string $data Data that has been read from file
+ */
+ public function postFile_get_contents( $path, $data ) {
+
+ # TODO: Use dependency injection to add required args for view and user etc. to this method
+
+ // Disable encryption proxy to prevent recursive calls
+ \OC_FileProxy::$enabled = false;
+
+ // If data is a catfile
+ if (
+ Crypt::mode() == 'server'
+ && Crypt::isEncryptedContent( $data )
+ ) {
+
+ $split = explode( '/', $path );
+
+ $filePath = array_slice( $split, 3 );
+
+ $filePath = '/' . implode( '/', $filePath );
+
+ //$cached = \OC_FileCache_Cached::get( $path, '' );
+
+ $view = new \OC_FilesystemView( '' );
+
+ $userId = \OCP\USER::getUser();
+
+ $encryptedKeyfile = Keymanager::getFileKey( $view, $userId, $filePath );
- public function postFile_get_contents($path, $data) {
- if (self::isEncrypted($path)) {
- $cached=OC_FileCache_Cached::get($path, '');
- $data=OC_Crypt::blockDecrypt($data, '', $cached['size']);
+ $session = new Session();
+
+ $decrypted = Crypt::keyDecryptKeyfile( $data, $encryptedKeyfile, $session->getPrivateKey( $split[1] ) );
+
+ } elseif (
+ Crypt::mode() == 'server'
+ && isset( $_SESSION['legacyenckey'] )
+ && Crypt::isEncryptedMeta( $path )
+ ) {
+
+ $decrypted = Crypt::legacyDecrypt( $data, $_SESSION['legacyenckey'] );
+
}
- return $data;
+
+ \OC_FileProxy::$enabled = true;
+
+ if ( ! isset( $decrypted ) ) {
+
+ $decrypted = $data;
+
+ }
+
+ return $decrypted;
+
}
-
- public function postFopen($path,&$result) {
- if ( ! $result) {
+
+ public function postFopen( $path, &$result ){
+
+ if ( !$result ) {
+
return $result;
+
}
- $meta=stream_get_meta_data($result);
- if (self::isEncrypted($path)) {
- fclose($result);
- $result=fopen('crypt://'.$path, $meta['mode']);
- } elseif (self::shouldEncrypt($path) and $meta['mode']!='r' and $meta['mode']!='rb') {
- 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
- OCP\Util::writeLog('files_encryption', 'Decrypting '.$path.' before writing', OCP\Util::DEBUG);
- $tmp=fopen('php://temp');
- OCP\Files::streamCopy($result, $tmp);
- fclose($result);
- OC_Filesystem::file_put_contents($path, $tmp);
- fclose($tmp);
+
+ // Reformat path for use with OC_FSV
+ $path_split = explode( '/', $path );
+ $path_f = implode( array_slice( $path_split, 3 ) );
+
+ // Disable encryption proxy to prevent recursive calls
+ \OC_FileProxy::$enabled = false;
+
+ $meta = stream_get_meta_data( $result );
+
+ $view = new \OC_FilesystemView( '' );
+
+ $util = new Util( $view, \OCP\USER::getUser());
+
+ // If file is already encrypted, decrypt using crypto protocol
+ if (
+ Crypt::mode() == 'server'
+ && $util->isEncryptedPath( $path )
+ ) {
+
+ // Close the original encrypted file
+ fclose( $result );
+
+ // Open the file using the crypto stream wrapper
+ // protocol and let it do the decryption work instead
+ $result = fopen( 'crypt://' . $path_f, $meta['mode'] );
+
+
+ } elseif (
+ self::shouldEncrypt( $path )
+ and $meta ['mode'] != 'r'
+ and $meta['mode'] != 'rb'
+ ) {
+ // If the file is not yet encrypted, but should be
+ // encrypted when it's saved (it's not read only)
+
+ // NOTE: this is the case for new files saved via WebDAV
+
+ if (
+ $view->file_exists( $path )
+ and $view->filesize( $path ) > 0
+ ) {
+ $x = $view->file_get_contents( $path );
+
+ $tmp = tmpfile();
+
+// // Make a temporary copy of the original file
+// \OCP\Files::streamCopy( $result, $tmp );
+//
+// // Close the original stream, we'll return another one
+// fclose( $result );
+//
+// $view->file_put_contents( $path_f, $tmp );
+//
+// fclose( $tmp );
+
}
- $result=fopen('crypt://'.$path, $meta['mode']);
+
+ $result = fopen( 'crypt://'.$path_f, $meta['mode'] );
+
}
+
+ // Re-enable the proxy
+ \OC_FileProxy::$enabled = true;
+
return $result;
+
}
- public function postGetMimeType($path, $mime) {
- if (self::isEncrypted($path)) {
- $mime=OCP\Files::getMimeType('crypt://'.$path, 'w');
+ public function postGetMimeType($path,$mime){
+ if( Crypt::isEncryptedContent($path)){
+ $mime = \OCP\Files::getMimeType('crypt://'.$path,'w');
}
return $mime;
}
- public function postStat($path, $data) {
- if (self::isEncrypted($path)) {
- $cached=OC_FileCache_Cached::get($path, '');
+ public function postStat($path,$data){
+ if( Crypt::isEncryptedContent($path)){
+ $cached= \OC_FileCache_Cached::get($path,'');
$data['size']=$cached['size'];
}
return $data;
}
- public function postFileSize($path, $size) {
- if (self::isEncrypted($path)) {
- $cached=OC_FileCache_Cached::get($path, '');
+ public function postFileSize($path,$size){
+ if( Crypt::isEncryptedContent($path)){
+ $cached = \OC_FileCache_Cached::get($path,'');
return $cached['size'];
- } else {
+ }else{
return $size;
}
}
diff --git a/apps/files_encryption/lib/session.php b/apps/files_encryption/lib/session.php
new file mode 100644
index 00000000000..85d533fde7a
--- /dev/null
+++ b/apps/files_encryption/lib/session.php
@@ -0,0 +1,66 @@
+<?php
+/**
+ * ownCloud
+ *
+ * @author Sam Tuke
+ * @copyright 2012 Sam Tuke samtuke@owncloud.com
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Encryption;
+
+/**
+ * Class for handling encryption related session data
+ */
+
+class Session {
+
+ /**
+ * @brief Sets user id for session and triggers emit
+ * @return bool
+ *
+ */
+ public function setPrivateKey( $privateKey, $userId ) {
+
+ $_SESSION['privateKey'] = $privateKey;
+
+ return true;
+
+ }
+
+ /**
+ * @brief Gets user id for session and triggers emit
+ * @returns string $privateKey The user's plaintext private key
+ *
+ */
+ public function getPrivateKey( $userId ) {
+
+ if (
+ isset( $_SESSION['privateKey'] )
+ && !empty( $_SESSION['privateKey'] )
+ ) {
+
+ return $_SESSION['privateKey'];
+
+ } else {
+
+ return false;
+
+ }
+
+ }
+
+} \ No newline at end of file
diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
new file mode 100644
index 00000000000..f482e2d75ac
--- /dev/null
+++ b/apps/files_encryption/lib/stream.php
@@ -0,0 +1,464 @@
+<?php
+/**
+ * ownCloud
+ *
+ * @author Robin Appelman
+ * @copyright 2012 Sam Tuke <samtuke@owncloud.com>, 2011 Robin Appelman
+ * <icewind1991@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+/**
+ * transparently encrypted filestream
+ *
+ * you can use it as wrapper around an existing stream by setting CryptStream::$sourceStreams['foo']=array('path'=>$path,'stream'=>$stream)
+ * and then fopen('crypt://streams/foo');
+ */
+
+namespace OCA\Encryption;
+
+/**
+ * @brief Provides 'crypt://' stream wrapper protocol.
+ * @note We use a stream wrapper because it is the most secure way to handle
+ * decrypted content transfers. There is no safe way to decrypt the entire file
+ * somewhere on the server, so we have to encrypt and decrypt blocks on the fly.
+ * @note Paths used with this protocol MUST BE RELATIVE. Use URLs like:
+ * crypt://filename, or crypt://subdirectory/filename, NOT
+ * crypt:///home/user/owncloud/data. Otherwise keyfiles will be put in
+ * [owncloud]/data/user/files_encryption/keyfiles/home/user/owncloud/data and
+ * will not be accessible to other methods.
+ * @note Data read and written must always be 8192 bytes long, as this is the
+ * buffer size used internally by PHP. The encryption process makes the input
+ * data longer, and input is chunked into smaller pieces in order to result in
+ * a 8192 encrypted block size.
+ */
+class Stream {
+
+ public static $sourceStreams = array();
+
+ # TODO: make all below properties private again once unit testing is configured correctly
+ public $rawPath; // The raw path received by stream_open
+ public $path_f; // The raw path formatted to include username and data directory
+ private $userId;
+ private $handle; // Resource returned by fopen
+ private $path;
+ private $readBuffer; // For streams that dont support seeking
+ private $meta = array(); // Header / meta for source stream
+ private $count;
+ private $writeCache;
+ public $size;
+ private $publicKey;
+ private $keyfile;
+ private $encKeyfile;
+ private static $view; // a fsview object set to user dir
+ private $rootView; // a fsview object set to '/'
+
+ public function stream_open( $path, $mode, $options, &$opened_path ) {
+
+ // Get access to filesystem via filesystemview object
+ if ( !self::$view ) {
+
+ self::$view = new \OC_FilesystemView( $this->userId . '/' );
+
+ }
+
+ // Set rootview object if necessary
+ if ( ! $this->rootView ) {
+
+ $this->rootView = new \OC_FilesystemView( $this->userId . '/' );
+
+ }
+
+ $this->userId = \OCP\User::getUser();
+
+ // Get the bare file path
+ $path = str_replace( 'crypt://', '', $path );
+
+ $this->rawPath = $path;
+
+ $this->path_f = $this->userId . '/files/' . $path;
+
+ if (
+ dirname( $path ) == 'streams'
+ and isset( self::$sourceStreams[basename( $path )] )
+ ) {
+
+ // Is this just for unit testing purposes?
+
+ $this->handle = self::$sourceStreams[basename( $path )]['stream'];
+
+ $this->path = self::$sourceStreams[basename( $path )]['path'];
+
+ $this->size = self::$sourceStreams[basename( $path )]['size'];
+
+ } else {
+
+ if (
+ $mode == 'w'
+ or $mode == 'w+'
+ or $mode == 'wb'
+ or $mode == 'wb+'
+ ) {
+
+ $this->size = 0;
+
+ } else {
+
+
+
+ $this->size = self::$view->filesize( $this->path_f, $mode );
+
+ //$this->size = filesize( $path );
+
+ }
+
+ // Disable fileproxies so we can open the source file without recursive encryption
+ \OC_FileProxy::$enabled = false;
+
+ //$this->handle = fopen( $path, $mode );
+
+ $this->handle = self::$view->fopen( $this->path_f, $mode );
+
+ \OC_FileProxy::$enabled = true;
+
+ if ( !is_resource( $this->handle ) ) {
+
+ \OCP\Util::writeLog( 'files_encryption', 'failed to open '.$path, \OCP\Util::ERROR );
+
+ }
+
+ }
+
+ if ( is_resource( $this->handle ) ) {
+
+ $this->meta = stream_get_meta_data( $this->handle );
+
+ }
+
+ return is_resource( $this->handle );
+
+ }
+
+ public function stream_seek( $offset, $whence = SEEK_SET ) {
+
+ $this->flush();
+
+ fseek( $this->handle, $offset, $whence );
+
+ }
+
+ public function stream_tell() {
+ return ftell($this->handle);
+ }
+
+ public function stream_read( $count ) {
+
+ $this->writeCache = '';
+
+ if ( $count != 8192 ) {
+
+ // $count will always be 8192 https://bugs.php.net/bug.php?id=21641
+ // This makes this function a lot simpler, but will break this class if the above 'bug' gets 'fixed'
+ \OCP\Util::writeLog( 'files_encryption', 'PHP "bug" 21641 no longer holds, decryption system requires refactoring', OCP\Util::FATAL );
+
+ die();
+
+ }
+
+// $pos = ftell( $this->handle );
+//
+ // Get the data from the file handle
+ $data = fread( $this->handle, 8192 );
+
+ if ( strlen( $data ) ) {
+
+ $this->getKey();
+
+ $result = Crypt::symmetricDecryptFileContent( $data, $this->keyfile );
+
+ } else {
+
+ $result = '';
+
+ }
+
+// $length = $this->size - $pos;
+//
+// if ( $length < 8192 ) {
+//
+// $result = substr( $result, 0, $length );
+//
+// }
+
+ return $result;
+
+ }
+
+ /**
+ * @brief Encrypt and pad data ready for writting to disk
+ * @param string $plainData data to be encrypted
+ * @param string $key key to use for encryption
+ * @return encrypted data on success, false on failure
+ */
+ public function preWriteEncrypt( $plainData, $key ) {
+
+ // Encrypt data to 'catfile', which includes IV
+ if ( $encrypted = Crypt::symmetricEncryptFileContent( $plainData, $key ) ) {
+
+ return $encrypted;
+
+ } else {
+
+ return false;
+
+ }
+
+ }
+
+ /**
+ * @brief Get the keyfile for the current file, generate one if necessary
+ * @param bool $generate if true, a new key will be generated if none can be found
+ * @return bool true on key found and set, false on key not found and new key generated and set
+ */
+ public function getKey() {
+
+ // If a keyfile already exists for a file named identically to file to be written
+ if ( self::$view->file_exists( $this->userId . '/'. 'files_encryption' . '/' . 'keyfiles' . '/' . $this->rawPath . '.key' ) ) {
+
+ # TODO: add error handling for when file exists but no keyfile
+
+ // Fetch existing keyfile
+ $this->encKeyfile = Keymanager::getFileKey( $this->rootView, $this->userId, $this->rawPath );
+
+ $this->getUser();
+
+ $session = new Session();
+
+ $privateKey = $session->getPrivateKey( $this->userId );
+
+ $this->keyfile = Crypt::keyDecrypt( $this->encKeyfile, $privateKey );
+
+ return true;
+
+ } else {
+
+ return false;
+
+ }
+
+ }
+
+ public function getuser() {
+
+ // Only get the user again if it isn't already set
+ if ( empty( $this->userId ) ) {
+
+ # TODO: Move this user call out of here - it belongs elsewhere
+ $this->userId = \OCP\User::getUser();
+
+ }
+
+ # TODO: Add a method for getting the user in case OCP\User::
+ # getUser() doesn't work (can that scenario ever occur?)
+
+ }
+
+ /**
+ * @brief Handle plain data from the stream, and write it in 8192 byte blocks
+ * @param string $data data to be written to disk
+ * @note the data will be written to the path stored in the stream handle, set in stream_open()
+ * @note $data is only ever be a maximum of 8192 bytes long. This is set by PHP internally. stream_write() is called multiple times in a loop on data larger than 8192 bytes
+ * @note Because the encryption process used increases the length of $data, a writeCache is used to carry over data which would not fit in the required block size
+ * @note Padding is added to each encrypted block to ensure that the resulting block is exactly 8192 bytes. This is removed during stream_read
+ * @note PHP automatically updates the file pointer after writing data to reflect it's length. There is generally no need to update the poitner manually using fseek
+ */
+ public function stream_write( $data ) {
+
+ // Disable the file proxies so that encryption is not automatically attempted when the file is written to disk - we are handling that separately here and we don't want to get into an infinite loop
+ \OC_FileProxy::$enabled = false;
+
+ // Get the length of the unencrypted data that we are handling
+ $length = strlen( $data );
+
+ // So far this round, no data has been written
+ $written = 0;
+
+ // Find out where we are up to in the writing of data to the file
+ $pointer = ftell( $this->handle );
+
+ // Make sure the userId is set
+ $this->getuser();
+
+ // Get / generate the keyfile for the file we're handling
+ // If we're writing a new file (not overwriting an existing one), save the newly generated keyfile
+ if ( ! $this->getKey() ) {
+
+ $this->keyfile = Crypt::generateKey();
+
+ $this->publicKey = Keymanager::getPublicKey( $this->rootView, $this->userId );
+
+ $this->encKeyfile = Crypt::keyEncrypt( $this->keyfile, $this->publicKey );
+
+ // Save the new encrypted file key
+ Keymanager::setFileKey( $this->rawPath, $this->encKeyfile, new \OC_FilesystemView( '/' ) );
+
+ # TODO: move this new OCFSV out of here some how, use DI
+
+ }
+
+ // If extra data is left over from the last round, make sure it is integrated into the next 6126 / 8192 block
+ if ( $this->writeCache ) {
+
+ // Concat writeCache to start of $data
+ $data = $this->writeCache . $data;
+
+ // Clear the write cache, ready for resuse - it has been flushed and its old contents processed
+ $this->writeCache = '';
+
+ }
+//
+// // Make sure we always start on a block start
+ if ( 0 != ( $pointer % 8192 ) ) { // if the current positoin of file indicator is not aligned to a 8192 byte block, fix it so that it is
+
+// fseek( $this->handle, - ( $pointer % 8192 ), SEEK_CUR );
+//
+// $pointer = ftell( $this->handle );
+//
+// $unencryptedNewBlock = fread( $this->handle, 8192 );
+//
+// fseek( $this->handle, - ( $currentPos % 8192 ), SEEK_CUR );
+//
+// $block = Crypt::symmetricDecryptFileContent( $unencryptedNewBlock, $this->keyfile );
+//
+// $x = substr( $block, 0, $currentPos % 8192 );
+//
+// $data = $x . $data;
+//
+// fseek( $this->handle, - ( $currentPos % 8192 ), SEEK_CUR );
+//
+ }
+
+// $currentPos = ftell( $this->handle );
+
+// // While there still remains somed data to be processed & written
+ while( strlen( $data ) > 0 ) {
+//
+// // Remaining length for this iteration, not of the entire file (may be greater than 8192 bytes)
+// $remainingLength = strlen( $data );
+//
+// // If data remaining to be written is less than the size of 1 6126 byte block
+ if ( strlen( $data ) < 6126 ) {
+
+ // Set writeCache to contents of $data
+ // The writeCache will be carried over to the next write round, and added to the start of $data to ensure that written blocks are always the correct length. If there is still data in writeCache after the writing round has finished, then the data will be written to disk by $this->flush().
+ $this->writeCache = $data;
+
+ // Clear $data ready for next round
+ $data = '';
+//
+ } else {
+
+ // Read the chunk from the start of $data
+ $chunk = substr( $data, 0, 6126 );
+
+ $encrypted = $this->preWriteEncrypt( $chunk, $this->keyfile );
+
+ // Write the data chunk to disk. This will be addended to the last data chunk if the file being handled totals more than 6126 bytes
+ fwrite( $this->handle, $encrypted );
+
+ $writtenLen = strlen( $encrypted );
+ //fseek( $this->handle, $writtenLen, SEEK_CUR );
+
+ // Remove the chunk we just processed from $data, leaving only unprocessed data in $data var, for handling on the next round
+ $data = substr( $data, 6126 );
+
+ }
+
+ }
+
+ $this->size = max( $this->size, $pointer + $length );
+
+ return $length;
+
+ }
+
+
+ public function stream_set_option($option,$arg1,$arg2) {
+ switch($option) {
+ case STREAM_OPTION_BLOCKING:
+ stream_set_blocking($this->handle,$arg1);
+ break;
+ case STREAM_OPTION_READ_TIMEOUT:
+ stream_set_timeout($this->handle,$arg1,$arg2);
+ break;
+ case STREAM_OPTION_WRITE_BUFFER:
+ stream_set_write_buffer($this->handle,$arg1,$arg2);
+ }
+ }
+
+ public function stream_stat() {
+ return fstat($this->handle);
+ }
+
+ public function stream_lock($mode) {
+ flock($this->handle,$mode);
+ }
+
+ public function stream_flush() {
+
+ return fflush($this->handle); // Not a typo: http://php.net/manual/en/function.fflush.php
+
+ }
+
+ public function stream_eof() {
+ return feof($this->handle);
+ }
+
+ private function flush() {
+
+ if ( $this->writeCache ) {
+
+ // Set keyfile property for file in question
+ $this->getKey();
+
+ $encrypted = $this->preWriteEncrypt( $this->writeCache, $this->keyfile );
+
+ fwrite( $this->handle, $encrypted );
+
+ $this->writeCache = '';
+
+ }
+
+ }
+
+ public function stream_close() {
+
+ $this->flush();
+
+ if (
+ $this->meta['mode']!='r'
+ and $this->meta['mode']!='rb'
+ ) {
+
+ \OC_FileCache::put( $this->path, array( 'encrypted' => true, 'size' => $this->size ), '' );
+
+ }
+
+ return fclose( $this->handle );
+
+ }
+
+}
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
new file mode 100644
index 00000000000..cd46d23108a
--- /dev/null
+++ b/apps/files_encryption/lib/util.php
@@ -0,0 +1,330 @@
+<?php
+/**
+ * ownCloud
+ *
+ * @author Sam Tuke, Frank Karlitschek
+ * @copyright 2012 Sam Tuke samtuke@owncloud.com,
+ * Frank Karlitschek frank@owncloud.org
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+// Todo:
+// - Crypt/decrypt button in the userinterface
+// - Setting if crypto should be on by default
+// - Add a setting "Don´t encrypt files larger than xx because of performance reasons"
+// - Transparent decrypt/encrypt in filesystem.php. Autodetect if a file is encrypted (.encrypted extension)
+// - Don't use a password directly as encryption key. but a key which is stored on the server and encrypted with the user password. -> password change faster
+// - IMPORTANT! Check if the block lenght of the encrypted data stays the same
+
+namespace OCA\Encryption;
+
+/**
+ * @brief Class for utilities relating to encrypted file storage system
+ * @param $view OC_FilesystemView object, expected to have OC '/' as root path
+ * @param $client flag indicating status of client side encryption. Currently
+ * unused, likely to become obsolete shortly
+ */
+
+class Util {
+
+
+ # Web UI:
+
+ ## DONE: files created via web ui are encrypted
+ ## DONE: file created & encrypted via web ui are readable in web ui
+ ## DONE: file created & encrypted via web ui are readable via webdav
+
+
+ # WebDAV:
+
+ ## DONE: new data filled files added via webdav get encrypted
+ ## DONE: new data filled files added via webdav are readable via webdav
+ ## DONE: reading unencrypted files when encryption is enabled works via webdav
+ ## DONE: files created & encrypted via web ui are readable via webdav
+
+
+ # Legacy support:
+
+ ## DONE: add method to check if file is encrypted using new system
+ ## DONE: add method to check if file is encrypted using old system
+ ## DONE: add method to fetch legacy key
+ ## DONE: add method to decrypt legacy encrypted data
+
+ ## TODO: add method to encrypt all user files using new system
+ ## TODO: add method to decrypt all user files using new system
+ ## TODO: add method to encrypt all user files using old system
+ ## TODO: add method to decrypt all user files using old system
+
+
+ # Admin UI:
+
+ ## DONE: changing user password also changes encryption passphrase
+
+ ## TODO: add support for optional recovery in case of lost passphrase / keys
+ ## TODO: add admin optional required long passphrase for users
+ ## TODO: add UI buttons for encrypt / decrypt everything
+ ## TODO: implement flag system to allow user to specify encryption by folder, subfolder, etc.
+
+
+ # Sharing:
+
+ ## TODO: add support for encrypting to multiple public keys
+ ## TODO: add support for decrypting to multiple private keys
+
+
+ # Integration testing:
+
+ ## TODO: test new encryption with webdav
+ ## TODO: test new encryption with versioning
+ ## TODO: test new encryption with sharing
+ ## TODO: test new encryption with proxies
+
+
+ private $view; // OC_FilesystemView object for filesystem operations
+ private $pwd; // User Password
+ private $client; // Client side encryption mode flag
+ private $publicKeyDir; // Directory containing all public user keys
+ private $encryptionDir; // Directory containing user's files_encryption
+ private $keyfilesPath; // Directory containing user's keyfiles
+ private $publicKeyPath; // Path to user's public key
+ private $privateKeyPath; // Path to user's private key
+
+ public function __construct( \OC_FilesystemView $view, $userId, $client = false ) {
+
+ $this->view = $view;
+ $this->userId = $userId;
+ $this->client = $client;
+ $this->publicKeyDir = '/' . 'public-keys';
+ $this->encryptionDir = '/' . $this->userId . '/' . 'files_encryption';
+ $this->keyfilesPath = $this->encryptionDir . '/' . 'keyfiles';
+ $this->publicKeyPath = $this->publicKeyDir . '/' . $this->userId . '.public.key'; // e.g. data/public-keys/admin.public.key
+ $this->privateKeyPath = $this->encryptionDir . '/' . $this->userId . '.private.key'; // e.g. data/admin/admin.private.key
+
+ }
+
+ public function ready() {
+
+ if(
+ !$this->view->file_exists( $this->keyfilesPath )
+ or !$this->view->file_exists( $this->publicKeyPath )
+ or !$this->view->file_exists( $this->privateKeyPath )
+ ) {
+
+ return false;
+
+ } else {
+
+ return true;
+
+ }
+
+ }
+
+ /**
+ * @brief Sets up user folders and keys for serverside encryption
+ * @param $passphrase passphrase to encrypt server-stored private key with
+ */
+ public function setupServerSide( $passphrase = null ) {
+
+ // Create shared public key directory
+ if( !$this->view->file_exists( $this->publicKeyDir ) ) {
+
+ $this->view->mkdir( $this->publicKeyDir );
+
+ }
+
+ // Create encryption app directory
+ if( !$this->view->file_exists( $this->encryptionDir ) ) {
+
+ $this->view->mkdir( $this->encryptionDir );
+
+ }
+
+ // Create mirrored keyfile directory
+ if( !$this->view->file_exists( $this->keyfilesPath ) ) {
+
+ $this->view->mkdir( $this->keyfilesPath );
+
+ }
+
+ // Create user keypair
+ if (
+ !$this->view->file_exists( $this->publicKeyPath )
+ or !$this->view->file_exists( $this->privateKeyPath )
+ ) {
+
+ // Generate keypair
+ $keypair = Crypt::createKeypair();
+
+ \OC_FileProxy::$enabled = false;
+
+ // Save public key
+ $this->view->file_put_contents( $this->publicKeyPath, $keypair['publicKey'] );
+
+ // Encrypt private key with user pwd as passphrase
+ $encryptedPrivateKey = Crypt::symmetricEncryptFileContent( $keypair['privateKey'], $passphrase );
+
+ // Save private key
+ $this->view->file_put_contents( $this->privateKeyPath, $encryptedPrivateKey );
+
+ \OC_FileProxy::$enabled = true;
+
+ }
+
+ return true;
+
+ }
+
+ public function findFiles( $directory, $type = 'plain' ) {
+
+ # TODO: test finding non plain content
+
+ if ( $handle = $this->view->opendir( $directory ) ) {
+
+ while ( false !== ( $file = readdir( $handle ) ) ) {
+
+ if (
+ $file != "."
+ && $file != ".."
+ ) {
+
+ $filePath = $directory . '/' . $this->view->getRelativePath( '/' . $file );
+
+ var_dump($filePath);
+
+ if ( $this->view->is_dir( $filePath ) ) {
+
+ $this->findFiles( $filePath );
+
+ } elseif ( $this->view->is_file( $filePath ) ) {
+
+ if ( $type == 'plain' ) {
+
+ $this->files[] = array( 'name' => $file, 'path' => $filePath );
+
+ } elseif ( $type == 'encrypted' ) {
+
+ if ( Crypt::isEncryptedContent( $this->view->file_get_contents( $filePath ) ) ) {
+
+ $this->files[] = array( 'name' => $file, 'path' => $filePath );
+
+ }
+
+ } elseif ( $type == 'legacy' ) {
+
+ if ( Crypt::isLegacyEncryptedContent( $this->view->file_get_contents( $filePath ) ) ) {
+
+ $this->files[] = array( 'name' => $file, 'path' => $filePath );
+
+ }
+
+ }
+
+ }
+
+ }
+
+ }
+
+ if ( !empty( $this->files ) ) {
+
+ return $this->files;
+
+ } else {
+
+ return false;
+
+ }
+
+ }
+
+ return false;
+
+ }
+
+ /**
+ * @brief Check if a given path identifies an encrypted file
+ * @return true / false
+ */
+ public function isEncryptedPath( $path ) {
+
+ // Disable encryption proxy so data retreived is in its
+ // original form
+ \OC_FileProxy::$enabled = false;
+
+ $data = $this->view->file_get_contents( $path );
+
+ \OC_FileProxy::$enabled = true;
+
+ return Crypt::isEncryptedContent( $data );
+
+ }
+
+ public function encryptAll( $directory ) {
+
+ $plainFiles = $this->findFiles( $this->view, 'plain' );
+
+ if ( $this->encryptFiles( $plainFiles ) ) {
+
+ return true;
+
+ } else {
+
+ return false;
+
+ }
+
+ }
+
+ public function getPath( $pathName ) {
+
+ switch ( $pathName ) {
+
+ case 'publicKeyDir':
+
+ return $this->publicKeyDir;
+
+ break;
+
+ case 'encryptionDir':
+
+ return $this->encryptionDir;
+
+ break;
+
+ case 'keyfilesPath':
+
+ return $this->keyfilesPath;
+
+ break;
+
+ case 'publicKeyPath':
+
+ return $this->publicKeyPath;
+
+ break;
+
+ case 'privateKeyPath':
+
+ return $this->privateKeyPath;
+
+ break;
+
+ }
+
+ }
+
+}
diff --git a/apps/files_encryption/settings-personal.php b/apps/files_encryption/settings-personal.php
new file mode 100644
index 00000000000..014288f2efe
--- /dev/null
+++ b/apps/files_encryption/settings-personal.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Copyright (c) 2012 Bjoern Schiessle <schiessle@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+$sysEncMode = \OC_Appconfig::getValue('files_encryption', 'mode', 'none');
+
+if ($sysEncMode == 'user') {
+
+ $tmpl = new OCP\Template( 'files_encryption', 'settings-personal');
+
+ $query = \OC_DB::prepare( "SELECT mode FROM *PREFIX*encryption WHERE uid = ?" );
+ $result = $query->execute(array(\OCP\User::getUser()));
+
+ if ($row = $result->fetchRow()){
+ $mode = $row['mode'];
+ } else {
+ $mode = 'none';
+ }
+
+ OCP\Util::addscript('files_encryption','settings-personal');
+ $tmpl->assign('encryption_mode', $mode);
+ return $tmpl->fetchPage();
+}
+
+return null;
diff --git a/apps/files_encryption/settings.php b/apps/files_encryption/settings.php
index 94ff5ab94ba..d1260f44e9f 100644
--- a/apps/files_encryption/settings.php
+++ b/apps/files_encryption/settings.php
@@ -6,17 +6,16 @@
* See the COPYING-README file.
*/
-OC_Util::checkAdminUser();
+\OC_Util::checkAdminUser();
-$tmpl = new OCP\Template( 'files_encryption', 'settings');
-$blackList=explode(',', OCP\Config::getAppValue('files_encryption',
- 'type_blacklist',
- 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
-$enabled=(OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true')=='true');
-$tmpl->assign('blacklist', $blackList);
-$tmpl->assign('encryption_enabled', $enabled);
+$tmpl = new OCP\Template( 'files_encryption', 'settings' );
-OCP\Util::addscript('files_encryption', 'settings');
-OCP\Util::addscript('core', 'multiselect');
+$blackList = explode( ',', \OCP\Config::getAppValue( 'files_encryption', 'type_blacklist', 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg' ) );
+
+$tmpl->assign( 'blacklist', $blackList );
+$tmpl->assign( 'encryption_mode', \OC_Appconfig::getValue( 'files_encryption', 'mode', 'none' ) );
+
+\OCP\Util::addscript( 'files_encryption', 'settings' );
+\OCP\Util::addscript( 'core', 'multiselect' );
return $tmpl->fetchPage();
diff --git a/apps/files_encryption/templates/settings-personal.php b/apps/files_encryption/templates/settings-personal.php
new file mode 100644
index 00000000000..1274bd3bb5c
--- /dev/null
+++ b/apps/files_encryption/templates/settings-personal.php
@@ -0,0 +1,45 @@
+<form id="encryption">
+ <fieldset class="personalblock">
+ <strong><?php echo $l->t('Choose encryption mode:'); ?></strong>
+ <p>
+ <input
+ type="hidden"
+ name="prev_encryption_mode"
+ id="prev_encryption_mode"
+ value="<?php echo $_['encryption_mode']; ?>"
+ >
+
+ <input
+ type="radio"
+ name="encryption_mode"
+ value="client"
+ id='client_encryption'
+ style="width:20px;"
+ <?php if ($_['encryption_mode'] == 'client') echo "checked='checked'"?>
+ />
+ <?php echo $l->t('Client side encryption (most secure but makes it impossible to access your data from the web interface)'); ?>
+ <br />
+
+ <input
+ type="radio"
+ name="encryption_mode"
+ value="server"
+ id='server_encryption'
+ style="width:20px;" <?php if ($_['encryption_mode'] == 'server') echo "checked='checked'"?>
+ />
+ <?php echo $l->t('Server side encryption (allows you to access your files from the web interface and the desktop client)'); ?>
+ <br />
+
+ <input
+ type="radio"
+ name="encryption_mode"
+ value="none"
+ id='none_encryption'
+ style="width:20px;"
+ <?php if ($_['encryption_mode'] == 'none') echo "checked='checked'"?>
+ />
+ <?php echo $l->t('None (no encryption at all)'); ?>
+ <br/>
+ </p>
+ </fieldset>
+</form>
diff --git a/apps/files_encryption/templates/settings.php b/apps/files_encryption/templates/settings.php
index 61bfe849c72..544ec793f37 100644
--- a/apps/files_encryption/templates/settings.php
+++ b/apps/files_encryption/templates/settings.php
@@ -1,14 +1,79 @@
-<form id="calendar">
+<form id="encryption">
<fieldset class="personalblock">
- <legend><strong><?php echo $l->t('Encryption');?></strong></legend>
- <input type='checkbox'<?php if ($_['encryption_enabled']): ?> checked="checked"<?php endif; ?>
- id='enable_encryption' />
- <label for='enable_encryption'><?php echo $l->t('Enable Encryption')?></label><br />
- <select id='encryption_blacklist' title="<?php echo $l->t('None')?>" multiple="multiple">
- <?php foreach ($_['blacklist'] as $type): ?>
- <option selected="selected" value="<?php echo $type;?>"><?php echo $type;?></option>
+
+ <strong>
+ <?php echo $l->t('Choose encryption mode:'); ?>
+ </strong>
+
+ <p>
+ <i>
+ <?php echo $l->t('Important: Once you selected an encryption mode there is no way to change it back'); ?>
+ </i>
+ </p>
+
+ <p>
+ <input
+ type="radio"
+ name="encryption_mode"
+ id="client_encryption"
+ value="client"
+ style="width:20px;"
+ <?php if ($_['encryption_mode'] == 'client') echo "checked='checked'"; if ($_['encryption_mode'] != 'none') echo "DISABLED"?>
+ />
+
+ <?php echo $l->t("Client side encryption (most secure but makes it impossible to access your data from the web interface)"); ?>
+ <br />
+
+ <input
+ type="radio"
+ name="encryption_mode"
+ id="server_encryption"
+ value="server"
+ style="width:20px;"
+ <?php if ($_['encryption_mode'] == 'server') echo "checked='checked'"; if ($_['encryption_mode'] != 'none') echo "DISABLED"?>
+ />
+
+ <?php echo $l->t('Server side encryption (allows you to access your files from the web interface and the desktop client)'); ?>
+ <br />
+
+ <input
+ type="radio"
+ name="encryption_mode"
+ id="user_encryption"
+ value="user"
+ style="width:20px;"
+ <?php if ($_['encryption_mode'] == 'user') echo "checked='checked'"; if ($_['encryption_mode'] != 'none') echo "DISABLED"?>
+ />
+
+ <?php echo $l->t('User specific (let the user decide)'); ?>
+ <br/>
+
+ <input
+ type="radio"
+ name="encryption_mode"
+ id="none_encryption"
+ value="none"
+ style="width:20px;"
+ <?php if ($_['encryption_mode'] == 'none') echo "checked='checked'"; if ($_['encryption_mode'] != 'none') echo "DISABLED"?>
+ />
+
+ <?php echo $l->t('None (no encryption at all)'); ?>
+ <br/>
+
+ </p>
+ <p>
+ <strong><?php echo $l->t('Encryption'); ?></strong>
+
+ <?php echo $l->t("Exclude the following file types from encryption"); ?>
+
+ <select
+ id='encryption_blacklist'
+ title="<?php echo $l->t('None')?>"
+ multiple="multiple">
+ <?php foreach($_["blacklist"] as $type): ?>
+ <option selected="selected" value="<?php echo $type;?>"> <?php echo $type;?> </option>
<?php endforeach;?>
- </select><br />
- <?php echo $l->t('Exclude the following file types from encryption'); ?>
+ </select>
+ </p>
</fieldset>
</form>
diff --git a/apps/files_encryption/tests/binary b/apps/files_encryption/test/binary
index 79bc99479da..79bc99479da 100644
--- a/apps/files_encryption/tests/binary
+++ b/apps/files_encryption/test/binary
Binary files differ
diff --git a/apps/files_encryption/test/crypt.php b/apps/files_encryption/test/crypt.php
new file mode 100755
index 00000000000..19c10ab0ab5
--- /dev/null
+++ b/apps/files_encryption/test/crypt.php
@@ -0,0 +1,667 @@
+<?php
+/**
+ * Copyright (c) 2012 Sam Tuke <samtuke@owncloud.com>, and
+ * Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+//require_once "PHPUnit/Framework/TestCase.php";
+require_once realpath( dirname(__FILE__).'/../../../3rdparty/Crypt_Blowfish/Blowfish.php' );
+require_once realpath( dirname(__FILE__).'/../../../lib/base.php' );
+require_once realpath( dirname(__FILE__).'/../lib/crypt.php' );
+require_once realpath( dirname(__FILE__).'/../lib/keymanager.php' );
+require_once realpath( dirname(__FILE__).'/../lib/proxy.php' );
+require_once realpath( dirname(__FILE__).'/../lib/stream.php' );
+require_once realpath( dirname(__FILE__).'/../lib/util.php' );
+require_once realpath( dirname(__FILE__).'/../appinfo/app.php' );
+
+use OCA\Encryption;
+
+// This has to go here because otherwise session errors arise, and the private
+// encryption key needs to be saved in the session
+\OC_User::login( 'admin', 'admin' );
+
+/**
+ * @note It would be better to use Mockery here for mocking out the session
+ * handling process, and isolate calls to session class and data from the unit
+ * tests relating to them (stream etc.). However getting mockery to work and
+ * overload classes whilst also using the OC autoloader is difficult due to
+ * load order Pear errors.
+ */
+
+class Test_Crypt extends \PHPUnit_Framework_TestCase {
+
+ function setUp() {
+
+ // set content for encrypting / decrypting in tests
+ $this->dataLong = file_get_contents( realpath( dirname(__FILE__).'/../lib/crypt.php' ) );
+ $this->dataShort = 'hats';
+ $this->dataUrl = realpath( dirname(__FILE__).'/../lib/crypt.php' );
+ $this->legacyData = realpath( dirname(__FILE__).'/legacy-text.txt' );
+ $this->legacyEncryptedData = realpath( dirname(__FILE__).'/legacy-encrypted-text.txt' );
+ $this->randomKey = Encryption\Crypt::generateKey();
+
+ $keypair = Encryption\Crypt::createKeypair();
+ $this->genPublicKey = $keypair['publicKey'];
+ $this->genPrivateKey = $keypair['privateKey'];
+
+ $this->view = new \OC_FilesystemView( '/' );
+
+ \OC_User::setUserId( 'admin' );
+ $this->userId = 'admin';
+ $this->pass = 'admin';
+
+ \OC_Filesystem::init( '/' );
+ \OC_Filesystem::mount( 'OC_Filestorage_Local', array('datadir' => \OC_User::getHome($this->userId)), '/' );
+
+ }
+
+ function tearDown() {
+
+ }
+
+ function testGenerateKey() {
+
+ # TODO: use more accurate (larger) string length for test confirmation
+
+ $key = Encryption\Crypt::generateKey();
+
+ $this->assertTrue( strlen( $key ) > 16 );
+
+ }
+
+ function testGenerateIv() {
+
+ $iv = Encryption\Crypt::generateIv();
+
+ $this->assertEquals( 16, strlen( $iv ) );
+
+ return $iv;
+
+ }
+
+ /**
+ * @depends testGenerateIv
+ */
+ function testConcatIv( $iv ) {
+
+ $catFile = Encryption\Crypt::concatIv( $this->dataLong, $iv );
+
+ // Fetch encryption metadata from end of file
+ $meta = substr( $catFile, -22 );
+
+ $identifier = substr( $meta, 0, 6);
+
+ // Fetch IV from end of file
+ $foundIv = substr( $meta, 6 );
+
+ $this->assertEquals( '00iv00', $identifier );
+
+ $this->assertEquals( $iv, $foundIv );
+
+ // Remove IV and IV identifier text to expose encrypted content
+ $data = substr( $catFile, 0, -22 );
+
+ $this->assertEquals( $this->dataLong, $data );
+
+ return array(
+ 'iv' => $iv
+ , 'catfile' => $catFile
+ );
+
+ }
+
+ /**
+ * @depends testConcatIv
+ */
+ function testSplitIv( $testConcatIv ) {
+
+ // Split catfile into components
+ $splitCatfile = Encryption\Crypt::splitIv( $testConcatIv['catfile'] );
+
+ // Check that original IV and split IV match
+ $this->assertEquals( $testConcatIv['iv'], $splitCatfile['iv'] );
+
+ // Check that original data and split data match
+ $this->assertEquals( $this->dataLong, $splitCatfile['encrypted'] );
+
+ }
+
+ function testAddPadding() {
+
+ $padded = Encryption\Crypt::addPadding( $this->dataLong );
+
+ $padding = substr( $padded, -2 );
+
+ $this->assertEquals( 'xx' , $padding );
+
+ return $padded;
+
+ }
+
+ /**
+ * @depends testAddPadding
+ */
+ function testRemovePadding( $padded ) {
+
+ $noPadding = Encryption\Crypt::RemovePadding( $padded );
+
+ $this->assertEquals( $this->dataLong, $noPadding );
+
+ }
+
+ function testEncrypt() {
+
+ $random = openssl_random_pseudo_bytes( 13 );
+
+ $iv = substr( base64_encode( $random ), 0, -4 ); // i.e. E5IG033j+mRNKrht
+
+ $crypted = Encryption\Crypt::encrypt( $this->dataUrl, $iv, 'hat' );
+
+ $this->assertNotEquals( $this->dataUrl, $crypted );
+
+ }
+
+ function testDecrypt() {
+
+ $random = openssl_random_pseudo_bytes( 13 );
+
+ $iv = substr( base64_encode( $random ), 0, -4 ); // i.e. E5IG033j+mRNKrht
+
+ $crypted = Encryption\Crypt::encrypt( $this->dataUrl, $iv, 'hat' );
+
+ $decrypt = Encryption\Crypt::decrypt( $crypted, $iv, 'hat' );
+
+ $this->assertEquals( $this->dataUrl, $decrypt );
+
+ }
+
+ function testSymmetricEncryptFileContent() {
+
+ # TODO: search in keyfile for actual content as IV will ensure this test always passes
+
+ $crypted = Encryption\Crypt::symmetricEncryptFileContent( $this->dataShort, 'hat' );
+
+ $this->assertNotEquals( $this->dataShort, $crypted );
+
+
+ $decrypt = Encryption\Crypt::symmetricDecryptFileContent( $crypted, 'hat' );
+
+ $this->assertEquals( $this->dataShort, $decrypt );
+
+ }
+
+ // These aren't used for now
+// function testSymmetricBlockEncryptShortFileContent() {
+//
+// $crypted = Encryption\Crypt::symmetricBlockEncryptFileContent( $this->dataShort, $this->randomKey );
+//
+// $this->assertNotEquals( $this->dataShort, $crypted );
+//
+//
+// $decrypt = Encryption\Crypt::symmetricBlockDecryptFileContent( $crypted, $this->randomKey );
+//
+// $this->assertEquals( $this->dataShort, $decrypt );
+//
+// }
+//
+// function testSymmetricBlockEncryptLongFileContent() {
+//
+// $crypted = Encryption\Crypt::symmetricBlockEncryptFileContent( $this->dataLong, $this->randomKey );
+//
+// $this->assertNotEquals( $this->dataLong, $crypted );
+//
+//
+// $decrypt = Encryption\Crypt::symmetricBlockDecryptFileContent( $crypted, $this->randomKey );
+//
+// $this->assertEquals( $this->dataLong, $decrypt );
+//
+// }
+
+ function testSymmetricStreamEncryptShortFileContent() {
+
+ $filename = 'tmp-'.time();
+
+ $cryptedFile = file_put_contents( 'crypt://' . $filename, $this->dataShort );
+
+ // Test that data was successfully written
+ $this->assertTrue( is_int( $cryptedFile ) );
+
+
+ // Get file contents without using any wrapper to get it's actual contents on disk
+ $retreivedCryptedFile = $this->view->file_get_contents( $this->userId . '/files/' . $filename );
+
+ // Check that the file was encrypted before being written to disk
+ $this->assertNotEquals( $this->dataShort, $retreivedCryptedFile );
+
+ // Get private key
+ $encryptedPrivateKey = Encryption\Keymanager::getPrivateKey( $this->view, $this->userId );
+
+ $decryptedPrivateKey = Encryption\Crypt::symmetricDecryptFileContent( $encryptedPrivateKey, $this->pass );
+
+
+ // Get keyfile
+ $encryptedKeyfile = Encryption\Keymanager::getFileKey( $this->view, $this->userId, $filename );
+
+ $decryptedKeyfile = Encryption\Crypt::keyDecrypt( $encryptedKeyfile, $decryptedPrivateKey );
+
+
+ // Manually decrypt
+ $manualDecrypt = Encryption\Crypt::symmetricBlockDecryptFileContent( $retreivedCryptedFile, $decryptedKeyfile );
+
+ // Check that decrypted data matches
+ $this->assertEquals( $this->dataShort, $manualDecrypt );
+
+ }
+
+ /**
+ * @brief Test that data that is written by the crypto stream wrapper
+ * @note Encrypted data is manually prepared and decrypted here to avoid dependency on success of stream_read
+ * @note If this test fails with truncate content, check that enough array slices are being rejoined to form $e, as the crypt.php file may have gotten longer and broken the manual
+ * reassembly of its data
+ */
+ function testSymmetricStreamEncryptLongFileContent() {
+
+ // Generate a a random filename
+ $filename = 'tmp-'.time();
+
+ // Save long data as encrypted file using stream wrapper
+ $cryptedFile = file_put_contents( 'crypt://' . $filename, $this->dataLong.$this->dataLong );
+
+ // Test that data was successfully written
+ $this->assertTrue( is_int( $cryptedFile ) );
+
+ // Get file contents without using any wrapper to get it's actual contents on disk
+ $retreivedCryptedFile = $this->view->file_get_contents( $this->userId . '/files/' . $filename );
+
+// echo "\n\n\$retreivedCryptedFile = $retreivedCryptedFile\n\n";
+
+ // Check that the file was encrypted before being written to disk
+ $this->assertNotEquals( $this->dataLong.$this->dataLong, $retreivedCryptedFile );
+
+ // Manuallly split saved file into separate IVs and encrypted chunks
+ $r = preg_split('/(00iv00.{16,18})/', $retreivedCryptedFile, NULL, PREG_SPLIT_DELIM_CAPTURE);
+
+ //print_r($r);
+
+ // Join IVs and their respective data chunks
+ $e = array( $r[0].$r[1], $r[2].$r[3], $r[4].$r[5], $r[6].$r[7], $r[8].$r[9], $r[10].$r[11], $r[12].$r[13] );//.$r[11], $r[12].$r[13], $r[14] );
+
+ //print_r($e);
+
+
+ // Get private key
+ $encryptedPrivateKey = Encryption\Keymanager::getPrivateKey( $this->view, $this->userId );
+
+ $decryptedPrivateKey = Encryption\Crypt::symmetricDecryptFileContent( $encryptedPrivateKey, $this->pass );
+
+
+ // Get keyfile
+ $encryptedKeyfile = Encryption\Keymanager::getFileKey( $this->view, $this->userId, $filename );
+
+ $decryptedKeyfile = Encryption\Crypt::keyDecrypt( $encryptedKeyfile, $decryptedPrivateKey );
+
+
+ // Set var for reassembling decrypted content
+ $decrypt = '';
+
+ // Manually decrypt chunk
+ foreach ($e as $e) {
+
+// echo "\n\$e = $e";
+
+ $chunkDecrypt = Encryption\Crypt::symmetricDecryptFileContent( $e, $decryptedKeyfile );
+
+ // Assemble decrypted chunks
+ $decrypt .= $chunkDecrypt;
+
+// echo "\n\$chunkDecrypt = $chunkDecrypt";
+
+ }
+
+// echo "\n\$decrypt = $decrypt";
+
+ $this->assertEquals( $this->dataLong.$this->dataLong, $decrypt );
+
+ // Teardown
+
+ $this->view->unlink( $filename );
+
+ Encryption\Keymanager::deleteFileKey( $filename );
+
+ }
+
+ /**
+ * @brief Test that data that is read by the crypto stream wrapper
+ */
+ function testSymmetricStreamDecryptShortFileContent() {
+
+ $filename = 'tmp-'.time();
+
+ // Save long data as encrypted file using stream wrapper
+ $cryptedFile = file_put_contents( 'crypt://' . $filename, $this->dataShort );
+
+ // Test that data was successfully written
+ $this->assertTrue( is_int( $cryptedFile ) );
+
+
+ // Get file contents without using any wrapper to get it's actual contents on disk
+ $retreivedCryptedFile = $this->view->file_get_contents( $this->userId . '/files/' . $filename );
+
+ $decrypt = file_get_contents( 'crypt://' . $filename );
+
+ $this->assertEquals( $this->dataShort, $decrypt );
+
+ }
+
+ function testSymmetricStreamDecryptLongFileContent() {
+
+ $filename = 'tmp-'.time();
+
+ // Save long data as encrypted file using stream wrapper
+ $cryptedFile = file_put_contents( 'crypt://' . $filename, $this->dataLong );
+
+ // Test that data was successfully written
+ $this->assertTrue( is_int( $cryptedFile ) );
+
+
+ // Get file contents without using any wrapper to get it's actual contents on disk
+ $retreivedCryptedFile = $this->view->file_get_contents( $this->userId . '/files/' . $filename );
+
+ $decrypt = file_get_contents( 'crypt://' . $filename );
+
+ $this->assertEquals( $this->dataLong, $decrypt );
+
+ }
+
+ // Is this test still necessary?
+// function testSymmetricBlockStreamDecryptFileContent() {
+//
+// \OC_User::setUserId( 'admin' );
+//
+// // Disable encryption proxy to prevent unwanted en/decryption
+// \OC_FileProxy::$enabled = false;
+//
+// $cryptedFile = file_put_contents( 'crypt://' . '/blockEncrypt', $this->dataUrl );
+//
+// // Disable encryption proxy to prevent unwanted en/decryption
+// \OC_FileProxy::$enabled = false;
+//
+// echo "\n\n\$cryptedFile = " . $this->view->file_get_contents( '/blockEncrypt' );
+//
+// $retreivedCryptedFile = file_get_contents( 'crypt://' . '/blockEncrypt' );
+//
+// $this->assertEquals( $this->dataUrl, $retreivedCryptedFile );
+//
+// \OC_FileProxy::$enabled = false;
+//
+// }
+
+ function testSymmetricEncryptFileContentKeyfile() {
+
+ # TODO: search in keyfile for actual content as IV will ensure this test always passes
+
+ $crypted = Encryption\Crypt::symmetricEncryptFileContentKeyfile( $this->dataUrl );
+
+ $this->assertNotEquals( $this->dataUrl, $crypted['encrypted'] );
+
+
+ $decrypt = Encryption\Crypt::symmetricDecryptFileContent( $crypted['encrypted'], $crypted['key'] );
+
+ $this->assertEquals( $this->dataUrl, $decrypt );
+
+ }
+
+ function testIsEncryptedContent() {
+
+ $this->assertFalse( Encryption\Crypt::isEncryptedContent( $this->dataUrl ) );
+
+ $this->assertFalse( Encryption\Crypt::isEncryptedContent( $this->legacyEncryptedData ) );
+
+ $keyfileContent = Encryption\Crypt::symmetricEncryptFileContent( $this->dataUrl, 'hat' );
+
+ $this->assertTrue( Encryption\Crypt::isEncryptedContent( $keyfileContent ) );
+
+ }
+
+ function testMultiKeyEncrypt() {
+
+ # TODO: search in keyfile for actual content as IV will ensure this test always passes
+
+ $pair1 = Encryption\Crypt::createKeypair();
+
+ $this->assertEquals( 2, count( $pair1 ) );
+
+ $this->assertTrue( strlen( $pair1['publicKey'] ) > 1 );
+
+ $this->assertTrue( strlen( $pair1['privateKey'] ) > 1 );
+
+
+ $crypted = Encryption\Crypt::multiKeyEncrypt( $this->dataUrl, array( $pair1['publicKey'] ) );
+
+ $this->assertNotEquals( $this->dataUrl, $crypted['encrypted'] );
+
+
+ $decrypt = Encryption\Crypt::multiKeyDecrypt( $crypted['encrypted'], $crypted['keys'][0], $pair1['privateKey'] );
+
+ $this->assertEquals( $this->dataUrl, $decrypt );
+
+ }
+
+ function testKeyEncrypt() {
+
+ // Generate keypair
+ $pair1 = Encryption\Crypt::createKeypair();
+
+ // Encrypt data
+ $crypted = Encryption\Crypt::keyEncrypt( $this->dataUrl, $pair1['publicKey'] );
+
+ $this->assertNotEquals( $this->dataUrl, $crypted );
+
+ // Decrypt data
+ $decrypt = Encryption\Crypt::keyDecrypt( $crypted, $pair1['privateKey'] );
+
+ $this->assertEquals( $this->dataUrl, $decrypt );
+
+ }
+
+ // What is the point of this test? It doesn't use keyEncryptKeyfile()
+ function testKeyEncryptKeyfile() {
+
+ # TODO: Don't repeat encryption from previous tests, use PHPUnit test interdependency instead
+
+ // Generate keypair
+ $pair1 = Encryption\Crypt::createKeypair();
+
+ // Encrypt plain data, generate keyfile & encrypted file
+ $cryptedData = Encryption\Crypt::symmetricEncryptFileContentKeyfile( $this->dataUrl );
+
+ // Encrypt keyfile
+ $cryptedKey = Encryption\Crypt::keyEncrypt( $cryptedData['key'], $pair1['publicKey'] );
+
+ // Decrypt keyfile
+ $decryptKey = Encryption\Crypt::keyDecrypt( $cryptedKey, $pair1['privateKey'] );
+
+ // Decrypt encrypted file
+ $decryptData = Encryption\Crypt::symmetricDecryptFileContent( $cryptedData['encrypted'], $decryptKey );
+
+ $this->assertEquals( $this->dataUrl, $decryptData );
+
+ }
+
+ /**
+ * @brief test functionality of keyEncryptKeyfile() and
+ * keyDecryptKeyfile()
+ */
+ function testKeyDecryptKeyfile() {
+
+ $encrypted = Encryption\Crypt::keyEncryptKeyfile( $this->dataShort, $this->genPublicKey );
+
+ $this->assertNotEquals( $encrypted['data'], $this->dataShort );
+
+ $decrypted = Encryption\Crypt::keyDecryptKeyfile( $encrypted['data'], $encrypted['key'], $this->genPrivateKey );
+
+ $this->assertEquals( $decrypted, $this->dataShort );
+
+ }
+
+
+ /**
+ * @brief test encryption using legacy blowfish method
+ */
+ function testLegacyEncryptShort() {
+
+ $crypted = Encryption\Crypt::legacyEncrypt( $this->dataShort, $this->pass );
+
+ $this->assertNotEquals( $this->dataShort, $crypted );
+
+ # TODO: search inencrypted text for actual content to ensure it
+ # genuine transformation
+
+ return $crypted;
+
+ }
+
+ /**
+ * @brief test decryption using legacy blowfish method
+ * @depends testLegacyEncryptShort
+ */
+ function testLegacyDecryptShort( $crypted ) {
+
+ $decrypted = Encryption\Crypt::legacyDecrypt( $crypted, $this->pass );
+
+ $this->assertEquals( $this->dataShort, $decrypted );
+
+ }
+
+ /**
+ * @brief test encryption using legacy blowfish method
+ */
+ function testLegacyEncryptLong() {
+
+ $crypted = Encryption\Crypt::legacyEncrypt( $this->dataLong, $this->pass );
+
+ $this->assertNotEquals( $this->dataLong, $crypted );
+
+ # TODO: search inencrypted text for actual content to ensure it
+ # genuine transformation
+
+ return $crypted;
+
+ }
+
+ /**
+ * @brief test decryption using legacy blowfish method
+ * @depends testLegacyEncryptLong
+ */
+ function testLegacyDecryptLong( $crypted ) {
+
+ $decrypted = Encryption\Crypt::legacyDecrypt( $crypted, $this->pass );
+
+ $this->assertEquals( $this->dataLong, $decrypted );
+
+ }
+
+ /**
+ * @brief test generation of legacy encryption key
+ * @depends testLegacyDecryptShort
+ */
+ function testLegacyCreateKey() {
+
+ // Create encrypted key
+ $encKey = Encryption\Crypt::legacyCreateKey( $this->pass );
+
+ // Decrypt key
+ $key = Encryption\Crypt::legacyDecrypt( $encKey, $this->pass );
+
+ $this->assertTrue( is_numeric( $key ) );
+
+ // Check that key is correct length
+ $this->assertEquals( 20, strlen( $key ) );
+
+ }
+
+ /**
+ * @brief test decryption using legacy blowfish method
+ * @depends testLegacyEncryptLong
+ */
+ function testLegacyKeyRecryptKeyfileEncrypt( $crypted ) {
+
+ $recrypted = Encryption\Crypt::LegacyKeyRecryptKeyfile( $crypted, $this->pass, $this->genPublicKey, $this->pass );
+
+ $this->assertNotEquals( $this->dataLong, $recrypted['data'] );
+
+ return $recrypted;
+
+ # TODO: search inencrypted text for actual content to ensure it
+ # genuine transformation
+
+ }
+
+// function testEncryption(){
+//
+// $key=uniqid();
+// $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
+// $source=file_get_contents($file); //nice large text file
+// $encrypted=OC_Encryption\Crypt::encrypt($source,$key);
+// $decrypted=OC_Encryption\Crypt::decrypt($encrypted,$key);
+// $decrypted=rtrim($decrypted, "\0");
+// $this->assertNotEquals($encrypted,$source);
+// $this->assertEquals($decrypted,$source);
+//
+// $chunk=substr($source,0,8192);
+// $encrypted=OC_Encryption\Crypt::encrypt($chunk,$key);
+// $this->assertEquals(strlen($chunk),strlen($encrypted));
+// $decrypted=OC_Encryption\Crypt::decrypt($encrypted,$key);
+// $decrypted=rtrim($decrypted, "\0");
+// $this->assertEquals($decrypted,$chunk);
+//
+// $encrypted=OC_Encryption\Crypt::blockEncrypt($source,$key);
+// $decrypted=OC_Encryption\Crypt::blockDecrypt($encrypted,$key);
+// $this->assertNotEquals($encrypted,$source);
+// $this->assertEquals($decrypted,$source);
+//
+// $tmpFileEncrypted=OCP\Files::tmpFile();
+// OC_Encryption\Crypt::encryptfile($file,$tmpFileEncrypted,$key);
+// $encrypted=file_get_contents($tmpFileEncrypted);
+// $decrypted=OC_Encryption\Crypt::blockDecrypt($encrypted,$key);
+// $this->assertNotEquals($encrypted,$source);
+// $this->assertEquals($decrypted,$source);
+//
+// $tmpFileDecrypted=OCP\Files::tmpFile();
+// OC_Encryption\Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted,$key);
+// $decrypted=file_get_contents($tmpFileDecrypted);
+// $this->assertEquals($decrypted,$source);
+//
+// $file=OC::$SERVERROOT.'/core/img/weather-clear.png';
+// $source=file_get_contents($file); //binary file
+// $encrypted=OC_Encryption\Crypt::encrypt($source,$key);
+// $decrypted=OC_Encryption\Crypt::decrypt($encrypted,$key);
+// $decrypted=rtrim($decrypted, "\0");
+// $this->assertEquals($decrypted,$source);
+//
+// $encrypted=OC_Encryption\Crypt::blockEncrypt($source,$key);
+// $decrypted=OC_Encryption\Crypt::blockDecrypt($encrypted,$key);
+// $this->assertEquals($decrypted,$source);
+//
+// }
+//
+// function testBinary(){
+// $key=uniqid();
+//
+// $file=__DIR__.'/binary';
+// $source=file_get_contents($file); //binary file
+// $encrypted=OC_Encryption\Crypt::encrypt($source,$key);
+// $decrypted=OC_Encryption\Crypt::decrypt($encrypted,$key);
+//
+// $decrypted=rtrim($decrypted, "\0");
+// $this->assertEquals($decrypted,$source);
+//
+// $encrypted=OC_Encryption\Crypt::blockEncrypt($source,$key);
+// $decrypted=OC_Encryption\Crypt::blockDecrypt($encrypted,$key,strlen($source));
+// $this->assertEquals($decrypted,$source);
+// }
+
+}
diff --git a/apps/files_encryption/test/keymanager.php b/apps/files_encryption/test/keymanager.php
new file mode 100644
index 00000000000..f02d6eb5f7a
--- /dev/null
+++ b/apps/files_encryption/test/keymanager.php
@@ -0,0 +1,132 @@
+<?php
+/**
+ * Copyright (c) 2012 Sam Tuke <samtuke@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+//require_once "PHPUnit/Framework/TestCase.php";
+require_once realpath( dirname(__FILE__).'/../../../lib/base.php' );
+require_once realpath( dirname(__FILE__).'/../lib/crypt.php' );
+require_once realpath( dirname(__FILE__).'/../lib/keymanager.php' );
+require_once realpath( dirname(__FILE__).'/../lib/proxy.php' );
+require_once realpath( dirname(__FILE__).'/../lib/stream.php' );
+require_once realpath( dirname(__FILE__).'/../lib/util.php' );
+require_once realpath( dirname(__FILE__).'/../appinfo/app.php' );
+
+use OCA\Encryption;
+
+// This has to go here because otherwise session errors arise, and the private
+// encryption key needs to be saved in the session
+\OC_User::login( 'admin', 'admin' );
+
+class Test_Keymanager extends \PHPUnit_Framework_TestCase {
+
+ function setUp() {
+
+ \OC_FileProxy::$enabled = false;
+
+ // set content for encrypting / decrypting in tests
+ $this->dataLong = file_get_contents( realpath( dirname(__FILE__).'/../lib/crypt.php' ) );
+ $this->dataShort = 'hats';
+ $this->dataUrl = realpath( dirname(__FILE__).'/../lib/crypt.php' );
+ $this->legacyData = realpath( dirname(__FILE__).'/legacy-text.txt' );
+ $this->legacyEncryptedData = realpath( dirname(__FILE__).'/legacy-encrypted-text.txt' );
+ $this->randomKey = Encryption\Crypt::generateKey();
+
+ $keypair = Encryption\Crypt::createKeypair();
+ $this->genPublicKey = $keypair['publicKey'];
+ $this->genPrivateKey = $keypair['privateKey'];
+
+ $this->view = new \OC_FilesystemView( '/' );
+
+ \OC_User::setUserId( 'admin' );
+ $this->userId = 'admin';
+ $this->pass = 'admin';
+
+ \OC_Filesystem::init( '/' );
+ \OC_Filesystem::mount( 'OC_Filestorage_Local', array('datadir' => \OC_User::getHome($this->userId)), '/' );
+
+ }
+
+ function tearDown(){
+
+ \OC_FileProxy::$enabled = true;
+
+ }
+
+ function testGetPrivateKey() {
+
+ $key = Encryption\Keymanager::getPrivateKey( $this->view, $this->userId );
+
+ // Will this length vary? Perhaps we should use a range instead
+ $this->assertEquals( 2296, strlen( $key ) );
+
+ }
+
+ function testGetPublicKey() {
+
+ $key = Encryption\Keymanager::getPublicKey( $this->view, $this->userId );
+
+ $this->assertEquals( 451, strlen( $key ) );
+
+ $this->assertEquals( '-----BEGIN PUBLIC KEY-----', substr( $key, 0, 26 ) );
+ }
+
+ function testSetFileKey() {
+
+ # NOTE: This cannot be tested until we are able to break out
+ # of the FileSystemView data directory root
+
+// $key = Crypt::symmetricEncryptFileContentKeyfile( $this->data, 'hat' );
+//
+// $tmpPath = sys_get_temp_dir(). '/' . 'testSetFileKey';
+//
+// $view = new \OC_FilesystemView( '/tmp/' );
+//
+// //$view = new \OC_FilesystemView( '/' . $this->userId . '/files_encryption/keyfiles' );
+//
+// Encryption\Keymanager::setFileKey( $tmpPath, $key['key'], $view );
+
+ }
+
+// /**
+// * @depends testGetPrivateKey
+// */
+// function testGetPrivateKey_decrypt() {
+//
+// $key = Encryption\Keymanager::getPrivateKey( $this->view, $this->userId );
+//
+// # TODO: replace call to Crypt with a mock object?
+// $decrypted = Encryption\Crypt::symmetricDecryptFileContent( $key, $this->passphrase );
+//
+// $this->assertEquals( 1704, strlen( $decrypted ) );
+//
+// $this->assertEquals( '-----BEGIN PRIVATE KEY-----', substr( $decrypted, 0, 27 ) );
+//
+// }
+
+ function testGetUserKeys() {
+
+ $keys = Encryption\Keymanager::getUserKeys( $this->view, $this->userId );
+
+ $this->assertEquals( 451, strlen( $keys['publicKey'] ) );
+ $this->assertEquals( '-----BEGIN PUBLIC KEY-----', substr( $keys['publicKey'], 0, 26 ) );
+ $this->assertEquals( 2296, strlen( $keys['privateKey'] ) );
+
+ }
+
+ function testGetPublicKeys() {
+
+ # TODO: write me
+
+ }
+
+ function testGetFileKey() {
+
+// Encryption\Keymanager::getFileKey( $this->view, $this->userId, $this->filePath );
+
+ }
+
+}
diff --git a/apps/files_encryption/test/legacy-encrypted-text.txt b/apps/files_encryption/test/legacy-encrypted-text.txt
new file mode 100644
index 00000000000..cb5bf50550d
--- /dev/null
+++ b/apps/files_encryption/test/legacy-encrypted-text.txt
Binary files differ
diff --git a/apps/files_encryption/test/proxy.php b/apps/files_encryption/test/proxy.php
new file mode 100644
index 00000000000..709730f7609
--- /dev/null
+++ b/apps/files_encryption/test/proxy.php
@@ -0,0 +1,220 @@
+<?php
+/**
+ * Copyright (c) 2012 Sam Tuke <samtuke@owncloud.com>,
+ * and Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+// require_once "PHPUnit/Framework/TestCase.php";
+// require_once realpath( dirname(__FILE__).'/../../../lib/base.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/Generator.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/MockInterface.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/Mock.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/Container.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/Configuration.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/CompositeExpectation.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/ExpectationDirector.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/Expectation.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/Exception.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/CountValidator/CountValidatorAbstract.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/CountValidator/Exception.php' );
+// require_once realpath( dirname(__FILE__).'/../../../3rdparty/mockery/Mockery/CountValidator/Exact.php' );
+//
+// use \Mockery as m;
+// use OCA\Encryption;
+
+// class Test_Util extends \PHPUnit_Framework_TestCase {
+//
+// public function setUp() {
+//
+// $this->proxy = new Encryption\Proxy();
+//
+// $this->tmpFileName = "tmpFile-".time();
+//
+// $this->privateKey = file_get_contents( realpath( dirname(__FILE__).'/data/admin.public.key' ) );
+// $this->publicKey = file_get_contents( realpath( dirname(__FILE__).'/data/admin.private.key' ) );
+// $this->encDataShort = file_get_contents( realpath( dirname(__FILE__).'/data/yoga-manchester-enc' ) );
+// $this->encDataShortKey = file_get_contents( realpath( dirname(__FILE__).'/data/yoga-manchester.key' ) );
+//
+// $this->dataShort = file_get_contents( realpath( dirname(__FILE__).'/data/yoga-manchester' ) );
+// $this->dataLong = file_get_contents( realpath( dirname(__FILE__).'/../lib/crypt.php' ) );
+// $this->longDataPath = realpath( dirname(__FILE__).'/../lib/crypt.php' );
+//
+// $this->data1 = file_get_contents( realpath( dirname(__FILE__).'/../../../data/admin/files/enc-test.txt' ) );
+//
+// \OC_FileProxy::$enabled = false;
+// $this->Encdata1 = file_get_contents( realpath( dirname(__FILE__).'/../../../data/admin/files/enc-test.txt' ) );
+// \OC_FileProxy::$enabled = true;
+//
+// $this->userId = 'admin';
+// $this->pass = 'admin';
+//
+// $this->session = new Encryption\Session();
+//
+// $this->session->setPrivateKey(
+// '-----BEGIN PRIVATE KEY-----
+// MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDiH3EA4EpFA7Fx
+// s2dyyfL5jwXeYXrTqQJ6DqKgGn8VsbT3eu8R9KzM2XitVwZe8c8L52DvJ06o5vg0
+// GqPYxilFdOFJe/ggac5Tq8UmJiZS4EqYEMwxBIfIyWTxeGV06/0HOwnVAkqHMcBz
+// 64qldtgi5O8kZMEM2/gKBgU0kMLJzM+8oEWhL1+gsUWQhxd8cKLXypS6iWgqFJrz
+// f/X0hJsJR+gyYxNpahtnjzd/LxLAETrOMsl2tue+BAxmjbAM0aG0NEM0div+b59s
+// 2uz/iWbxImp5pOdYVKcVW89D4XBMyGegR40trV2VwiuX1blKCfdjMsJhiaL9pymp
+// ug1wzyQFAgMBAAECggEAK6c+PZkPPXuVCgpEcliiW6NM0r2m5K3AGKgypQ34csu3
+// z/8foCvIIFPrhCtEw5eTDQ1CHWlNOjY8vHJYJ0U6Onpx86nHIRrMBkMm8FJ1G5LJ
+// U8oKYXwqaozWu/cuPwA//OFc6I5krOzh5n8WaRMkbrgbor8AtebRX74By0AXGrXe
+// cswJI7zR96oFn4Dm7Pgvpg5Zhk1vFJ+w6QtH+4DDJ6PBvlZsRkGxYBLGVd/3qhAI
+// sBAyjFlSzuP4eCRhHOhHC/e4gmAH9evFVXB88jFyRZm3K+jQ5W5CwrVRBCV2lph6
+// 2B6P7CBJN+IjGKMhy+75y13UvvKPv9IwH8Fzl2x1gQKBgQD8qQOr7a6KhSj16wQE
+// jim2xqt9gQ2jH5No405NrKs/PFQQZnzD4YseQsiK//NUjOJiUhaT+L5jhIpzINHt
+// RJpt3bGkEZmLyjdjgTpB3GwZdXa28DNK9VdXZ19qIl/ZH0qAjKmJCRahUDASMnVi
+// M4Pkk9yx9ZIKkri4TcuMWqc0DQKBgQDlHKBTITZq/arYPD6Nl3NsoOdqVRqJrGay
+// 0TjXAVbBXe46+z5lnMsqwXb79nx14hdmSEsZULrw/3f+MnQbdjMTYLFP24visZg9
+// MN8vAiALiiiR1a+Crz+DTA1Q8sGOMVCMqMDmD7QBys3ZuWxuapm0txAiIYUtsjJZ
+// XN76T4nZ2QKBgQCHaT3igzwsWTmesxowJtEMeGWomeXpKx8h89EfqA8PkRGsyIDN
+// qq+YxEoe1RZgljEuaLhZDdNcGsjo8woPk9kAUPTH7fbRCMuutK+4ZJ469s1tNkcH
+// QX5SBcEJbOrZvv967ehe3VQXmJZq6kgnHVzuwKBjcC2ZJRGDFY6l5l/+cQKBgCqh
+// +Adf/8NK7paMJ0urqfPFwSodKfICXZ3apswDWMRkmSbqh4La+Uc8dsqN5Dz/VEFZ
+// JHhSeGbN8uMfOlG93eU2MehdPxtw1pZUWMNjjtj23XO9ooob2CKzbSrp8TBnZsi1
+// widNNr66oTFpeo7VUUK6acsgF6sYJJxSVr+XO1yJAoGAEhvitq8shNKcEY0xCipS
+// k1kbgyS7KKB7opVxI5+ChEqyUDijS3Y9FZixrRIWE6i2uGu86UG+v2lbKvSbM4Qm
+// xvbOcX9OVMnlRb7n8woOP10UMY+ZE2x+YEUXQTLtPYq7F66e1OfxltstMxLQA+3d
+// Y1d5piFV8PXK3Fg2F+Cj5qg=
+// -----END PRIVATE KEY-----
+// '
+// , $this->userId
+// );
+//
+// \OC_User::setUserId( $this->userId );
+//
+// }
+//
+// public function testpreFile_get_contents() {
+//
+// // This won't work for now because mocking of the static keymanager class isn't working :(
+//
+// // $mock = m::mock( 'alias:OCA\Encryption\Keymanager' );
+// //
+// // $mock->shouldReceive( 'getFileKey' )->times(2)->andReturn( $this->encDataShort );
+// //
+// // $encrypted = $this->proxy->postFile_get_contents( 'data/'.$this->tmpFileName, $this->encDataShortKey );
+// //
+// // $this->assertNotEquals( $this->dataShort, $encrypted );
+//
+// $decrypted = $this->proxy->postFile_get_contents( 'data/admin/files/enc-test.txt', $this->data1 );
+//
+// }
+//
+// }
+
+// class Test_CryptProxy extends PHPUnit_Framework_TestCase {
+// private $oldConfig;
+// private $oldKey;
+//
+// public function setUp(){
+// $user=OC_User::getUser();
+//
+// $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption','true');
+// OCP\Config::setAppValue('files_encryption','enable_encryption','true');
+// $this->oldKey=isset($_SESSION['privateKey'])?$_SESSION['privateKey']:null;
+//
+//
+// //set testing key
+// $_SESSION['privateKey']=md5(time());
+//
+// //clear all proxies and hooks so we can do clean testing
+// OC_FileProxy::clearProxies();
+// OC_Hook::clear('OC_Filesystem');
+//
+// //enable only the encryption hook
+// OC_FileProxy::register(new OC_FileProxy_Encryption());
+//
+// //set up temporary storage
+// OC_Filesystem::clearMounts();
+// OC_Filesystem::mount('OC_Filestorage_Temporary',array(),'/');
+//
+// OC_Filesystem::init('/'.$user.'/files');
+//
+// //set up the users home folder in the temp storage
+// $rootView=new OC_FilesystemView('');
+// $rootView->mkdir('/'.$user);
+// $rootView->mkdir('/'.$user.'/files');
+// }
+//
+// public function tearDown(){
+// OCP\Config::setAppValue('files_encryption','enable_encryption',$this->oldConfig);
+// if(!is_null($this->oldKey)){
+// $_SESSION['privateKey']=$this->oldKey;
+// }
+// }
+//
+// public function testSimple(){
+// $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
+// $original=file_get_contents($file);
+//
+// OC_Filesystem::file_put_contents('/file',$original);
+//
+// OC_FileProxy::$enabled=false;
+// $stored=OC_Filesystem::file_get_contents('/file');
+// OC_FileProxy::$enabled=true;
+//
+// $fromFile=OC_Filesystem::file_get_contents('/file');
+// $this->assertNotEquals($original,$stored);
+// $this->assertEquals(strlen($original),strlen($fromFile));
+// $this->assertEquals($original,$fromFile);
+//
+// }
+//
+// public function testView(){
+// $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
+// $original=file_get_contents($file);
+//
+// $rootView=new OC_FilesystemView('');
+// $view=new OC_FilesystemView('/'.OC_User::getUser());
+// $userDir='/'.OC_User::getUser().'/files';
+//
+// $rootView->file_put_contents($userDir.'/file',$original);
+//
+// OC_FileProxy::$enabled=false;
+// $stored=$rootView->file_get_contents($userDir.'/file');
+// OC_FileProxy::$enabled=true;
+//
+// $this->assertNotEquals($original,$stored);
+// $fromFile=$rootView->file_get_contents($userDir.'/file');
+// $this->assertEquals($original,$fromFile);
+//
+// $fromFile=$view->file_get_contents('files/file');
+// $this->assertEquals($original,$fromFile);
+// }
+//
+// public function testBinary(){
+// $file=__DIR__.'/binary';
+// $original=file_get_contents($file);
+//
+// OC_Filesystem::file_put_contents('/file',$original);
+//
+// OC_FileProxy::$enabled=false;
+// $stored=OC_Filesystem::file_get_contents('/file');
+// OC_FileProxy::$enabled=true;
+//
+// $fromFile=OC_Filesystem::file_get_contents('/file');
+// $this->assertNotEquals($original,$stored);
+// $this->assertEquals(strlen($original),strlen($fromFile));
+// $this->assertEquals($original,$fromFile);
+//
+// $file=__DIR__.'/zeros';
+// $original=file_get_contents($file);
+//
+// OC_Filesystem::file_put_contents('/file',$original);
+//
+// OC_FileProxy::$enabled=false;
+// $stored=OC_Filesystem::file_get_contents('/file');
+// OC_FileProxy::$enabled=true;
+//
+// $fromFile=OC_Filesystem::file_get_contents('/file');
+// $this->assertNotEquals($original,$stored);
+// $this->assertEquals(strlen($original),strlen($fromFile));
+// }
+// }
diff --git a/apps/files_encryption/test/stream.php b/apps/files_encryption/test/stream.php
new file mode 100644
index 00000000000..ba82ac80eab
--- /dev/null
+++ b/apps/files_encryption/test/stream.php
@@ -0,0 +1,226 @@
+// <?php
+// /**
+// * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
+// * This file is licensed under the Affero General Public License version 3 or
+// * later.
+// * See the COPYING-README file.
+// */
+//
+// namespace OCA\Encryption;
+//
+// class Test_Stream extends \PHPUnit_Framework_TestCase {
+//
+// function setUp() {
+//
+// \OC_Filesystem::mount( 'OC_Filestorage_Local', array(), '/' );
+//
+// $this->empty = '';
+//
+// $this->stream = new Stream();
+//
+// $this->dataLong = file_get_contents( realpath( dirname(__FILE__).'/../lib/crypt.php' ) );
+// $this->dataShort = 'hats';
+//
+// $this->emptyTmpFilePath = \OCP\Files::tmpFile();
+//
+// $this->dataTmpFilePath = \OCP\Files::tmpFile();
+//
+// file_put_contents( $this->dataTmpFilePath, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est." );
+//
+// }
+//
+// function testStreamOpen() {
+//
+// $stream1 = new Stream();
+//
+// $handle1 = $stream1->stream_open( $this->emptyTmpFilePath, 'wb', array(), $this->empty );
+//
+// // Test that resource was returned successfully
+// $this->assertTrue( $handle1 );
+//
+// // Test that file has correct size
+// $this->assertEquals( 0, $stream1->size );
+//
+// // Test that path is correct
+// $this->assertEquals( $this->emptyTmpFilePath, $stream1->rawPath );
+//
+// $stream2 = new Stream();
+//
+// $handle2 = $stream2->stream_open( 'crypt://' . $this->emptyTmpFilePath, 'wb', array(), $this->empty );
+//
+// // Test that protocol identifier is removed from path
+// $this->assertEquals( $this->emptyTmpFilePath, $stream2->rawPath );
+//
+// // "Stat failed error" prevents this test from executing
+// // $stream3 = new Stream();
+// //
+// // $handle3 = $stream3->stream_open( $this->dataTmpFilePath, 'r', array(), $this->empty );
+// //
+// // $this->assertEquals( 0, $stream3->size );
+//
+// }
+//
+// function testStreamWrite() {
+//
+// $stream1 = new Stream();
+//
+// $handle1 = $stream1->stream_open( $this->emptyTmpFilePath, 'r+b', array(), $this->empty );
+//
+// # what about the keymanager? there is no key for the newly created temporary file!
+//
+// $stream1->stream_write( $this->dataShort );
+//
+// }
+//
+// // function getStream( $id, $mode, $size ) {
+// //
+// // if ( $id === '' ) {
+// //
+// // $id = uniqid();
+// // }
+// //
+// //
+// // if ( !isset( $this->tmpFiles[$id] ) ) {
+// //
+// // // If tempfile with given name does not already exist, create it
+// //
+// // $file = OCP\Files::tmpFile();
+// //
+// // $this->tmpFiles[$id] = $file;
+// //
+// // } else {
+// //
+// // $file = $this->tmpFiles[$id];
+// //
+// // }
+// //
+// // $stream = fopen( $file, $mode );
+// //
+// // Stream::$sourceStreams[$id] = array( 'path' => 'dummy' . $id, 'stream' => $stream, 'size' => $size );
+// //
+// // return fopen( 'crypt://streams/'.$id, $mode );
+// //
+// // }
+// //
+// // function testStream( ){
+// //
+// // $stream = $this->getStream( 'test1', 'w', strlen( 'foobar' ) );
+// //
+// // fwrite( $stream, 'foobar' );
+// //
+// // fclose( $stream );
+// //
+// //
+// // $stream = $this->getStream( 'test1', 'r', strlen( 'foobar' ) );
+// //
+// // $data = fread( $stream, 6 );
+// //
+// // fclose( $stream );
+// //
+// // $this->assertEquals( 'foobar', $data );
+// //
+// //
+// // $file = OC::$SERVERROOT.'/3rdparty/MDB2.php';
+// //
+// // $source = fopen( $file, 'r' );
+// //
+// // $target = $this->getStream( 'test2', 'w', 0 );
+// //
+// // OCP\Files::streamCopy( $source, $target );
+// //
+// // fclose( $target );
+// //
+// // fclose( $source );
+// //
+// //
+// // $stream = $this->getStream( 'test2', 'r', filesize( $file ) );
+// //
+// // $data = stream_get_contents( $stream );
+// //
+// // $original = file_get_contents( $file );
+// //
+// // $this->assertEquals( strlen( $original ), strlen( $data ) );
+// //
+// // $this->assertEquals( $original, $data );
+// //
+// // }
+//
+// }
+//
+// // class Test_CryptStream extends PHPUnit_Framework_TestCase {
+// // private $tmpFiles=array();
+// //
+// // function testStream(){
+// // $stream=$this->getStream('test1','w',strlen('foobar'));
+// // fwrite($stream,'foobar');
+// // fclose($stream);
+// //
+// // $stream=$this->getStream('test1','r',strlen('foobar'));
+// // $data=fread($stream,6);
+// // fclose($stream);
+// // $this->assertEquals('foobar',$data);
+// //
+// // $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
+// // $source=fopen($file,'r');
+// // $target=$this->getStream('test2','w',0);
+// // OCP\Files::streamCopy($source,$target);
+// // fclose($target);
+// // fclose($source);
+// //
+// // $stream=$this->getStream('test2','r',filesize($file));
+// // $data=stream_get_contents($stream);
+// // $original=file_get_contents($file);
+// // $this->assertEquals(strlen($original),strlen($data));
+// // $this->assertEquals($original,$data);
+// // }
+// //
+// // /**
+// // * get a cryptstream to a temporary file
+// // * @param string $id
+// // * @param string $mode
+// // * @param int size
+// // * @return resource
+// // */
+// // function getStream($id,$mode,$size){
+// // if($id===''){
+// // $id=uniqid();
+// // }
+// // if(!isset($this->tmpFiles[$id])){
+// // $file=OCP\Files::tmpFile();
+// // $this->tmpFiles[$id]=$file;
+// // }else{
+// // $file=$this->tmpFiles[$id];
+// // }
+// // $stream=fopen($file,$mode);
+// // OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id,'stream'=>$stream,'size'=>$size);
+// // return fopen('crypt://streams/'.$id,$mode);
+// // }
+// //
+// // function testBinary(){
+// // $file=__DIR__.'/binary';
+// // $source=file_get_contents($file);
+// //
+// // $stream=$this->getStream('test','w',strlen($source));
+// // fwrite($stream,$source);
+// // fclose($stream);
+// //
+// // $stream=$this->getStream('test','r',strlen($source));
+// // $data=stream_get_contents($stream);
+// // fclose($stream);
+// // $this->assertEquals(strlen($data),strlen($source));
+// // $this->assertEquals($source,$data);
+// //
+// // $file=__DIR__.'/zeros';
+// // $source=file_get_contents($file);
+// //
+// // $stream=$this->getStream('test2','w',strlen($source));
+// // fwrite($stream,$source);
+// // fclose($stream);
+// //
+// // $stream=$this->getStream('test2','r',strlen($source));
+// // $data=stream_get_contents($stream);
+// // fclose($stream);
+// // $this->assertEquals(strlen($data),strlen($source));
+// // $this->assertEquals($source,$data);
+// // }
+// // }
diff --git a/apps/files_encryption/test/util.php b/apps/files_encryption/test/util.php
new file mode 100755
index 00000000000..a299ec67f59
--- /dev/null
+++ b/apps/files_encryption/test/util.php
@@ -0,0 +1,210 @@
+<?php
+/**
+ * Copyright (c) 2012 Sam Tuke <samtuke@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+//require_once "PHPUnit/Framework/TestCase.php";
+require_once realpath( dirname(__FILE__).'/../../../lib/base.php' );
+require_once realpath( dirname(__FILE__).'/../lib/crypt.php' );
+require_once realpath( dirname(__FILE__).'/../lib/keymanager.php' );
+require_once realpath( dirname(__FILE__).'/../lib/proxy.php' );
+require_once realpath( dirname(__FILE__).'/../lib/stream.php' );
+require_once realpath( dirname(__FILE__).'/../lib/util.php' );
+require_once realpath( dirname(__FILE__).'/../appinfo/app.php' );
+
+// Load mockery files
+require_once 'Mockery/Loader.php';
+require_once 'Hamcrest/Hamcrest.php';
+$loader = new \Mockery\Loader;
+$loader->register();
+
+use \Mockery as m;
+use OCA\Encryption;
+
+class Test_Enc_Util extends \PHPUnit_Framework_TestCase {
+
+ function setUp() {
+
+ \OC_Filesystem::mount( 'OC_Filestorage_Local', array(), '/' );
+
+ // set content for encrypting / decrypting in tests
+ $this->dataUrl = realpath( dirname(__FILE__).'/../lib/crypt.php' );
+ $this->dataShort = 'hats';
+ $this->dataLong = file_get_contents( realpath( dirname(__FILE__).'/../lib/crypt.php' ) );
+ $this->legacyData = realpath( dirname(__FILE__).'/legacy-text.txt' );
+ $this->legacyEncryptedData = realpath( dirname(__FILE__).'/legacy-encrypted-text.txt' );
+
+ $this->userId = 'admin';
+ $this->pass = 'admin';
+
+ $keypair = Encryption\Crypt::createKeypair();
+
+ $this->genPublicKey = $keypair['publicKey'];
+ $this->genPrivateKey = $keypair['privateKey'];
+
+ $this->publicKeyDir = '/' . 'public-keys';
+ $this->encryptionDir = '/' . $this->userId . '/' . 'files_encryption';
+ $this->keyfilesPath = $this->encryptionDir . '/' . 'keyfiles';
+ $this->publicKeyPath = $this->publicKeyDir . '/' . $this->userId . '.public.key'; // e.g. data/public-keys/admin.public.key
+ $this->privateKeyPath = $this->encryptionDir . '/' . $this->userId . '.private.key'; // e.g. data/admin/admin.private.key
+
+ $this->view = new OC_FilesystemView( '/admin' );
+
+ $this->mockView = m::mock('OC_FilesystemView');
+ $this->util = new Encryption\Util( $this->mockView, $this->userId );
+
+ }
+
+ function tearDown(){
+
+ m::close();
+
+ }
+
+ /**
+ * @brief test that paths set during User construction are correct
+ */
+ function testKeyPaths() {
+
+ $mockView = m::mock('OC_FilesystemView');
+
+ $util = new Encryption\Util( $mockView, $this->userId );
+
+ $this->assertEquals( $this->publicKeyDir, $util->getPath( 'publicKeyDir' ) );
+ $this->assertEquals( $this->encryptionDir, $util->getPath( 'encryptionDir' ) );
+ $this->assertEquals( $this->keyfilesPath, $util->getPath( 'keyfilesPath' ) );
+ $this->assertEquals( $this->publicKeyPath, $util->getPath( 'publicKeyPath' ) );
+ $this->assertEquals( $this->privateKeyPath, $util->getPath( 'privateKeyPath' ) );
+
+ }
+
+ /**
+ * @brief test setup of encryption directories when they don't yet exist
+ */
+ function testSetupServerSideNotSetup() {
+
+ $mockView = m::mock('OC_FilesystemView');
+
+ $mockView->shouldReceive( 'file_exists' )->times(4)->andReturn( false );
+ $mockView->shouldReceive( 'mkdir' )->times(3)->andReturn( true );
+ $mockView->shouldReceive( 'file_put_contents' )->withAnyArgs();
+
+ $util = new Encryption\Util( $mockView, $this->userId );
+
+ $this->assertEquals( true, $util->setupServerSide( $this->pass ) );
+
+ }
+
+ /**
+ * @brief test setup of encryption directories when they already exist
+ */
+ function testSetupServerSideIsSetup() {
+
+ $mockView = m::mock('OC_FilesystemView');
+
+ $mockView->shouldReceive( 'file_exists' )->times(5)->andReturn( true );
+ $mockView->shouldReceive( 'file_put_contents' )->withAnyArgs();
+
+ $util = new Encryption\Util( $mockView, $this->userId );
+
+ $this->assertEquals( true, $util->setupServerSide( $this->pass ) );
+
+ }
+
+ /**
+ * @brief test checking whether account is ready for encryption, when it isn't ready
+ */
+ function testReadyNotReady() {
+
+ $mockView = m::mock('OC_FilesystemView');
+
+ $mockView->shouldReceive( 'file_exists' )->times(1)->andReturn( false );
+
+ $util = new Encryption\Util( $mockView, $this->userId );
+
+ $this->assertEquals( false, $util->ready() );
+
+ # TODO: Add more tests here to check that if any of the dirs are
+ # then false will be returned. Use strict ordering?
+
+ }
+
+ /**
+ * @brief test checking whether account is ready for encryption, when it is ready
+ */
+ function testReadyIsReady() {
+
+ $mockView = m::mock('OC_FilesystemView');
+
+ $mockView->shouldReceive( 'file_exists' )->times(3)->andReturn( true );
+
+ $util = new Encryption\Util( $mockView, $this->userId );
+
+ $this->assertEquals( true, $util->ready() );
+
+ # TODO: Add more tests here to check that if any of the dirs are
+ # then false will be returned. Use strict ordering?
+
+ }
+
+// /**
+// * @brief test decryption using legacy blowfish method
+// * @depends testLegacyEncryptLong
+// */
+// function testLegacyKeyRecryptKeyfileDecrypt( $recrypted ) {
+//
+// $decrypted = Encryption\Crypt::keyDecryptKeyfile( $recrypted['data'], $recrypted['key'], $this->genPrivateKey );
+//
+// $this->assertEquals( $this->dataLong, $decrypted );
+//
+// }
+
+// // Cannot use this test for now due to hidden dependencies in OC_FileCache
+// function testIsLegacyEncryptedContent() {
+//
+// $keyfileContent = OCA\Encryption\Crypt::symmetricEncryptFileContent( $this->legacyEncryptedData, 'hat' );
+//
+// $this->assertFalse( OCA\Encryption\Crypt::isLegacyEncryptedContent( $keyfileContent, '/files/admin/test.txt' ) );
+//
+// OC_FileCache::put( '/admin/files/legacy-encrypted-test.txt', $this->legacyEncryptedData );
+//
+// $this->assertTrue( OCA\Encryption\Crypt::isLegacyEncryptedContent( $this->legacyEncryptedData, '/files/admin/test.txt' ) );
+//
+// }
+
+// // Cannot use this test for now due to need for different root in OC_Filesystem_view class
+// function testGetLegacyKey() {
+//
+// $c = new \OCA\Encryption\Util( $view, false );
+//
+// $bool = $c->getLegacyKey( 'admin' );
+//
+// $this->assertTrue( $bool );
+//
+// $this->assertTrue( $c->legacyKey );
+//
+// $this->assertTrue( is_int( $c->legacyKey ) );
+//
+// $this->assertTrue( strlen( $c->legacyKey ) == 20 );
+//
+// }
+
+// // Cannot use this test for now due to need for different root in OC_Filesystem_view class
+// function testLegacyDecrypt() {
+//
+// $c = new OCA\Encryption\Util( $this->view, false );
+//
+// $bool = $c->getLegacyKey( 'admin' );
+//
+// $encrypted = $c->legacyEncrypt( $this->data, $c->legacyKey );
+//
+// $decrypted = $c->legacyDecrypt( $encrypted, $c->legacyKey );
+//
+// $this->assertEquals( $decrypted, $this->data );
+//
+// }
+
+} \ No newline at end of file
diff --git a/apps/files_encryption/tests/zeros b/apps/files_encryption/test/zeros
index ff982acf423..ff982acf423 100644
--- a/apps/files_encryption/tests/zeros
+++ b/apps/files_encryption/test/zeros
Binary files differ
diff --git a/apps/files_encryption/tests/encryption.php b/apps/files_encryption/tests/encryption.php
deleted file mode 100644
index 0e119f55bea..00000000000
--- a/apps/files_encryption/tests/encryption.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-/**
- * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-class Test_Encryption extends UnitTestCase {
- function testEncryption() {
- $key=uniqid();
- $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
- $source=file_get_contents($file); //nice large text file
- $encrypted=OC_Crypt::encrypt($source, $key);
- $decrypted=OC_Crypt::decrypt($encrypted, $key);
- $decrypted=rtrim($decrypted, "\0");
- $this->assertNotEqual($encrypted, $source);
- $this->assertEqual($decrypted, $source);
-
- $chunk=substr($source, 0, 8192);
- $encrypted=OC_Crypt::encrypt($chunk, $key);
- $this->assertEqual(strlen($chunk), strlen($encrypted));
- $decrypted=OC_Crypt::decrypt($encrypted, $key);
- $decrypted=rtrim($decrypted, "\0");
- $this->assertEqual($decrypted, $chunk);
-
- $encrypted=OC_Crypt::blockEncrypt($source, $key);
- $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
- $this->assertNotEqual($encrypted, $source);
- $this->assertEqual($decrypted, $source);
-
- $tmpFileEncrypted=OCP\Files::tmpFile();
- OC_Crypt::encryptfile($file, $tmpFileEncrypted, $key);
- $encrypted=file_get_contents($tmpFileEncrypted);
- $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
- $this->assertNotEqual($encrypted, $source);
- $this->assertEqual($decrypted, $source);
-
- $tmpFileDecrypted=OCP\Files::tmpFile();
- OC_Crypt::decryptfile($tmpFileEncrypted, $tmpFileDecrypted, $key);
- $decrypted=file_get_contents($tmpFileDecrypted);
- $this->assertEqual($decrypted, $source);
-
- $file=OC::$SERVERROOT.'/core/img/weather-clear.png';
- $source=file_get_contents($file); //binary file
- $encrypted=OC_Crypt::encrypt($source, $key);
- $decrypted=OC_Crypt::decrypt($encrypted, $key);
- $decrypted=rtrim($decrypted, "\0");
- $this->assertEqual($decrypted, $source);
-
- $encrypted=OC_Crypt::blockEncrypt($source, $key);
- $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
- $this->assertEqual($decrypted, $source);
-
- }
-
- function testBinary() {
- $key=uniqid();
-
- $file=__DIR__.'/binary';
- $source=file_get_contents($file); //binary file
- $encrypted=OC_Crypt::encrypt($source, $key);
- $decrypted=OC_Crypt::decrypt($encrypted, $key);
-
- $decrypted=rtrim($decrypted, "\0");
- $this->assertEqual($decrypted, $source);
-
- $encrypted=OC_Crypt::blockEncrypt($source, $key);
- $decrypted=OC_Crypt::blockDecrypt($encrypted, $key, strlen($source));
- $this->assertEqual($decrypted, $source);
- }
-}
diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php
deleted file mode 100644
index 5aa617e7472..00000000000
--- a/apps/files_encryption/tests/proxy.php
+++ /dev/null
@@ -1,117 +0,0 @@
-<?php
-/**
- * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-class Test_CryptProxy extends UnitTestCase {
- private $oldConfig;
- private $oldKey;
-
- public function setUp() {
- $user=OC_User::getUser();
-
- $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption', 'true');
- OCP\Config::setAppValue('files_encryption', 'enable_encryption', 'true');
- $this->oldKey=isset($_SESSION['enckey'])?$_SESSION['enckey']:null;
-
-
- //set testing key
- $_SESSION['enckey']=md5(time());
-
- //clear all proxies and hooks so we can do clean testing
- OC_FileProxy::clearProxies();
- OC_Hook::clear('OC_Filesystem');
-
- //enable only the encryption hook
- OC_FileProxy::register(new OC_FileProxy_Encryption());
-
- //set up temporary storage
- OC_Filesystem::clearMounts();
- OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
-
- OC_Filesystem::init('/'.$user.'/files');
-
- //set up the users home folder in the temp storage
- $rootView=new OC_FilesystemView('');
- $rootView->mkdir('/'.$user);
- $rootView->mkdir('/'.$user.'/files');
- }
-
- public function tearDown() {
- OCP\Config::setAppValue('files_encryption', 'enable_encryption', $this->oldConfig);
- if ( ! is_null($this->oldKey)) {
- $_SESSION['enckey']=$this->oldKey;
- }
- }
-
- public function testSimple() {
- $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
- $original=file_get_contents($file);
-
- OC_Filesystem::file_put_contents('/file', $original);
-
- OC_FileProxy::$enabled=false;
- $stored=OC_Filesystem::file_get_contents('/file');
- OC_FileProxy::$enabled=true;
-
- $fromFile=OC_Filesystem::file_get_contents('/file');
- $this->assertNotEqual($original, $stored);
- $this->assertEqual(strlen($original), strlen($fromFile));
- $this->assertEqual($original, $fromFile);
-
- }
-
- public function testView() {
- $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
- $original=file_get_contents($file);
-
- $rootView=new OC_FilesystemView('');
- $view=new OC_FilesystemView('/'.OC_User::getUser());
- $userDir='/'.OC_User::getUser().'/files';
-
- $rootView->file_put_contents($userDir.'/file', $original);
-
- OC_FileProxy::$enabled=false;
- $stored=$rootView->file_get_contents($userDir.'/file');
- OC_FileProxy::$enabled=true;
-
- $this->assertNotEqual($original, $stored);
- $fromFile=$rootView->file_get_contents($userDir.'/file');
- $this->assertEqual($original, $fromFile);
-
- $fromFile=$view->file_get_contents('files/file');
- $this->assertEqual($original, $fromFile);
- }
-
- public function testBinary() {
- $file=__DIR__.'/binary';
- $original=file_get_contents($file);
-
- OC_Filesystem::file_put_contents('/file', $original);
-
- OC_FileProxy::$enabled=false;
- $stored=OC_Filesystem::file_get_contents('/file');
- OC_FileProxy::$enabled=true;
-
- $fromFile=OC_Filesystem::file_get_contents('/file');
- $this->assertNotEqual($original, $stored);
- $this->assertEqual(strlen($original), strlen($fromFile));
- $this->assertEqual($original, $fromFile);
-
- $file=__DIR__.'/zeros';
- $original=file_get_contents($file);
-
- OC_Filesystem::file_put_contents('/file', $original);
-
- OC_FileProxy::$enabled=false;
- $stored=OC_Filesystem::file_get_contents('/file');
- OC_FileProxy::$enabled=true;
-
- $fromFile=OC_Filesystem::file_get_contents('/file');
- $this->assertNotEqual($original, $stored);
- $this->assertEqual(strlen($original), strlen($fromFile));
- }
-}
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
deleted file mode 100644
index e4af17d47b5..00000000000
--- a/apps/files_encryption/tests/stream.php
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-/**
- * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-class Test_CryptStream extends UnitTestCase {
- private $tmpFiles=array();
-
- function testStream() {
- $stream=$this->getStream('test1', 'w', strlen('foobar'));
- fwrite($stream, 'foobar');
- fclose($stream);
-
- $stream=$this->getStream('test1', 'r', strlen('foobar'));
- $data=fread($stream, 6);
- fclose($stream);
- $this->assertEqual('foobar', $data);
-
- $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
- $source=fopen($file, 'r');
- $target=$this->getStream('test2', 'w', 0);
- OCP\Files::streamCopy($source, $target);
- fclose($target);
- fclose($source);
-
- $stream=$this->getStream('test2', 'r', filesize($file));
- $data=stream_get_contents($stream);
- $original=file_get_contents($file);
- $this->assertEqual(strlen($original), strlen($data));
- $this->assertEqual($original, $data);
- }
-
- /**
- * get a cryptstream to a temporary file
- * @param string $id
- * @param string $mode
- * @param int size
- * @return resource
- */
- function getStream($id, $mode, $size) {
- if ($id==='') {
- $id=uniqid();
- }
- if ( ! isset($this->tmpFiles[$id])) {
- $file=OCP\Files::tmpFile();
- $this->tmpFiles[$id]=$file;
- } else {
- $file=$this->tmpFiles[$id];
- }
- $stream=fopen($file, $mode);
- OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id, 'stream'=>$stream, 'size'=>$size);
- return fopen('crypt://streams/'.$id, $mode);
- }
-
- function testBinary() {
- $file=__DIR__.'/binary';
- $source=file_get_contents($file);
-
- $stream=$this->getStream('test', 'w', strlen($source));
- fwrite($stream, $source);
- fclose($stream);
-
- $stream=$this->getStream('test', 'r', strlen($source));
- $data=stream_get_contents($stream);
- fclose($stream);
- $this->assertEqual(strlen($data), strlen($source));
- $this->assertEqual($source, $data);
-
- $file=__DIR__.'/zeros';
- $source=file_get_contents($file);
-
- $stream=$this->getStream('test2', 'w', strlen($source));
- fwrite($stream, $source);
- fclose($stream);
-
- $stream=$this->getStream('test2', 'r', strlen($source));
- $data=stream_get_contents($stream);
- fclose($stream);
- $this->assertEqual(strlen($data), strlen($source));
- $this->assertEqual($source, $data);
- }
-}
diff --git a/apps/files_external/l10n/ro.php b/apps/files_external/l10n/ro.php
index 6a152786808..ca2c9f7e5c8 100644
--- a/apps/files_external/l10n/ro.php
+++ b/apps/files_external/l10n/ro.php
@@ -1,4 +1,12 @@
<?php $TRANSLATIONS = array(
+"Access granted" => "Acces permis",
+"Error configuring Dropbox storage" => "Eroare la configurarea mediului de stocare Dropbox",
+"Grant access" => "Permite accesul",
+"Fill out all required fields" => "Completează toate câmpurile necesare",
+"Please provide a valid Dropbox app key and secret." => "Prezintă te rog o cheie de Dropbox validă și parola",
+"Error configuring Google Drive storage" => "Eroare la configurarea mediului de stocare Google Drive",
+"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Atenție:</b> \"smbclient\" nu este instalat. Montarea mediilor CIFS/SMB partajate nu este posibilă. Solicită administratorului sistemului tău să îl instaleaze.",
+"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Atenție:</b> suportul pentru FTP în PHP nu este activat sau instalat. Montarea mediilor FPT partajate nu este posibilă. Solicită administratorului sistemului tău să îl instaleze.",
"External Storage" => "Stocare externă",
"Mount point" => "Punctul de montare",
"Backend" => "Backend",
diff --git a/apps/files_external/l10n/th_TH.php b/apps/files_external/l10n/th_TH.php
index 70ab8d33485..870995c8e7a 100644
--- a/apps/files_external/l10n/th_TH.php
+++ b/apps/files_external/l10n/th_TH.php
@@ -5,6 +5,8 @@
"Fill out all required fields" => "กรอกข้อมูลในช่องข้อมูลที่จำเป็นต้องกรอกทั้งหมด",
"Please provide a valid Dropbox app key and secret." => "กรุณากรอกรหัส app key ของ Dropbox และรหัสลับ",
"Error configuring Google Drive storage" => "เกิดข้อผิดพลาดในการกำหนดค่าการจัดเก็บข้อมูลในพื้นที่ของ Google Drive",
+"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>คำเตือน:</b> \"smbclient\" ยังไม่ได้ถูกติดตั้ง. การชี้ CIFS/SMB เพื่อแชร์ข้อมูลไม่สามารถกระทำได้ กรุณาสอบถามข้อมูลเพิ่มเติมจากผู้ดูแลระบบเพื่อติดตั้ง.",
+"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>คำเตือน:</b> การสนับสนุนการใช้งาน FTP ในภาษา PHP ยังไม่ได้ถูกเปิดใช้งานหรือถูกติดตั้ง. การชี้ FTP เพื่อแชร์ข้อมูลไม่สามารถดำเนินการได้ กรุณาสอบถามข้อมูลเพิ่มเติมจากผู้ดูแลระบบเพื่อติดตั้ง",
"External Storage" => "พื้นทีจัดเก็บข้อมูลจากภายนอก",
"Mount point" => "จุดชี้ตำแหน่ง",
"Backend" => "ด้านหลังระบบ",
diff --git a/apps/files_external/tests/ftp.php b/apps/files_external/tests/ftp.php
index d0404b5f34c..91e4589ed18 100644
--- a/apps/files_external/tests/ftp.php
+++ b/apps/files_external/tests/ftp.php
@@ -32,18 +32,18 @@ class Test_Filestorage_FTP extends Test_FileStorage {
'root' => '/',
'secure' => false );
$instance = new OC_Filestorage_FTP($config);
- $this->assertEqual('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
+ $this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = true;
$instance = new OC_Filestorage_FTP($config);
- $this->assertEqual('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
+ $this->assertEquals('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = 'false';
$instance = new OC_Filestorage_FTP($config);
- $this->assertEqual('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
+ $this->assertEquals('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = 'true';
$instance = new OC_Filestorage_FTP($config);
- $this->assertEqual('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
+ $this->assertEquals('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
}
}
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 0dae4daa08a..eb5a6e8cb7f 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -1,6 +1,9 @@
$(document).ready(function() {
+ var disableSharing = $('#disableSharing').data('status');
+
if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) {
+
FileActions.register('all', 'Share', OC.PERMISSION_READ, OC.imagePath('core', 'actions/share'), function(filename) {
if ($('#dir').val() == '/') {
var item = $('#dir').val() + filename;
diff --git a/apps/files_sharing/l10n/lb.php b/apps/files_sharing/l10n/lb.php
new file mode 100644
index 00000000000..8aba5806aa0
--- /dev/null
+++ b/apps/files_sharing/l10n/lb.php
@@ -0,0 +1,3 @@
+<?php $TRANSLATIONS = array(
+"Password" => "Passwuert"
+);
diff --git a/apps/files_sharing/l10n/sr.php b/apps/files_sharing/l10n/sr.php
new file mode 100644
index 00000000000..7a922b89002
--- /dev/null
+++ b/apps/files_sharing/l10n/sr.php
@@ -0,0 +1,3 @@
+<?php $TRANSLATIONS = array(
+"Submit" => "Пошаљи"
+);
diff --git a/apps/files_sharing/l10n/zh_TW.php b/apps/files_sharing/l10n/zh_TW.php
index fa4f8075c6e..f1d28731a7f 100644
--- a/apps/files_sharing/l10n/zh_TW.php
+++ b/apps/files_sharing/l10n/zh_TW.php
@@ -4,5 +4,6 @@
"%s shared the folder %s with you" => "%s 分享了資料夾 %s 給您",
"%s shared the file %s with you" => "%s 分享了檔案 %s 給您",
"Download" => "下載",
-"No preview available for" => "無法預覽"
+"No preview available for" => "無法預覽",
+"web services under your control" => "在您掌控之下的網路服務"
);
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index bfcc521e106..35cca7c42dc 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -1,11 +1,3 @@
-<script type="text/javascript">
- <?php if ( array_key_exists('disableSharing', $_) && $_['disableSharing'] == true ) {
- echo "var disableSharing = true;";
- } else {
- echo "var disableSharing = false;";
- }
- ?>
-</script>
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
<input type="hidden" name="downloadURL" value="<?php echo $_['downloadURL'] ?>" id="downloadURL">
<input type="hidden" name="filename" value="<?php echo $_['filename'] ?>" id="filename">
diff --git a/apps/files_versions/l10n/lb.php b/apps/files_versions/l10n/lb.php
new file mode 100644
index 00000000000..3aa625ffc97
--- /dev/null
+++ b/apps/files_versions/l10n/lb.php
@@ -0,0 +1,5 @@
+<?php $TRANSLATIONS = array(
+"History" => "Historique",
+"Files Versioning" => "Fichier's Versionéierung ",
+"Enable" => "Aschalten"
+);
diff --git a/apps/user_ldap/l10n/fr.php b/apps/user_ldap/l10n/fr.php
index dd2fb08091c..28ee6346ef4 100644
--- a/apps/user_ldap/l10n/fr.php
+++ b/apps/user_ldap/l10n/fr.php
@@ -1,11 +1,13 @@
<?php $TRANSLATIONS = array(
"<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour. Please ask your system administrator to disable one of them." => "<b>Avertissement:</b> Les applications user_ldap et user_webdavauth sont incompatibles. Des disfonctionnements peuvent survenir. Contactez votre administrateur système pour qu'il désactive l'une d'elles.",
+"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Attention :</b> Le module php LDAP n'est pas installé, par conséquent cette extension ne pourra fonctionner. Veuillez contacter votre administrateur système afin qu'il l'installe.",
"Host" => "Hôte",
"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Vous pouvez omettre le protocole, sauf si vous avez besoin de SSL. Dans ce cas préfixez avec ldaps://",
"Base DN" => "DN Racine",
-"You can specify Base DN for users and groups in the Advanced tab" => "Vous pouvez détailler les DN Racines de vos utilisateurs et groupes dans l'onglet Avancé",
+"One Base DN per line" => "Un DN racine par ligne",
+"You can specify Base DN for users and groups in the Advanced tab" => "Vous pouvez spécifier les DN Racines de vos utilisateurs et groupes via l'onglet Avancé",
"User DN" => "DN Utilisateur (Autorisé à consulter l'annuaire)",
-"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "Le DN de l'utilisateur client avec lequel la liaison doit se faire, par exemple uid=agent,dc=example,dc=com. Pour l'accès anonyme, laisser le DN et le mot de passe vides.",
+"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "DN de l'utilisateur client pour lequel la liaison doit se faire, par exemple uid=agent,dc=example,dc=com. Pour un accès anonyme, laisser le DN et le mot de passe vides.",
"Password" => "Mot de passe",
"For anonymous access, leave DN and Password empty." => "Pour un accès anonyme, laisser le DN Utilisateur et le mot de passe vides.",
"User Login Filter" => "Modèle d'authentification utilisateurs",
@@ -19,7 +21,9 @@
"without any placeholder, e.g. \"objectClass=posixGroup\"." => "sans élément de substitution, par exemple \"objectClass=posixGroup\".",
"Port" => "Port",
"Base User Tree" => "DN racine de l'arbre utilisateurs",
+"One User Base DN per line" => "Un DN racine utilisateur par ligne",
"Base Group Tree" => "DN racine de l'arbre groupes",
+"One Group Base DN per line" => "Un DN racine groupe par ligne",
"Group-Member association" => "Association groupe-membre",
"Use TLS" => "Utiliser TLS",
"Do not use it for SSL connections, it will fail." => "Ne pas utiliser pour les connexions SSL, car cela échouera.",
diff --git a/apps/user_ldap/l10n/lb.php b/apps/user_ldap/l10n/lb.php
index 2926538b5b0..6d70f682ddb 100644
--- a/apps/user_ldap/l10n/lb.php
+++ b/apps/user_ldap/l10n/lb.php
@@ -1,3 +1,4 @@
<?php $TRANSLATIONS = array(
+"Password" => "Passwuert",
"Help" => "Hëllef"
);
diff --git a/apps/user_ldap/l10n/ro.php b/apps/user_ldap/l10n/ro.php
index 3ab336cfffb..d83c890b747 100644
--- a/apps/user_ldap/l10n/ro.php
+++ b/apps/user_ldap/l10n/ro.php
@@ -1,8 +1,10 @@
<?php $TRANSLATIONS = array(
"<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour. Please ask your system administrator to disable one of them." => "<b>Atentie:</b> Apps user_ldap si user_webdavauth sunt incompatibile. Este posibil sa experimentati un comportament neasteptat. Vă rugăm să întrebați administratorul de sistem pentru a dezactiva una dintre ele.",
+"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Atenție</b> Modulul PHP LDAP nu este instalat, infrastructura nu va funcționa. Contactează administratorul sistemului pentru al instala.",
"Host" => "Gazdă",
"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Puteți omite protocolul, decât dacă folosiți SSL. Atunci se începe cu ldaps://",
"Base DN" => "DN de bază",
+"One Base DN per line" => "Un Base DN pe linie",
"You can specify Base DN for users and groups in the Advanced tab" => "Puteți să specificați DN de bază pentru utilizatori și grupuri în fila Avansat",
"User DN" => "DN al utilizatorului",
"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "DN-ul clientului utilizator cu care se va efectua conectarea, d.e. uid=agent,dc=example,dc=com. Pentru acces anonim, lăsăți DN și Parolă libere.",
@@ -19,7 +21,9 @@
"without any placeholder, e.g. \"objectClass=posixGroup\"." => "fără substituenți, d.e. \"objectClass=posixGroup\"",
"Port" => "Portul",
"Base User Tree" => "Arborele de bază al Utilizatorilor",
+"One User Base DN per line" => "Un User Base DN pe linie",
"Base Group Tree" => "Arborele de bază al Grupurilor",
+"One Group Base DN per line" => "Un Group Base DN pe linie",
"Group-Member association" => "Asocierea Grup-Membru",
"Use TLS" => "Utilizează TLS",
"Do not use it for SSL connections, it will fail." => "A nu se utiliza pentru conexiuni SSL, va eșua.",
diff --git a/apps/user_ldap/l10n/sv.php b/apps/user_ldap/l10n/sv.php
index 1e36ff91bab..25abfdd7ddb 100644
--- a/apps/user_ldap/l10n/sv.php
+++ b/apps/user_ldap/l10n/sv.php
@@ -1,8 +1,10 @@
<?php $TRANSLATIONS = array(
"<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour. Please ask your system administrator to disable one of them." => "<b>Varning:</b> Apps user_ldap och user_webdavauth är inkompatibla. Oväntade problem kan uppstå. Be din systemadministratör att inaktivera en av dom.",
+"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Varning:</b> PHP LDAP - modulen är inte installerad, serversidan kommer inte att fungera. Kontakta din systemadministratör för installation.",
"Host" => "Server",
"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Du behöver inte ange protokoll förutom om du använder SSL. Starta då med ldaps://",
"Base DN" => "Start DN",
+"One Base DN per line" => "Ett Start DN per rad",
"You can specify Base DN for users and groups in the Advanced tab" => "Du kan ange start DN för användare och grupper under fliken Avancerat",
"User DN" => "Användare DN",
"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "DN för användaren som skall användas, t.ex. uid=agent, dc=example, dc=com. För anonym åtkomst, lämna DN och lösenord tomt.",
@@ -19,7 +21,9 @@
"without any placeholder, e.g. \"objectClass=posixGroup\"." => "utan platshållare, t.ex. \"objectClass=posixGroup\".",
"Port" => "Port",
"Base User Tree" => "Bas för användare i katalogtjänst",
+"One User Base DN per line" => "En Användare start DN per rad",
"Base Group Tree" => "Bas för grupper i katalogtjänst",
+"One Group Base DN per line" => "En Grupp start DN per rad",
"Group-Member association" => "Attribut för gruppmedlemmar",
"Use TLS" => "Använd TLS",
"Do not use it for SSL connections, it will fail." => "Använd inte för SSL-anslutningar, det kommer inte att fungera.",
diff --git a/apps/user_ldap/l10n/th_TH.php b/apps/user_ldap/l10n/th_TH.php
index acc7a4936bc..e3a941c4244 100644
--- a/apps/user_ldap/l10n/th_TH.php
+++ b/apps/user_ldap/l10n/th_TH.php
@@ -1,7 +1,10 @@
<?php $TRANSLATIONS = array(
+"<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour. Please ask your system administrator to disable one of them." => "<b>คำเตือน:</b> แอปฯ user_ldap และ user_webdavauth ไม่สามารถใช้งานร่วมกันได้. คุณอาจประสพปัญหาที่ไม่คาดคิดจากเหตุการณ์ดังกล่าว กรุณาติดต่อผู้ดูแลระบบของคุณเพื่อระงับการใช้งานแอปฯ ตัวใดตัวหนึ่งข้างต้น",
+"<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>คำเตือน:</b> โมดูล PHP LDAP ยังไม่ได้ถูกติดตั้ง, ระบบด้านหลังจะไม่สามารถทำงานได้ กรุณาติดต่อผู้ดูแลระบบของคุณเพื่อทำการติดตั้งโมดูลดังกล่าว",
"Host" => "โฮสต์",
"You can omit the protocol, except you require SSL. Then start with ldaps://" => "คุณสามารถปล่อยช่องโปรโตคอลเว้นไว้ได้, ยกเว้นกรณีที่คุณต้องการใช้ SSL จากนั้นเริ่มต้นด้วย ldaps://",
"Base DN" => "DN ฐาน",
+"One Base DN per line" => "หนึ่ง Base DN ต่อบรรทัด",
"You can specify Base DN for users and groups in the Advanced tab" => "คุณสามารถระบุ DN หลักสำหรับผู้ใช้งานและกลุ่มต่างๆในแท็บขั้นสูงได้",
"User DN" => "DN ของผู้ใช้งาน",
"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "DN ของผู้ใช้งานที่เป็นลูกค้าอะไรก็ตามที่ผูกอยู่ด้วย เช่น uid=agent, dc=example, dc=com, สำหรับการเข้าถึงโดยบุคคลนิรนาม, ให้เว้นว่าง DN และ รหัสผ่านเอาไว้",
@@ -18,7 +21,9 @@
"without any placeholder, e.g. \"objectClass=posixGroup\"." => "โดยไม่ต้องมีตัวยึดใดๆ, เช่น \"objectClass=posixGroup\",",
"Port" => "พอร์ต",
"Base User Tree" => "รายการผู้ใช้งานหลักแบบ Tree",
+"One User Base DN per line" => "หนึ่ง User Base DN ต่อบรรทัด",
"Base Group Tree" => "รายการกลุ่มหลักแบบ Tree",
+"One Group Base DN per line" => "หนึ่ง Group Base DN ต่อบรรทัด",
"Group-Member association" => "ความสัมพันธ์ของสมาชิกในกลุ่ม",
"Use TLS" => "ใช้ TLS",
"Do not use it for SSL connections, it will fail." => "กรุณาอย่าใช้การเชื่อมต่อแบบ SSL การเชื่อมต่อจะเกิดการล้มเหลว",
diff --git a/apps/user_ldap/tests/group_ldap.php b/apps/user_ldap/tests/group_ldap.php
index f99902d32f5..ae635597b71 100644
--- a/apps/user_ldap/tests/group_ldap.php
+++ b/apps/user_ldap/tests/group_ldap.php
@@ -20,7 +20,7 @@
*
*/
-class Test_Group_Ldap extends UnitTestCase {
+class Test_Group_Ldap extends PHPUnit_Framework_TestCase {
function setUp() {
OC_Group::clearBackends();
}
diff --git a/apps/user_webdavauth/l10n/fr.php b/apps/user_webdavauth/l10n/fr.php
index 339931c7cee..9d528a3a9d2 100644
--- a/apps/user_webdavauth/l10n/fr.php
+++ b/apps/user_webdavauth/l10n/fr.php
@@ -1,3 +1,5 @@
<?php $TRANSLATIONS = array(
-"URL: http://" => "URL : http://"
+"WebDAV Authentication" => "Authentification WebDAV",
+"URL: http://" => "URL : http://",
+"ownCloud will send the user credentials to this URL. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "ownCloud enverra les informations de connexion à cette adresse. Ce module complémentaire analyse le code réponse HTTP et considère tout code différent des codes 401 et 403 comme associé à une authentification correcte."
);
diff --git a/apps/user_webdavauth/l10n/ro.php b/apps/user_webdavauth/l10n/ro.php
index 245a5101341..9df490e81ec 100644
--- a/apps/user_webdavauth/l10n/ro.php
+++ b/apps/user_webdavauth/l10n/ro.php
@@ -1,3 +1,5 @@
<?php $TRANSLATIONS = array(
-"URL: http://" => "URL: http://"
+"WebDAV Authentication" => "Autentificare WebDAV",
+"URL: http://" => "URL: http://",
+"ownCloud will send the user credentials to this URL. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "ownCloud va trimite datele de autentificare la acest URL. Acest modul verifică răspunsul și va interpreta codurile de status HTTP 401 sau 403 ca fiind date de autentificare invalide, și orice alt răspuns ca fiind date valide."
);
diff --git a/apps/user_webdavauth/l10n/sk_SK.php b/apps/user_webdavauth/l10n/sk_SK.php
index 9bd32954b05..6e34b818ed7 100644
--- a/apps/user_webdavauth/l10n/sk_SK.php
+++ b/apps/user_webdavauth/l10n/sk_SK.php
@@ -1,3 +1,4 @@
<?php $TRANSLATIONS = array(
-"WebDAV URL: http://" => "WebDAV URL: http://"
+"WebDAV Authentication" => "WebDAV overenie",
+"URL: http://" => "URL: http://"
);
diff --git a/apps/user_webdavauth/l10n/sv.php b/apps/user_webdavauth/l10n/sv.php
index 245a5101341..c79b35c27cd 100644
--- a/apps/user_webdavauth/l10n/sv.php
+++ b/apps/user_webdavauth/l10n/sv.php
@@ -1,3 +1,5 @@
<?php $TRANSLATIONS = array(
-"URL: http://" => "URL: http://"
+"WebDAV Authentication" => "WebDAV Autentisering",
+"URL: http://" => "URL: http://",
+"ownCloud will send the user credentials to this URL. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "ownCloud kommer skicka användaruppgifterna till denna URL. Denna plugin kontrollerar svaret och tolkar HTTP-statuskoderna 401 och 403 som felaktiga uppgifter, och alla andra svar som giltiga uppgifter."
);
diff --git a/apps/user_webdavauth/l10n/th_TH.php b/apps/user_webdavauth/l10n/th_TH.php
index 9bd32954b05..2bd1f685e65 100644
--- a/apps/user_webdavauth/l10n/th_TH.php
+++ b/apps/user_webdavauth/l10n/th_TH.php
@@ -1,3 +1,5 @@
<?php $TRANSLATIONS = array(
-"WebDAV URL: http://" => "WebDAV URL: http://"
+"WebDAV Authentication" => "WebDAV Authentication",
+"URL: http://" => "URL: http://",
+"ownCloud will send the user credentials to this URL. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "ownCloud จะส่งข้อมูลการเข้าใช้งานของผู้ใช้งานไปยังที่อยู่ URL ดังกล่าวนี้ ปลั๊กอินดังกล่าวจะทำการตรวจสอบข้อมูลที่โต้ตอบกลับมาและจะทำการแปลรหัส HTTP statuscodes 401 และ 403 ให้เป็นข้อมูลการเข้าใช้งานที่ไม่สามารถใช้งานได้ ส่วนข้อมูลอื่นๆที่เหลือทั้งหมดจะเป็นข้อมูลการเข้าใช้งานที่สามารถใช้งานได้"
);
diff --git a/apps/user_webdavauth/l10n/zh_CN.php b/apps/user_webdavauth/l10n/zh_CN.php
index 5b06409b42e..72d2a0c11df 100644
--- a/apps/user_webdavauth/l10n/zh_CN.php
+++ b/apps/user_webdavauth/l10n/zh_CN.php
@@ -1,3 +1,5 @@
<?php $TRANSLATIONS = array(
-"URL: http://" => "URL:http://"
+"WebDAV Authentication" => "WebDAV 认证",
+"URL: http://" => "URL:http://",
+"ownCloud will send the user credentials to this URL. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "ownCloud 将会发送用户的身份到此 URL。这个插件检查返回值并且将 HTTP 状态编码 401 和 403 解释为非法身份,其他所有返回值为合法身份。"
);