diff options
Diffstat (limited to 'apps')
27 files changed, 247 insertions, 157 deletions
diff --git a/apps/files/css/files.css b/apps/files/css/files.css index f35478ecc21..566ae39f92c 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -12,14 +12,15 @@ .file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .5em; padding-left:2em; } .file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin:0;} .file_upload_wrapper .file_upload_button_wrapper { position:absolute; top:0; left:0; width:100%; height:100%; cursor:pointer; z-index:1000; } -#new { float:left; border-top-right-radius:0; border-bottom-right-radius:0; margin:0 0 0 1em; border-right:none; z-index:1010; height:1.3em; } +#new { background-color:#5bb75b; float:left; border-top-right-radius:0; border-bottom-right-radius:0; margin:0 0 0 1em; border-right:none; z-index:1010; height:1.3em; } +#new:hover, a.file_upload_button_wrapper:hover + button.file_upload_filename { background-color:#4b964b; } #new.active { border-bottom-left-radius:0; border-bottom:none; } #new>a { padding:.5em 1.2em .3em; color:#fff; text-shadow:0 1px 0 #51a351; } #new>ul { display:none; position:fixed; text-align:left; padding:.5em; background:#f8f8f8; margin-top:0.075em; border:1px solid #ddd; min-width:7em; margin-left:-.5em; z-index:-1; } #new>ul>li { margin:.3em; padding-left:2em; background-repeat:no-repeat; cursor:pointer; padding-bottom:0.1em } #new>ul>li>p { cursor:pointer; } #new>ul>li>input { padding:0.3em; margin:-0.3em; } -#new, .file_upload_filename { background:#5bb75b; border:1px solid; border-color:#51a351 #419341 #387038; -moz-box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; } +#new, .file_upload_filename { border:1px solid; border-color:#51a351 #419341 #387038; -moz-box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; } #new .popup { border-top-left-radius:0; } #file_newfolder_name { background-image:url('%webroot%/core/img/places/folder.svg'); font-weight:normal; width:7em; } @@ -29,8 +30,7 @@ .file_upload_start { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; z-index:1; position:absolute; left:0; top:0; width:100%; cursor:pointer;} .file_upload_filename.active { border-bottom-right-radius:0 } -.file_upload_filename { z-index:100; padding-left: 0.8em; padding-right: 0.8em; cursor:pointer; border-top-left-radius:0; border-bottom-left-radius:0; } -.file_upload_filename img { position: absolute; top: 0.4em; left: 0.4em; -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter:alpha(opacity=100); opacity:1; } +.file_upload_filename { background-color:#5bb75b; z-index:100; cursor:pointer; border-top-left-radius:0; border-bottom-left-radius:0; background-image: url('%webroot%/core/img/actions/upload-white.svg'); background-repeat: no-repeat; background-position: center; height: 2.29em; width: 2.5em; } #upload { position:absolute; right:13.5em; top:0em; } #upload #uploadprogressbar { position:relative; display:inline-block; width:10em; height:1.5em; top:.4em; } @@ -87,3 +87,6 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } #navigation>ul>li:first-child+li { padding-top:2.9em; } #scanning-message{ top:40%; left:40%; position:absolute; display:none; } + +div.crumb a{ padding: 0.9em 0 0.7em 0; } + diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 1403d345e8a..f579d8530ed 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -179,6 +179,7 @@ FileActions.register('all','Delete', OC.PERMISSION_DELETE, function(){return OC. $('.tipsy').remove(); }); +// t('files', 'Rename') FileActions.register('all','Rename', OC.PERMISSION_UPDATE, function(){return OC.imagePath('core','actions/rename');},function(filename){ FileList.rename(filename); }); diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 383ade997c5..261d0d76890 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -145,31 +145,33 @@ var FileList={ if (newname != name) { if (FileList.checkName(name, newname, false)) { newname = name; - } else { + } else { $.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(result) { if (!result || result.status == 'error') { OC.dialogs.alert(result.data.message, 'Error moving file'); newname = name; } + tr.data('renaming',false); }); + + } + + tr.attr('data-file', newname); + var path = td.children('a.name').attr('href'); + td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname))); + if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') { + var basename=newname.substr(0,newname.lastIndexOf('.')); + } else { + var basename=newname; + } + td.children('a.name').empty(); + var span=$('<span class="nametext"></span>'); + span.text(basename); + td.children('a.name').append(span); + if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') { + span.append($('<span class="extension">'+newname.substr(newname.lastIndexOf('.'))+'</span>')); } } - tr.attr('data-file', newname); - var path = td.children('a.name').attr('href'); - td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname))); - if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') { - var basename=newname.substr(0,newname.lastIndexOf('.')); - } else { - var basename=newname; - } - td.children('a.name').empty(); - var span=$('<span class="nametext"></span>'); - span.text(basename); - td.children('a.name').append(span); - if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') { - span.append($('<span class="extension">'+newname.substr(newname.lastIndexOf('.'))+'</span>')); - } - tr.data('renaming',false); return false; }); input.click(function(event){ @@ -255,20 +257,23 @@ var FileList={ }, do_delete:function(files){ // Finish any existing actions - if (FileList.lastAction || !FileList.useUndo) { - if(!FileList.deleteFiles) { - FileList.prepareDeletion(files); - } + if (FileList.lastAction) { FileList.lastAction(); } + FileList.prepareDeletion(files); - // NOTE: Temporary fix to change the text to unshared for files in root of Shared folder - if ($('#dir').val() == '/Shared') { - $('#notification').html(t('files', 'unshared')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>'); + + if (!FileList.useUndo) { + FileList.lastAction(); } else { - $('#notification').html(t('files', 'deleted')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>'); + // NOTE: Temporary fix to change the text to unshared for files in root of Shared folder + if ($('#dir').val() == '/Shared') { + $('#notification').html(t('files', 'unshared')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>'); + } else { + $('#notification').html(t('files', 'deleted')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>'); + } + $('#notification').fadeIn(); } - $('#notification').fadeIn(); }, finishDelete:function(ready,sync){ if(!FileList.deleteCanceled && FileList.deleteFiles){ diff --git a/apps/files/js/files.js b/apps/files/js/files.js index aefd6f20bec..ec2f159b4ca 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -356,12 +356,13 @@ $(document).ready(function() { $('#notification').fadeIn(); } }); - uploadingFiles[files[i].name] = jqXHR; + uploadingFiles[uniqueName] = jqXHR; } } }else{ data.submit().success(function(data, status) { - response = jQuery.parseJSON(data[0].body.innerText); + // in safari data is a string + response = jQuery.parseJSON(typeof data === 'string' ? data : data[0].body.innerText); if(response[0] != undefined && response[0].status == 'success') { var file=response[0]; delete uploadingFiles[file.name]; diff --git a/apps/files/l10n/el.php b/apps/files/l10n/el.php index 5b9f11814cf..404b580ca16 100644 --- a/apps/files/l10n/el.php +++ b/apps/files/l10n/el.php @@ -3,9 +3,9 @@ "The uploaded file exceeds the upload_max_filesize directive in php.ini" => "Το αρχείο που μεταφορτώθηκε υπερβαίνει την οδηγία μέγιστου επιτρεπτού μεγέθους \"upload_max_filesize\" του php.ini", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Το αρχείο υπερβαίνει την οδηγία μέγιστου επιτρεπτού μεγέθους \"MAX_FILE_SIZE\" που έχει οριστεί στην HTML φόρμα", "The uploaded file was only partially uploaded" => "Το αρχείο μεταφορώθηκε μόνο εν μέρει", -"No file was uploaded" => "Το αρχείο δεν μεταφορτώθηκε", -"Missing a temporary folder" => "Λείπει ένας προσωρινός φάκελος", -"Failed to write to disk" => "Η εγγραφή στο δίσκο απέτυχε", +"No file was uploaded" => "Κανένα αρχείο δεν μεταφορτώθηκε", +"Missing a temporary folder" => "Λείπει ο προσωρινός φάκελος", +"Failed to write to disk" => "Αποτυχία εγγραφής στο δίσκο", "Files" => "Αρχεία", "Unshare" => "Διακοπή κοινής χρήσης", "Delete" => "Διαγραφή", @@ -16,15 +16,17 @@ "replaced" => "αντικαταστάθηκε", "undo" => "αναίρεση", "with" => "με", -"unshared" => "Διακόπηκε η κοινή χρήση", +"unshared" => "Διακόπηκε ο διαμοιρασμός", "deleted" => "διαγράφηκε", "generating ZIP-file, it may take some time." => "παραγωγή αρχείου ZIP, ίσως διαρκέσει αρκετά.", "Unable to upload your file as it is a directory or has 0 bytes" => "Αδυναμία στην μεταφόρτωση του αρχείου σας αφού είναι φάκελος ή έχει 0 bytes", "Upload Error" => "Σφάλμα Μεταφόρτωσης", -"Pending" => "Εν αναμονή", +"Pending" => "Εκκρεμεί", "Upload cancelled." => "Η μεταφόρτωση ακυρώθηκε.", "File upload is in progress. Leaving the page now will cancel the upload." => "Η μεταφόρτωση του αρχείου βρίσκεται σε εξέλιξη. Έξοδος από την σελίδα τώρα θα ακυρώσει την μεταφόρτωση.", "Invalid name, '/' is not allowed." => "Μη έγκυρο όνομα, το '/' δεν επιτρέπεται.", +"files scanned" => "αρχεία σαρώθηκαν", +"error while scanning" => "σφάλμα κατά την ανίχνευση", "Size" => "Μέγεθος", "Modified" => "Τροποποιήθηκε", "folder" => "φάκελος", @@ -44,13 +46,13 @@ "Folder" => "Φάκελος", "From url" => "Από την διεύθυνση", "Upload" => "Μεταφόρτωση", -"Cancel upload" => "Ακύρωση ανεβάσματος", +"Cancel upload" => "Ακύρωση μεταφόρτωσης", "Nothing in here. Upload something!" => "Δεν υπάρχει τίποτα εδώ. Ανέβασε κάτι!", "Name" => "Όνομα", -"Share" => "Διαμοίρασε", +"Share" => "Διαμοιρασμός", "Download" => "Λήψη", -"Upload too large" => "Πολύ μεγάλο το αρχείο προς μεταφόρτωση", -"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Τα αρχεία που προσπαθείτε να ανεβάσετε υπερβαίνουν το μέγιστο μέγεθος μεταφόρτωσης αρχείων σε αυτόν το διακομιστή.", -"Files are being scanned, please wait." => "Τα αρχεία ανιχνεύονται, παρακαλώ περιμένετε", +"Upload too large" => "Πολύ μεγάλο αρχείο προς μεταφόρτωση", +"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Τα αρχεία που προσπαθείτε να μεταφορτώσετε υπερβαίνουν το μέγιστο μέγεθος μεταφόρτωσης αρχείων σε αυτόν το διακομιστή.", +"Files are being scanned, please wait." => "Τα αρχεία σαρώνονται, παρακαλώ περιμένετε", "Current scanning" => "Τρέχουσα αναζήτηση " ); diff --git a/apps/files/l10n/eu.php b/apps/files/l10n/eu.php index d72e73adf00..fd8ec94895e 100644 --- a/apps/files/l10n/eu.php +++ b/apps/files/l10n/eu.php @@ -25,6 +25,8 @@ "Upload cancelled." => "Igoera ezeztatuta", "File upload is in progress. Leaving the page now will cancel the upload." => "Fitxategien igoera martxan da. Orria orain uzteak igoera ezeztatutko du.", "Invalid name, '/' is not allowed." => "Baliogabeko izena, '/' ezin da erabili. ", +"files scanned" => "fitxategiak eskaneatuta", +"error while scanning" => "errore bat egon da eskaneatzen zen bitartean", "Size" => "Tamaina", "Modified" => "Aldatuta", "folder" => "karpeta", diff --git a/apps/files/l10n/ja_JP.php b/apps/files/l10n/ja_JP.php index 6d278c3f0fb..84d671a938d 100644 --- a/apps/files/l10n/ja_JP.php +++ b/apps/files/l10n/ja_JP.php @@ -25,6 +25,8 @@ "Upload cancelled." => "アップロードはキャンセルされました。", "File upload is in progress. Leaving the page now will cancel the upload." => "ファイル転送を実行中です。今このページから移動するとアップロードが中止されます。", "Invalid name, '/' is not allowed." => "無効な名前、'/' は使用できません。", +"files scanned" => "ファイルをスキャンしました", +"error while scanning" => "スキャン中のエラー", "Size" => "サイズ", "Modified" => "更新日時", "folder" => "フォルダ", diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 911a312fb9a..aff484f0a7a 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -16,9 +16,9 @@ <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload"> <input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)"> <input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir"> - <button class="file_upload_filename"> <img class='svg action' alt="Upload" src="<?php echo OCP\image_path("core", "actions/upload-white.svg"); ?>" /></button> <input class="file_upload_start" type="file" name='files[]'/> - <a href="#" class="file_upload_button_wrapper" onclick="return false;" title="<?php echo $l->t('Upload'); echo ' max. '.$_['uploadMaxHumanFilesize'] ?>"></a> + <a href="#" class="file_upload_button_wrapper" onclick="return false;" title="<?php echo $l->t('Upload'); echo ' max. '.$_['uploadMaxHumanFilesize'] ?>"></a> + <button class="file_upload_filename"></button> <iframe name="file_upload_target_1" class='file_upload_target' src=""></iframe> </form> </div> diff --git a/apps/files_encryption/l10n/ru_RU.php b/apps/files_encryption/l10n/ru_RU.php new file mode 100644 index 00000000000..1328b0d0359 --- /dev/null +++ b/apps/files_encryption/l10n/ru_RU.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Encryption" => "Шифрование", +"Exclude the following file types from encryption" => "Исключите следующие типы файлов из шифрования", +"None" => "Ни один", +"Enable Encryption" => "Включить шифрование" +); diff --git a/apps/files_external/l10n/ru_RU.php b/apps/files_external/l10n/ru_RU.php new file mode 100644 index 00000000000..5b0cf1b6aaa --- /dev/null +++ b/apps/files_external/l10n/ru_RU.php @@ -0,0 +1,18 @@ +<?php $TRANSLATIONS = array( +"External Storage" => "Внешние системы хранения данных", +"Mount point" => "Точка монтирования", +"Backend" => "Бэкэнд", +"Configuration" => "Конфигурация", +"Options" => "Опции", +"Applicable" => "Применимый", +"Add mount point" => "Добавить точку монтирования", +"None set" => "Не задан", +"All Users" => "Все пользователи", +"Groups" => "Группы", +"Users" => "Пользователи", +"Delete" => "Удалить", +"SSL root certificates" => "Корневые сертификаты SSL", +"Import Root Certificate" => "Импортировать корневые сертификаты", +"Enable User External Storage" => "Включить пользовательскую внешнюю систему хранения данных", +"Allow users to mount their own external storage" => "Разрешить пользователям монтировать их собственную внешнюю систему хранения данных" +); diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index eec31ec2ef9..f87a042b386 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -270,6 +270,7 @@ class OC_Mount_Config { fclose($fh); if (strpos($data, 'BEGIN CERTIFICATE')) { fwrite($fh_certs, $data); + fwrite($fh_certs, "\r\n"); } } diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php index eabd1167c97..5ef7a8bbb9c 100644 --- a/apps/files_sharing/appinfo/update.php +++ b/apps/files_sharing/appinfo/update.php @@ -1,6 +1,7 @@ <?php $installedVersion = OCP\Config::getAppValue('files_sharing', 'installed_version'); if (version_compare($installedVersion, '0.3', '<')) { + $update_error = false; $query = OCP\DB::prepare('SELECT * FROM `*PREFIX*sharing`'); $result = $query->execute(); $groupShares = array(); @@ -38,10 +39,19 @@ if (version_compare($installedVersion, '0.3', '<')) { $shareWith = $row['uid_shared_with']; } OC_User::setUserId($row['uid_owner']); - OCP\Share::shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions); + try { + OCP\Share::shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions); + } + catch (Exception $e) { + $update_error = true; + echo 'Skipping sharing "'.$row['source'].'" to "'.$shareWith.'" (error is "'.$e->getMessage().'")<br/>'; + } } } + if ($update_error) { + throw new Exception('There were some problems upgrading the sharing of files'); + } // NOTE: Let's drop the table after more testing // $query = OCP\DB::prepare('DROP TABLE `*PREFIX*sharing`'); // $query->execute(); -}
\ No newline at end of file +} diff --git a/apps/files_sharing/css/public.css b/apps/files_sharing/css/public.css index a700cc2169b..fb4794e0474 100644 --- a/apps/files_sharing/css/public.css +++ b/apps/files_sharing/css/public.css @@ -1,8 +1,11 @@ body { background:#ddd; } #header { position:fixed; top:0; left:0; right:0; z-index:100; height:2.5em; line-height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; } #details { color:#fff; } -#header #download { margin-left:2em; font-weight:bold; color:#fff; } +#header #download { margin-left:2em; font-weight:bold; } +#header #download img { padding-left: 0.1em; padding-right: 0.3em; vertical-align: text-bottom; } #preview { min-height:30em; margin:50px auto; padding-top:2em; border-bottom:1px solid #f8f8f8; background:#eee; text-align:center; } #noPreview { display:none; padding-top:5em; } p.info { width:22em; text-align: center; margin:2em auto; color:#777; text-shadow:#fff 0 1px 0; } -p.info a { font-weight:bold; color:#777; }
\ No newline at end of file +p.info a { font-weight:bold; color:#777; } +#imgframe { width:80%; height: 75%; margin: 0 auto; padding-bottom:2em; } +#imgframe img { max-height:100%; max-width: 100%; }
\ No newline at end of file diff --git a/apps/files_sharing/l10n/ru_RU.php b/apps/files_sharing/l10n/ru_RU.php new file mode 100644 index 00000000000..a1579efc8f9 --- /dev/null +++ b/apps/files_sharing/l10n/ru_RU.php @@ -0,0 +1,7 @@ +<?php $TRANSLATIONS = array( +"Password" => "Пароль", +"Submit" => "Передать", +"Download" => "Загрузка", +"No preview available for" => "Предварительный просмотр недоступен", +"web services under your control" => "веб-сервисы под Вашим контролем" +); diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php index 2149da1d731..074ca9928d4 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -47,7 +47,7 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { } public function generateTarget($filePath, $shareWith, $exclude = null) { - $target = $filePath; + $target = '/'.basename($filePath); if (isset($exclude)) { if ($pos = strrpos($target, '.')) { $name = substr($target, 0, $pos); @@ -72,8 +72,16 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { // Only 1 item should come through for this format call return array('path' => $items[key($items)]['path'], 'permissions' => $items[key($items)]['permissions']); } else if ($format == self::FORMAT_FILE_APP) { + if (isset($parameters['mimetype_filter']) && $parameters['mimetype_filter']) { + $mimetype_filter = $parameters['mimetype_filter']; + } $files = array(); foreach ($items as $item) { + if (isset($mimetype_filter) + && strpos($item['mimetype'], $mimetype_filter) !== 0 + && $item['mimetype'] != 'httpd/unix-directory') { + continue; + } $file = array(); $file['id'] = $item['file_source']; $file['path'] = $item['file_target']; @@ -116,4 +124,4 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { return array(); } -}
\ No newline at end of file +} diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index bed1a19fd63..dbaf29e962d 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -119,7 +119,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) { $folder->assign('uploadMaxHumanFilesize', 0); $folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); $tmpl->assign('folder', $folder->fetchPage(), false); - $tmpl->assign('details', $uidOwner.' shared the folder '.$baseDir.' with you'); + $tmpl->assign('uidOwner', $uidOwner); $tmpl->assign('dir', basename($dir)); $tmpl->assign('filename', basename($path)); $tmpl->assign('mimetype', OC_Filesystem::getMimeType($path)); @@ -132,7 +132,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) { $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.$_GET['dir'].'&path='.$getPath, false); } else { // Show file preview if viewer is available - $tmpl->assign('details', $uidOwner.' shared the file '.basename($path).' with you'); + $tmpl->assign('uidOwner', $uidOwner); $tmpl->assign('dir', dirname($path)); $tmpl->assign('filename', basename($path)); $tmpl->assign('mimetype', OC_Filesystem::getMimeType($path)); @@ -155,4 +155,4 @@ if (isset($_GET['file']) || isset($_GET['dir'])) { } header('HTTP/1.0 404 Not Found'); $tmpl = new OCP\Template('', '404', 'guest'); -$tmpl->printPage();
\ No newline at end of file +$tmpl->printPage(); diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 426b45b2681..fd9b79e6f17 100755..100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -5,9 +5,13 @@ <header><div id="header"> <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a> <div class="header-right"> - <span id="details"><?php echo $_['details']; ?></span> + <?php if (isset($_['folder'])): ?> + <span id="details"><?php echo $l->t('%s shared the folder %s with you', array($_['uidOwner'], $_['filename'])) ?></span> + <?php else: ?> + <span id="details"><?php echo $l->t('%s shared the file %s with you', array($_['uidOwner'], $_['filename'])) ?></span> + <?php endif; ?> <?php if (!isset($_['folder']) || $_['allowZipDownload']): ?> - <a href="<?php echo $_['downloadURL']; ?>" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a> + <a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a> <?php endif; ?> </div> </div></header> @@ -16,7 +20,9 @@ <?php echo $_['folder']; ?> <?php else: ?> <?php if (substr($_['mimetype'], 0 , strpos($_['mimetype'], '/')) == 'image'): ?> - <img src="<?php echo $_['downloadURL']; ?>" /> + <div id="imgframe"> + <img src="<?php echo $_['downloadURL']; ?>" /> + </div> <?php endif; ?> <ul id="noPreview"> <li class="error"> @@ -28,4 +34,4 @@ <div id="content"></div> <table></table> </div> -<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> – <?php echo $l->t('web services under your control'); ?></p></footer>
\ No newline at end of file +<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> – <?php echo $l->t('web services under your control'); ?></p></footer> diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index 495848b8226..9075095d286 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -10,10 +10,10 @@ $(document).ready(function() { $(document).ready(function(){ if (typeof FileActions !== 'undefined') { - // Add history button to files/index.php + // Add history button to 'files/index.php' FileActions.register( 'file' - ,'History' + , t('files_versions', 'History') , OC.PERMISSION_UPDATE , function() { // Specify icon for hitory button @@ -147,4 +147,4 @@ $(this).click( } -);
\ No newline at end of file +); diff --git a/apps/files_versions/l10n/eu.php b/apps/files_versions/l10n/eu.php index 889e762c6b9..d4353c96cd6 100644 --- a/apps/files_versions/l10n/eu.php +++ b/apps/files_versions/l10n/eu.php @@ -1,5 +1,7 @@ <?php $TRANSLATIONS = array( "Expire all versions" => "Iraungi bertsio guztiak", "Versions" => "Bertsioak", -"This will delete all existing backup versions of your files" => "Honek zure fitxategien bertsio guztiak ezabatuko ditu" +"This will delete all existing backup versions of your files" => "Honek zure fitxategien bertsio guztiak ezabatuko ditu", +"Files Versioning" => "Fitxategien Bertsioak", +"Enable" => "Gaitu" ); diff --git a/apps/files_versions/l10n/ja_JP.php b/apps/files_versions/l10n/ja_JP.php index 7a00d0b4dad..8a4e0ab245d 100644 --- a/apps/files_versions/l10n/ja_JP.php +++ b/apps/files_versions/l10n/ja_JP.php @@ -1,5 +1,7 @@ <?php $TRANSLATIONS = array( "Expire all versions" => "すべてのバージョンを削除する", "Versions" => "バージョン", -"This will delete all existing backup versions of your files" => "これは、あなたのファイルのすべてのバックアップバージョンを削除します" +"This will delete all existing backup versions of your files" => "これは、あなたのファイルのすべてのバックアップバージョンを削除します", +"Files Versioning" => "ファイルのバージョン管理", +"Enable" => "有効化" ); diff --git a/apps/files_versions/l10n/ru_RU.php b/apps/files_versions/l10n/ru_RU.php new file mode 100644 index 00000000000..2563c318bc2 --- /dev/null +++ b/apps/files_versions/l10n/ru_RU.php @@ -0,0 +1,6 @@ +<?php $TRANSLATIONS = array( +"Versions" => "Версии", +"This will delete all existing backup versions of your files" => "Это приведет к удалению всех существующих версий резервной копии ваших файлов", +"Files Versioning" => "Файлы управления версиями", +"Enable" => "Включить" +); diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index c517eb01ff5..7d12e58f941 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -35,46 +35,31 @@ class Storage { const DEFAULTMININTERVAL=60; // 1 min const DEFAULTMAXVERSIONS=50; - private $view; - - function __construct() { - - $this->view = \OCP\Files::getStorage('files_versions'); - - } - - /** - * listen to write event. - */ - public static function write_hook($params) { - if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { - $path = $params[\OC_Filesystem::signal_param_path]; - if($path<>'') $this->store($path); + private static function getUidAndFilename($filename) + { + if (\OCP\App::isEnabled('files_sharing') + && substr($filename, 0, 7) == '/Shared' + && $source = \OCP\Share::getItemSharedWith('file', + substr($filename, 7), + \OC_Share_Backend_File::FORMAT_SHARED_STORAGE)) { + $filename = $source['path']; + $pos = strpos($filename, '/files', 1); + $uid = substr($filename, 1, $pos - 1); + $filename = substr($filename, $pos + 6); + } else { + $uid = \OCP\User::getUser(); } + return array($uid, $filename); } - - /** * store a new version of a file. */ public function store($filename) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { - - $files_view = \OCP\Files::getStorage("files"); - $users_view = \OCP\Files::getStorage("files_versions"); - $users_view->chroot(\OCP\User::getUser().'/'); - - //FIXME OC_Share no longer exists - //if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) { - // $pos = strpos($source, '/files', 1); - // $uid = substr($source, 1, $pos - 1); - // $filename = substr($source, $pos + 6); - //} else { - $uid = \OCP\User::getUser(); - //} - - $versionsFolderName=\OCP\Config::getSystemValue('datadirectory') . $this->view->getAbsolutePath(''); + list($uid, $filename) = self::getUidAndFilename($filename); + $files_view = new \OC_FilesystemView('/'.$uid.'/files'); + $users_view = new \OC_FilesystemView('/'.$uid); //check if source file already exist as version to avoid recursions. // todo does this check work? @@ -96,7 +81,6 @@ class Storage { return false; } } - // we should have a source file to work with if (!$files_view->file_exists($filename)) { return false; @@ -110,6 +94,8 @@ class Storage { // check mininterval if the file is being modified by the owner (all shared files should be versioned despite mininterval) if ($uid == \OCP\User::getUser()) { + $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); + $versionsFolderName=\OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath(''); $matches=glob($versionsFolderName.'/'.$filename.'.v*'); sort($matches); $parts=explode('.v',end($matches)); @@ -120,8 +106,10 @@ class Storage { // create all parent folders - $info=pathinfo($filename); - if(!file_exists($versionsFolderName.'/'.$info['dirname'])) mkdir($versionsFolderName.'/'.$info['dirname'],0700,true); + $dirname = dirname($filename); + if(!$users_view->file_exists('/files_versions/'.$dirname)) { + $users_view->mkdir('/files_versions/'.$dirname,0700,true); + } // store a new version of a file $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.time()); @@ -138,17 +126,8 @@ class Storage { public static function rollback($filename,$revision) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { - $users_view = \OCP\Files::getStorage("files_versions"); - $users_view->chroot(\OCP\User::getUser().'/'); - - //FIXME OC_Share no longer exists - //if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) { - // $pos = strpos($source, '/files', 1); - // $uid = substr($source, 1, $pos - 1); - // $filename = substr($source, $pos + 6); - //} else { - $uid = \OCP\User::getUser(); - //} + list($uid, $filename) = self::getUidAndFilename($filename); + $users_view = new \OC_FilesystemView('/'.$uid); // rollback if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) { @@ -170,12 +149,8 @@ class Storage { */ public static function isversioned($filename) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { - $versions_fileview = \OCP\Files::getStorage("files_versions"); - //FIXME OC_Share no longer exists - //if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) { - // $pos = strpos($source, '/files', 1); - // $filename = substr($source, $pos + 6); - //} + list($uid, $filename) = self::getUidAndFilename($filename); + $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); $versionsFolderName=\OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath(''); @@ -202,16 +177,9 @@ class Storage { public static function getVersions( $filename, $count = 0 ) { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { + list($uid, $filename) = self::getUidAndFilename($filename); + $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); - //FIXME OC_Share no longer exists - //if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) { - // $pos = strpos($source, '/files', 1); - // $uid = substr($source, 1, $pos - 1); - // $filename = substr($source, $pos + 6); - //} else { - $uid = \OCP\User::getUser(); - //} - $versions_fileview = \OCP\Files::getStorage('files_versions'); $versionsFolderName = \OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath(''); $versions = array(); @@ -222,7 +190,7 @@ class Storage { $i = 0; - $files_view = \OCP\Files::getStorage('files'); + $files_view = new \OC_FilesystemView('/'.$uid.'/files'); $local_file = $files_view->getLocalFile($filename); foreach( $matches as $ma ) { @@ -276,16 +244,9 @@ class Storage { */ public static function expire($filename) { if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { + list($uid, $filename) = self::getUidAndFilename($filename); + $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions'); - //FIXME OC_Share no longer exists - //if (\OCP\App::isEnabled('files_sharing') && $source = \OC_Share::getSource('/'.\OCP\User::getUser().'/files'.$filename)) { - // $pos = strpos($source, '/files', 1); - // $uid = substr($source, 1, $pos - 1); - // $filename = substr($source, $pos + 6); - //} else { - $uid = \OCP\User::getUser(); - //} - $versions_fileview = \OCP\Files::getStorage("files_versions"); $versionsFolderName=\OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath(''); // check for old versions @@ -293,7 +254,7 @@ class Storage { if( count( $matches ) > \OCP\Config::getSystemValue( 'files_versionmaxversions', Storage::DEFAULTMAXVERSIONS ) ) { - $numberToDelete = count( $matches-\OCP\Config::getSystemValue( 'files_versionmaxversions', Storage::DEFAULTMAXVERSIONS ) ); + $numberToDelete = count($matches) - \OCP\Config::getSystemValue( 'files_versionmaxversions', Storage::DEFAULTMAXVERSIONS ); // delete old versions of a file $deleteItems = array_slice( $matches, 0, $numberToDelete ); @@ -312,6 +273,7 @@ class Storage { * @return true/false */ public function expireAll() { - return $this->view->deleteAll('', true); + $view = \OCP\Files::getStorage('files_versions'); + return $view->deleteAll('', true); } } diff --git a/apps/user_ldap/l10n/ru_RU.php b/apps/user_ldap/l10n/ru_RU.php new file mode 100644 index 00000000000..9c0eb23a34c --- /dev/null +++ b/apps/user_ldap/l10n/ru_RU.php @@ -0,0 +1,15 @@ +<?php $TRANSLATIONS = array( +"Host" => "Хост", +"Base DN" => "База DN", +"User DN" => "DN пользователя", +"Password" => "Пароль", +"For anonymous access, leave DN and Password empty." => "Для анонимного доступа оставьте поля DN и пароль пустыми.", +"Group Filter" => "Групповой фильтр", +"Port" => "Порт", +"Use TLS" => "Использовать TLS", +"Do not use it for SSL connections, it will fail." => "Не используйте это SSL-соединений, это не будет выполнено.", +"Turn off SSL certificate validation." => "Выключить проверку сертификата SSL.", +"in bytes" => "в байтах", +"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Оставьте пустым под имя пользователя (по умолчанию). В противном случае задайте LDAP/AD атрибут.", +"Help" => "Помощь" +); diff --git a/apps/user_ldap/l10n/zh_CN.php b/apps/user_ldap/l10n/zh_CN.php new file mode 100644 index 00000000000..5f6200db404 --- /dev/null +++ b/apps/user_ldap/l10n/zh_CN.php @@ -0,0 +1,9 @@ +<?php $TRANSLATIONS = array( +"Host" => "主机", +"Base DN" => "Base DN", +"You can specify Base DN for users and groups in the Advanced tab" => "您可以在高级选项卡里为用户和组指定Base DN", +"User DN" => "User DN", +"Password" => "密码", +"Port" => "端口", +"Help" => "帮助" +); diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 53619ab4c1d..d855ae2a163 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -206,21 +206,17 @@ abstract class Access { $dn = $this->sanitizeDN($dn); $table = $this->getMapTable($isUser); if($isUser) { + $fncFindMappedName = 'findMappedUser'; $nameAttribute = $this->connection->ldapUserDisplayName; } else { + $fncFindMappedName = 'findMappedGroup'; $nameAttribute = $this->connection->ldapGroupDisplayName; } - $query = \OCP\DB::prepare(' - SELECT `owncloud_name` - FROM `'.$table.'` - WHERE `ldap_dn` = ? - '); - //let's try to retrieve the ownCloud name from the mappings table - $component = $query->execute(array($dn))->fetchOne(); - if($component) { - return $component; + $ocname = $this->$fncFindMappedName($dn); + if($ocname) { + return $ocname; } //second try: get the UUID and check if it is known. Then, update the DN and return the name. @@ -295,25 +291,48 @@ abstract class Access { return $this->ldap2ownCloudNames($ldapGroups, false); } + private function findMappedUser($dn) { + static $query = null; + if(is_null($query)) { + $query = \OCP\DB::prepare(' + SELECT `owncloud_name` + FROM `'.$this->getMapTable(true).'` + WHERE `ldap_dn` = ?' + ); + } + $res = $query->execute(array($dn))->fetchOne(); + if($res) { + return $res; + } + return false; + } + + private function findMappedGroup($dn) { + static $query = null; + if(is_null($query)) { + $query = \OCP\DB::prepare(' + SELECT `owncloud_name` + FROM `'.$this->getMapTable(false).'` + WHERE `ldap_dn` = ?' + ); + } + $res = $query->execute(array($dn))->fetchOne(); + if($res) { + return $res; + } + return false; + } + + private function ldap2ownCloudNames($ldapObjects, $isUsers) { if($isUsers) { - $knownObjects = $this->mappedUsers(); $nameAttribute = $this->connection->ldapUserDisplayName; } else { - $knownObjects = $this->mappedGroups(); $nameAttribute = $this->connection->ldapGroupDisplayName; } $ownCloudNames = array(); foreach($ldapObjects as $ldapObject) { - $key = \OCP\Util::recursiveArraySearch($knownObjects, $ldapObject['dn']); - - //everything is fine when we know the group - if($key !== false) { - $ownCloudNames[] = $knownObjects[$key]['owncloud_name']; - continue; - } - $ocname = $this->dn2ocname($ldapObject['dn'], $ldapObject[$nameAttribute], $isUsers); if($ocname) { $ownCloudNames[] = $ocname; diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php index 1922e7ff1f2..bf65d9ad91c 100644 --- a/apps/user_ldap/lib/connection.php +++ b/apps/user_ldap/lib/connection.php @@ -258,7 +258,7 @@ class Connection { if(empty($this->config['ldapGroupFilter']) && empty($this->config['ldapGroupMemberAssocAttr'])) { \OCP\Util::writeLog('user_ldap', 'No group filter is specified, LDAP group feature will not be used.', \OCP\Util::INFO); } - if(!in_array($this->config['ldapUuidAttribute'], array('auto','entryuuid', 'nsuniqueid', 'objectguid'))) { + if(!in_array($this->config['ldapUuidAttribute'], array('auto','entryuuid', 'nsuniqueid', 'objectguid')) && (!is_null($this->configID))) { \OCP\Config::setAppValue($this->configID, 'ldap_uuid_attribute', 'auto'); \OCP\Util::writeLog('user_ldap', 'Illegal value for the UUID Attribute, reset to autodetect.', \OCP\Util::INFO); } @@ -357,4 +357,4 @@ class Connection { return true; } -}
\ No newline at end of file +} diff --git a/apps/user_ldap/lib/jobs.php b/apps/user_ldap/lib/jobs.php index aff519226c8..b265a8339ef 100644 --- a/apps/user_ldap/lib/jobs.php +++ b/apps/user_ldap/lib/jobs.php @@ -43,7 +43,7 @@ class Jobs { if(empty($actualGroups) && empty($knownGroups)) { \OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – groups do not seem to be configured properly, aborting.', \OCP\Util::INFO); - \OCP\setAppValue('user_ldap', 'bgjUpdateGroupsLastRun', time()); + \OCP\Config::setAppValue('user_ldap', 'bgjUpdateGroupsLastRun', time()); return; } |