Merge branch 'master' into fixing-4546-master

Conflicts:
	lib/private/connector/sabre/directory.php
This commit is contained in:
Thomas Müller 2013-10-07 17:47:54 +02:00
commit 5e397d89c4
1186 changed files with 36962 additions and 20281 deletions

View File

@ -3,10 +3,6 @@
// only need filesystem apps
$RUNTIME_APPTYPES=array('filesystem');
// Init owncloud
require_once 'lib/template.php';
OCP\JSON::checkLoggedIn();
// Load the files
@ -26,7 +22,7 @@ $files = array();
if($mimetypes && !in_array('httpd/unix-directory', $mimetypes)) {
foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, 'httpd/unix-directory' ) as $file ) {
$file['directory'] = $dir;
$file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']);
$file['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($file['mimetype']);
$file["date"] = OCP\Util::formatDate($file["mtime"]);
$file['mimetype_icon'] = \OCA\Files\Helper::determineIcon($file);
$files[] = $file;
@ -37,7 +33,7 @@ if (is_array($mimetypes) && count($mimetypes)) {
foreach ($mimetypes as $mimetype) {
foreach( \OC\Files\Filesystem::getDirectoryContent( $dir, $mimetype ) as $file ) {
$file['directory'] = $dir;
$file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']);
$file['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($file['mimetype']);
$file["date"] = OCP\Util::formatDate($file["mtime"]);
$file['mimetype_icon'] = \OCA\Files\Helper::determineIcon($file);
$files[] = $file;
@ -46,7 +42,7 @@ if (is_array($mimetypes) && count($mimetypes)) {
} else {
foreach( \OC\Files\Filesystem::getDirectoryContent( $dir ) as $file ) {
$file['directory'] = $dir;
$file['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($file['mimetype']);
$file['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($file['mimetype']);
$file["date"] = OCP\Util::formatDate($file["mtime"]);
$file['mimetype_icon'] = \OCA\Files\Helper::determineIcon($file);
$files[] = $file;

View File

@ -7,68 +7,55 @@
.actions input, .actions button, .actions .button { margin:0; float:left; }
.actions .button a { color: #555; }
.actions .button a:hover, .actions .button a:active { color: #333; }
#new {
height:17px; margin:0 0 0 1em; z-index:1010; float:left;
#new, #trash {
z-index: 1010;
float: left;
padding: 0 !important; /* override default control bar button padding */
}
#trash {
margin-right: 12px;
float: right;
}
#new>a, #trash>a {
padding: 14px 10px;
position: relative;
top: 7px;
}
#new.active {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
border-bottom: none;
}
#new.active { border-bottom-left-radius:0; border-bottom-right-radius:0; border-bottom:none; }
#new>a { padding:.5em 1.2em .3em; }
#new>ul {
display:none; position:fixed; min-width:7em; z-index:10;
padding:.5em; padding-bottom:0; margin-top:.075em; margin-left:-.5em;
display: none;
position: fixed;
min-width: 7em;
z-index: 10;
padding: .5em;
padding-bottom: 0;
margin-top: 14px;
margin-left: -1px;
text-align:left;
background:#f8f8f8; border:1px solid #ddd; border-radius:10px; border-top-left-radius:0;
background: #f8f8f8;
border: 1px solid #ddd;
border-radius: 5px;
border-top-left-radius: 0;
box-shadow:0 2px 7px rgba(170,170,170,.4);
}
#new>ul>li { height:36px; margin:.3em; padding-left:3em; padding-bottom:0.1em;
background-repeat:no-repeat; cursor:pointer; }
#new>ul>li>p { cursor:pointer; padding-top: 7px; padding-bottom: 7px;}
#new>ul>li>form>input {
padding: 5px;
margin: 2px 0;
}
#trash { margin: 0 1em; z-index:1010; float: right; }
#upload {
height:27px; padding:0; margin-left:0.2em; overflow:hidden;
}
#upload a {
position:relative; display:block; width:100%; height:27px;
cursor:pointer; z-index:10;
background-image:url('%webroot%/core/img/actions/upload.svg');
background-repeat:no-repeat;
background-position:7px 6px;
opacity:0.65;
}
.file_upload_target { display:none; }
.file_upload_form { display:inline; float:left; margin:0; padding:0; cursor:pointer; overflow:visible; }
#file_upload_start {
left:0; top:0; width:28px; height:27px; padding:0;
font-size:1em;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0;
z-index:20; position:relative; cursor:pointer; overflow:hidden;
}
#uploadprogresswrapper {
position: relative;
display: inline;
}
#uploadprogressbar {
position:relative;
float: left;
margin-left: 12px;
width: 130px;
height: 26px;
display:inline-block;
}
#uploadprogressbar + stop {
font-size: 13px;
}
/* FILE TABLE */
#filestable { position: relative; top:37px; width:100%; }
#filestable {
position: relative;
top: 44px;
width: 100%;
}
#filestable tbody tr { background-color:#fff; height:2.5em; }
#filestable tbody tr:hover, tbody tr:active {
background-color: rgb(240,240,240);
@ -122,12 +109,21 @@ table th#headerDate, table td.date {
/* Multiselect bar */
#filestable.multiselect {
top: 88px;
top: 95px;
}
table.multiselect thead {
position: fixed;
top: 89px;
z-index: 10;
-moz-box-sizing: border-box;
box-sizing: border-box;
left: 0;
padding-left: 80px;
width: 100%;
}
table.multiselect thead { position:fixed; top:82px; z-index:1; -moz-box-sizing: border-box; box-sizing: border-box; left: 0; padding-left: 80px; width:100%; }
table.multiselect thead th {
background-color: rgba(210,210,210,.7);
background-color: rgba(220,220,220,.8);
color: #000;
font-weight: bold;
border-bottom: 0;
@ -228,14 +224,19 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; }
-webkit-transition:background-image 500ms; -moz-transition:background-image 500ms; -o-transition:background-image 500ms; transition:background-image 500ms;
}
#fileList tr td.filename a.name label {
position: absolute;
width: 100%;
height: 50px;
}
#uploadsize-message,#delete-confirm { display:none; }
/* File actions */
.fileactions {
position: absolute;
top: 16px;
top: 14px;
right: 0;
font-size: 11px;
}
#fileList tr:hover .fileactions { /* background to distinguish when overlaying with file names */
background-color: rgba(240,240,240,0.898);
@ -245,7 +246,6 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; }
background-color: rgba(230,230,230,.9);
box-shadow: -5px 0 7px rgba(230,230,230,.9);
}
#fileList .fileactions a.action img { position:relative; top:.2em; }
#fileList img.move2trash { display:inline; margin:-.5em 0; padding:1em .5em 1em .5em !important; float:right; }
#fileList a.action.delete {
@ -319,8 +319,6 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; }
#scanning-message{ top:40%; left:40%; position:absolute; display:none; }
div.crumb a{ padding:0.9em 0 0.7em 0; color:#555; }
table.dragshadow {
width:auto;
}

View File

@ -1,38 +1,63 @@
#upload {
height:27px; padding:0; margin-left:0.2em; overflow:hidden;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
height: 36px;
width: 39px;
padding: 0 !important; /* override default control bar button padding */
margin-left: .2em;
overflow: hidden;
vertical-align: top;
}
#upload a {
position:relative; display:block; width:100%; height:27px;
cursor:pointer; z-index:10;
background-image:url('%webroot%/core/img/actions/upload.svg');
background-repeat:no-repeat;
background-position:7px 6px;
opacity:0.65;
position: relative;
display: block;
width: 100%;
height: 44px;
width: 44px;
margin: -5px -3px;
cursor: pointer;
z-index: 10;
background-image: url('%webroot%/core/img/actions/upload.svg');
background-repeat: no-repeat;
background-position: center;
opacity: .65;
}
.file_upload_target { display:none; }
.file_upload_form { display:inline; float:left; margin:0; padding:0; cursor:pointer; overflow:visible; }
#file_upload_start {
float: left;
left:0; top:0; width:28px; height:27px; padding:0;
font-size:1em;
position: relative;
left: 0;
top: 0;
width: 44px;
height: 44px;
margin: -5px -3px;
padding: 0;
font-size: 1em;
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0;
z-index:20; position:relative; cursor:pointer; overflow:hidden;
z-index: 20;
cursor: pointer;
overflow: hidden;
}
#uploadprogresswrapper {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
display: inline-block;
vertical-align: top;
margin:0.3em;
height: 29px;
height: 36px;
box-sizing: border-box;
}
#uploadprogresswrapper > input[type='button'] {
height: 36px;
}
#uploadprogressbar {
position:relative;
float: left;
margin-left: 12px;
width: 130px;
height: 26px;
height: 36px;
display:inline-block;
}
#uploadprogressbar + stop {

View File

@ -104,8 +104,12 @@ if ($needUpgrade) {
$storageInfo=OC_Helper::getStorageInfo($dir);
$maxUploadFilesize=OCP\Util::maxUploadFilesize($dir);
$publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes');
// if the encryption app is disabled, than everything is fine (INIT_SUCCESSFUL status code)
$encryptionInitStatus = 2;
if (OC_App::isEnabled('files_encryption')) {
$publicUploadEnabled = 'no';
$session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
$encryptionInitStatus = $session->getInitialized();
}
$trashEnabled = \OCP\App::isEnabled('files_trashbin');
@ -113,7 +117,7 @@ if ($needUpgrade) {
if ($trashEnabled) {
$trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user);
}
OCP\Util::addscript('files', 'fileactions');
OCP\Util::addscript('files', 'files');
OCP\Util::addscript('files', 'keyboardshortcuts');
@ -133,7 +137,10 @@ if ($needUpgrade) {
$tmpl->assign('isPublic', false);
$tmpl->assign('publicUploadEnabled', $publicUploadEnabled);
$tmpl->assign("encryptedFiles", \OCP\Util::encryptedFiles());
$tmpl->assign("mailNotificationEnabled", \OC_Appconfig::getValue('core', 'shareapi_allow_mail_notification', 'yes'));
$tmpl->assign("encryptionInitStatus", $encryptionInitStatus);
$tmpl->assign('disableSharing', false);
$tmpl->assign('ajaxLoad', $ajaxLoad);
$tmpl->printPage();
}

View File

@ -41,26 +41,6 @@ function supportAjaxUploadWithProgress() {
*/
OC.Upload = {
_uploads: [],
/**
* cancels a single upload,
* @deprecated because it was only used when a file currently beeing uploaded was deleted. Now they are added after
* they have been uploaded.
* @param {string} dir
* @param {string} filename
* @returns {unresolved}
*/
cancelUpload:function(dir, filename) {
var self = this;
var deleted = false;
//FIXME _selections
jQuery.each(this._uploads, function(i, jqXHR) {
if (selection.dir === dir && selection.uploads[filename]) {
deleted = self.deleteSelectionUpload(selection, filename);
return false; // end searching through selections
}
});
return deleted;
},
/**
* deletes the jqHXR object from a data selection
* @param {object} data

View File

@ -177,20 +177,7 @@ $(document).ready(function () {
FileActions.register('all', 'Delete', OC.PERMISSION_DELETE, function () {
return OC.imagePath('core', 'actions/delete');
}, function (filename) {
if (OC.Upload.cancelUpload($('#dir').val(), filename)) {
if (filename.substr) {
filename = [filename];
}
$.each(filename, function (index, file) {
var filename = $('tr').filterAttr('data-file', file);
filename.hide();
filename.find('input[type="checkbox"]').removeAttr('checked');
filename.removeClass('selected');
});
procesSelection();
} else {
FileList.do_delete(filename);
}
FileList.do_delete(filename);
$('.tipsy').remove();
});

View File

@ -804,7 +804,7 @@ $(document).ready(function(){
data.context.attr('data-mime',file.mime).attr('data-id',file.id);
var permissions = data.context.data('permissions');
if(permissions != file.permissions) {
if(permissions !== file.permissions) {
data.context.attr('data-permissions', file.permissions);
data.context.data('permissions', file.permissions);
}
@ -895,6 +895,10 @@ $(document).ready(function(){
$(window).trigger('beforeunload');
});
function decodeQuery(query){
return query.replace(/\+/g, ' ');
}
function parseHashQuery(){
var hash = window.location.hash,
pos = hash.indexOf('?'),
@ -911,11 +915,11 @@ $(document).ready(function(){
dir = '/';
// try and parse from URL hash first
if (query){
params = OC.parseQueryString(query);
params = OC.parseQueryString(decodeQuery(query));
}
// else read from query attributes
if (!params){
params = OC.parseQueryString(location.search);
params = OC.parseQueryString(decodeQuery(location.search));
}
return (params && params.dir) || '/';
}

View File

@ -63,6 +63,15 @@ Files={
}
var encryptedFiles = $('#encryptedFiles').val();
var initStatus = $('#encryptionInitStatus').val();
if (initStatus === '0') { // enc not initialized, but should be
OC.Notification.show(t('files_encryption', 'Encryption App is enabled but your keys are not initialized, please log-out and log-in again'));
return;
}
if (initStatus === '1') { // encryption tried to init but failed
OC.Notification.showHtml(t('files_encryption', 'Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.'));
return;
}
if (encryptedFiles === '1') {
OC.Notification.show(t('files_encryption', 'Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files.'));
return;
@ -89,6 +98,8 @@ Files={
lastWidth: 0,
initBreadCrumbs: function () {
var $controls = $('#controls');
Files.lastWidth = 0;
Files.breadcrumbs = [];
@ -109,7 +120,10 @@ Files={
});
// event handlers for breadcrumb items
$('#controls .crumb a').on('click', onClickBreadcrumb);
$controls.find('.crumb a').on('click', onClickBreadcrumb);
// setup drag and drop
$controls.find('.crumb:not(.last)').droppable(crumbDropOptions);
},
resizeBreadcrumbs: function (width, firstRun) {
@ -167,11 +181,8 @@ $(document).ready(function() {
$('#file_action_panel').attr('activeAction', false);
$('div.crumb:not(.last)').droppable(crumbDropOptions);
$('ul#apps>li:first-child').data('dir','');
if($('div.crumb').length){
$('ul#apps>li:first-child').droppable(crumbDropOptions);
}
// allow dropping on the "files" app icon
$('ul#apps li:first-child').data('dir','').droppable(crumbDropOptions);
// Triggers invisible file input
$('#upload a').on('click', function() {
@ -358,7 +369,7 @@ $(document).ready(function() {
}
});
}
//scroll to and highlight preselected file
if (getURLParameter('scrollto')) {
FileList.scrollTo(getURLParameter('scrollto'));
@ -636,7 +647,7 @@ function lazyLoadPreview(path, mime, ready, width, height) {
// get mime icon url
getMimeIcon(mime, function(iconURL) {
ready(iconURL); // set mimeicon URL
// now try getting a preview thumbnail URL
if ( ! width ) {
width = $('#filestable').data('preview-x');
@ -645,9 +656,9 @@ function lazyLoadPreview(path, mime, ready, width, height) {
height = $('#filestable').data('preview-y');
}
if( $('#publicUploadButtonMock').length ) {
var previewURL = OC.Router.generate('core_ajax_public_preview', {file: encodeURIComponent(path), x:width, y:height, t:$('#dirToken').val()});
var previewURL = OC.Router.generate('core_ajax_public_preview', {file: path, x:width, y:height, t:$('#dirToken').val()});
} else {
var previewURL = OC.Router.generate('core_ajax_preview', {file: encodeURIComponent(path), x:width, y:height});
var previewURL = OC.Router.generate('core_ajax_preview', {file: path, x:width, y:height});
}
$.get(previewURL, function() {
previewURL = previewURL.replace('(', '%28');

View File

@ -13,10 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "المجلد المؤقت غير موجود",
"Failed to write to disk" => "خطأ في الكتابة على القرص الصلب",
"Not enough storage available" => "لا يوجد مساحة تخزينية كافية",
"Upload failed. Could not get file info." => "فشلت عملية الرفع. تعذر الحصول على معلومات الملف.",
"Upload failed. Could not find uploaded file" => "*فشلت علمية الرفع. تعذر إيجاد الملف الذي تم رفعه.\n*فشلت علمية التحميل. تعذر إيجاد الملف الذي تم تحميله.",
"Invalid directory." => "مسار غير صحيح.",
"Files" => "الملفات",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "تعذر رفع الملف {filename} إما لأنه مجلد أو لان حجم الملف 0 بايت",
"Not enough space available" => "لا توجد مساحة كافية",
"Upload cancelled." => "تم إلغاء عملية رفع الملفات .",
"Could not get result from server." => "تعذر الحصول على نتيجة من الخادم",
"File upload is in progress. Leaving the page now will cancel the upload." => "عملية رفع الملفات قيد التنفيذ. اغلاق الصفحة سوف يلغي عملية رفع الملفات.",
"URL cannot be empty." => "عنوان ال URL لا يجوز أن يكون فارغا.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "تسمية ملف غير صالحة. استخدام الاسم \"shared\" محجوز بواسطة ownCloud",
@ -31,20 +35,24 @@ $TRANSLATIONS = array(
"cancel" => "إلغاء",
"replaced {new_name} with {old_name}" => "استبدل {new_name} بـ {old_name}",
"undo" => "تراجع",
"_%n folder_::_%n folders_" => array("","","","","",""),
"_%n file_::_%n files_" => array("","","","","",""),
"_%n folder_::_%n folders_" => array("لا يوجد مجلدات %n","1 مجلد %n","2 مجلد %n","عدد قليل من مجلدات %n","عدد كبير من مجلدات %n","مجلدات %n"),
"_%n file_::_%n files_" => array("لا يوجد ملفات %n","ملف %n","2 ملف %n","قليل من ملفات %n","الكثير من ملفات %n"," ملفات %n"),
"{dirs} and {files}" => "{dirs} و {files}",
"_Uploading %n file_::_Uploading %n files_" => array("","","","","",""),
"_Uploading %n file_::_Uploading %n files_" => array("لا يوجد ملفات %n لتحميلها","تحميل 1 ملف %n","تحميل 2 ملف %n","يتم تحميل عدد قليل من ملفات %n","يتم تحميل عدد كبير من ملفات %n","يتم تحميل ملفات %n"),
"'.' is an invalid file name." => "\".\" اسم ملف غير صحيح.",
"File name cannot be empty." => "اسم الملف لا يجوز أن يكون فارغا",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "اسم غير صحيح , الرموز '\\', '/', '<', '>', ':', '\"', '|', '?' و \"*\" غير مسموح استخدامها",
"Your storage is full, files can not be updated or synced anymore!" => "مساحتك التخزينية ممتلئة, لا يمكم تحديث ملفاتك أو مزامنتها بعد الآن !",
"Your storage is almost full ({usedSpacePercent}%)" => "مساحتك التخزينية امتلأت تقريبا ",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "تم تمكين تشفير البرامج لكن لم يتم تهيئة المفاتيح لذا يرجى تسجيل الخروج ثم تسجيل الدخول مرة آخرى.",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "المفتاح الخاص بتشفير التطبيقات غير صالح. يرجى تحديث كلمة السر الخاصة بالمفتاح الخاص من الإعدادت الشخصية حتى تتمكن من الوصول للملفات المشفرة.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "تم تعطيل التشفير لكن ملفاتك لا تزال مشفرة. فضلا اذهب إلى الإعدادات الشخصية لإزالة التشفير عن ملفاتك.",
"Your download is being prepared. This might take some time if the files are big." => "جاري تجهيز عملية التحميل. قد تستغرق بعض الوقت اذا كان حجم الملفات كبير.",
"Error moving file" => "حدث خطأ أثناء نقل الملف",
"Name" => "اسم",
"Size" => "حجم",
"Modified" => "معدل",
"%s could not be renamed" => "%s لا يمكن إعادة تسميته. ",
"Upload" => "رفع",
"File handling" => "التعامل مع الملف",
"Maximum upload size" => "الحد الأقصى لحجم الملفات التي يمكن رفعها",

View File

@ -42,6 +42,7 @@ $TRANSLATIONS = array(
"Your storage is almost full ({usedSpacePercent}%)" => "Vaše úložiště je téměř plné ({usedSpacePercent}%)",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifrování bylo vypnuto, vaše soubory jsou však stále zašifrované. Běžte prosím do osobního nastavení, kde soubory odšifrujete.",
"Your download is being prepared. This might take some time if the files are big." => "Vaše soubory ke stažení se připravují. Pokud jsou velké, může to chvíli trvat.",
"Error moving file" => "Chyba při přesunu souboru",
"Name" => "Název",
"Size" => "Velikost",
"Modified" => "Upraveno",

View File

@ -13,10 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Manglende midlertidig mappe.",
"Failed to write to disk" => "Fejl ved skrivning til disk.",
"Not enough storage available" => "Der er ikke nok plads til rådlighed",
"Upload failed. Could not get file info." => "Upload fejlede. Kunne ikke hente filinformation.",
"Upload failed. Could not find uploaded file" => "Upload fejlede. Kunne ikke finde den uploadede fil.",
"Invalid directory." => "Ugyldig mappe.",
"Files" => "Filer",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Kan ikke upload {filename} da det er enten en mappe eller indholder 0 bytes.",
"Not enough space available" => "ikke nok tilgængelig ledig plads ",
"Upload cancelled." => "Upload afbrudt.",
"Could not get result from server." => "Kunne ikke hente resultat fra server.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Fil upload kører. Hvis du forlader siden nu, vil uploadet blive annuleret.",
"URL cannot be empty." => "URLen kan ikke være tom.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Ugyldigt mappenavn. Brug af 'Shared' er forbeholdt af ownCloud",
@ -42,6 +46,7 @@ $TRANSLATIONS = array(
"Your storage is almost full ({usedSpacePercent}%)" => "Din opbevaringsplads er næsten fyldt op ({usedSpacePercent}%)",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Krypteringen blev deaktiveret, men dine filer er stadig krypteret. Gå venligst til dine personlige indstillinger for at dekryptere dine filer. ",
"Your download is being prepared. This might take some time if the files are big." => "Dit download forberedes. Dette kan tage lidt tid ved større filer.",
"Error moving file" => "Fejl ved flytning af fil",
"Name" => "Navn",
"Size" => "Størrelse",
"Modified" => "Ændret",

View File

@ -44,6 +44,8 @@ $TRANSLATIONS = array(
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.",
"Your storage is full, files can not be updated or synced anymore!" => "Dein Speicher ist voll, daher können keine Dateien mehr aktualisiert oder synchronisiert werden!",
"Your storage is almost full ({usedSpacePercent}%)" => "Dein Speicher ist fast voll ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Verschlüsselung-App ist aktiviert aber Deine Schlüssel sind nicht initialisiert. Bitte melden sich nochmals ab und wieder an.",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ungültiger privater Schlüssel für die Verschlüsselung-App. Bitte aktualisiere dein privates Schlüssel-Passwort um den Zugriff auf Deine verschlüsselten Dateien wiederherzustellen.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Die Verschlüsselung wurde deaktiviert, jedoch sind deine Dateien nach wie vor verschlüsselt. Bitte gehe zu deinen persönlichen Einstellungen, um deine Dateien zu entschlüsseln.",
"Your download is being prepared. This might take some time if the files are big." => "Dein Download wird vorbereitet. Dies kann bei größeren Dateien etwas dauern.",
"Error moving file" => "Fehler beim Verschieben der Datei",

View File

@ -44,6 +44,8 @@ $TRANSLATIONS = array(
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.",
"Your storage is full, files can not be updated or synced anymore!" => "Ihr Speicher ist voll, daher können keine Dateien mehr aktualisiert oder synchronisiert werden!",
"Your storage is almost full ({usedSpacePercent}%)" => "Ihr Speicher ist fast voll ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Verschlüsselung-App ist aktiviert aber Ihre Schlüssel sind nicht initialisiert. Bitte melden sich nochmals ab und wieder an.",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Ungültiger privater Schlüssel für die Verschlüsselung-App. Bitte aktualisieren Sie Ihr privates Schlüssel-Passwort um den Zugriff auf Ihre verschlüsselten Dateien wiederherzustellen.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Die Verschlüsselung wurde deaktiviert, jedoch sind Ihre Dateien nach wie vor verschlüsselt. Bitte gehen Sie zu Ihren persönlichen Einstellungen, um Ihre Dateien zu entschlüsseln.",
"Your download is being prepared. This might take some time if the files are big." => "Ihr Download wird vorbereitet. Dies kann bei größeren Dateien etwas dauern.",
"Error moving file" => "Fehler beim Verschieben der Datei",

View File

@ -13,10 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Falta la carpeta temporal",
"Failed to write to disk" => "Falló al escribir al disco",
"Not enough storage available" => "No hay suficiente espacio disponible",
"Upload failed. Could not get file info." => "Actualización fallida. No se pudo obtener información del archivo.",
"Upload failed. Could not find uploaded file" => "Actualización fallida. No se pudo encontrar el archivo subido",
"Invalid directory." => "Directorio inválido.",
"Files" => "Archivos",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "No ha sido posible subir {filename} porque es un directorio o tiene 0 bytes",
"Not enough space available" => "No hay suficiente espacio disponible",
"Upload cancelled." => "Subida cancelada.",
"Could not get result from server." => "No se pudo obtener respuesta del servidor.",
"File upload is in progress. Leaving the page now will cancel the upload." => "La subida del archivo está en proceso. Si sale de la página ahora cancelará la subida.",
"URL cannot be empty." => "La URL no puede estar vacía.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nombre de carpeta invalido. El uso de \"Shared\" está reservado por ownCloud",
@ -42,6 +46,7 @@ $TRANSLATIONS = array(
"Your storage is almost full ({usedSpacePercent}%)" => "Su almacenamiento está casi lleno ({usedSpacePercent}%)",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "El cifrado ha sido deshabilitado pero tus archivos permanecen cifrados. Por favor, ve a tus ajustes personales para descifrar tus archivos.",
"Your download is being prepared. This might take some time if the files are big." => "Su descarga está siendo preparada. Esto puede tardar algún tiempo si los archivos son grandes.",
"Error moving file" => "Error moviendo archivo",
"Name" => "Nombre",
"Size" => "Tamaño",
"Modified" => "Modificado",

View File

@ -13,10 +13,13 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Ajutiste failide kaust puudub",
"Failed to write to disk" => "Kettale kirjutamine ebaõnnestus",
"Not enough storage available" => "Saadaval pole piisavalt ruumi",
"Upload failed. Could not get file info." => "Üleslaadimine ebaõnnestus. Faili info hankimine ebaõnnestus.",
"Upload failed. Could not find uploaded file" => "Üleslaadimine ebaõnnestus. Üleslaetud faili ei leitud",
"Invalid directory." => "Vigane kaust.",
"Files" => "Failid",
"Not enough space available" => "Pole piisavalt ruumi",
"Upload cancelled." => "Üleslaadimine tühistati.",
"Could not get result from server." => "Serverist ei saadud tulemusi",
"File upload is in progress. Leaving the page now will cancel the upload." => "Faili üleslaadimine on töös. Lehelt lahkumine katkestab selle üleslaadimise.",
"URL cannot be empty." => "URL ei saa olla tühi.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Vigane kausta nimi. 'Shared' kasutamine on reserveeritud ownCloud poolt.",
@ -42,6 +45,7 @@ $TRANSLATIONS = array(
"Your storage is almost full ({usedSpacePercent}%)" => "Su andmemaht on peaaegu täis ({usedSpacePercent}%)",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Krüpteering on keelatud, kuid sinu failid on endiselt krüpteeritud. Palun vaata oma personaalseid seadeid oma failide dekrüpteerimiseks.",
"Your download is being prepared. This might take some time if the files are big." => "Valmistatakse allalaadimist. See võib võtta veidi aega, kui on tegu suurte failidega. ",
"Error moving file" => "Viga faili eemaldamisel",
"Name" => "Nimi",
"Size" => "Suurus",
"Modified" => "Muudetud",

View File

@ -13,10 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Aldi bateko karpeta falta da",
"Failed to write to disk" => "Errore bat izan da diskoan idazterakoan",
"Not enough storage available" => "Ez dago behar aina leku erabilgarri,",
"Upload failed. Could not get file info." => "Igoerak huts egin du. Ezin izan da fitxategiaren informazioa eskuratu.",
"Upload failed. Could not find uploaded file" => "Igoerak huts egin du. Ezin izan da igotako fitxategia aurkitu",
"Invalid directory." => "Baliogabeko karpeta.",
"Files" => "Fitxategiak",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Ezin da {filename} igo karpeta bat delako edo 0 byte dituelako",
"Not enough space available" => "Ez dago leku nahikorik.",
"Upload cancelled." => "Igoera ezeztatuta",
"Could not get result from server." => "Ezin da zerbitzaritik emaitzik lortu",
"File upload is in progress. Leaving the page now will cancel the upload." => "Fitxategien igoera martxan da. Orria orain uzteak igoera ezeztatutko du.",
"URL cannot be empty." => "URLa ezin da hutsik egon.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Karpeta izne baliogabea. \"Shared\" karpeta erabilpena OwnCloudentzat erreserbaturik dago.",
@ -33,14 +37,18 @@ $TRANSLATIONS = array(
"undo" => "desegin",
"_%n folder_::_%n folders_" => array("karpeta %n","%n karpeta"),
"_%n file_::_%n files_" => array("fitxategi %n","%n fitxategi"),
"{dirs} and {files}" => "{dirs} eta {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Fitxategi %n igotzen","%n fitxategi igotzen"),
"'.' 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})",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Enkriptazio aplikazioa gaituta dago baina zure gakoak ez daude konfiguratuta, mesedez saioa bukatu eta berriro hasi",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Enkriptazio aplikaziorako gako pribatu okerra. Mesedez eguneratu zure gako pribatuaren pasahitza zure ezarpen pertsonaletan zure enkriptatuko fitxategietarako sarrera berreskuratzeko.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Enkriptazioa desgaitua izan da baina zure fitxategiak oraindik enkriptatuta daude. Mesedez jo zure ezarpen pertsonaletara zure fitxategiak dekodifikatzeko.",
"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. ",
"Error moving file" => "Errorea fitxategia mugitzean",
"Name" => "Izena",
"Size" => "Tamaina",
"Modified" => "Aldatuta",

View File

@ -44,6 +44,8 @@ $TRANSLATIONS = array(
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome incorrecto, non se permite «\\», «/», «<», «>», «:», «\"», «|», «?» e «*».",
"Your storage is full, files can not be updated or synced anymore!" => "O seu espazo de almacenamento está cheo, non é posíbel actualizar ou sincronizar máis os ficheiros!",
"Your storage is almost full ({usedSpacePercent}%)" => "O seu espazo de almacenamento está case cheo ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "O aplicativo de cifrado está activado, mais as chaves non foron inicializadas, saia da sesión e volva a acceder de novo",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "A chave privada para o aplicativo de cifrado non é correcta. Actualice o contrasinal da súa chave privada nos seus axustes persoais para recuperar o acceso aos seus ficheiros cifrados.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "O cifrado foi desactivado, mais os ficheiros están cifrados. Vaia á configuración persoal para descifrar os ficheiros.",
"Your download is being prepared. This might take some time if the files are big." => "Está a prepararse a súa descarga. Isto pode levar bastante tempo se os ficheiros son grandes.",
"Error moving file" => "Produciuse un erro ao mover o ficheiro",

View File

@ -13,11 +13,11 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Manca una cartella temporanea",
"Failed to write to disk" => "Scrittura su disco non riuscita",
"Not enough storage available" => "Spazio di archiviazione insufficiente",
"Upload failed. Could not get file info." => "Upload fallito. Impossibile ottenere informazioni sul file",
"Upload failed. Could not find uploaded file" => "Upload fallit. Impossibile trovare file caricato",
"Upload failed. Could not get file info." => "Caricamento non riuscito. Impossibile ottenere informazioni sul file.",
"Upload failed. Could not find uploaded file" => "Caricamento non riuscito. Impossibile trovare il file caricato.",
"Invalid directory." => "Cartella non valida.",
"Files" => "File",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Impossibile caricare {filename} poiché è una cartella oppure è di 0 byte",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Impossibile caricare {filename} poiché è una cartella oppure ha una dimensione di 0 byte.",
"Not enough space available" => "Spazio disponibile insufficiente",
"Upload cancelled." => "Invio annullato",
"Could not get result from server." => "Impossibile ottenere il risultato dal server.",
@ -44,6 +44,8 @@ $TRANSLATIONS = array(
"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}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "L'applicazione di cifratura è abilitata, ma le chiavi non sono state inizializzate, disconnettiti ed effettua nuovamente l'accesso",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Chiave privata non valida per l'applicazione di cifratura. Aggiorna la password della chiave privata nelle impostazioni personali per ripristinare l'accesso ai tuoi file cifrati.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "La cifratura è stata disabilitata ma i tuoi file sono ancora cifrati. Vai nelle impostazioni personali per decifrare i file.",
"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.",
"Error moving file" => "Errore durante lo spostamento del file",

View File

@ -13,10 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "一時保存フォルダが見つかりません",
"Failed to write to disk" => "ディスクへの書き込みに失敗しました",
"Not enough storage available" => "ストレージに十分な空き容量がありません",
"Upload failed. Could not get file info." => "アップロードに失敗。ファイル情報を取得できませんでした。",
"Upload failed. Could not find uploaded file" => "アップロードに失敗。アップロード済みのファイルを見つけることができませんでした。",
"Invalid directory." => "無効なディレクトリです。",
"Files" => "ファイル",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "ディレクトリもしくは0バイトのため {filename} をアップロードできません",
"Not enough space available" => "利用可能なスペースが十分にありません",
"Upload cancelled." => "アップロードはキャンセルされました。",
"Could not get result from server." => "サーバから結果を取得できませんでした。",
"File upload is in progress. Leaving the page now will cancel the upload." => "ファイル転送を実行中です。今このページから移動するとアップロードが中止されます。",
"URL cannot be empty." => "URLは空にできません。",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "無効なフォルダ名です。'Shared' の利用はownCloudで予約済みです",
@ -42,6 +46,7 @@ $TRANSLATIONS = array(
"Your storage is almost full ({usedSpacePercent}%)" => "あなたのストレージはほぼ一杯です({usedSpacePercent}%",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "暗号化の機能は無効化されましたが、ファイルはすでに暗号化されています。個人設定からファイルを複合を行ってください。",
"Your download is being prepared. This might take some time if the files are big." => "ダウンロードの準備中です。ファイルサイズが大きい場合は少し時間がかかるかもしれません。",
"Error moving file" => "ファイルの移動エラー",
"Name" => "名前",
"Size" => "サイズ",
"Modified" => "変更",

View File

@ -2,6 +2,8 @@
$TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "%s 항목을 이동시키지 못하였음 - 파일 이름이 이미 존재함",
"Could not move %s" => "%s 항목을 이딩시키지 못하였음",
"Unable to set upload directory." => "업로드 디렉터리를 정할수 없습니다",
"Invalid Token" => "잘못된 토큰",
"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의 upload_max_filesize보다 큽니다:",
@ -11,12 +13,17 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "임시 폴더가 없음",
"Failed to write to disk" => "디스크에 쓰지 못했습니다",
"Not enough storage available" => "저장소가 용량이 충분하지 않습니다.",
"Upload failed. Could not get file info." => "업로드에 실패했습니다. 파일 정보를 가져올수 없습니다.",
"Upload failed. Could not find uploaded file" => "업로드에 실패했습니다. 업로드할 파일을 찾을수 없습니다",
"Invalid directory." => "올바르지 않은 디렉터리입니다.",
"Files" => "파일",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "{filename}을 업로드 할수 없습니다. 폴더이거나 0 바이트 파일입니다.",
"Not enough space available" => "여유 공간이 부족합니다",
"Upload cancelled." => "업로드가 취소되었습니다.",
"Could not get result from server." => "서버에서 결과를 가져올수 없습니다.",
"File upload is in progress. Leaving the page now will cancel the upload." => "파일 업로드가 진행 중입니다. 이 페이지를 벗어나면 업로드가 취소됩니다.",
"URL cannot be empty." => "URL을 입력해야 합니다.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "유효하지 않은 폴더명입니다. \"Shared\" 이름의 사용은 OwnCloud 가 이미 예약하고 있습니다.",
"Error" => "오류",
"Share" => "공유",
"Delete permanently" => "영원히 삭제",
@ -28,18 +35,22 @@ $TRANSLATIONS = array(
"cancel" => "취소",
"replaced {new_name} with {old_name}" => "{old_name}이(가) {new_name}(으)로 대체됨",
"undo" => "되돌리기",
"_%n folder_::_%n folders_" => array(""),
"_%n file_::_%n files_" => array(""),
"_Uploading %n file_::_Uploading %n files_" => array(""),
"_%n folder_::_%n folders_" => array("폴더 %n"),
"_%n file_::_%n files_" => array("파일 %n 개"),
"{dirs} and {files}" => "{dirs} 그리고 {files}",
"_Uploading %n file_::_Uploading %n files_" => array("%n 개의 파일을 업로드중"),
"'.' is an invalid file name." => "'.' 는 올바르지 않은 파일 이름 입니다.",
"File name cannot be empty." => "파일 이름이 비어 있을 수 없습니다.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "폴더 이름이 올바르지 않습니다. 이름에 문자 '\\', '/', '<', '>', ':', '\"', '|', '? ', '*'는 사용할 수 없습니다.",
"Your storage is full, files can not be updated or synced anymore!" => "저장 공간이 가득 찼습니다. 파일을 업데이트하거나 동기화할 수 없습니다!",
"Your storage is almost full ({usedSpacePercent}%)" => "저장 공간이 거의 가득 찼습니다 ({usedSpacePercent}%)",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "암호화는 해제되어 있지만, 파일은 아직 암호화 되어 있습니다. 개인 설저에 가셔서 암호를 해제하십시오",
"Your download is being prepared. This might take some time if the files are big." => "다운로드가 준비 중입니다. 파일 크기가 크다면 시간이 오래 걸릴 수도 있습니다.",
"Error moving file" => "파일 이동 오류",
"Name" => "이름",
"Size" => "크기",
"Modified" => "수정됨",
"%s could not be renamed" => "%s 의 이름을 변경할수 없습니다",
"Upload" => "업로드",
"File handling" => "파일 처리",
"Maximum upload size" => "최대 업로드 크기",

View File

@ -13,10 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Nėra laikinojo katalogo",
"Failed to write to disk" => "Nepavyko įrašyti į diską",
"Not enough storage available" => "Nepakanka vietos serveryje",
"Upload failed. Could not get file info." => "Įkėlimas nepavyko. Nepavyko gauti failo informacijos.",
"Upload failed. Could not find uploaded file" => "Įkėlimas nepavyko. Nepavyko rasti įkelto failo",
"Invalid directory." => "Neteisingas aplankas",
"Files" => "Failai",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nepavyksta įkelti {filename}, nes tai katalogas arba yra 0 baitų dydžio",
"Not enough space available" => "Nepakanka vietos",
"Upload cancelled." => "Įkėlimas atšauktas.",
"Could not get result from server." => "Nepavyko gauti rezultato iš serverio.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Failo įkėlimas pradėtas. Jei paliksite šį puslapį, įkėlimas nutrūks.",
"URL cannot be empty." => "URL negali būti tuščias.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Negalimas aplanko pavadinimas. 'Shared' pavadinimas yra rezervuotas ownCloud",
@ -40,8 +44,11 @@ $TRANSLATIONS = array(
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Neleistinas pavadinimas, '\\', '/', '<', '>', ':', '\"', '|', '?' ir '*' yra neleidžiami.",
"Your storage is full, files can not be updated or synced anymore!" => "Jūsų visa vieta serveryje užimta",
"Your storage is almost full ({usedSpacePercent}%)" => "Jūsų vieta serveryje beveik visa užimta ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Šifravimo programa įjungta, bet Jūsų raktai nėra pritaikyti. Prašome atsijungti ir vėl prisijungti",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Netinkamas privatus raktas Šifravimo programai. Prašome atnaujinti savo privataus rakto slaptažodį asmeniniuose nustatymuose, kad atkurti prieigą prie šifruotų failų.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifravimas buvo išjungtas, bet Jūsų failai vis dar užšifruoti. Prašome eiti į asmeninius nustatymus ir iššifruoti savo failus.",
"Your download is being prepared. This might take some time if the files are big." => "Jūsų atsisiuntimas yra paruošiamas. tai gali užtrukti jei atsisiunčiamas didelis failas.",
"Error moving file" => "Klaida perkeliant failą",
"Name" => "Pavadinimas",
"Size" => "Dydis",
"Modified" => "Pakeista",

View File

@ -13,10 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Brak folderu tymczasowego",
"Failed to write to disk" => "Błąd zapisu na dysk",
"Not enough storage available" => "Za mało dostępnego miejsca",
"Upload failed. Could not get file info." => "Nieudane przesłanie. Nie można pobrać informacji o pliku.",
"Upload failed. Could not find uploaded file" => "Nieudane przesłanie. Nie można znaleźć przesyłanego pliku",
"Invalid directory." => "Zła ścieżka.",
"Files" => "Pliki",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nie można przesłać {filename} być może jest katalogiem lub posiada 0 bajtów",
"Not enough space available" => "Za mało miejsca",
"Upload cancelled." => "Wczytywanie anulowane.",
"Could not get result from server." => "Nie można uzyskać wyniku z serwera.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Wysyłanie pliku jest w toku. Jeśli opuścisz tę stronę, wysyłanie zostanie przerwane.",
"URL cannot be empty." => "URL nie może być pusty.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Nieprawidłowa nazwa folderu. Wykorzystanie 'Shared' jest zarezerwowane przez ownCloud",
@ -42,6 +46,7 @@ $TRANSLATIONS = array(
"Your storage is almost full ({usedSpacePercent}%)" => "Twój magazyn jest prawie pełny ({usedSpacePercent}%)",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Szyfrowanie zostało wyłączone, ale nadal pliki są zaszyfrowane. Przejdź do ustawień osobistych i tam odszyfruj pliki.",
"Your download is being prepared. This might take some time if the files are big." => "Pobieranie jest przygotowywane. Może to zająć trochę czasu jeśli pliki są duże.",
"Error moving file" => "Błąd prz przenoszeniu pliku",
"Name" => "Nazwa",
"Size" => "Rozmiar",
"Modified" => "Modyfikacja",

View File

@ -44,6 +44,8 @@ $TRANSLATIONS = array(
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nome inválido, '\\', '/', '<', '>', ':', '\"', '|', '?' e '*' não são permitidos.",
"Your storage is full, files can not be updated or synced anymore!" => "Seu armazenamento está cheio, arquivos não podem mais ser atualizados ou sincronizados!",
"Your storage is almost full ({usedSpacePercent}%)" => "Seu armazenamento está quase cheio ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "App de encriptação está ativado, mas as chaves não estão inicializadas, por favor log-out e faça login novamente",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Chave do App de Encriptação é inválida. Por favor, atualize sua senha de chave privada em suas configurações pessoais para recuperar o acesso a seus arquivos criptografados.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Encriptação foi desabilitada mas seus arquivos continuam encriptados. Por favor vá a suas configurações pessoais para descriptar seus arquivos.",
"Your download is being prepared. This might take some time if the files are big." => "Seu download está sendo preparado. Isto pode levar algum tempo se os arquivos forem grandes.",
"Error moving file" => "Erro movendo o arquivo",

View File

@ -13,10 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "找不到暫存資料夾",
"Failed to write to disk" => "寫入硬碟失敗",
"Not enough storage available" => "儲存空間不足",
"Upload failed. Could not get file info." => "上傳失敗,無法取得檔案資訊",
"Upload failed. Could not find uploaded file" => "上傳失敗,找不到上傳的檔案",
"Invalid directory." => "無效的資料夾",
"Files" => "檔案",
"Unable to upload {filename} as it is a directory or has 0 bytes" => "因為 {filename} 是個目錄或是大小為零,所以無法上傳",
"Not enough space available" => "沒有足夠的可用空間",
"Upload cancelled." => "上傳已取消",
"Could not get result from server." => "無法從伺服器取回結果",
"File upload is in progress. Leaving the page now will cancel the upload." => "檔案上傳中,離開此頁面將會取消上傳。",
"URL cannot be empty." => "URL 不能為空",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "無效的資料夾名稱,'Shared' 的使用被 ownCloud 保留",
@ -40,8 +44,11 @@ $TRANSLATIONS = array(
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "檔名不合法,不允許 \\ / < > : \" | ? * 字元",
"Your storage is full, files can not be updated or synced anymore!" => "您的儲存空間已滿,沒有辦法再更新或是同步檔案!",
"Your storage is almost full ({usedSpacePercent}%)" => "您的儲存空間快要滿了 ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "檔案加密已啓用,但是您的金鑰尚未初始化,請重新登入一次",
"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "無效的檔案加密私鑰,請在個人設定中更新您的私鑰密語以存取加密的檔案。",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "加密已經被停用,但是您的舊檔案還是處於已加密的狀態,請前往個人設定以解密這些檔案。",
"Your download is being prepared. This might take some time if the files are big." => "正在準備您的下載,若您的檔案較大,將會需要更多時間。",
"Error moving file" => "移動檔案失敗",
"Name" => "名稱",
"Size" => "大小",
"Modified" => "修改時間",

View File

@ -84,7 +84,7 @@ class Helper
}
}
$i['directory'] = $dir;
$i['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($i['mimetype']);
$i['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($i['mimetype']);
$i['icon'] = \OCA\Files\Helper::determineIcon($i);
$files[] = $i;
}

View File

@ -2,7 +2,7 @@
<form name="filesForm" action='#' method='post'>
<fieldset class="personalblock">
<legend><strong><?php p($l->t('File handling')); ?></strong></legend>
<h2><?php p($l->t('File handling')); ?></h2>
<?php if($_['uploadChangable']):?>
<label for="maxUploadSize"><?php p($l->t( 'Maximum upload size' )); ?> </label>
<input name='maxUploadSize' id="maxUploadSize" value='<?php p($_['uploadMaxFilesize']) ?>'/>

View File

@ -9,7 +9,7 @@
data-type='file'><p><?php p($l->t('Text file'));?></p></li>
<li style="background-image:url('<?php p(OCP\mimetype_icon('dir')) ?>')"
data-type='folder'><p><?php p($l->t('Folder'));?></p></li>
<li style="background-image:url('<?php p(OCP\image_path('core', 'filetypes/web.svg')) ?>')"
<li style="background-image:url('<?php p(OCP\image_path('core', 'places/link.svg')) ?>')"
data-type='web'><p><?php p($l->t('From link'));?></p></li>
</ul>
</div>
@ -19,8 +19,6 @@
<input type="hidden" name="MAX_FILE_SIZE" id="max_upload"
value="<?php p($_['uploadMaxFilesize']) ?>">
<?php endif;?>
<!-- Send the requesttoken, this is needed for older IE versions
because they don't send the CSRF token via HTTP header in this case -->
<input type="hidden" class="max_human_file_size"
value="(max <?php p($_['uploadMaxHumanFilesize']); ?>)">
<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
@ -29,9 +27,7 @@
<a href="#" class="svg"></a>
</div>
<?php if ($_['trash'] ): ?>
<div id="trash" class="button" <?php $_['trashEmpty'] ? p('disabled') : '' ?>>
<a><?php p($l->t('Deleted files'));?></a>
</div>
<input id="trash" type="button" value="<?php p($l->t('Deleted files'));?>" class="button" <?php $_['trashEmpty'] ? p('disabled') : '' ?>></input>
<?php endif; ?>
<div id="uploadprogresswrapper">
<div id="uploadprogressbar"></div>
@ -116,3 +112,5 @@
<input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php p($_['allowZipDownload']); ?>" />
<input type="hidden" name="usedSpacePercent" id="usedSpacePercent" value="<?php p($_['usedSpacePercent']); ?>" />
<input type="hidden" name="encryptedFiles" id="encryptedFiles" value="<?php $_['encryptedFiles'] ? p('1') : p('0'); ?>" />
<input type="hidden" name="encryptedInitStatus" id="encryptionInitStatus" value="<?php p($_['encryptionInitStatus']) ?>" />
<input type="hidden" name="mailNotificationEnabled" id="mailNotificationEnabled" value="<?php p($_['mailNotificationEnabled']) ?>" />

View File

@ -30,16 +30,15 @@ $totalsize = 0; ?>
<?php endif; ?>
<?php if($file['type'] == 'dir'): ?>
<a class="name" href="<?php p(rtrim($_['baseURL'],'/').'/'.trim($directory,'/').'/'.$name); ?>" title="">
<?php else: ?>
<a class="name" href="<?php p(rtrim($_['downloadURL'],'/').'/'.trim($directory,'/').'/'.$name); ?>" title="">
<?php endif; ?>
<span class="nametext">
<?php if($file['type'] == 'dir'):?>
<span class="nametext">
<?php print_unescaped(htmlspecialchars($file['name']));?>
<?php else:?>
<?php print_unescaped(htmlspecialchars($file['basename']));?><span class='extension'><?php p($file['extension']);?></span>
<?php endif;?>
</span>
</span>
<?php else: ?>
<a class="name" href="<?php p(rtrim($_['downloadURL'],'/').'/'.trim($directory,'/').'/'.$name); ?>">
<label class="filetext" title="" for="select-<?php p($file['fileid']); ?>"></label>
<span class="nametext"><?php print_unescaped(htmlspecialchars($file['basename']));?><span class='extension'><?php p($file['extension']);?></span>
</a>
<?php endif; ?>
<?php if($file['type'] == 'dir'):?>
<span class="uploadtext" currentUploads="0">
</span>

View File

@ -48,6 +48,7 @@ if ($decryptedKey) {
// success or failure
if ($return) {
$session->setInitialized(\OCA\Encryption\Session::INIT_SUCCESSFUL);
\OCP\JSON::success(array('data' => array('message' => $l->t('Private key password successfully updated.'))));
} else {
\OCP\JSON::error(array('data' => array('message' => $l->t('Could not update the private key password. Maybe the old password was not correct.'))));

View File

@ -43,23 +43,6 @@ if (!OC_Config::getValue('maintenance', false)) {
if($sessionReady) {
$session = new \OCA\Encryption\Session($view);
}
$user = \OCP\USER::getUser();
// check if user has a private key
if ($sessionReady === false
|| (!$view->file_exists('/' . $user . '/files_encryption/' . $user . '.private.key')
&& OCA\Encryption\Crypt::mode() === 'server')
) {
// Force the user to log-in again 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 . '/');
exit();
}
}
} else {
// logout user if we are in maintenance to force re-login

View File

@ -7,6 +7,7 @@
<author>Sam Tuke, Bjoern Schiessle, Florin Peter</author>
<require>4</require>
<shipped>true</shipped>
<rememberlogin>false</rememberlogin>
<types>
<filesystem/>
</types>

View File

@ -1 +1 @@
0.4
0.5

View File

@ -1,23 +1,33 @@
<?php
if (!isset($_)) { //also provide standalone error page
require_once __DIR__ . '/../../../lib/base.php';
$l = OC_L10N::get('files_encryption');
$errorMsg = $l->t('Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files.');
if (isset($_GET['i']) && $_GET['i'] === '0') {
$errorMsg = $l->t('Encryption app not initialized! Maybe the encryption app was re-enabled during your session. Please try to log out and log back in to initialize the encryption app.');
$init = '0';
} else {
$errorMsg = $l->t('Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files.');
$init = '1';
}
if(isset($_GET['p']) && $_GET['p'] === '1') {
if (isset($_GET['p']) && $_GET['p'] === '1') {
header('HTTP/1.0 404 ' . $errorMsg);
}
// check if ajax request
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
// check if ajax request
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
\OCP\JSON::error(array('data' => array('message' => $errorMsg)));
} else {
header('HTTP/1.0 404 ' . $errorMsg);
$tmpl = new OC_Template('files_encryption', 'invalid_private_key', 'guest');
$tmpl->assign('message', $errorMsg);
$tmpl->assign('init', $init);
$tmpl->printPage();
}
exit;
}

View File

@ -159,7 +159,6 @@ class Hooks {
* @param array $params keys: uid, password
*/
public static function setPassphrase($params) {
// Only attempt to change passphrase if server-side encryption
// is in use (client-side encryption does not have access to
// the necessary keys)
@ -543,14 +542,18 @@ class Hooks {
}
/**
* set migration status back to '0' so that all new files get encrypted
* set migration status and the init status back to '0' so that all new files get encrypted
* if the app gets enabled again
* @param array $params contains the app ID
*/
public static function preDisable($params) {
if ($params['app'] === 'files_encryption') {
$query = \OC_DB::prepare('UPDATE `*PREFIX*encryption` SET `migration_status`=0');
$query->execute();
$setMigrationStatus = \OC_DB::prepare('UPDATE `*PREFIX*encryption` SET `migration_status`=0');
$setMigrationStatus->execute();
$session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
$session->setInitialized(\OCA\Encryption\Session::NOT_INITIALIZED);
}
}

View File

@ -1,6 +1,8 @@
/**
* Copyright (c) 2013, Sam Tuke <samtuke@owncloud.com>, Robin Appelman
* <icewind1991@gmail.com>
* Copyright (c) 2013
* Sam Tuke <samtuke@owncloud.com>
* Robin Appelman <icewind1991@gmail.com>
* Bjoern Schiessle <schiessle@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING-README file.
*/
@ -31,22 +33,23 @@ $(document).ready(function(){
// Trigger ajax on recoveryAdmin status change
var enabledStatus = $('#adminEnableRecovery').val();
$('input:password[name="recoveryPassword"]').keyup(function(event) {
var recoveryPassword = $( '#recoveryPassword' ).val();
$('input:password[name="encryptionRecoveryPassword"]').keyup(function(event) {
var recoveryPassword = $( '#encryptionRecoveryPassword' ).val();
var recoveryPasswordRepeated = $( '#repeatEncryptionRecoveryPassword' ).val();
var checkedButton = $('input:radio[name="adminEnableRecovery"]:checked').val();
var uncheckedValue = (1+parseInt(checkedButton)) % 2;
if (recoveryPassword != '' ) {
if (recoveryPassword !== '' && recoveryPassword === recoveryPasswordRepeated) {
$('input:radio[name="adminEnableRecovery"][value="'+uncheckedValue.toString()+'"]').removeAttr("disabled");
} else {
$('input:radio[name="adminEnableRecovery"][value="'+uncheckedValue.toString()+'"]').attr("disabled", "true");
}
});
$( 'input:radio[name="adminEnableRecovery"]' ).change(
$( 'input:radio[name="adminEnableRecovery"]' ).change(
function() {
var recoveryStatus = $( this ).val();
var oldStatus = (1+parseInt(recoveryStatus)) % 2;
var recoveryPassword = $( '#recoveryPassword' ).val();
var recoveryPassword = $( '#encryptionRecoveryPassword' ).val();
$.post(
OC.filePath( 'files_encryption', 'ajax', 'adminrecovery.php' )
, { adminEnableRecovery: recoveryStatus, recoveryPassword: recoveryPassword }
@ -57,11 +60,10 @@ $(document).ready(function(){
} else {
OC.Notification.hide();
if (recoveryStatus === "0") {
$('button:button[name="submitChangeRecoveryKey"]').attr("disabled", "true");
$('input:password[name="changeRecoveryPassword"]').attr("disabled", "true");
$('input:password[name="changeRecoveryPassword"]').val("");
$('p[name="changeRecoveryPasswordBlock"]').addClass("hidden");
} else {
$('input:password[name="changeRecoveryPassword"]').removeAttr("disabled");
$('input:password[name="changeRecoveryPassword"]').val("");
$('p[name="changeRecoveryPasswordBlock"]').removeClass("hidden");
}
}
}
@ -72,9 +74,11 @@ $(document).ready(function(){
// change recovery password
$('input:password[name="changeRecoveryPassword"]').keyup(function(event) {
var oldRecoveryPassword = $('input:password[id="oldRecoveryPassword"]').val();
var newRecoveryPassword = $('input:password[id="newRecoveryPassword"]').val();
if (newRecoveryPassword != '' && oldRecoveryPassword != '' ) {
var oldRecoveryPassword = $('#oldEncryptionRecoveryPassword').val();
var newRecoveryPassword = $('#newEncryptionRecoveryPassword').val();
var newRecoveryPasswordRepeated = $('#repeatedNewEncryptionRecoveryPassword').val();
if (newRecoveryPassword !== '' && oldRecoveryPassword !== '' && newRecoveryPassword === newRecoveryPasswordRepeated) {
$('button:button[name="submitChangeRecoveryKey"]').removeAttr("disabled");
} else {
$('button:button[name="submitChangeRecoveryKey"]').attr("disabled", "true");
@ -83,8 +87,8 @@ $(document).ready(function(){
$('button:button[name="submitChangeRecoveryKey"]').click(function() {
var oldRecoveryPassword = $('input:password[id="oldRecoveryPassword"]').val();
var newRecoveryPassword = $('input:password[id="newRecoveryPassword"]').val();
var oldRecoveryPassword = $('#oldEncryptionRecoveryPassword').val();
var newRecoveryPassword = $('#newEncryptionRecoveryPassword').val();
OC.msg.startSaving('#encryption .msg');
$.post(
OC.filePath( 'files_encryption', 'ajax', 'changeRecoveryPassword.php' )
@ -98,5 +102,5 @@ $(document).ready(function(){
}
);
});
});

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Assegureu-vos que teniu instal·lat PHP 5.3.3 o una versió superior i que està activat Open SSL i habilitada i configurada correctament l'extensió de PHP. De moment, l'aplicació d'encriptació s'ha desactivat.",
"Following users are not set up for encryption:" => "Els usuaris següents no estan configurats per a l'encriptació:",
"Saving..." => "Desant...",
"Your private key is not valid! Maybe the your password was changed from outside." => "La vostra clau privada no és vàlida! Potser la vostra contrasenya ha canviat des de fora.",
"You can unlock your private key in your " => "Podeu desbloquejar la clau privada en el vostre",
"personal settings" => "arranjament personal",
"Encryption" => "Xifrat",
"Enable recovery key (allow to recover users files in case of password loss):" => "Activa la clau de recuperació (permet recuperar fitxers d'usuaris en cas de pèrdua de contrasenya):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Ujistěte se prosím, že máte nainstalované PHP 5.3.3 nebo novější a že máte povolené a správně nakonfigurované OpenSSL včetně jeho rozšíření pro PHP. Prozatím byla aplikace pro šifrování vypnuta.",
"Following users are not set up for encryption:" => "Následující uživatelé nemají nastavené šifrování:",
"Saving..." => "Ukládám...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Váš soukromý klíč není platný! Pravděpodobně bylo vaše heslo změněno zvenčí.",
"You can unlock your private key in your " => "Můžete odemknout váš soukromý klíč ve vašem",
"personal settings" => "osobní nastavení",
"Encryption" => "Šifrování",
"Enable recovery key (allow to recover users files in case of password loss):" => "Povolit klíč pro obnovu (umožňuje obnovu uživatelských souborů v případě ztráty hesla)",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Sørg for at PHP 5.3.3 eller nyere er installeret og at OpenSSL sammen med PHP-udvidelsen er aktiveret og korrekt konfigureret. Indtil videre er krypteringsprogrammet deaktiveret.",
"Following users are not set up for encryption:" => "Følgende brugere er ikke sat op til kryptering:",
"Saving..." => "Gemmer...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Din private nøgle er ikke gyldig. Måske blev dit kodeord ændre udefra.",
"You can unlock your private key in your " => "Du kan låse din private nøgle op i din ",
"personal settings" => "Personlige indstillinger",
"Encryption" => "Kryptering",
"Enable recovery key (allow to recover users files in case of password loss):" => "Aktiver gendannelsesnøgle (Tillad gendannelse af brugerfiler i tilfælde af tab af kodeord):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Bitte stelle sicher, dass PHP 5.3.3 oder neuer installiert und das OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Zur Zeit ist die Verschlüsselungs-App deaktiviert.",
"Following users are not set up for encryption:" => "Für folgende Nutzer ist keine Verschlüsselung eingerichtet:",
"Saving..." => "Speichern...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Ihr privater Schlüssel ist ungültig! Eventuell wurde Ihr Passwort von außerhalb geändert.",
"You can unlock your private key in your " => "Du kannst den privaten Schlüssel ändern und zwar in deinem",
"personal settings" => "Private Einstellungen",
"Encryption" => "Verschlüsselung",
"Enable recovery key (allow to recover users files in case of password loss):" => "Wiederherstellungsschlüssel aktivieren (ermöglicht das Wiederherstellen von Dateien, falls das Passwort vergessen wurde):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Bitte stellen Sie sicher, dass PHP 5.3.3 oder neuer installiert und das OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Zur Zeit ist die Verschlüsselungs-App deaktiviert.",
"Following users are not set up for encryption:" => "Für folgende Nutzer ist keine Verschlüsselung eingerichtet:",
"Saving..." => "Speichern...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Ihr privater Schlüssel ist ungültig! Vielleicht wurde Ihr Passwort von ausserhalb geändert.",
"You can unlock your private key in your " => "Sie können den privaten Schlüssel ändern und zwar in Ihrem",
"personal settings" => "Persönliche Einstellungen",
"Encryption" => "Verschlüsselung",
"Enable recovery key (allow to recover users files in case of password loss):" => "Aktivieren Sie den Wiederherstellungsschlüssel (erlaubt die Wiederherstellung des Zugangs zu den Benutzerdateien, wenn das Passwort verloren geht).",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Bitte stellen Sie sicher, dass PHP 5.3.3 oder neuer installiert und das OpenSSL zusammen mit der PHP-Erweiterung aktiviert und richtig konfiguriert ist. Zur Zeit ist die Verschlüsselungs-App deaktiviert.",
"Following users are not set up for encryption:" => "Für folgende Nutzer ist keine Verschlüsselung eingerichtet:",
"Saving..." => "Speichern...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Ihr privater Schlüssel ist ungültig! Vielleicht wurde Ihr Passwort von außerhalb geändert.",
"You can unlock your private key in your " => "Sie können den privaten Schlüssel ändern und zwar in Ihrem",
"personal settings" => "Persönliche Einstellungen",
"Encryption" => "Verschlüsselung",
"Enable recovery key (allow to recover users files in case of password loss):" => "Aktivieren Sie den Wiederherstellungsschlüssel (erlaubt die Wiederherstellung des Zugangs zu den Benutzerdateien, wenn das Passwort verloren geht).",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled.",
"Following users are not set up for encryption:" => "Following users are not set up for encryption:",
"Saving..." => "Saving...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Your private key is not valid! Maybe the your password was changed externally.",
"You can unlock your private key in your " => "You can unlock your private key in your ",
"personal settings" => "personal settings",
"Encryption" => "Encryption",
"Enable recovery key (allow to recover users files in case of password loss):" => "Enable recovery key (allow to recover users files in case of password loss):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Por favor, asegúrese de que PHP 5.3.3 o posterior está instalado y que la extensión OpenSSL de PHP está habilitada y configurada correctamente. Por el momento, la aplicación de cifrado ha sido deshabilitada.",
"Following users are not set up for encryption:" => "Los siguientes usuarios no han sido configurados para el cifrado:",
"Saving..." => "Guardando...",
"Your private key is not valid! Maybe the your password was changed from outside." => "¡Su clave privada no es válida! Tal vez su contraseña ha sido cambiada desde fuera.",
"You can unlock your private key in your " => "Puede desbloquear su clave privada en su",
"personal settings" => "opciones personales",
"Encryption" => "Cifrado",
"Enable recovery key (allow to recover users files in case of password loss):" => "Habilitar la clave de recuperación (permite recuperar los ficheros del usuario en caso de pérdida de la contraseña);",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Por favor, asegúrese de que PHP 5.3.3 o una versión más reciente esté instalado y que OpenSSL junto con la extensión PHP esté habilitado y configurado apropiadamente. Por ahora, la aplicación de encriptación ha sido deshabilitada.",
"Following users are not set up for encryption:" => "Los siguientes usuarios no fueron configurados para encriptar:",
"Saving..." => "Guardando...",
"Your private key is not valid! Maybe the your password was changed from outside." => "¡Tu clave privada no es válida! Tal vez tu contraseña fue cambiada desde afuera.",
"You can unlock your private key in your " => "Podés desbloquear tu clave privada en tu",
"personal settings" => "Configuración personal",
"Encryption" => "Encriptación",
"Enable recovery key (allow to recover users files in case of password loss):" => "Habilitar clave de recuperación (te permite recuperar los archivos de usuario en el caso que pierdas la contraseña):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Palun veendu, et on paigaldatud PHP 5.3.3 või uuem ning PHP OpenSSL laiendus on lubatud ning seadistatud korrektselt. Hetkel krüpteerimise rakendus on peatatud.",
"Following users are not set up for encryption:" => "Järgmised kasutajad pole seadistatud krüpteeringuks:",
"Saving..." => "Salvestamine...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Sinu privaatne võti ei ole õige. Võib-olla on parool vahetatud süsteemi väliselt.",
"You can unlock your private key in your " => "Saad avada oma privaatse võtme oma",
"personal settings" => "isiklikes seadetes",
"Encryption" => "Krüpteerimine",
"Enable recovery key (allow to recover users files in case of password loss):" => "Luba taastevõti (võimada kasutaja failide taastamine parooli kaotuse puhul):",

View File

@ -10,9 +10,9 @@ $TRANSLATIONS = array(
"Could not update the private key password. Maybe the old password was not correct." => "Ezin izan da gako pribatu pasahitza eguneratu. Agian pasahitz zaharra okerrekoa da.",
"Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "Zure gako pribatua ez da egokia! Seguruaski zure pasahitza ownCloud sistematik kanpo aldatu da (adb. zure direktorio korporatiboa). Zure gako pribatuaren pasahitza eguneratu dezakezu zure ezarpen pertsonaletan zure enkriptatutako fitxategiak berreskuratzeko.",
"Missing requirements." => "Eskakizun batzuk ez dira betetzen.",
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Mesedez ziurtatu PHP 5.3.3 edo berriago bat instalatuta dagoela eta OpenSSL PHP hedapenarekin gaitua eta ongi konfiguratuta dagoela. Oraingoz, enkriptazio aplikazioa desgaituta dago.",
"Following users are not set up for encryption:" => "Hurrengo erabiltzaileak ez daude enktriptatzeko konfiguratutak:",
"Saving..." => "Gordetzen...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Zure gako pribatua ez da egokia! Agian zure pasahitza kanpotik aldatu da.",
"You can unlock your private key in your " => "Zure gako pribatua desblokeatu dezakezu zure",
"personal settings" => "ezarpen pertsonalak",
"Encryption" => "Enkriptazioa",
"Enable recovery key (allow to recover users files in case of password loss):" => "Gaitu berreskurapen gakoa (erabiltzaileen fitxategiak berreskuratzea ahalbidetzen du pasahitza galtzen badute ere):",

View File

@ -11,8 +11,6 @@ $TRANSLATIONS = array(
"Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "کلید خصوصی شما معتبر نمی باشد! ظاهرا رمزعبور شما بیرون از سیستم ownCloud تغییر یافته است( به عنوان مثال پوشه سازمان شما ). شما میتوانید رمزعبور کلید خصوصی خود را در تنظیمات شخصیتان به روز کنید تا بتوانید به فایل های رمزگذاری شده خود را دسترسی داشته باشید.",
"Missing requirements." => "نیازمندی های گمشده",
"Saving..." => "در حال ذخیره سازی...",
"Your private key is not valid! Maybe the your password was changed from outside." => "کلید خصوصی شما معتبر نیست! شاید رمزعبوراز بیرون تغییر یافته است.",
"You can unlock your private key in your " => "شما میتوانید کلید خصوصی خود را باز نمایید.",
"personal settings" => "تنظیمات شخصی",
"Encryption" => "رمزگذاری",
"Enable recovery key (allow to recover users files in case of password loss):" => "فعال کردن کلید بازیابی(اجازه بازیابی فایل های کاربران در صورت از دست دادن رمزعبور):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Veuillez vous assurer qu'une version de PHP 5.3.3 ou supérieure est installée et qu'OpenSSL et son extension PHP sont activés et configurés correctement. En attendant, l'application de chiffrement été désactivée.",
"Following users are not set up for encryption:" => "Les utilisateurs suivants ne sont pas configurés pour le chiffrement :",
"Saving..." => "Enregistrement...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Votre clef privée est invalide ! Votre mot de passe a peut-être été modifié depuis l'extérieur.",
"You can unlock your private key in your " => "Vous pouvez déverrouiller votre clé privée dans votre",
"personal settings" => "paramètres personnel",
"Encryption" => "Chiffrement",
"Enable recovery key (allow to recover users files in case of password loss):" => "Activer la clef de récupération (permet de récupérer les fichiers des utilisateurs en cas de perte de mot de passe).",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Asegúrese de que está instalado o PHP 5.3.3 ou posterior e de o OpenSSL xunto coa extensión PHP estean activados e configurados correctamente. Polo de agora foi desactivado o aplicativo de cifrado.",
"Following users are not set up for encryption:" => "Os seguintes usuarios non teñen configuración para o cifrado:",
"Saving..." => "Gardando...",
"Your private key is not valid! Maybe the your password was changed from outside." => "A chave privada non é correcta! É probábel que o seu contrasinal teña sido cambiado desde o exterior. ",
"You can unlock your private key in your " => "Pode desbloquear a chave privada nos seus",
"personal settings" => "axustes persoais",
"Encryption" => "Cifrado",
"Enable recovery key (allow to recover users files in case of password loss):" => "Activar a chave de recuperación (permitirá recuperar os ficheiros dos usuarios no caso de perda do contrasinal):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Assicurati che sia installato PHP 5.3.3 o versioni successive e che l'estensione OpenSSL di PHP sia abilitata e configurata correttamente. Per ora, l'applicazione di cifratura è disabilitata.",
"Following users are not set up for encryption:" => "I seguenti utenti non sono configurati per la cifratura:",
"Saving..." => "Salvataggio in corso...",
"Your private key is not valid! Maybe the your password was changed from outside." => "La tua chiave privata non è valida! Forse è stata modifica dall'esterno.",
"You can unlock your private key in your " => "Puoi sbloccare la chiave privata nelle tue",
"personal settings" => "impostazioni personali",
"Encryption" => "Cifratura",
"Enable recovery key (allow to recover users files in case of password loss):" => "Abilita la chiave di recupero (permette di recuperare i file utenti in caso di perdita della password):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "必ず、PHP 5.3.3もしくはそれ以上をインストールし、同時にOpenSSLのPHP拡張を有効にした上でOpenSSLも同様にインストール、適切に設定してください。現時点では暗号化アプリは無効になっています。",
"Following users are not set up for encryption:" => "以下のユーザーは、暗号化設定がされていません:",
"Saving..." => "保存中...",
"Your private key is not valid! Maybe the your password was changed from outside." => "秘密鍵が有効ではありません。パスワードが外部から変更された恐れがあります。",
"You can unlock your private key in your " => "個人設定で",
"personal settings" => "秘密鍵をアンロックできます",
"Encryption" => "暗号化",
"Enable recovery key (allow to recover users files in case of password loss):" => "復旧キーを有効化 (万一パスワードを亡くした場合もユーザーのファイルを回復できる):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Prašome įsitikinti, kad PHP 5.3.3 ar naujesnė yra įdiegta ir kad OpenSSL kartu su PHP plėtiniu yra šjungti ir teisingai sukonfigūruoti. Kol kas šifravimo programa bus išjungta.",
"Following users are not set up for encryption:" => "Sekantys naudotojai nenustatyti šifravimui:",
"Saving..." => "Saugoma...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Jūsų privatus raktas yra netinkamas! Galbūt Jūsų slaptažodis buvo pakeistas iš išorės?",
"You can unlock your private key in your " => "Galite atrakinti savo privatų raktą savo",
"personal settings" => "asmeniniai nustatymai",
"Encryption" => "Šifravimas",
"Enable recovery key (allow to recover users files in case of password loss):" => "Įjunkite atkūrimo raktą, (leisti atkurti naudotojų failus praradus slaptažodį):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Wees er zeker van dat PHP5.3.3 of nieuwer is geïstalleerd en dat de OpenSSL PHP extensie is ingeschakeld en correct geconfigureerd. De versleutel-app is voorlopig uitgeschakeld.",
"Following users are not set up for encryption:" => "De volgende gebruikers hebben geen configuratie voor encryptie:",
"Saving..." => "Opslaan",
"Your private key is not valid! Maybe the your password was changed from outside." => "Uw privésleutel is niet geldig. Misschien was uw wachtwoord van buitenaf gewijzigd.",
"You can unlock your private key in your " => "U kunt uw privésleutel deblokkeren in uw",
"personal settings" => "persoonlijke instellingen",
"Encryption" => "Versleuteling",
"Enable recovery key (allow to recover users files in case of password loss):" => "Activeren herstelsleutel (maakt het mogelijk om gebruikersbestanden terug te halen in geval van verlies van het wachtwoord):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Proszę upewnić się, że PHP 5.3.3 lub nowszy jest zainstalowany i że OpenSSL oraz rozszerzenie PHP jest włączone i poprawnie skonfigurowane. Obecnie szyfrowanie aplikacji zostało wyłączone.",
"Following users are not set up for encryption:" => "Następujący użytkownicy nie mają skonfigurowanego szyfrowania:",
"Saving..." => "Zapisywanie...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Klucz prywatny nie jest poprawny! Może Twoje hasło zostało zmienione z zewnątrz.",
"You can unlock your private key in your " => "Możesz odblokować swój klucz prywatny w swojej",
"personal settings" => "Ustawienia osobiste",
"Encryption" => "Szyfrowanie",
"Enable recovery key (allow to recover users files in case of password loss):" => "Włączhasło klucza odzyskiwania (pozwala odzyskać pliki użytkowników w przypadku utraty hasła):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Por favor, certifique-se que o PHP 5.3.3 ou mais recente está instalado e que a extensão PHP OpenSSL está habilitado e configurado corretamente. Por enquanto, o aplicativo de criptografia foi desativado.",
"Following users are not set up for encryption:" => "Seguintes usuários não estão configurados para criptografia:",
"Saving..." => "Salvando...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Sua chave privada não é válida! Talvez sua senha tenha sido mudada.",
"You can unlock your private key in your " => "Você pode desbloquear sua chave privada nas suas",
"personal settings" => "configurações pessoais.",
"Encryption" => "Criptografia",
"Enable recovery key (allow to recover users files in case of password loss):" => "Habilitar chave de recuperação (permite recuperar arquivos de usuários em caso de perda de senha):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Пожалуйста, убедитесь, что версия PHP 5.3.3 или новее, а также, что OpenSSL и соответствующее расширение PHP включены и правильно настроены. На данный момент приложение шифрования отключено.",
"Following users are not set up for encryption:" => "Для следующих пользователей шифрование не настроено:",
"Saving..." => "Сохранение...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Секретный ключ недействителен! Возможно, Ваш пароль был изменён в другой программе.",
"You can unlock your private key in your " => "Вы можете разблокировать закрытый ключ в своём ",
"personal settings" => "персональные настройки",
"Encryption" => "Шифрование",
"Enable recovery key (allow to recover users files in case of password loss):" => "Включить ключ восстановления (позволяет пользователям восстановить файлы при потере пароля):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Prosím uistite sa, že PHP verzie 5.3.3 alebo novšej je nainštalované a tiež, že OpenSSL knižnica spolu z PHP rozšírením je povolená a konfigurovaná správne. Nateraz bola aplikácia šifrovania zablokovaná.",
"Following users are not set up for encryption:" => "Nasledujúci používatelia nie sú nastavení pre šifrovanie:",
"Saving..." => "Ukladám...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Váš súkromný kľúč je neplatný. Možno bolo Vaše heslo zmenené z vonku.",
"You can unlock your private key in your " => "Môžte odomknúť váš privátny kľúč v",
"personal settings" => "osobné nastavenia",
"Encryption" => "Šifrovanie",
"Enable recovery key (allow to recover users files in case of password loss):" => "Povoliť obnovovací kľúč (umožňuje obnoviť používateľské súbory v prípade straty hesla):",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Preverite, da imate na strežniku nameščen paket PHP 5.3.3 ali novejši in da je omogočen in pravilno nastavljen PHP OpenSSL . Zaenkrat je šifriranje onemogočeno.",
"Following users are not set up for encryption:" => "Naslednji uporabniki še nimajo nastavljenega šifriranja:",
"Saving..." => "Poteka shranjevanje ...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Vaš zasebni ključ ni veljaven. Morda je bilo vaše geslo spremenjeno.",
"You can unlock your private key in your " => "Svoj zasebni ključ lahko odklenite v",
"personal settings" => "osebne nastavitve",
"Encryption" => "Šifriranje",
"Enable recovery key (allow to recover users files in case of password loss):" => "Omogoči ključ za obnovitev datotek (v primeru izgube gesla)",

View File

@ -13,8 +13,6 @@ $TRANSLATIONS = array(
"Please make sure that PHP 5.3.3 or newer is installed and that OpenSSL together with the PHP extension is enabled and configured properly. For now, the encryption app has been disabled." => "Kontrollera att PHP 5.3.3 eller senare är installerad och att tillägget OpenSSL PHP är aktiverad och korrekt konfigurerad. Kryptering är tillsvidare inaktiverad.",
"Following users are not set up for encryption:" => "Följande användare har inte aktiverat kryptering:",
"Saving..." => "Sparar...",
"Your private key is not valid! Maybe the your password was changed from outside." => "Din privata lösenordsnyckel är inte giltig! Kanske byttes ditt lösenord från utsidan.",
"You can unlock your private key in your " => "Du kan låsa upp din privata nyckel i dina",
"personal settings" => "personliga inställningar",
"Encryption" => "Kryptering",
"Enable recovery key (allow to recover users files in case of password loss):" => "Aktivera lösenordsnyckel (för att kunna återfå användarens filer vid glömt eller förlorat lösenord):",

View File

@ -10,8 +10,6 @@ $TRANSLATIONS = array(
"Could not update the private key password. Maybe the old password was not correct." => "无法更新私钥密码。可能旧密码不正确。",
"Your private key is not valid! Likely your password was changed outside the ownCloud system (e.g. your corporate directory). You can update your private key password in your personal settings to recover access to your encrypted files." => "您的私有密钥无效!也许是您在 ownCloud 系统外更改了密码 (比如,在您的公司目录)。您可以在个人设置里更新您的私钥密码来恢复访问你的加密文件。",
"Saving..." => "保存中",
"Your private key is not valid! Maybe the your password was changed from outside." => "您的私钥不正确!可能您在别处更改了密码。",
"You can unlock your private key in your " => "您可以在这里解锁您的私钥:",
"personal settings" => "个人设置",
"Encryption" => "加密",
"Enable recovery key (allow to recover users files in case of password loss):" => "启用恢复密钥(允许你在密码丢失后恢复文件):",

View File

@ -199,12 +199,12 @@ class Helper {
public static function stripUserFilesPath($path) {
$trimmed = ltrim($path, '/');
$split = explode('/', $trimmed);
// it is not a file relative to data/user/files
if (count($split) < 3 || $split[1] !== 'files') {
return false;
}
$sliced = array_slice($split, 2);
$relPath = implode('/', $sliced);
@ -219,30 +219,33 @@ class Helper {
public static function getPathToRealFile($path) {
$trimmed = ltrim($path, '/');
$split = explode('/', $trimmed);
if (count($split) < 3 || $split[1] !== "files_versions") {
return false;
}
$sliced = array_slice($split, 2);
$realPath = implode('/', $sliced);
//remove the last .v
$realPath = substr($realPath, 0, strrpos($realPath, '.v'));
return $realPath;
}
}
/**
* @brief redirect to a error page
*/
public static function redirectToErrorPage() {
public static function redirectToErrorPage($session) {
$init = $session->getInitialized();
$location = \OC_Helper::linkToAbsolute('apps/files_encryption/files', 'error.php');
$post = 0;
if(count($_POST) > 0) {
$post = 1;
}
header('Location: ' . $location . '?p=' . $post);
exit();
}
header('Location: ' . $location . '?p=' . $post . '&i=' . $init);
exit();
}
/**
@ -259,7 +262,7 @@ class Helper {
return (bool) $result;
}
/**
* check some common errors if the server isn't configured properly for encryption
* @return bool true if configuration seems to be OK

View File

@ -317,7 +317,7 @@ class Proxy extends \OC_FileProxy {
public function postGetFileInfo($path, $data) {
// if path is a folder do nothing
if (is_array($data) && array_key_exists('size', $data)) {
if (\OCP\App::isEnabled('files_encryption') && is_array($data) && array_key_exists('size', $data)) {
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;

View File

@ -30,6 +30,11 @@ class Session {
private $view;
const NOT_INITIALIZED = '0';
const INIT_EXECUTED = '1';
const INIT_SUCCESSFUL = '2';
/**
* @brief if session is started, check if ownCloud key pair is set up, if not create it
* @param \OC_FilesystemView $view
@ -112,6 +117,36 @@ class Session {
}
/**
* @brief Sets status of encryption app
* @param string $init INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INOITIALIZED
* @return bool
*
* @note this doesn not indicate of the init was successful, we just remeber the try!
*/
public function setInitialized($init) {
\OC::$session->set('encryptionInitialized', $init);
return true;
}
/**
* @brief Gets status if we already tried to initialize the encryption app
* @returns init status INIT_SUCCESSFUL, INIT_EXECUTED, NOT_INOITIALIZED
*
* @note this doesn not indicate of the init was successful, we just remeber the try!
*/
public function getInitialized() {
if (!is_null(\OC::$session->get('encryptionInitialized'))) {
return \OC::$session->get('encryptionInitialized');
} else {
return self::NOT_INITIALIZED;
}
}
/**
* @brief Gets user or public share private key from session
* @returns string $privateKey The user's plaintext private key

View File

@ -131,7 +131,7 @@ class Stream {
if($this->privateKey === false) {
// if private key is not valid redirect user to a error page
\OCA\Encryption\Helper::redirectToErrorPage();
\OCA\Encryption\Helper::redirectToErrorPage($this->session);
}
$this->size = $this->rootView->filesize($this->rawPath, $mode);

View File

@ -37,7 +37,6 @@ class Util {
const MIGRATION_IN_PROGRESS = -1; // migration is running
const MIGRATION_OPEN = 0; // user still needs to be migrated
private $view; // OC_FilesystemView object for filesystem operations
private $userId; // ID of the currently logged-in user
private $client; // Client side encryption mode flag
@ -1752,6 +1751,11 @@ class Util {
*/
public function initEncryption($params) {
$session = new \OCA\Encryption\Session($this->view);
// we tried to initialize the encryption app for this session
$session->setInitialized(\OCA\Encryption\Session::INIT_EXECUTED);
$encryptedKey = Keymanager::getPrivateKey($this->view, $params['uid']);
$privateKey = Crypt::decryptPrivateKey($encryptedKey, $params['password']);
@ -1762,9 +1766,8 @@ class Util {
return false;
}
$session = new \OCA\Encryption\Session($this->view);
$session->setPrivateKey($privateKey);
$session->setInitialized(\OCA\Encryption\Session::INIT_SUCCESSFUL);
return $session;
}

View File

@ -16,7 +16,9 @@ $view = new \OC_FilesystemView('/');
$util = new \OCA\Encryption\Util($view, $user);
$session = new \OCA\Encryption\Session($view);
$privateKeySet = $session->getPrivateKey() !== false;
$privateKeySet = $session->getPrivateKey() !== false;
// did we tried to initialize the keys for this session?
$initialized = $session->getInitialized();
$recoveryAdminEnabled = OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled');
$recoveryEnabledForUser = $util->recoveryEnabledForUser();
@ -31,6 +33,7 @@ if ($recoveryAdminEnabled || !$privateKeySet) {
$tmpl->assign('recoveryEnabled', $recoveryAdminEnabled);
$tmpl->assign('recoveryEnabledForUser', $recoveryEnabledForUser);
$tmpl->assign('privateKeySet', $privateKeySet);
$tmpl->assign('initialized', $initialized);
$result = $tmpl->fetchPage();
}

View File

@ -2,9 +2,11 @@
<li class='error'>
<?php $location = \OC_Helper::linkToRoute( "settings_personal" ).'#changePKPasswd' ?>
<?php p($l->t('Your private key is not valid! Maybe the your password was changed from outside.')); ?>
<?php p($_['message']); ?>
<br/>
<?php p($l->t('You can unlock your private key in your ')); ?> <a href="<?php echo $location?>"><?php p($l->t('personal settings')); ?>.</a>
<?php if($_['init']): ?>
<?php>p($l->t('Go directly to your ')); ?> <a href="<?php echo $location?>"><?php p($l->t('personal settings')); ?>.</a>
<?php endif; ?>
<br/>
</li>
</ul>

View File

@ -10,14 +10,17 @@
<?php p($l->t("Enable recovery key (allow to recover users files in case of password loss):")); ?>
<br/>
<br/>
<input type="password" name="recoveryPassword" id="recoveryPassword"/>
<input type="password" name="encryptionRecoveryPassword" id="encryptionRecoveryPassword"/>
<label for="recoveryPassword"><?php p($l->t("Recovery key password")); ?></label>
<br/>
<input type="password" name="encryptionRecoveryPassword" id="repeatEncryptionRecoveryPassword"/>
<label for="repeatEncryptionRecoveryPassword"><?php p($l->t("Repeat Recovery key password")); ?></label>
<br/>
<input
type='radio'
name='adminEnableRecovery'
value='1'
<?php echo($_["recoveryEnabled"] == 1 ? 'checked="checked"' : 'disabled'); ?> />
<?php echo($_["recoveryEnabled"] === '1' ? 'checked="checked"' : 'disabled'); ?> />
<?php p($l->t("Enabled")); ?>
<br/>
@ -25,27 +28,32 @@
type='radio'
name='adminEnableRecovery'
value='0'
<?php echo($_["recoveryEnabled"] == 0 ? 'checked="checked"' : 'disabled'); ?> />
<?php echo($_["recoveryEnabled"] === '0' ? 'checked="checked"' : 'disabled'); ?> />
<?php p($l->t("Disabled")); ?>
</p>
<br/><br/>
<p>
<p name="changeRecoveryPasswordBlock" <?php if ($_['recoveryEnabled'] === '0') print_unescaped('class="hidden"');?>>
<strong><?php p($l->t("Change recovery key password:")); ?></strong>
<br/><br/>
<input
type="password"
name="changeRecoveryPassword"
id="oldRecoveryPassword"
<?php echo($_["recoveryEnabled"] == 0 ? 'disabled' : ''); ?> />
<label for="oldRecoveryPassword"><?php p($l->t("Old Recovery key password")); ?></label>
id="oldEncryptionRecoveryPassword"
<label for="oldEncryptionRecoveryPassword"><?php p($l->t("Old Recovery key password")); ?></label>
<br/>
<br/>
<input
type="password"
name="changeRecoveryPassword"
id="newRecoveryPassword"
<?php echo($_["recoveryEnabled"] == 0 ? 'disabled' : ''); ?> />
<label for="newRecoveryPassword"><?php p($l->t("New Recovery key password")); ?></label>
id="newEncryptionRecoveryPassword"
<label for="newEncryptionRecoveryPassword"><?php p($l->t("New Recovery key password")); ?></label>
<br/>
<input
type="password"
name="changeRecoveryPassword"
id="repeatedNewEncryptionRecoveryPassword"
<label for="repeatEncryptionRecoveryPassword"><?php p($l->t("Repeat New Recovery key password")); ?></label>
<br/>
<button
type="button"

View File

@ -4,7 +4,7 @@
<?php p( $l->t( 'Encryption' ) ); ?>
</legend>
<?php if ( ! $_["privateKeySet"] ): ?>
<?php if ( ! $_["privateKeySet"] && $_["initialized"] ): ?>
<p>
<a name="changePKPasswd" />
<label for="changePrivateKeyPasswd">
@ -39,22 +39,22 @@
<?php endif; ?>
<br />
<?php if ( $_["recoveryEnabled"] && $_["privateKeySet"] ): ?>
<p>
<label for="userEnableRecovery"><?php p( $l->t( "Enable password recovery:" ) ); ?></label>
<br />
<em><?php p( $l->t( "Enabling this option will allow you to reobtain access to your encrypted files in case of password loss" ) ); ?></em>
<br />
<input
<input
type='radio'
name='userEnableRecovery'
value='1'
<?php echo ( $_["recoveryEnabledForUser"] == 1 ? 'checked="checked"' : '' ); ?> />
<?php p( $l->t( "Enabled" ) ); ?>
<br />
<input
<input
type='radio'
name='userEnableRecovery'
value='0'

View File

@ -29,60 +29,72 @@ class SFTP extends \OC\Files\Storage\Common {
}
$this->user = $params['user'];
$this->password = $params['password'];
$this->root = isset($params['root']) ? $this->cleanPath($params['root']) : '/';
if ($this->root[0] != '/') $this->root = '/' . $this->root;
if (substr($this->root, -1, 1) != '/') $this->root .= '/';
$this->root
= isset($params['root']) ? $this->cleanPath($params['root']) : '/';
$host_keys = $this->read_host_keys();
if ($this->root[0] != '/') {
$this->root = '/' . $this->root;
}
if (substr($this->root, -1, 1) != '/') {
$this->root .= '/';
}
$hostKeys = $this->readHostKeys();
$this->client = new \Net_SFTP($this->host);
if (!$this->client->login($this->user, $this->password)) {
throw new \Exception('Login failed');
}
$current_host_key = $this->client->getServerPublicHostKey();
$currentHostKey = $this->client->getServerPublicHostKey();
if (array_key_exists($this->host, $host_keys)) {
if ($host_keys[$this->host] != $current_host_key) {
if (array_key_exists($this->host, $hostKeys)) {
if ($hostKeys[$this->host] != $currentHostKey) {
throw new \Exception('Host public key does not match known key');
}
} else {
$host_keys[$this->host] = $current_host_key;
$this->write_host_keys($host_keys);
$hostKeys[$this->host] = $currentHostKey;
$this->writeHostKeys($hostKeys);
}
}
public function test() {
if (!isset($params['host']) || !isset($params['user']) || !isset($params['password'])) {
throw new \Exception("Required parameters not set");
if (
!isset($this->host)
|| !isset($this->user)
|| !isset($this->password)
) {
return false;
}
return $this->client->nlist() !== false;
}
public function getId(){
return 'sftp::' . $this->user . '@' . $this->host . '/' . $this->root;
}
private function abs_path($path) {
private function absPath($path) {
return $this->root . $this->cleanPath($path);
}
private function host_keys_path() {
private function hostKeysPath() {
try {
$storage_view = \OCP\Files::getStorage('files_external');
if ($storage_view) {
return \OCP\Config::getSystemValue('datadirectory') .
$storage_view->getAbsolutePath('') .
'ssh_host_keys';
'ssh_hostKeys';
}
} catch (\Exception $e) {
}
return false;
}
private function write_host_keys($keys) {
private function writeHostKeys($keys) {
try {
$key_path = $this->host_keys_path();
$fp = fopen($key_path, 'w');
$keyPath = $this->hostKeysPath();
$fp = fopen($keyPath, 'w');
foreach ($keys as $host => $key) {
fwrite($fp, $host . '::' . $key . "\n");
}
@ -93,19 +105,19 @@ class SFTP extends \OC\Files\Storage\Common {
}
}
private function read_host_keys() {
private function readHostKeys() {
try {
$key_path = $this->host_keys_path();
if (file_exists($key_path)) {
$keyPath = $this->hostKeysPath();
if (file_exists($keyPath)) {
$hosts = array();
$keys = array();
$lines = file($key_path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$lines = file($keyPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
if ($lines) {
foreach ($lines as $line) {
$host_key_arr = explode("::", $line, 2);
if (count($host_key_arr) == 2) {
$hosts[] = $host_key_arr[0];
$keys[] = $host_key_arr[1];
$hostKeyArray = explode("::", $line, 2);
if (count($hostKeyArray) == 2) {
$hosts[] = $hostKeyArray[0];
$keys[] = $hostKeyArray[1];
}
}
return array_combine($hosts, $keys);
@ -118,7 +130,7 @@ class SFTP extends \OC\Files\Storage\Common {
public function mkdir($path) {
try {
return $this->client->mkdir($this->abs_path($path));
return $this->client->mkdir($this->absPath($path));
} catch (\Exception $e) {
return false;
}
@ -126,7 +138,7 @@ class SFTP extends \OC\Files\Storage\Common {
public function rmdir($path) {
try {
return $this->client->delete($this->abs_path($path), true);
return $this->client->delete($this->absPath($path), true);
} catch (\Exception $e) {
return false;
}
@ -134,16 +146,16 @@ class SFTP extends \OC\Files\Storage\Common {
public function opendir($path) {
try {
$list = $this->client->nlist($this->abs_path($path));
$list = $this->client->nlist($this->absPath($path));
$id = md5('sftp:' . $path);
$dir_stream = array();
$dirStream = array();
foreach($list as $file) {
if ($file != '.' && $file != '..') {
$dir_stream[] = $file;
$dirStream[] = $file;
}
}
\OC\Files\Stream\Dir::register($id, $dir_stream);
\OC\Files\Stream\Dir::register($id, $dirStream);
return opendir('fakedir://' . $id);
} catch(\Exception $e) {
return false;
@ -152,10 +164,16 @@ class SFTP extends \OC\Files\Storage\Common {
public function filetype($path) {
try {
$stat = $this->client->stat($this->abs_path($path));
if ($stat['type'] == NET_SFTP_TYPE_REGULAR) return 'file';
if ($stat['type'] == NET_SFTP_TYPE_DIRECTORY) return 'dir';
$stat = $this->client->stat($this->absPath($path));
if ($stat['type'] == NET_SFTP_TYPE_REGULAR) {
return 'file';
}
if ($stat['type'] == NET_SFTP_TYPE_DIRECTORY) {
return 'dir';
}
} catch (\Exeption $e) {
}
return false;
}
@ -170,7 +188,7 @@ class SFTP extends \OC\Files\Storage\Common {
public function file_exists($path) {
try {
return $this->client->stat($this->abs_path($path)) !== false;
return $this->client->stat($this->absPath($path)) !== false;
} catch (\Exception $e) {
return false;
}
@ -178,7 +196,7 @@ class SFTP extends \OC\Files\Storage\Common {
public function unlink($path) {
try {
return $this->client->delete($this->abs_path($path), true);
return $this->client->delete($this->absPath($path), true);
} catch (\Exception $e) {
return false;
}
@ -186,18 +204,21 @@ class SFTP extends \OC\Files\Storage\Common {
public function fopen($path, $mode) {
try {
$abs_path = $this->abs_path($path);
$absPath = $this->absPath($path);
switch($mode) {
case 'r':
case 'rb':
if ( !$this->file_exists($path)) return false;
if ( !$this->file_exists($path)) {
return false;
}
if (strrpos($path, '.')!==false) {
$ext=substr($path, strrpos($path, '.'));
} else {
$ext='';
}
$tmp = \OC_Helper::tmpFile($ext);
$this->getFile($abs_path, $tmp);
$this->getFile($absPath, $tmp);
return fopen($tmp, $mode);
case 'w':
@ -217,12 +238,18 @@ class SFTP extends \OC\Files\Storage\Common {
} else {
$ext='';
}
$tmpFile=\OC_Helper::tmpFile($ext);
\OC\Files\Stream\Close::registerCallback($tmpFile, array($this, 'writeBack'));
\OC\Files\Stream\Close::registerCallback(
$tmpFile,
array($this, 'writeBack')
);
if ($this->file_exists($path)) {
$this->getFile($abs_path, $tmpFile);
$this->getFile($absPath, $tmpFile);
}
self::$tempFiles[$tmpFile]=$abs_path;
self::$tempFiles[$tmpFile]=$absPath;
return fopen('close://'.$tmpFile, $mode);
}
} catch (\Exception $e) {
@ -240,9 +267,11 @@ class SFTP extends \OC\Files\Storage\Common {
public function touch($path, $mtime=null) {
try {
if (!is_null($mtime)) return false;
if (!is_null($mtime)) {
return false;
}
if (!$this->file_exists($path)) {
$this->client->put($this->abs_path($path), '');
$this->client->put($this->absPath($path), '');
} else {
return false;
}
@ -262,7 +291,10 @@ class SFTP extends \OC\Files\Storage\Common {
public function rename($source, $target) {
try {
return $this->client->rename($this->abs_path($source), $this->abs_path($target));
return $this->client->rename(
$this->absPath($source),
$this->absPath($target)
);
} catch (\Exception $e) {
return false;
}
@ -270,7 +302,7 @@ class SFTP extends \OC\Files\Storage\Common {
public function stat($path) {
try {
$stat = $this->client->stat($this->abs_path($path));
$stat = $this->client->stat($this->absPath($path));
$mtime = $stat ? $stat['mtime'] : -1;
$size = $stat ? $stat['size'] : 0;
@ -279,6 +311,5 @@ class SFTP extends \OC\Files\Storage\Common {
} catch (\Exception $e) {
return false;
}
}
}

View File

@ -1,6 +1,6 @@
<form id="files_external">
<fieldset class="personalblock">
<legend><strong><?php p($l->t('External Storage')); ?></strong></legend>
<h2><?php p($l->t('External Storage')); ?></h2>
<?php if (isset($_['dependencies']) and ($_['dependencies']<>'')) print_unescaped(''.$_['dependencies'].''); ?>
<table id="externalStorage" data-admin='<?php print_unescaped(json_encode($_['isAdminPage'])); ?>'>
<thead>
@ -138,7 +138,7 @@
enctype="multipart/form-data"
action="<?php p(OCP\Util::linkTo('files_external', 'ajax/addRootCertificate.php')); ?>">
<fieldset class="personalblock">
<legend><strong><?php p($l->t('SSL root certificates'));?></strong></legend>
<h2><?php p($l->t('SSL root certificates'));?></h2>
<table id="sslCertificate" data-admin='<?php print_unescaped(json_encode($_['isAdminPage'])); ?>'>
<tbody width="100%">
<?php foreach ($_['certs'] as $rootCert): ?>

View File

@ -7,6 +7,7 @@ OC::$CLASSPATH['OC\Files\Cache\Shared_Cache'] = 'files_sharing/lib/cache.php';
OC::$CLASSPATH['OC\Files\Cache\Shared_Permissions'] = 'files_sharing/lib/permissions.php';
OC::$CLASSPATH['OC\Files\Cache\Shared_Updater'] = 'files_sharing/lib/updater.php';
OC::$CLASSPATH['OC\Files\Cache\Shared_Watcher'] = 'files_sharing/lib/watcher.php';
OC::$CLASSPATH['OCA\Files\Share\Api'] = 'files_sharing/lib/api.php';
OCP\Util::connectHook('OC_Filesystem', 'setup', '\OC\Files\Storage\Shared', 'setup');
OCP\Share::registerBackend('file', 'OC_Share_Backend_File');
OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file');

View File

@ -2,4 +2,33 @@
$this->create('core_ajax_public_preview', '/publicpreview.png')->action(
function() {
require_once __DIR__ . '/../ajax/publicpreview.php';
});
});
// OCS API
//TODO: SET: mail notification, waiting for PR #4689 to be accepted
OC_API::register('get',
'/apps/files_sharing/api/v1/shares',
array('\OCA\Files\Share\Api', 'getAllShares'),
'files_sharing');
OC_API::register('post',
'/apps/files_sharing/api/v1/shares',
array('\OCA\Files\Share\Api', 'createShare'),
'files_sharing');
OC_API::register('get',
'/apps/files_sharing/api/v1/shares/{id}',
array('\OCA\Files\Share\Api', 'getShare'),
'files_sharing');
OC_API::register('put',
'/apps/files_sharing/api/v1/shares/{id}',
array('\OCA\Files\Share\Api', 'updateShare'),
'files_sharing');
OC_API::register('delete',
'/apps/files_sharing/api/v1/shares/{id}',
array('\OCA\Files\Share\Api', 'deleteShare'),
'files_sharing');

View File

@ -68,11 +68,21 @@ if (version_compare($installedVersion, '0.3', '<')) {
// $query = OCP\DB::prepare('DROP TABLE `*PREFIX*sharing`');
// $query->execute();
}
if (version_compare($installedVersion, '0.3.3', '<')) {
OC_User::useBackend(new OC_User_Database());
OC_App::loadApps(array('authentication'));
$users = OC_User::getUsers();
foreach ($users as $user) {
// OC_FileCache::delete('Shared', '/'.$user.'/files/');
// clean up oc_share table from files which are no longer exists
if (version_compare($installedVersion, '0.3.4', '<')) {
// get all shares where the original file no longer exists
$findShares = \OC_DB::prepare('SELECT `file_source` FROM `*PREFIX*share` LEFT JOIN `*PREFIX*filecache` ON `file_source` = `*PREFIX*filecache`.`fileid` WHERE `*PREFIX*filecache`.`fileid` IS NULL');
$sharesFound = $findShares->execute(array())->fetchAll();
// delete those shares from the oc_share table
if (is_array($sharesFound) && !empty($sharesFound)) {
$delArray = array();
foreach ($sharesFound as $share) {
$delArray[] = $share['file_source'];
}
$removeShares = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `file_source` IN (?)');
$result = $removeShares->execute(array(implode(',', $delArray)));
}
}

View File

@ -1 +1 @@
0.3.3
0.3.4

View File

@ -3,8 +3,7 @@ body {
}
#header {
background:#1d2d44;
box-shadow:0 0 10px rgba(0,0,0,.5), inset 0 -2px 10px #222;
background: #1d2d44 url('%webroot%/core/img/noise.png') repeat;
height:2.5em;
left:0;
line-height:2.5em;
@ -61,7 +60,6 @@ body {
p.info {
color:#777;
text-align:center;
text-shadow:#fff 0 1px 0;
width:22em;
margin:2em auto;
}

View File

@ -1,7 +1,14 @@
<?php
$TRANSLATIONS = array(
"The password is wrong. Try again." => "비밀번호가 틀립니다. 다시 입력해주세요.",
"Password" => "암호",
"Submit" => "제출",
"Sorry, this link doesnt seem to work anymore." => "죄송합니다만 이 링크는 더이상 작동되지 않습니다.",
"Reasons might be:" => "이유는 다음과 같을 수 있습니다:",
"the item was removed" => "이 항목은 삭제되었습니다",
"the link expired" => "링크가 만료되었습니다",
"sharing is disabled" => "공유가 비활성되었습니다",
"For more info, please ask the person who sent this link." => "더 자세한 설명은 링크를 보내신 분에게 여쭤보십시오",
"%s shared the folder %s with you" => "%s 님이 폴더 %s을(를) 공유하였습니다",
"%s shared the file %s with you" => "%s 님이 파일 %s을(를) 공유하였습니다",
"Download" => "다운로드",

View File

@ -0,0 +1,467 @@
<?php
/**
* ownCloud
*
* @author Bjoern Schiessle
* @copyright 2013 Bjoern Schiessle schiessle@owncloud.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Files\Share;
class Api {
/**
* @brief get all shares
*
* @param array $params option 'file' to limit the result to a specific file/folder
* @return \OC_OCS_Result share information
*/
public static function getAllShares($params) {
// if a file is specified, get the share for this file
if (isset($_GET['path'])) {
$params['itemSource'] = self::getFileId($_GET['path']);
$params['path'] = $_GET['path'];
if (isset($_GET['subfiles']) && $_GET['subfiles'] === 'true') {
return self::getSharesFromFolder($params);
}
return self::getShare($params);
}
$share = \OCP\Share::getItemShared('file', null);
if ($share === false) {
return new \OC_OCS_Result(null, 404, 'could not get shares');
} else {
return new \OC_OCS_Result($share);
}
}
/**
* @brief get share information for a given share
*
* @param array $params which contains a 'id'
* @return \OC_OCS_Result share information
*/
public static function getShare($params) {
// either the $params already contains a itemSource if we come from
// getAllShare() or we need to translate the shareID to a itemSource
if(isset($params['itemSource'])) {
$itemSource = $params['itemSource'];
$getSpecificShare = true;
} else {
$s = self::getShareFromId($params['id']);
$itemSource = $s['item_source'];
$getSpecificShare = false;
}
if ($itemSource !== null) {
$shares = \OCP\Share::getItemShared('file', $itemSource);
// if a specific share was specified only return this one
if ($getSpecificShare === false) {
foreach ($shares as $share) {
if ($share['id'] === (int)$params['id']) {
$shares = array('element' => $share);
break;
}
}
}
} else {
$shares = null;
}
if ($shares === null || empty($shares)) {
return new \OC_OCS_Result(null, 404, 'share doesn\'t exist');
} else {
return new \OC_OCS_Result($shares);
}
}
/**
* @brief get share from all files in a given folder (non-recursive)
* @param array $params contains 'path' to the folder
* @return \OC_OCS_Result
*/
private static function getSharesFromFolder($params) {
$path = $params['path'];
$view = new \OC\Files\View('/'.\OCP\User::getUser().'/files');
if(!$view->is_dir($path)) {
return new \OC_OCS_Result(null, 404, "not a directory");
}
$content = $view->getDirectoryContent($path);
$result = array();
foreach ($content as $file) {
$share = \OCP\Share::getItemShared('file', $file['fileid']);
if ($share) {
$share['filename'] = $file['name'];
$result[] = $share;
}
}
return new \OC_OCS_Result($result);
}
/**
* @breif create a new share
* @param array $params
* @return \OC_OCS_Result
*/
public static function createShare($params) {
$path = isset($_POST['path']) ? $_POST['path'] : null;
if($path === null) {
return new \OC_OCS_Result(null, 400, "please specify a file or folder path");
}
$itemSource = self::getFileId($path);
$itemType = self::getItemType($path);
if($itemSource === null) {
return new \OC_OCS_Result(null, 404, "wrong path, file/folder doesn't exist.");
}
$shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : null;
$shareType = isset($_POST['shareType']) ? (int)$_POST['shareType'] : null;
switch($shareType) {
case \OCP\Share::SHARE_TYPE_USER:
$permissions = isset($_POST['permissions']) ? (int)$_POST['permissions'] : 31;
break;
case \OCP\Share::SHARE_TYPE_GROUP:
$permissions = isset($_POST['permissions']) ? (int)$_POST['permissions'] : 31;
break;
case \OCP\Share::SHARE_TYPE_LINK:
//allow password protection
$shareWith = isset($_POST['password']) ? $_POST['password'] : null;
//check public link share
$publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes');
$encryptionEnabled = \OC_App::isEnabled('files_encryption');
if(isset($_POST['publicUpload']) &&
($encryptionEnabled || $publicUploadEnabled !== 'yes')) {
return new \OC_OCS_Result(null, 404, "public upload disabled by the administrator");
}
$publicUpload = isset($_POST['publicUpload']) ? $_POST['publicUpload'] : 'false';
// read, create, update (7) if public upload is enabled or
// read (1) if public upload is disabled
$permissions = $publicUpload === 'true' ? 7 : 1;
break;
default:
return new \OC_OCS_Result(null, 404, "unknown share type");
}
try {
$token = \OCP\Share::shareItem(
$itemType,
$itemSource,
$shareType,
$shareWith,
$permissions
);
} catch (\Exception $e) {
return new \OC_OCS_Result(null, 404, $e->getMessage());
}
if ($token) {
$data = array();
$data['id'] = 'unknown';
$shares = \OCP\Share::getItemShared('file', $itemSource);
if(is_string($token)) { //public link share
foreach ($shares as $share) {
if ($share['token'] === $token) {
$data['id'] = $share['id'];
break;
}
}
$url = \OCP\Util::linkToPublic('files&t='.$token);
$data['url'] = $url; // '&' gets encoded to $amp;
$data['token'] = $token;
} else {
foreach ($shares as $share) {
if ($share['share_with'] === $shareWith && $share['share_type'] === $shareType) {
$data['id'] = $share['id'];
break;
}
}
}
return new \OC_OCS_Result($data);
} else {
return new \OC_OCS_Result(null, 404, "couldn't share file");
}
}
/**
* update shares, e.g. password, permissions, etc
* @param array $params shareId 'id' and the parameter we want to update
* currently supported: permissions, password, publicUpload
* @return \OC_OCS_Result
*/
public static function updateShare($params) {
$share = self::getShareFromId($params['id']);
$itemSource = isset($share['item_source']) ? $share['item_source'] : null;
if($itemSource === null) {
return new \OC_OCS_Result(null, 404, "wrong share Id, share doesn't exist.");
}
try {
if(isset($params['_put']['permissions'])) {
return self::updatePermissions($share, $params);
} elseif (isset($params['_put']['password'])) {
return self::updatePassword($share, $params);
} elseif (isset($params['_put']['publicUpload'])) {
return self::updatePublicUpload($share, $params);
}
} catch (\Exception $e) {
return new \OC_OCS_Result(null, 400, $e->getMessage());
}
return new \OC_OCS_Result(null, 400, "Wrong or no update parameter given");
}
/**
* @brief update permissions for a share
* @param array $share information about the share
* @param array $params contains 'permissions'
* @return \OC_OCS_Result
*/
private static function updatePermissions($share, $params) {
$itemSource = $share['item_source'];
$itemType = $share['item_type'];
$shareWith = $share['share_with'];
$shareType = $share['share_type'];
$permissions = isset($params['_put']['permissions']) ? (int)$params['_put']['permissions'] : null;
$publicUploadStatus = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes');
$encryptionEnabled = \OC_App::isEnabled('files_encryption');
$publicUploadEnabled = false;
if(!$encryptionEnabled && $publicUploadStatus === 'yes') {
$publicUploadEnabled = true;
}
// only change permissions for public shares if public upload is enabled
// and we want to set permissions to 1 (read only) or 7 (allow upload)
if ( (int)$shareType === \OCP\Share::SHARE_TYPE_LINK ) {
if ($publicUploadEnabled === false || ($permissions !== 7 && $permissions !== 1)) {
return new \OC_OCS_Result(null, 400, "can't change permission for public link share");
}
}
try {
$return = \OCP\Share::setPermissions(
$itemType,
$itemSource,
$shareType,
$shareWith,
$permissions
);
} catch (\Exception $e) {
return new \OC_OCS_Result(null, 404, $e->getMessage());
}
if ($return) {
return new \OC_OCS_Result();
} else {
return new \OC_OCS_Result(null, 404, "couldn't set permissions");
}
}
/**
* @brief enable/disable public upload
* @param array $share information about the share
* @param array $params contains 'publicUpload' which can be 'yes' or 'no'
* @return \OC_OCS_Result
*/
private static function updatePublicUpload($share, $params) {
$publicUploadEnabled = \OC_Appconfig::getValue('core', 'shareapi_allow_public_upload', 'yes');
$encryptionEnabled = \OC_App::isEnabled('files_encryption');
if($encryptionEnabled || $publicUploadEnabled !== 'yes') {
return new \OC_OCS_Result(null, 404, "public upload disabled by the administrator");
}
if ($share['item_type'] !== 'folder' ||
(int)$share['share_type'] !== \OCP\Share::SHARE_TYPE_LINK ) {
return new \OC_OCS_Result(null, 404, "public upload is only possible for public shared folders");
}
// read, create, update (7) if public upload is enabled or
// read (1) if public upload is disabled
$params['_put']['permissions'] = $params['_put']['publicUpload'] === 'true' ? 7 : 1;
return self::updatePermissions($share, $params);
}
/**
* @brief update password for public link share
* @param array $share information about the share
* @param type $params 'password'
* @return \OC_OCS_Result
*/
private static function updatePassword($share, $params) {
$itemSource = $share['item_source'];
$itemType = $share['item_type'];
if( (int)$share['share_type'] !== \OCP\Share::SHARE_TYPE_LINK) {
return new \OC_OCS_Result(null, 400, "password protection is only supported for public shares");
}
$shareWith = isset($params['_put']['password']) ? $params['_put']['password'] : null;
if($shareWith === '') {
$shareWith = null;
}
$items = \OCP\Share::getItemShared($itemType, $itemSource);
$checkExists = false;
foreach ($items as $item) {
if($item['share_type'] === \OCP\Share::SHARE_TYPE_LINK) {
$checkExists = true;
$permissions = $item['permissions'];
}
}
if (!$checkExists) {
return new \OC_OCS_Result(null, 404, "share doesn't exists, can't change password");
}
$result = \OCP\Share::shareItem(
$itemType,
$itemSource,
\OCP\Share::SHARE_TYPE_LINK,
$shareWith,
$permissions
);
if($result) {
return new \OC_OCS_Result();
}
return new \OC_OCS_Result(null, 404, "couldn't set password");
}
/**
* @brief unshare a file/folder
* @param array $params contains the shareID 'id' which should be unshared
* @return \OC_OCS_Result
*/
public static function deleteShare($params) {
$share = self::getShareFromId($params['id']);
$itemSource = isset($share['item_source']) ? $share['item_source'] : null;
$itemType = isset($share['item_type']) ? $share['item_type'] : null;;
if($itemSource === null) {
return new \OC_OCS_Result(null, 404, "wrong share ID, share doesn't exist.");
}
$shareWith = isset($share['share_with']) ? $share['share_with'] : null;
$shareType = isset($share['share_type']) ? (int)$share['share_type'] : null;
if( $shareType === \OCP\Share::SHARE_TYPE_LINK) {
$shareWith = null;
}
try {
$return = \OCP\Share::unshare(
$itemType,
$itemSource,
$shareType,
$shareWith);
} catch (\Exception $e) {
return new \OC_OCS_Result(null, 404, $e->getMessage());
}
if ($return) {
return new \OC_OCS_Result();
} else {
$msg = "Unshare Failed";
return new \OC_OCS_Result(null, 404, $msg);
}
}
/**
* @brief get file ID from a given path
* @param string $path
* @return string fileID or null
*/
private static function getFileId($path) {
$view = new \OC\Files\View('/'.\OCP\User::getUser().'/files');
$fileId = null;
$fileInfo = $view->getFileInfo($path);
if ($fileInfo) {
$fileId = $fileInfo['fileid'];
}
return $fileId;
}
/**
* @brief get itemType
* @param string $path
* @return string type 'file', 'folder' or null of file/folder doesn't exists
*/
private static function getItemType($path) {
$view = new \OC\Files\View('/'.\OCP\User::getUser().'/files');
$itemType = null;
if ($view->is_dir($path)) {
$itemType = "folder";
} elseif ($view->is_file($path)) {
$itemType = "file";
}
return $itemType;
}
/**
* @brief get some information from a given share
* @param int $shareID
* @return array with: item_source, share_type, share_with, item_type, permissions
*/
private static function getShareFromId($shareID) {
$sql = 'SELECT `item_source`, `share_type`, `share_with`, `item_type`, `permissions` FROM `*PREFIX*share` WHERE `id` = ?';
$args = array($shareID);
$query = \OCP\DB::prepare($sql);
$result = $query->execute($args);
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('files_sharing', \OC_DB::getErrorMessage($result), \OCP\Util::ERROR);
return null;
}
if ($share = $result->fetchRow()) {
return $share;
}
return null;
}
}

View File

@ -57,6 +57,23 @@ class Shared_Updater {
}
}
/**
* @brief remove all shares for a given file if the file was deleted
*
* @param string $path
*/
private static function removeShare($path) {
$fileInfo = \OC\Files\Filesystem::getFileInfo($path);
$fileSource = $fileInfo['fileid'];
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*share` WHERE `file_source`=?');
try {
\OC_DB::executeAudited($query, array($fileSource));
} catch (\Exception $e) {
\OCP\Util::writeLog('files_sharing', "can't remove share: " . $e->getMessage(), \OCP\Util::WARN);
}
}
/**
* @param array $params
*/
@ -77,8 +94,10 @@ class Shared_Updater {
*/
static public function deleteHook($params) {
self::correctFolders($params['path']);
self::removeShare($params['path']);
}
/**
* @param array $params
*/

View File

@ -188,7 +188,7 @@ if (isset($path)) {
} else {
$i['extension'] = '';
}
$i['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($i['mimetype']);
$i['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($i['mimetype']);
}
$i['directory'] = $getPath;
$i['permissions'] = OCP\PERMISSION_READ;

View File

@ -2,6 +2,7 @@
<div id="notification" style="display: none;"></div>
</div>
<input type="hidden" id="isPublic" name="isPublic" value="1">
<input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir">
<input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL">
<input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename">

View File

@ -0,0 +1,537 @@
<?php
/**
* ownCloud
*
* @author Bjoern Schiessle
* @copyright 2013 Bjoern Schiessle <schiessle@owncloud.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
require_once __DIR__ . '/../../../lib/base.php';
use OCA\Files\Share;
/**
* Class Test_Files_Sharing_Api
*/
class Test_Files_Sharing_Api extends \PHPUnit_Framework_TestCase {
const TEST_FILES_SHARING_API_USER1 = "test-share-user1";
const TEST_FILES_SHARING_API_USER2 = "test-share-user2";
public $stateFilesEncryption;
public $filename;
public $data;
/**
* @var OC_FilesystemView
*/
public $view;
public $folder;
public static function setUpBeforeClass() {
// reset backend
\OC_User::clearBackends();
\OC_User::useBackend('database');
// clear share hooks
\OC_Hook::clear('OCP\\Share');
\OC::registerShareHooks();
\OCP\Util::connectHook('OC_Filesystem', 'setup', '\OC\Files\Storage\Shared', 'setup');
// create users
self::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1, true);
self::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, true);
}
function setUp() {
$this->data = 'foobar';
$this->view = new \OC_FilesystemView('/' . \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1 . '/files');
$this->folder = '/folder_share_api_test';
$this->filename = 'share-api-test.txt';
// remember files_encryption state
$this->stateFilesEncryption = \OC_App::isEnabled('files_encryption');
//we don't want to tests with app files_encryption enabled
\OC_App::disable('files_encryption');
$this->assertTrue(!\OC_App::isEnabled('files_encryption'));
// save file with content
$this->view->file_put_contents($this->filename, $this->data);
$this->view->mkdir($this->folder);
$this->view->file_put_contents($this->folder.'/'.$this->filename, $this->data);
}
function tearDown() {
$this->view->unlink($this->filename);
$this->view->deleteAll($this->folder);
// reset app files_encryption
if ($this->stateFilesEncryption) {
\OC_App::enable('files_encryption');
} else {
\OC_App::disable('files_encryption');
}
}
public static function tearDownAfterClass() {
// cleanup users
\OC_User::deleteUser(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1);
\OC_User::deleteUser(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
}
/**
* @medium
*/
function testCreateShare() {
//login as user1
\Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1);
// share to user
// simulate a post request
$_POST['path'] = $this->filename;
$_POST['shareWith'] = \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2;
$_POST['shareType'] = \OCP\Share::SHARE_TYPE_USER;
$result = Share\Api::createShare(array());
$this->assertTrue($result->succeeded());
$data = $result->getData();
$share = $this->getShareFromId($data['id']);
$items = \OCP\Share::getItemShared('file', $share['item_source']);
$this->assertTrue(!empty($items));
// share link
// simulate a post request
$_POST['path'] = $this->folder;
$_POST['shareType'] = \OCP\Share::SHARE_TYPE_LINK;
$result = Share\Api::createShare(array());
// check if API call was successful
$this->assertTrue($result->succeeded());
$data = $result->getData();
// check if we have a token
$this->assertTrue(is_string($data['token']));
$share = $this->getShareFromId($data['id']);
$items = \OCP\Share::getItemShared('file', $share['item_source']);
$this->assertTrue(!empty($items));
$fileinfo = $this->view->getFileInfo($this->filename);
\OCP\Share::unshare('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
$fileinfo = $this->view->getFileInfo($this->folder);
\OCP\Share::unshare('folder', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, null);
}
/**
* @medium
* @depends testCreateShare
*/
function testGetAllShares() {
$fileinfo = $this->view->getFileInfo($this->filename);
\OCP\Share::shareItem('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31);
$result = Share\Api::getAllShares(array());
$this->assertTrue($result->succeeded());
// test should return two shares created from testCreateShare()
$this->assertTrue(count($result->getData()) === 1);
\OCP\Share::unshare('file', $fileinfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
}
/**
* @medium
* @depends testCreateShare
*/
function testGetShareFromSource() {
$fileInfo = $this->view->getFileInfo($this->filename);
\OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31);
\OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK,
null, 1);
$params = array('itemSource' => $fileInfo['fileid']);
$result = Share\Api::getShare($params);
$this->assertTrue($result->succeeded());
// test should return one share created from testCreateShare()
$this->assertTrue(count($result->getData()) === 2);
\OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
\OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, null);
}
/**
* @medium
* @depends testCreateShare
*/
function testGetShareFromId() {
$fileInfo = $this->view->getFileInfo($this->filename);
$result = \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31);
// share was successful?
$this->assertTrue($result);
// get item to determine share ID
$result = \OCP\Share::getItemShared('file', $fileInfo['fileid']);
$this->assertEquals(1, count($result));
// get first element
$share = reset($result);
// call getShare() with share ID
$params = array('id' => $share['id']);
$result = Share\Api::getShare($params);
$this->assertTrue($result->succeeded());
// test should return one share created from testCreateShare()
$this->assertEquals(1, count($result->getData()));
\OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
}
/**
* @medium
*/
function testGetShareFromFolder() {
$fileInfo1 = $this->view->getFileInfo($this->filename);
$fileInfo2 = $this->view->getFileInfo($this->folder.'/'.$this->filename);
$result = \OCP\Share::shareItem('file', $fileInfo1['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31);
// share was successful?
$this->assertTrue($result);
$result = \OCP\Share::shareItem('folder', $fileInfo2['fileid'], \OCP\Share::SHARE_TYPE_LINK,
null, 1);
// share was successful?
$this->assertTrue(is_string($result));
$_GET['path'] = $this->folder;
$_GET['subfiles'] = 'true';
$result = Share\Api::getAllShares(array());
$this->assertTrue($result->succeeded());
// test should return one share within $this->folder
$this->assertTrue(count($result->getData()) === 1);
\OCP\Share::unshare('file', $fileInfo1['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
\OCP\Share::unshare('folder', $fileInfo2['fileid'], \OCP\Share::SHARE_TYPE_LINK, null);
}
/**
* @medium
*/
function testGetShareFromUnknownId() {
$params = array('id' => 0);
$result = Share\Api::getShare($params);
$this->assertEquals(404, $result->getStatusCode());
$this->assertEquals('share doesn\'t exist', $result->getMeta()['message']);
}
/**
* @medium
* @depends testCreateShare
*/
function testUpdateShare() {
$fileInfo = $this->view->getFileInfo($this->filename);
$result = \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31);
// share was successful?
$this->assertTrue($result);
$result = \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK,
null, 1);
// share was successful?
$this->assertTrue(is_string($result));
$items = \OCP\Share::getItemShared('file', null);
// make sure that we found a link share and a user share
$this->assertEquals(count($items), 2);
$linkShare = null;
$userShare = null;
foreach ($items as $item) {
if ($item['share_type'] === \OCP\Share::SHARE_TYPE_LINK) {
$linkShare = $item;
}
if ($item['share_type'] === \OCP\Share::SHARE_TYPE_USER) {
$userShare = $item;
}
}
// make sure that we found a link share and a user share
$this->assertTrue(is_array($linkShare));
$this->assertTrue(is_array($userShare));
// update permissions
$this->assertEquals('31', $userShare['permissions']);
$params = array();
$params['id'] = $userShare['id'];
$params['_put'] = array();
$params['_put']['permissions'] = 1;
$result = Share\Api::updateShare($params);
$this->assertTrue($result->succeeded(), $result->getMeta()['message']);
$items = \OCP\Share::getItemShared('file', $userShare['file_source']);
$newUserShare = null;
foreach ($items as $item) {
if ($item['share_with'] === \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2) {
$newUserShare = $item;
break;
}
}
$this->assertTrue(is_array($newUserShare));
$this->assertEquals('1', $newUserShare['permissions']);
// update password for link share
$this->assertTrue(empty($linkShare['share_with']));
$params = array();
$params['id'] = $linkShare['id'];
$params['_put'] = array();
$params['_put']['password'] = 'foo';
$result = Share\Api::updateShare($params);
$this->assertTrue($result->succeeded());
$items = \OCP\Share::getItemShared('file', $linkShare['file_source']);
$newLinkShare = null;
foreach ($items as $item) {
if ($item['share_type'] === \OCP\Share::SHARE_TYPE_LINK) {
$newLinkShare = $item;
break;
}
}
$this->assertTrue(is_array($newLinkShare));
$this->assertTrue(!empty($newLinkShare['share_with']));
\OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
\OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, null);
}
/**
* @medium
*/
function testUpdateShareUpload() {
$fileInfo = $this->view->getFileInfo($this->folder);
$result = \OCP\Share::shareItem('folder', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK,
null, 1);
// share was successful?
$this->assertTrue(is_string($result));
$items = \OCP\Share::getItemShared('file', null);
// make sure that we found a link share and a user share
$this->assertEquals(count($items), 1);
$linkShare = null;
foreach ($items as $item) {
if ($item['share_type'] === \OCP\Share::SHARE_TYPE_LINK) {
$linkShare = $item;
}
}
// make sure that we found a link share
$this->assertTrue(is_array($linkShare));
// update public upload
$params = array();
$params['id'] = $linkShare['id'];
$params['_put'] = array();
$params['_put']['publicUpload'] = 'true';
$result = Share\Api::updateShare($params);
$this->assertTrue($result->succeeded());
$items = \OCP\Share::getItemShared('file', $linkShare['file_source']);
$updatedLinkShare = null;
foreach ($items as $item) {
if ($item['share_type'] === \OCP\Share::SHARE_TYPE_LINK) {
$updatedLinkShare = $item;
break;
}
}
$this->assertTrue(is_array($updatedLinkShare));
$this->assertEquals(7, $updatedLinkShare['permissions']);
// cleanup
\OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK, null);
}
/**
* @medium
* @depends testCreateShare
*/
function testDeleteShare() {
$fileInfo = $this->view->getFileInfo($this->filename);
\OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31);
\OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK,
null, 1);
$items = \OCP\Share::getItemShared('file', null);
$this->assertEquals(2, count($items));
foreach ($items as $item) {
$result = Share\Api::deleteShare(array('id' => $item['id']));
$this->assertTrue($result->succeeded());
}
$itemsAfterDelete = \OCP\Share::getItemShared('file', null);
$this->assertTrue(empty($itemsAfterDelete));
}
/**
* @param $user
* @param bool $create
* @param bool $password
*/
private static function loginHelper($user, $create = false, $password = false) {
if ($create) {
\OC_User::createUser($user, $user);
}
if ($password === false) {
$password = $user;
}
\OC_Util::tearDownFS();
\OC_User::setUserId('');
\OC\Files\Filesystem::tearDown();
\OC_Util::setupFS($user);
\OC_User::setUserId($user);
$params['uid'] = $user;
$params['password'] = $password;
}
/**
* @brief get some information from a given share
* @param int $shareID
* @return array with: item_source, share_type, share_with, item_type, permissions
*/
private function getShareFromId($shareID) {
$sql = 'SELECT `item_source`, `share_type`, `share_with`, `item_type`, `permissions` FROM `*PREFIX*share` WHERE `id` = ?';
$args = array($shareID);
$query = \OCP\DB::prepare($sql);
$result = $query->execute($args);
$share = Null;
if ($result && $result->numRows() > 0) {
$share = $result->fetchRow();
}
return $share;
}
}

View File

@ -8,8 +8,8 @@ $TRANSLATIONS = array(
"Delete permanently" => "حذف بشكل دائم",
"Name" => "اسم",
"Deleted" => "تم الحذف",
"_%n folder_::_%n folders_" => array("","","","","",""),
"_%n file_::_%n files_" => array("","","","","",""),
"_%n folder_::_%n folders_" => array("","","","","","مجلدات %n"),
"_%n file_::_%n files_" => array("","","","",""," ملفات %n"),
"Nothing in here. Your trash bin is empty!" => "لا يوجد شيء هنا. سلة المهملات خاليه.",
"Restore" => "استعيد",
"Delete" => "إلغاء",

View File

@ -8,8 +8,8 @@ $TRANSLATIONS = array(
"Delete permanently" => "Supprimer de façon définitive",
"Name" => "Nom",
"Deleted" => "Effacé",
"_%n folder_::_%n folders_" => array("","%n dossiers"),
"_%n file_::_%n files_" => array("","%n fichiers"),
"_%n folder_::_%n folders_" => array("%n dossier","%n dossiers"),
"_%n file_::_%n files_" => array("%n fichier","%n fichiers"),
"restored" => "restauré",
"Nothing in here. Your trash bin is empty!" => "Il n'y a rien ici. Votre corbeille est vide !",
"Restore" => "Restaurer",

View File

@ -1,11 +1,19 @@
<?php
$TRANSLATIONS = array(
"Couldn't delete %s permanently" => "%s를 영구적으로 삭제할수 없습니다",
"Couldn't restore %s" => "%s를 복원할수 없습니다",
"perform restore operation" => "복원 작업중",
"Error" => "오류",
"delete file permanently" => "영구적으로 파일 삭제하기",
"Delete permanently" => "영원히 삭제",
"Name" => "이름",
"_%n folder_::_%n folders_" => array(""),
"_%n file_::_%n files_" => array(""),
"Deleted" => "삭제됨",
"_%n folder_::_%n folders_" => array("폴더 %n개"),
"_%n file_::_%n files_" => array("파일 %n개 "),
"restored" => "복원됨",
"Nothing in here. Your trash bin is empty!" => "현재 휴지통은 비어있습니다!",
"Restore" => "복원",
"Delete" => "삭제"
"Delete" => "삭제",
"Deleted Files" => "삭제된 파일들"
);
$PLURAL_FORMS = "nplurals=1; plural=0;";

View File

@ -61,7 +61,7 @@ class Helper
$i['directory'] = '';
}
$i['permissions'] = \OCP\PERMISSION_READ;
$i['isPreviewAvailable'] = \OCP\Preview::isMimeSupported($r['mime']);
$i['isPreviewAvailable'] = \OC::$server->getPreviewManager()->isMimeSupported($r['mime']);
$i['icon'] = \OCA\Files\Helper::determineIcon($i);
$files[] = $i;
}

View File

@ -0,0 +1,43 @@
<?php
/**
* Copyright (c) 2013 Georg Ehrke georg@ownCloud.com
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
\OC_Util::checkLoggedIn();
if(!\OC_App::isEnabled('files_versions')){
exit;
}
$file = array_key_exists('file', $_GET) ? (string) urldecode($_GET['file']) : '';
$maxX = array_key_exists('x', $_GET) ? (int) $_GET['x'] : 44;
$maxY = array_key_exists('y', $_GET) ? (int) $_GET['y'] : 44;
$version = array_key_exists('version', $_GET) ? $_GET['version'] : '';
$scalingUp = array_key_exists('scalingup', $_GET) ? (bool) $_GET['scalingup'] : true;
if($file === '' && $version === '') {
\OC_Response::setStatus(400); //400 Bad Request
\OC_Log::write('core-preview', 'No file parameter was passed', \OC_Log::DEBUG);
exit;
}
if($maxX === 0 || $maxY === 0) {
\OC_Response::setStatus(400); //400 Bad Request
\OC_Log::write('core-preview', 'x and/or y set to 0', \OC_Log::DEBUG);
exit;
}
try{
$preview = new \OC\Preview(\OC_User::getUser(), 'files_versions');
$preview->setFile($file.'.v'.$version);
$preview->setMaxX($maxX);
$preview->setMaxY($maxY);
$preview->setScalingUp($scalingUp);
$preview->showPreview();
}catch(\Exception $e) {
\OC_Response::setStatus(500);
\OC_Log::write('core', $e->getmessage(), \OC_Log::DEBUG);
}

View File

@ -7,3 +7,8 @@
// Register with the capabilities API
OC_API::register('get', '/cloud/capabilities', array('OCA\Files_Versions\Capabilities', 'getCapabilities'), 'files_versions', OC_API::USER_AUTH);
$this->create('core_ajax_versions_preview', '/preview.png')->action(
function() {
require_once __DIR__ . '/../ajax/preview.php';
});

View File

@ -1,11 +1,11 @@
#dropdown.drop-versions {
width:22em;
width:24em;
}
#found_versions li {
width: 100%;
cursor: default;
height: 36px;
height: 56px;
float: left;
border-bottom: 1px solid rgba(100,100,100,.1);
}
@ -21,6 +21,12 @@
filter: alpha(opacity=50);
opacity: .5;
}
#found_versions li > a,
#found_versions li > span {
padding: 17px 7px;
}
#found_versions li > *:hover,
#found_versions li > *:focus {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
@ -33,6 +39,11 @@
padding-right: 4px;
}
#found_versions img.preview {
cursor: default;
opacity: 1;
}
#found_versions .versionDate {
min-width: 100px;
vertical-align: text-bottom;

View File

@ -129,6 +129,8 @@ function createVersionsDropdown(filename, files) {
var path = OC.filePath('files_versions', '', 'download.php');
var preview = '<img class="preview" src="'+revision.preview+'"/>';
var download ='<a href="' + path + "?file=" + files + '&revision=' + revision.version + '">';
download+='<img';
download+=' src="' + OC.imagePath('core', 'actions/download') + '"';
@ -146,7 +148,7 @@ function createVersionsDropdown(filename, files) {
var version=$('<li/>');
version.attr('value', revision.version);
version.html(download + revert);
version.html(preview + download + revert);
version.appendTo('#found_versions');
}

View File

@ -2,6 +2,9 @@
$TRANSLATIONS = array(
"Could not revert: %s" => "되돌릴 수 없습니다: %s",
"Versions" => "버전",
"Failed to revert {file} to revision {timestamp}." => "{timestamp} 판의 {file}로 돌리는데 실패했습니다.",
"More versions..." => "더 많은 버전들...",
"No other versions available" => "다른 버전을 사용할수 없습니다",
"Restore" => "복원"
);
$PLURAL_FORMS = "nplurals=1; plural=0;";

View File

@ -266,6 +266,7 @@ class Storage {
$versions[$key]['version'] = $version;
$versions[$key]['humanReadableTimestamp'] = self::getHumanReadableTimestamp($version);
$versions[$key]['path'] = $filename;
$versions[$key]['preview'] = \OCP\Util::linkToRoute('core_ajax_versions_preview', array('file' => $filename, 'version' => $version));
$versions[$key]['size'] = $versions_fileview->filesize($filename.'.v'.$version);
// if file with modified date exists, flag it in array as currently enabled version

View File

@ -27,5 +27,6 @@ OCP\JSON::checkAppEnabled('user_ldap');
OCP\JSON::callCheck();
$prefix = $_POST['ldap_serverconfig_chooser'];
$connection = new \OCA\user_ldap\lib\Connection($prefix);
$ldapWrapper = new OCA\user_ldap\lib\LDAP();
$connection = new \OCA\user_ldap\lib\Connection($ldapWrapper, $prefix);
OCP\JSON::success(array('configuration' => $connection->getConfiguration()));

View File

@ -27,7 +27,8 @@ OCP\JSON::checkAppEnabled('user_ldap');
OCP\JSON::callCheck();
$prefix = $_POST['ldap_serverconfig_chooser'];
$connection = new \OCA\user_ldap\lib\Connection($prefix);
$ldapWrapper = new OCA\user_ldap\lib\LDAP();
$connection = new \OCA\user_ldap\lib\Connection($ldapWrapper, $prefix);
$connection->setConfiguration($_POST);
$connection->saveConfiguration();
OCP\JSON::success();

View File

@ -28,7 +28,8 @@ OCP\JSON::callCheck();
$l=OC_L10N::get('user_ldap');
$connection = new \OCA\user_ldap\lib\Connection('', null);
$ldapWrapper = new OCA\user_ldap\lib\LDAP();
$connection = new \OCA\user_ldap\lib\Connection($ldapWrapper, '', null);
if($connection->setConfiguration($_POST)) {
//Configuration is okay
if($connection->bind()) {

View File

@ -24,15 +24,15 @@
OCP\App::registerAdmin('user_ldap', 'settings');
$configPrefixes = OCA\user_ldap\lib\Helper::getServerConfigurationPrefixes(true);
$ldapWrapper = new OCA\user_ldap\lib\LDAP();
if(count($configPrefixes) === 1) {
$connector = new OCA\user_ldap\lib\Connection($configPrefixes[0]);
$userBackend = new OCA\user_ldap\USER_LDAP();
$userBackend->setConnector($connector);
$groupBackend = new OCA\user_ldap\GROUP_LDAP();
$groupBackend->setConnector($connector);
$connector = new OCA\user_ldap\lib\Connection($ldapWrapper, $configPrefixes[0]);
$ldapAccess = new OCA\user_ldap\lib\Access($connector, $ldapWrapper);
$userBackend = new OCA\user_ldap\USER_LDAP($ldapAccess);
$groupBackend = new OCA\user_ldap\GROUP_LDAP($ldapAccess);
} else {
$userBackend = new OCA\user_ldap\User_Proxy($configPrefixes);
$groupBackend = new OCA\user_ldap\Group_Proxy($configPrefixes);
$userBackend = new OCA\user_ldap\User_Proxy($configPrefixes, $ldapWrapper);
$groupBackend = new OCA\user_ldap\Group_Proxy($configPrefixes, $ldapWrapper);
}
if(count($configPrefixes) > 0) {

View File

@ -23,13 +23,16 @@
namespace OCA\user_ldap;
class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
use OCA\user_ldap\lib\Access;
use OCA\user_ldap\lib\BackendUtility;
class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
protected $enabled = false;
public function setConnector(lib\Connection &$connection) {
parent::setConnector($connection);
$filter = $this->connection->ldapGroupFilter;
$gassoc = $this->connection->ldapGroupMemberAssocAttr;
public function __construct(Access $access) {
parent::__construct($access);
$filter = $this->access->connection->ldapGroupFilter;
$gassoc = $this->access->connection->ldapGroupMemberAssocAttr;
if(!empty($filter) && !empty($gassoc)) {
$this->enabled = true;
}
@ -47,30 +50,31 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
if(!$this->enabled) {
return false;
}
if($this->connection->isCached('inGroup'.$uid.':'.$gid)) {
return $this->connection->getFromCache('inGroup'.$uid.':'.$gid);
if($this->access->connection->isCached('inGroup'.$uid.':'.$gid)) {
return $this->access->connection->getFromCache('inGroup'.$uid.':'.$gid);
}
$dn_user = $this->username2dn($uid);
$dn_group = $this->groupname2dn($gid);
$dn_user = $this->access->username2dn($uid);
$dn_group = $this->access->groupname2dn($gid);
// just in case
if(!$dn_group || !$dn_user) {
$this->connection->writeToCache('inGroup'.$uid.':'.$gid, false);
$this->access->connection->writeToCache('inGroup'.$uid.':'.$gid, false);
return false;
}
//usually, LDAP attributes are said to be case insensitive. But there are exceptions of course.
$members = $this->readAttribute($dn_group, $this->connection->ldapGroupMemberAssocAttr);
$members = $this->access->readAttribute($dn_group,
$this->access->connection->ldapGroupMemberAssocAttr);
if(!$members) {
$this->connection->writeToCache('inGroup'.$uid.':'.$gid, false);
$this->access->connection->writeToCache('inGroup'.$uid.':'.$gid, false);
return false;
}
//extra work if we don't get back user DNs
//TODO: this can be done with one LDAP query
if(strtolower($this->connection->ldapGroupMemberAssocAttr) === 'memberuid') {
if(strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'memberuid') {
$dns = array();
foreach($members as $mid) {
$filter = str_replace('%uid', $mid, $this->connection->ldapLoginFilter);
$ldap_users = $this->fetchListOfUsers($filter, 'dn');
$filter = str_replace('%uid', $mid, $this->access->connection->ldapLoginFilter);
$ldap_users = $this->access->fetchListOfUsers($filter, 'dn');
if(count($ldap_users) < 1) {
continue;
}
@ -80,7 +84,7 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
}
$isInGroup = in_array($dn_user, $members);
$this->connection->writeToCache('inGroup'.$uid.':'.$gid, $isInGroup);
$this->access->connection->writeToCache('inGroup'.$uid.':'.$gid, $isInGroup);
return $isInGroup;
}
@ -98,35 +102,36 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
return array();
}
$cacheKey = 'getUserGroups'.$uid;
if($this->connection->isCached($cacheKey)) {
return $this->connection->getFromCache($cacheKey);
if($this->access->connection->isCached($cacheKey)) {
return $this->access->connection->getFromCache($cacheKey);
}
$userDN = $this->username2dn($uid);
$userDN = $this->access->username2dn($uid);
if(!$userDN) {
$this->connection->writeToCache($cacheKey, array());
$this->access->connection->writeToCache($cacheKey, array());
return array();
}
//uniqueMember takes DN, memberuid the uid, so we need to distinguish
if((strtolower($this->connection->ldapGroupMemberAssocAttr) === 'uniquemember')
|| (strtolower($this->connection->ldapGroupMemberAssocAttr) === 'member')
if((strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'uniquemember')
|| (strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'member')
) {
$uid = $userDN;
} else if(strtolower($this->connection->ldapGroupMemberAssocAttr) === 'memberuid') {
$result = $this->readAttribute($userDN, 'uid');
} else if(strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'memberuid') {
$result = $this->access->readAttribute($userDN, 'uid');
$uid = $result[0];
} else {
// just in case
$uid = $userDN;
}
$filter = $this->combineFilterWithAnd(array(
$this->connection->ldapGroupFilter,
$this->connection->ldapGroupMemberAssocAttr.'='.$uid
$filter = $this->access->combineFilterWithAnd(array(
$this->access->connection->ldapGroupFilter,
$this->access->connection->ldapGroupMemberAssocAttr.'='.$uid
));
$groups = $this->fetchListOfGroups($filter, array($this->connection->ldapGroupDisplayName, 'dn'));
$groups = array_unique($this->ownCloudGroupNames($groups), SORT_LOCALE_STRING);
$this->connection->writeToCache($cacheKey, $groups);
$groups = $this->access->fetchListOfGroups($filter,
array($this->access->connection->ldapGroupDisplayName, 'dn'));
$groups = array_unique($this->access->ownCloudGroupNames($groups), SORT_LOCALE_STRING);
$this->access->connection->writeToCache($cacheKey, $groups);
return $groups;
}
@ -144,70 +149,71 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
}
$cachekey = 'usersInGroup-'.$gid.'-'.$search.'-'.$limit.'-'.$offset;
// check for cache of the exact query
$groupUsers = $this->connection->getFromCache($cachekey);
$groupUsers = $this->access->connection->getFromCache($cachekey);
if(!is_null($groupUsers)) {
return $groupUsers;
}
// check for cache of the query without limit and offset
$groupUsers = $this->connection->getFromCache('usersInGroup-'.$gid.'-'.$search);
$groupUsers = $this->access->connection->getFromCache('usersInGroup-'.$gid.'-'.$search);
if(!is_null($groupUsers)) {
$groupUsers = array_slice($groupUsers, $offset, $limit);
$this->connection->writeToCache($cachekey, $groupUsers);
$this->access->connection->writeToCache($cachekey, $groupUsers);
return $groupUsers;
}
if($limit === -1) {
$limit = null;
}
$groupDN = $this->groupname2dn($gid);
$groupDN = $this->access->groupname2dn($gid);
if(!$groupDN) {
// group couldn't be found, return empty resultset
$this->connection->writeToCache($cachekey, array());
$this->access->connection->writeToCache($cachekey, array());
return array();
}
$members = $this->readAttribute($groupDN, $this->connection->ldapGroupMemberAssocAttr);
$members = $this->access->readAttribute($groupDN,
$this->access->connection->ldapGroupMemberAssocAttr);
if(!$members) {
//in case users could not be retrieved, return empty resultset
$this->connection->writeToCache($cachekey, array());
$this->access->connection->writeToCache($cachekey, array());
return array();
}
$groupUsers = array();
$isMemberUid = (strtolower($this->connection->ldapGroupMemberAssocAttr) === 'memberuid');
$isMemberUid = (strtolower($this->access->connection->ldapGroupMemberAssocAttr) === 'memberuid');
foreach($members as $member) {
if($isMemberUid) {
//we got uids, need to get their DNs to 'tranlsate' them to usernames
$filter = $this->combineFilterWithAnd(array(
$filter = $this->access->combineFilterWithAnd(array(
\OCP\Util::mb_str_replace('%uid', $member,
$this->connection->ldapLoginFilter, 'UTF-8'),
$this->getFilterPartForUserSearch($search)
$this->access->connection->ldapLoginFilter, 'UTF-8'),
$this->access->getFilterPartForUserSearch($search)
));
$ldap_users = $this->fetchListOfUsers($filter, 'dn');
$ldap_users = $this->access->fetchListOfUsers($filter, 'dn');
if(count($ldap_users) < 1) {
continue;
}
$groupUsers[] = $this->dn2username($ldap_users[0]);
$groupUsers[] = $this->access->dn2username($ldap_users[0]);
} else {
//we got DNs, check if we need to filter by search or we can give back all of them
if(!empty($search)) {
if(!$this->readAttribute($member,
$this->connection->ldapUserDisplayName,
$this->getFilterPartForUserSearch($search))) {
if(!$this->access->readAttribute($member,
$this->access->connection->ldapUserDisplayName,
$this->access->getFilterPartForUserSearch($search))) {
continue;
}
}
// dn2username will also check if the users belong to the allowed base
if($ocname = $this->dn2username($member)) {
if($ocname = $this->access->dn2username($member)) {
$groupUsers[] = $ocname;
}
}
}
natsort($groupUsers);
$this->connection->writeToCache('usersInGroup-'.$gid.'-'.$search, $groupUsers);
$this->access->connection->writeToCache('usersInGroup-'.$gid.'-'.$search, $groupUsers);
$groupUsers = array_slice($groupUsers, $offset, $limit);
$this->connection->writeToCache($cachekey, $groupUsers);
$this->access->connection->writeToCache($cachekey, $groupUsers);
return $groupUsers;
}
@ -245,7 +251,7 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
//Check cache before driving unnecessary searches
\OCP\Util::writeLog('user_ldap', 'getGroups '.$cachekey, \OCP\Util::DEBUG);
$ldap_groups = $this->connection->getFromCache($cachekey);
$ldap_groups = $this->access->connection->getFromCache($cachekey);
if(!is_null($ldap_groups)) {
return $ldap_groups;
}
@ -255,16 +261,18 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
if($limit <= 0) {
$limit = null;
}
$filter = $this->combineFilterWithAnd(array(
$this->connection->ldapGroupFilter,
$this->getFilterPartForGroupSearch($search)
$filter = $this->access->combineFilterWithAnd(array(
$this->access->connection->ldapGroupFilter,
$this->access->getFilterPartForGroupSearch($search)
));
\OCP\Util::writeLog('user_ldap', 'getGroups Filter '.$filter, \OCP\Util::DEBUG);
$ldap_groups = $this->fetchListOfGroups($filter, array($this->connection->ldapGroupDisplayName, 'dn'),
$limit, $offset);
$ldap_groups = $this->ownCloudGroupNames($ldap_groups);
$ldap_groups = $this->access->fetchListOfGroups($filter,
array($this->access->connection->ldapGroupDisplayName, 'dn'),
$limit,
$offset);
$ldap_groups = $this->access->ownCloudGroupNames($ldap_groups);
$this->connection->writeToCache($cachekey, $ldap_groups);
$this->access->connection->writeToCache($cachekey, $ldap_groups);
return $ldap_groups;
}
@ -278,25 +286,26 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
* @return bool
*/
public function groupExists($gid) {
if($this->connection->isCached('groupExists'.$gid)) {
return $this->connection->getFromCache('groupExists'.$gid);
if($this->access->connection->isCached('groupExists'.$gid)) {
return $this->access->connection->getFromCache('groupExists'.$gid);
}
//getting dn, if false the group does not exist. If dn, it may be mapped only, requires more checking.
$dn = $this->groupname2dn($gid);
//getting dn, if false the group does not exist. If dn, it may be mapped
//only, requires more checking.
$dn = $this->access->groupname2dn($gid);
if(!$dn) {
$this->connection->writeToCache('groupExists'.$gid, false);
$this->access->connection->writeToCache('groupExists'.$gid, false);
return false;
}
//if group really still exists, we will be able to read its objectclass
$objcs = $this->readAttribute($dn, 'objectclass');
$objcs = $this->access->readAttribute($dn, 'objectclass');
if(!$objcs || empty($objcs)) {
$this->connection->writeToCache('groupExists'.$gid, false);
$this->access->connection->writeToCache('groupExists'.$gid, false);
return false;
}
$this->connection->writeToCache('groupExists'.$gid, true);
$this->access->connection->writeToCache('groupExists'.$gid, true);
return true;
}

View File

@ -23,6 +23,8 @@
namespace OCA\user_ldap;
use OCA\user_ldap\lib\ILDAPWrapper;
class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface {
private $backends = array();
private $refBackend = null;
@ -31,12 +33,11 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface {
* @brief Constructor
* @param $serverConfigPrefixes array containing the config Prefixes
*/
public function __construct($serverConfigPrefixes) {
parent::__construct();
public function __construct($serverConfigPrefixes, ILDAPWrapper $ldap) {
parent::__construct($ldap);
foreach($serverConfigPrefixes as $configPrefix) {
$this->backends[$configPrefix] = new \OCA\user_ldap\GROUP_LDAP();
$connector = $this->getConnector($configPrefix);
$this->backends[$configPrefix]->setConnector($connector);
$this->backends[$configPrefix] =
new \OCA\user_ldap\GROUP_LDAP($this->getAccess($configPrefix));
if(is_null($this->refBackend)) {
$this->refBackend = &$this->backends[$configPrefix];
}

View File

@ -2,6 +2,7 @@
$TRANSLATIONS = array(
"Deletion failed" => "فشل الحذف",
"Error" => "خطأ",
"Host" => "المضيف",
"Password" => "كلمة المرور",
"Help" => "المساعدة"
);

View File

@ -1,8 +1,15 @@
<?php
$TRANSLATIONS = array(
"Failed to delete the server configuration" => "Malsukcesis forigo de la agordo de servilo",
"Deletion failed" => "Forigo malsukcesis",
"Keep settings?" => "Ĉu daŭrigi la agordon?",
"Cannot add server configuration" => "Ne eblas aldoni agordon de servilo",
"Success" => "Sukceso",
"Error" => "Eraro",
"Connection test succeeded" => "Provo de konekto sukcesis",
"Connection test failed" => "Provo de konekto malsukcesis",
"Server configuration" => "Agordo de servilo",
"Add Server Configuration" => "Aldoni agordon de servilo",
"Host" => "Gastigo",
"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Vi povas neglekti la protokolon, escepte se vi bezonas SSL-on. Tiuokaze, komencu per ldaps://",
"Base DN" => "Bazo-DN",
@ -24,6 +31,7 @@ $TRANSLATIONS = array(
"Group-Member association" => "Asocio de grupo kaj membro",
"in bytes" => "duumoke",
"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Lasu malplena por uzantonomo (defaŭlto). Alie, specifu LDAP/AD-atributon.",
"Test Configuration" => "Provi agordon",
"Help" => "Helpo"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";

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