summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-10-23 12:01:45 +0200
committerArthur Schiwon <blizzz@owncloud.com>2013-10-23 12:01:45 +0200
commitd78a80a6892bdf47388329d7d426ccab6a36cf20 (patch)
treed993a6fecb3277f86d457e0a952aeb2dc5f9590f /apps
parent76a195a0be5d36c090c05ce60e02466e9783fea3 (diff)
parent2d14daf36bf6c808e55895c78b42144942b73246 (diff)
downloadnextcloud-server-d78a80a6892bdf47388329d7d426ccab6a36cf20.tar.gz
nextcloud-server-d78a80a6892bdf47388329d7d426ccab6a36cf20.zip
merge master with resolved conflicts
Diffstat (limited to 'apps')
-rw-r--r--apps/files/index.php9
-rw-r--r--apps/files/js/filelist.js41
-rw-r--r--apps/files/js/files.js22
-rw-r--r--apps/files/l10n/ru_RU.php14
-rw-r--r--apps/files/l10n/sk_SK.php8
-rw-r--r--apps/files/templates/index.php12
-rw-r--r--apps/files_encryption/hooks/hooks.php11
-rw-r--r--apps/files_encryption/l10n/gl.php2
-rw-r--r--apps/files_encryption/l10n/it.php3
-rw-r--r--apps/files_encryption/l10n/ja_JP.php6
-rw-r--r--apps/files_encryption/l10n/nl.php2
-rw-r--r--apps/files_encryption/l10n/sv.php2
-rwxr-xr-xapps/files_encryption/lib/helper.php1
-rw-r--r--apps/files_encryption/lib/util.php2
-rw-r--r--apps/files_sharing/appinfo/app.php2
-rw-r--r--apps/files_sharing/css/public.css11
-rw-r--r--apps/files_sharing/js/public.js2
-rw-r--r--apps/files_sharing/l10n/pt_PT.php1
-rw-r--r--apps/files_sharing/l10n/ru_RU.php8
-rw-r--r--apps/files_sharing/l10n/sv.php1
-rw-r--r--apps/files_sharing/lib/api.php101
-rw-r--r--apps/files_sharing/lib/maintainer.php44
-rw-r--r--apps/files_sharing/templates/public.php7
-rw-r--r--apps/files_sharing/tests/api.php62
-rw-r--r--apps/files_trashbin/l10n/ru_RU.php5
-rw-r--r--apps/files_versions/js/versions.js7
-rw-r--r--apps/user_ldap/l10n/it.php2
-rw-r--r--apps/user_ldap/l10n/ru_RU.php6
-rw-r--r--apps/user_ldap/l10n/sk_SK.php2
-rw-r--r--apps/user_ldap/l10n/sv.php2
-rw-r--r--apps/user_ldap/lib/access.php2
31 files changed, 351 insertions, 49 deletions
diff --git a/apps/files/index.php b/apps/files/index.php
index 8d877be8ac9..f0f95b3bac8 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -118,6 +118,10 @@ if ($needUpgrade) {
$trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user);
}
+ $isCreatable = \OC\Files\Filesystem::isCreatable($dir . '/');
+ $fileHeader = (!isset($files) or count($files) > 0);
+ $emptyContent = ($isCreatable and !$fileHeader) or $ajaxLoad;
+
OCP\Util::addscript('files', 'fileactions');
OCP\Util::addscript('files', 'files');
OCP\Util::addscript('files', 'keyboardshortcuts');
@@ -125,7 +129,7 @@ if ($needUpgrade) {
$tmpl->assign('fileList', $list->fetchPage());
$tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage());
$tmpl->assign('dir', \OC\Files\Filesystem::normalizePath($dir));
- $tmpl->assign('isCreatable', \OC\Files\Filesystem::isCreatable($dir . '/'));
+ $tmpl->assign('isCreatable', $isCreatable);
$tmpl->assign('permissions', $permissions);
$tmpl->assign('files', $files);
$tmpl->assign('trash', $trashEnabled);
@@ -138,9 +142,12 @@ if ($needUpgrade) {
$tmpl->assign('publicUploadEnabled', $publicUploadEnabled);
$tmpl->assign("encryptedFiles", \OCP\Util::encryptedFiles());
$tmpl->assign("mailNotificationEnabled", \OC_Appconfig::getValue('core', 'shareapi_allow_mail_notification', 'yes'));
+ $tmpl->assign("allowShareWithLink", \OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes'));
$tmpl->assign("encryptionInitStatus", $encryptionInitStatus);
$tmpl->assign('disableSharing', false);
$tmpl->assign('ajaxLoad', $ajaxLoad);
+ $tmpl->assign('emptyContent', $emptyContent);
+ $tmpl->assign('fileHeader', $fileHeader);
$tmpl->printPage();
}
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 84ff1093253..85bdd509715 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -7,11 +7,9 @@ var FileList={
});
},
update:function(fileListHtml) {
- var $fileList = $('#fileList'),
- permissions = $('#permissions').val(),
- isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0;
+ var $fileList = $('#fileList');
$fileList.empty().html(fileListHtml);
- $('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').length > 0);
+ FileList.updateEmptyContent();
$fileList.find('tr').each(function () {
FileActions.display($(this).children('td.filename'));
});
@@ -251,12 +249,38 @@ var FileList={
$('.creatable').toggleClass('hidden', !isCreatable);
$('.notCreatable').toggleClass('hidden', isCreatable);
},
+ /**
+ * Shows/hides action buttons
+ *
+ * @param show true for enabling, false for disabling
+ */
+ showActions: function(show){
+ $('.actions,#file_action_panel').toggleClass('hidden', !show);
+ if (show){
+ // make sure to display according to permissions
+ var permissions = $('#permissions').val();
+ var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0;
+ $('.creatable').toggleClass('hidden', !isCreatable);
+ $('.notCreatable').toggleClass('hidden', isCreatable);
+ }
+ },
+ /**
+ * Enables/disables viewer mode.
+ * In viewer mode, apps can embed themselves under the controls bar.
+ * In viewer mode, the actions of the file list will be hidden.
+ * @param show true for enabling, false for disabling
+ */
+ setViewerMode: function(show){
+ this.showActions(!show);
+ $('#filestable').toggleClass('hidden', show);
+ },
remove:function(name){
$('tr').filterAttr('data-file',name).find('td.filename').draggable('destroy');
$('tr').filterAttr('data-file',name).remove();
FileList.updateFileSummary();
if($('tr[data-file]').length==0){
$('#emptycontent').removeClass('hidden');
+ $('#filescontent th').addClass('hidden');
}
},
insertElement:function(name,type,element){
@@ -287,6 +311,7 @@ var FileList={
$('#fileList').append(element);
}
$('#emptycontent').addClass('hidden');
+ $('#filestable th').removeClass('hidden');
FileList.updateFileSummary();
},
loadingDone:function(name, id){
@@ -505,6 +530,7 @@ var FileList={
procesSelection();
checkTrashStatus();
FileList.updateFileSummary();
+ FileList.updateEmptyContent();
} else {
$.each(files,function(index,file) {
var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete");
@@ -618,6 +644,13 @@ var FileList={
}
}
},
+ updateEmptyContent: function(){
+ var $fileList = $('#fileList');
+ var permissions = $('#permissions').val();
+ var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0;
+ $('#emptycontent').toggleClass('hidden', !isCreatable || $fileList.find('tr').length > 0);
+ $('#filestable th').toggleClass('hidden', $fileList.find('tr').length === 0);
+ },
showMask: function(){
// in case one was shown before
var $mask = $('#content .mask');
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index a35ed4add8c..ec2dc7c62ea 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -301,7 +301,7 @@ $(document).ready(function() {
});
$('.download').click('click',function(event) {
- var files=getSelectedFiles('name');
+ var files=getSelectedFilesTrash('name');
var fileslist = JSON.stringify(files);
var dir=$('#dir').val()||'/';
OC.Notification.show(t('files','Your download is being prepared. This might take some time if the files are big.'));
@@ -315,7 +315,7 @@ $(document).ready(function() {
});
$('.delete-selected').click(function(event) {
- var files=getSelectedFiles('name');
+ var files=getSelectedFilesTrash('name');
event.preventDefault();
FileList.do_delete(files);
return false;
@@ -433,7 +433,7 @@ var createDragShadow = function(event){
$(event.target).parents('tr').find('td input:first').prop('checked',true);
}
- var selectedFiles = getSelectedFiles();
+ var selectedFiles = getSelectedFilesTrash();
if (!isDragSelected && selectedFiles.length == 1) {
//revert the selection
@@ -562,7 +562,7 @@ var crumbDropOptions={
}
function procesSelection(){
- var selected=getSelectedFiles();
+ var selected=getSelectedFilesTrash();
var selectedFiles=selected.filter(function(el){return el.type=='file'});
var selectedFolders=selected.filter(function(el){return el.type=='dir'});
if(selectedFiles.length==0 && selectedFolders.length==0) {
@@ -607,7 +607,7 @@ function procesSelection(){
* if property is set, an array with that property for each file is returnd
* if it's ommited an array of objects with all properties is returned
*/
-function getSelectedFiles(property){
+function getSelectedFilesTrash(property){
var elements=$('td.filename input:checkbox:checked').parent().parent();
var files=[];
elements.each(function(i,element){
@@ -663,8 +663,16 @@ function lazyLoadPreview(path, mime, ready, width, height) {
$.get(previewURL, function() {
previewURL = previewURL.replace('(', '%28');
previewURL = previewURL.replace(')', '%29');
- //set preview thumbnail URL
- ready(previewURL + '&reload=true');
+ previewURL += '&reload=true';
+
+ // preload image to prevent delay
+ // this will make the browser cache the image
+ var img = new Image();
+ img.onload = function(){
+ //set preview thumbnail URL
+ ready(previewURL);
+ }
+ img.src = previewURL;
});
});
}
diff --git a/apps/files/l10n/ru_RU.php b/apps/files/l10n/ru_RU.php
new file mode 100644
index 00000000000..0764fef2ed9
--- /dev/null
+++ b/apps/files/l10n/ru_RU.php
@@ -0,0 +1,14 @@
+<?php
+$TRANSLATIONS = array(
+"Files" => "Файлы",
+"Error" => "Ошибка",
+"Share" => "Сделать общим",
+"Rename" => "Переименовать",
+"_%n folder_::_%n folders_" => array("","",""),
+"_%n file_::_%n files_" => array("","",""),
+"_Uploading %n file_::_Uploading %n files_" => array("","",""),
+"Upload" => "Загрузка",
+"Cancel upload" => "Отмена загрузки",
+"Download" => "Загрузка"
+);
+$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/apps/files/l10n/sk_SK.php b/apps/files/l10n/sk_SK.php
index 962ce7d7e9b..c246492211c 100644
--- a/apps/files/l10n/sk_SK.php
+++ b/apps/files/l10n/sk_SK.php
@@ -13,10 +13,14 @@ $TRANSLATIONS = array(
"Missing a temporary folder" => "Chýba dočasný priečinok",
"Failed to write to disk" => "Zápis na disk sa nepodaril",
"Not enough storage available" => "Nedostatok dostupného úložného priestoru",
+"Upload failed. Could not get file info." => "Nahrávanie zlyhalo. Nepodarilo sa získať informácie o súbore.",
+"Upload failed. Could not find uploaded file" => "Nahrávanie zlyhalo. Nepodarilo sa nájsť nahrávaný súbor",
"Invalid directory." => "Neplatný priečinok.",
"Files" => "Súbory",
+"Unable to upload {filename} as it is a directory or has 0 bytes" => "Nemožno nahrať súbor {filename}, pretože je to priečinok, alebo má 0 bitov",
"Not enough space available" => "Nie je k dispozícii dostatok miesta",
"Upload cancelled." => "Odosielanie zrušené.",
+"Could not get result from server." => "Nepodarilo sa dostať výsledky zo servera.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Opustenie stránky zruší práve prebiehajúce odosielanie súboru.",
"URL cannot be empty." => "URL nemôže byť prázdne.",
"Invalid folder name. Usage of 'Shared' is reserved by ownCloud" => "Neplatný názov priečinka. Názov \"Shared\" je rezervovaný pre ownCloud",
@@ -33,14 +37,18 @@ $TRANSLATIONS = array(
"undo" => "vrátiť",
"_%n folder_::_%n folders_" => array("%n priečinok","%n priečinky","%n priečinkov"),
"_%n file_::_%n files_" => array("%n súbor","%n súbory","%n súborov"),
+"{dirs} and {files}" => "{dirs} a {files}",
"_Uploading %n file_::_Uploading %n files_" => array("Nahrávam %n súbor","Nahrávam %n súbory","Nahrávam %n súborov"),
"'.' is an invalid file name." => "'.' je neplatné meno súboru.",
"File name cannot be empty." => "Meno súboru nemôže byť prázdne",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Nesprávne meno, '\\', '/', '<', '>', ':', '\"', '|', '?' a '*' nie sú povolené hodnoty.",
"Your storage is full, files can not be updated or synced anymore!" => "Vaše úložisko je plné. Súbory nemožno aktualizovať ani synchronizovať!",
"Your storage is almost full ({usedSpacePercent}%)" => "Vaše úložisko je takmer plné ({usedSpacePercent}%)",
+"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Aplikácia na šifrovanie je zapnutá, ale vaše kľúče nie sú inicializované. Odhláste sa a znovu sa prihláste.",
+"Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." => "Chybný súkromný kľúč na šifrovanie aplikácií. Zaktualizujte si heslo súkromného kľúča v svojom osobnom nastavení, aby ste znovu získali prístup k svojim zašifrovaným súborom.",
"Encryption was disabled but your files are still encrypted. Please go to your personal settings to decrypt your files." => "Šifrovanie bolo zakázané, ale vaše súbory sú stále zašifrované. Prosím, choďte do osobného nastavenia pre dešifrovanie súborov.",
"Your download is being prepared. This might take some time if the files are big." => "Vaše sťahovanie sa pripravuje. Ak sú sťahované súbory veľké, môže to chvíľu trvať.",
+"Error moving file" => "Chyba pri presúvaní súboru",
"Name" => "Názov",
"Size" => "Veľkosť",
"Modified" => "Upravené",
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index 32a59f1e1a6..2e88bf2dbb4 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -1,6 +1,6 @@
<div id="controls">
<?php print_unescaped($_['breadcrumb']); ?>
- <div class="actions creatable <?php if (!$_['isCreatable']):?>hidden<?php endif; ?> <?php if (isset($_['files']) and count($_['files'])==0):?>emptycontent<?php endif; ?>">
+ <div class="actions creatable <?php if (!$_['isCreatable']):?>hidden<?php endif; ?>">
<div id="new" class="button">
<a><?php p($l->t('New'));?></a>
<ul>
@@ -42,14 +42,14 @@
<input type="hidden" name="permissions" value="<?php p($_['permissions']); ?>" id="permissions">
</div>
-<div id="emptycontent" <?php if (!isset($_['files']) or !$_['isCreatable'] or count($_['files']) > 0 or $_['ajaxLoad']):?>class="hidden"<?php endif; ?>><?php p($l->t('Nothing in here. Upload something!'))?></div>
+<div id="emptycontent" <?php if (!$_['emptyContent']):?>class="hidden"<?php endif; ?>><?php p($l->t('Nothing in here. Upload something!'))?></div>
<input type="hidden" id="disableSharing" data-status="<?php p($_['disableSharing']); ?>"></input>
<table id="filestable" data-allow-public-upload="<?php p($_['publicUploadEnabled'])?>" data-preview-x="36" data-preview-y="36">
<thead>
<tr>
- <th id='headerName'>
+ <th <?php if (!$_['fileHeader']):?>class="hidden"<?php endif; ?> id='headerName'>
<div id="headerName-container">
<input type="checkbox" id="select_all" />
<label for="select_all"></label>
@@ -65,8 +65,8 @@
</span>
</div>
</th>
- <th id="headerSize"><?php p($l->t('Size')); ?></th>
- <th id="headerDate">
+ <th <?php if (!$_['fileHeader']):?>class="hidden"<?php endif; ?> id="headerSize"><?php p($l->t('Size')); ?></th>
+ <th <?php if (!$_['fileHeader']):?>class="hidden"<?php endif; ?> id="headerDate">
<span id="modified"><?php p($l->t( 'Modified' )); ?></span>
<?php if ($_['permissions'] & OCP\PERMISSION_DELETE): ?>
<!-- NOTE: Temporary fix to allow unsharing of files in root of Shared folder -->
@@ -114,3 +114,5 @@
<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']) ?>" />
+<input type="hidden" name="allowShareWithLink" id="allowShareWithLink" value="<?php p($_['allowShareWithLink']) ?>" />
+
diff --git a/apps/files_encryption/hooks/hooks.php b/apps/files_encryption/hooks/hooks.php
index d9a76becf25..6e2d360917b 100644
--- a/apps/files_encryption/hooks/hooks.php
+++ b/apps/files_encryption/hooks/hooks.php
@@ -555,4 +555,15 @@ class Hooks {
}
}
+ /**
+ * set the init status to 'NOT_INITIALIZED' (0) if the app gets enabled
+ * @param array $params contains the app ID
+ */
+ public static function postEnable($params) {
+ if ($params['app'] === 'files_encryption') {
+ $session = new \OCA\Encryption\Session(new \OC\Files\View('/'));
+ $session->setInitialized(\OCA\Encryption\Session::NOT_INITIALIZED);
+ }
+ }
+
}
diff --git a/apps/files_encryption/l10n/gl.php b/apps/files_encryption/l10n/gl.php
index 5a1d8ec750d..399761b0168 100644
--- a/apps/files_encryption/l10n/gl.php
+++ b/apps/files_encryption/l10n/gl.php
@@ -10,6 +10,8 @@ $TRANSLATIONS = array(
"Could not update the private key password. Maybe the old password was not correct." => "Non foi posíbel actualizar o contrasinal da chave privada. É probábel que o contrasinal antigo non sexa correcto.",
"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." => "Non se iniciou o aplicativo de cifrado! Quizais volva a activarse durante a sesión. Tente pechar a sesión e volver iniciala que tamén se inicie o aplicativo de cifrado.",
"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." => "A chave privada non é correcta! É probábel que o seu contrasinal teña sido cambiado desde o exterior (p.ex. o seu directorio corporativo). Vostede pode actualizar o contrasinal da súa chave privada nos seus axustes persoais para recuperar o acceso aos seus ficheiros",
+"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Non foi posíbel descifrar o ficheiro, probabelmente tratase dun ficheiro compartido. Pidalle ao propietario do ficheiro que volva compartir o ficheiro con vostede.",
+"Unknown error please check your system settings or contact your administrator" => "Produciuse un erro descoñecido. Comprobe os axustes do sistema ou póñase en contacto co administrador",
"Missing requirements." => "Non se cumpren os requisitos.",
"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:",
diff --git a/apps/files_encryption/l10n/it.php b/apps/files_encryption/l10n/it.php
index c93afa15729..fa3a9e39782 100644
--- a/apps/files_encryption/l10n/it.php
+++ b/apps/files_encryption/l10n/it.php
@@ -8,7 +8,10 @@ $TRANSLATIONS = array(
"Could not change the password. Maybe the old password was not correct." => "Impossibile cambiare la password. Forse la vecchia password non era corretta.",
"Private key password successfully updated." => "Password della chiave privata aggiornata correttamente.",
"Could not update the private key password. Maybe the old password was not correct." => "Impossibile aggiornare la password della chiave privata. Forse la vecchia password non era corretta.",
+"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." => "Applicazione di cifratura non inizializzata. Forse l'applicazione è stata riabilitata durante la tua sessione. Prova a disconnetterti e ad effettuare nuovamente l'accesso per inizializzarla.",
"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." => "La chiave privata non è valida! Forse la password è stata cambiata esternamente al sistema di ownCloud (ad es. la directory aziendale). Puoi aggiornare la password della chiave privata nelle impostazioni personali per ottenere nuovamente l'accesso ai file.",
+"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Impossibile decifrare questo file, probabilmente è un file condiviso. Chiedi al proprietario del file di condividere nuovamente il file con te.",
+"Unknown error please check your system settings or contact your administrator" => "Errore sconosciuto, controlla le impostazioni di sistema o contatta il tuo amministratore",
"Missing requirements." => "Requisiti mancanti.",
"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:",
diff --git a/apps/files_encryption/l10n/ja_JP.php b/apps/files_encryption/l10n/ja_JP.php
index fa536dca9b9..689fb78d074 100644
--- a/apps/files_encryption/l10n/ja_JP.php
+++ b/apps/files_encryption/l10n/ja_JP.php
@@ -8,20 +8,26 @@ $TRANSLATIONS = array(
"Could not change the password. Maybe the old password was not correct." => "パスワードを変更できませんでした。古いパスワードが間違っているかもしれません。",
"Private key password successfully updated." => "秘密鍵のパスワードが正常に更新されました。",
"Could not update the private key password. Maybe the old password was not correct." => "秘密鍵のパスワードを更新できませんでした。古いパスワードが正確でない場合があります。",
+"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." => "暗号化アプリが初期化されていません。暗号化アプリが接続中に再度有効かされた可能性があります。暗号化アプリを初期化する為に、1回ログアウトしてログインしなおしてください。",
"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システムの外部(例えば、企業ディレクトリ)から変更された恐れがあります。個人設定で秘密鍵のパスワードを更新して、暗号化されたファイルを回復出来ます。",
+"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "このファイルを復号化できません、共有ファイルの可能性があります。ファイルの所有者にお願いして、ファイルを共有しなおしてもらってください。",
+"Unknown error please check your system settings or contact your administrator" => "不明なエラーです。システム設定を確認するか、管理者に問い合わせてください。",
"Missing requirements." => "必要要件が満たされていません。",
"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..." => "保存中...",
+"Go directly to your " => "あなたのディレクトリへ",
"personal settings" => "秘密鍵をアンロックできます",
"Encryption" => "暗号化",
"Enable recovery key (allow to recover users files in case of password loss):" => "復旧キーを有効化 (万一パスワードを亡くした場合もユーザーのファイルを回復できる):",
"Recovery key password" => "復旧キーのパスワード",
+"Repeat Recovery key password" => "復旧キーのパスワードをもう一度入力",
"Enabled" => "有効",
"Disabled" => "無効",
"Change recovery key password:" => "復旧キーのパスワードを変更:",
"Old Recovery key password" => "古い復旧キーのパスワード",
"New Recovery key password" => "新しい復旧キーのパスワード",
+"Repeat New Recovery key password" => "新しい復旧キーのパスワードをもう一度入力",
"Change Password" => "パスワードを変更",
"Your private key password no longer match your log-in password:" => "もはや秘密鍵はログインパスワードと一致しません:",
"Set your old private key password to your current log-in password." => "古い秘密鍵のパスワードを現在のログインパスワードに設定する。",
diff --git a/apps/files_encryption/l10n/nl.php b/apps/files_encryption/l10n/nl.php
index 86d56e40315..5eed2bfe66a 100644
--- a/apps/files_encryption/l10n/nl.php
+++ b/apps/files_encryption/l10n/nl.php
@@ -10,6 +10,8 @@ $TRANSLATIONS = array(
"Could not update the private key password. Maybe the old password was not correct." => "Kon het wachtwoord van de privésleutel niet wijzigen. Misschien was het oude wachtwoord onjuist.",
"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." => "Crypto app niet geïnitialiseerd. Misschien werd de crypto app geheractiveerd tijdens de sessie. Log uit en log daarna opnieuw in om de crypto app te initialiseren.",
"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." => "Uw privésleutel is niet geldig! Misschien was uw wachtwoord van buitenaf gewijzigd. U kunt het wachtwoord van uw privésleutel aanpassen in uw persoonlijke instellingen om toegang tot uw versleutelde bestanden te vergaren.",
+"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Kan dit bestand niet ontcijferen, waarschijnlijk is het een gedeeld bestand, Vraag de eigenaar om het bestand opnieuw met u te delen.",
+"Unknown error please check your system settings or contact your administrator" => "Onbekende fout, Controleer uw systeeminstellingen of neem contact op met uw systeembeheerder",
"Missing requirements." => "Missende benodigdheden.",
"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:",
diff --git a/apps/files_encryption/l10n/sv.php b/apps/files_encryption/l10n/sv.php
index f806c3cc3e6..a3ffe18bfa2 100644
--- a/apps/files_encryption/l10n/sv.php
+++ b/apps/files_encryption/l10n/sv.php
@@ -10,6 +10,8 @@ $TRANSLATIONS = array(
"Could not update the private key password. Maybe the old password was not correct." => "Kunde inte uppdatera lösenordet för den privata nyckeln. Kanske var det gamla lösenordet fel.",
"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." => "Krypteringsprogrammet kunde inte initieras! Möjligen blev krypteringsprogrammet återaktiverad under din session. Försök med att logga ut och in igen för att initiera krypteringsprogrammet.",
"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." => "Lösenordet för din privata nyckel är inte giltig! Troligen har ditt lösenord ändrats utanför ownCloud (t.ex. i företagets katalogtjänst). Du kan uppdatera lösenordet för den privata nyckeln under dina personliga inställningar för att återfå tillgång till dina filer.",
+"Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." => "Kan ej dekryptera denna fil, förmodligen är det en delad fil. Be ägaren av filen att dela den med dig.",
+"Unknown error please check your system settings or contact your administrator" => "Oväntat fel, kolla dina system inställningar eller kontakta din administratör",
"Missing requirements." => "Krav som saknas",
"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:",
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index a754f9f28c4..91dd08ec08d 100755
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -69,6 +69,7 @@ class Helper {
public static function registerAppHooks() {
\OCP\Util::connectHook('OC_App', 'pre_disable', 'OCA\Encryption\Hooks', 'preDisable');
+ \OCP\Util::connectHook('OC_App', 'post_disable', 'OCA\Encryption\Hooks', 'postEnable');
}
/**
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 53d58fbf40d..b9592a32cb2 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -1278,7 +1278,7 @@ class Util {
// If no record is found
if (empty($migrationStatus)) {
\OCP\Util::writeLog('Encryption library', "Could not get migration status for " . $this->userId . ", no record found", \OCP\Util::ERROR);
- return false;
+ return self::MIGRATION_OPEN;
// If a record is found
} else {
return (int)$migrationStatus[0];
diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php
index ffdcbf05109..bdaea64bb90 100644
--- a/apps/files_sharing/appinfo/app.php
+++ b/apps/files_sharing/appinfo/app.php
@@ -8,6 +8,7 @@ OC::$CLASSPATH['OC\Files\Cache\Shared_Permissions'] = 'files_sharing/lib/permiss
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';
+OC::$CLASSPATH['OCA\Files\Share\Maintainer'] = 'files_sharing/lib/maintainer.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');
@@ -17,3 +18,4 @@ OCP\Util::addScript('files_sharing', 'share');
\OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Shared_Updater', 'renameHook');
\OC_Hook::connect('OCP\Share', 'post_shared', '\OC\Files\Cache\Shared_Updater', 'shareHook');
\OC_Hook::connect('OCP\Share', 'pre_unshare', '\OC\Files\Cache\Shared_Updater', 'shareHook');
+\OC_Hook::connect('OC_Appconfig', 'post_set_value', '\OCA\Files\Share\Maintainer', 'configChangeHook');
diff --git a/apps/files_sharing/css/public.css b/apps/files_sharing/css/public.css
index 3aa4a483041..3e1dec9bbe1 100644
--- a/apps/files_sharing/css/public.css
+++ b/apps/files_sharing/css/public.css
@@ -132,3 +132,14 @@ thead{
top: -2px;
color: #555;
}
+
+.directLink {
+ margin-bottom: 20px;
+}
+ .directLink label {
+ font-weight: normal;
+ }
+ .directLink input {
+ margin-left: 10px;
+ width: 300px;
+ }
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 67320b1cdb6..eacd4096ed8 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -67,4 +67,6 @@ $(document).ready(function() {
procesSelection();
});
+ $('#directLink').focus();
+
});
diff --git a/apps/files_sharing/l10n/pt_PT.php b/apps/files_sharing/l10n/pt_PT.php
index 7fa1876aaac..ce513485497 100644
--- a/apps/files_sharing/l10n/pt_PT.php
+++ b/apps/files_sharing/l10n/pt_PT.php
@@ -1,5 +1,6 @@
<?php
$TRANSLATIONS = array(
+"This share is password-protected" => "Esta partilha está protegida por palavra-chave",
"The password is wrong. Try again." => "Password errada, por favor tente de novo",
"Password" => "Password",
"Sorry, this link doesn’t seem to work anymore." => "Desculpe, mas este link parece não estar a funcionar.",
diff --git a/apps/files_sharing/l10n/ru_RU.php b/apps/files_sharing/l10n/ru_RU.php
new file mode 100644
index 00000000000..2686b1e852d
--- /dev/null
+++ b/apps/files_sharing/l10n/ru_RU.php
@@ -0,0 +1,8 @@
+<?php
+$TRANSLATIONS = array(
+"Password" => "Пароль",
+"Download" => "Загрузка",
+"Upload" => "Загрузка",
+"Cancel upload" => "Отмена загрузки"
+);
+$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/apps/files_sharing/l10n/sv.php b/apps/files_sharing/l10n/sv.php
index 23bf17aba45..64e8a389429 100644
--- a/apps/files_sharing/l10n/sv.php
+++ b/apps/files_sharing/l10n/sv.php
@@ -1,5 +1,6 @@
<?php
$TRANSLATIONS = array(
+"This share is password-protected" => "Den här delningen är lösenordsskyddad",
"The password is wrong. Try again." => "Lösenordet är fel. Försök igen.",
"Password" => "Lösenord",
"Sorry, this link doesn’t seem to work anymore." => "Tyvärr, denna länk verkar inte fungera längre.",
diff --git a/apps/files_sharing/lib/api.php b/apps/files_sharing/lib/api.php
index bd9beddf063..84e90c71681 100644
--- a/apps/files_sharing/lib/api.php
+++ b/apps/files_sharing/lib/api.php
@@ -36,10 +36,17 @@ class Api {
$params['itemSource'] = self::getFileId($_GET['path']);
$params['path'] = $_GET['path'];
$params['itemType'] = self::getItemType($_GET['path']);
- if (isset($_GET['subfiles']) && $_GET['subfiles'] === 'true') {
+
+ if ( isset($_GET['reshares']) && $_GET['reshares'] !== 'false' ) {
+ $params['reshares'] = true;
+ } else {
+ $params['reshares'] = false;
+ }
+
+ if (isset($_GET['subfiles']) && $_GET['subfiles'] !== 'false') {
return self::getSharesFromFolder($params);
}
- return self::getShare($params);
+ return self::collectShares($params);
}
$share = \OCP\Share::getItemShared('file', null);
@@ -59,34 +66,49 @@ class Api {
* @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'];
- $itemType = $params['itemType'];
- $getSpecificShare = true;
- } else {
- $s = self::getShareFromId($params['id']);
- $itemSource = $s['item_source'];
- $itemType = $s['item_type'];
- $getSpecificShare = false;
- }
+
+ $s = self::getShareFromId($params['id']);
+ $params['itemSource'] = $s['item_source'];
+ $params['itemType'] = $s['item_type'];
+ $params['specificShare'] = true;
+
+ return self::collectShares($params);
+ }
+
+ /**
+ * @brief collect all share information, either of a specific share or all
+ * shares for a given path
+ * @param array $params
+ * @return \OC_OCS_Result
+ */
+ private static function collectShares($params) {
+
+ $itemSource = $params['itemSource'];
+ $itemType = $params['itemType'];
+ $getSpecificShare = isset($params['specificShare']) ? $params['specificShare'] : false;
if ($itemSource !== null) {
$shares = \OCP\Share::getItemShared($itemType, $itemSource);
- $reshare = \OCP\Share::getItemSharedWithBySource($itemType, $itemSource);
+ $receivedFrom = \OCP\Share::getItemSharedWithBySource($itemType, $itemSource);
// if a specific share was specified only return this one
- if ($getSpecificShare === false) {
+ if ($getSpecificShare === true) {
foreach ($shares as $share) {
- if ($share['id'] === (int)$params['id']) {
+ if ($share['id'] === (int) $params['id']) {
$shares = array('element' => $share);
break;
}
}
}
- if ($reshare) {
- $shares['received_from'] = $reshare['uid_owner'];
- $shares['received_from_displayname'] = \OCP\User::getDisplayName($reshare['uid_owner']);
+
+ // include also reshares in the lists. This means that the result
+ // will contain every user with access to the file.
+ if (isset($params['reshares']) && $params['reshares'] === true) {
+ $shares = self::addReshares($shares, $itemSource);
+ }
+
+ if ($receivedFrom) {
+ $shares['received_from'] = $receivedFrom['uid_owner'];
+ $shares['received_from_displayname'] = \OCP\User::getDisplayName($receivedFrom['uid_owner']);
}
} else {
$shares = null;
@@ -100,6 +122,37 @@ class Api {
}
/**
+ * @brief add reshares to a array of shares
+ * @param array $shares array of shares
+ * @param int $itemSource item source ID
+ * @return array new shares array which includes reshares
+ */
+ private static function addReshares($shares, $itemSource) {
+
+ // if there are no shares than there are also no reshares
+ $firstShare = reset($shares);
+ if ($firstShare) {
+ $path = $firstShare['path'];
+ } else {
+ return $shares;
+ }
+
+ $select = '`*PREFIX*share`.`id`, `item_type`, `*PREFIX*share`.`parent`, `share_type`, `share_with`, `file_source`, `path` , `permissions`, `stime`, `expiration`, `token`, `storage`, `mail_send`, `mail_send`';
+ $getReshares = \OC_DB::prepare('SELECT ' . $select . ' FROM `*PREFIX*share` INNER JOIN `*PREFIX*filecache` ON `file_source` = `*PREFIX*filecache`.`fileid` WHERE `*PREFIX*share`.`file_source` = ? AND `*PREFIX*share`.`item_type` IN (\'file\', \'folder\') AND `uid_owner` != ?');
+ $reshares = $getReshares->execute(array($itemSource, \OCP\User::getUser()))->fetchAll();
+
+ foreach ($reshares as $key => $reshare) {
+ if (isset($reshare['share_with']) && $reshare['share_with'] !== '') {
+ $reshares[$key]['share_with_displayname'] = \OCP\User::getDisplayName($reshare['share_with']);
+ }
+ // add correct path to the result
+ $reshares[$key]['path'] = $path;
+ }
+
+ return array_merge($shares, $reshares);
+ }
+
+ /**
* @brief get share from all files in a given folder (non-recursive)
* @param array $params contains 'path' to the folder
* @return \OC_OCS_Result
@@ -119,10 +172,10 @@ class Api {
// workaround because folders are named 'dir' in this context
$itemType = $file['type'] === 'file' ? 'file' : 'folder';
$share = \OCP\Share::getItemShared($itemType, $file['fileid']);
- $reshare = \OCP\Share::getItemSharedWithBySource($itemType, $file['fileid']);
- if ($reshare) {
- $share['received_from'] = $reshare['uid_owner'];
- $share['received_from_displayname'] = \OCP\User::getDisplayName($reshare['uid_owner']);
+ $receivedFrom = \OCP\Share::getItemSharedWithBySource($itemType, $file['fileid']);
+ if ($receivedFrom) {
+ $share['received_from'] = $receivedFrom['uid_owner'];
+ $share['received_from_displayname'] = \OCP\User::getDisplayName($receivedFrom['uid_owner']);
}
if ($share) {
$share['filename'] = $file['name'];
diff --git a/apps/files_sharing/lib/maintainer.php b/apps/files_sharing/lib/maintainer.php
new file mode 100644
index 00000000000..bbb3268410e
--- /dev/null
+++ b/apps/files_sharing/lib/maintainer.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * ownCloud
+ *
+ * @author Morris Jobke
+ * @copyright 2013 Morris Jobke morris.jobke@gmail.com
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace OCA\Files\Share;
+
+/**
+ * Maintains stuff around the sharing functionality
+ *
+ * for example: on disable of "allow links" it removes all link shares
+ */
+
+class Maintainer {
+
+ /**
+ * Keeps track of the "allow links" config setting
+ * and removes all link shares if the config option is set to "no"
+ *
+ * @param array with app, key, value as named values
+ */
+ static public function configChangeHook($params) {
+ if($params['app'] === 'core' && $params['key'] === 'shareapi_allow_links' && $params['value'] === 'no') {
+ \OCP\Share::removeAllLinkShares();
+ }
+ }
+
+}
diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php
index 5d935f645e6..ef4c1c433da 100644
--- a/apps/files_sharing/templates/public.php
+++ b/apps/files_sharing/templates/public.php
@@ -15,10 +15,10 @@
<div class="header-right">
<?php if (isset($_['folder'])): ?>
<span id="details"><?php p($l->t('%s shared the folder %s with you',
- array($_['displayName'], $_['fileTarget']))) ?></span>
+ array($_['displayName'], $_['filename']))) ?></span>
<?php else: ?>
<span id="details"><?php p($l->t('%s shared the file %s with you',
- array($_['displayName'], $_['fileTarget']))) ?></span>
+ array($_['displayName'], $_['filename']))) ?></span>
<?php endif; ?>
@@ -88,13 +88,14 @@
<?php else: ?>
<ul id="noPreview">
<li class="error">
- <?php p($l->t('No preview available for').' '.$_['fileTarget']); ?><br />
+ <?php p($l->t('No preview available for').' '.$_['filename']); ?><br />
<a href="<?php p($_['downloadURL']); ?>" id="download"><img class="svg" alt="Download"
src="<?php print_unescaped(OCP\image_path("core", "actions/download.svg")); ?>"
/><?php p($l->t('Download'))?></a>
</li>
</ul>
<?php endif; ?>
+ <div class="directLink"><label for="directLink"><?php p($l->t('Direct link')) ?></label><input id="directLink" type="text" readonly value="<?php p($_['downloadURL']); ?>"></input></div>
<?php endif; ?>
</div>
<footer>
diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php
index 529140849c6..44fc4d8b7b3 100644
--- a/apps/files_sharing/tests/api.php
+++ b/apps/files_sharing/tests/api.php
@@ -31,6 +31,7 @@ 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";
+ const TEST_FILES_SHARING_API_USER3 = "test-share-user3";
public $stateFilesEncryption;
public $filename;
@@ -54,6 +55,7 @@ class Test_Files_Sharing_Api extends \PHPUnit_Framework_TestCase {
// 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);
+ self::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER3, true);
}
@@ -101,6 +103,7 @@ class Test_Files_Sharing_Api extends \PHPUnit_Framework_TestCase {
// 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);
+ \OC_User::deleteUser(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER3);
}
/**
@@ -197,10 +200,9 @@ class Test_Files_Sharing_Api extends \PHPUnit_Framework_TestCase {
\OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_LINK,
null, 1);
- $params = array('itemSource' => $fileInfo['fileid'],
- 'itemType' => 'file');
+ $_GET['path'] = $this->filename;
- $result = Share\Api::getShare($params);
+ $result = Share\Api::getAllShares(array());
$this->assertTrue($result->succeeded());
@@ -218,6 +220,60 @@ class Test_Files_Sharing_Api extends \PHPUnit_Framework_TestCase {
* @medium
* @depends testCreateShare
*/
+ function testGetShareFromSourceWithReshares() {
+
+ $fileInfo = $this->view->getFileInfo($this->filename);
+
+ // share the file as user1 to user2
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
+ \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2, 31);
+
+ // login as user2 and reshare the file to user3
+ \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
+
+ \OCP\Share::shareItem('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
+ \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER3, 31);
+
+ // login as user1 again
+ \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1);
+
+ $_GET['path'] = $this->filename;
+
+ $result = Share\Api::getAllShares(array());
+
+ $this->assertTrue($result->succeeded());
+
+ // test should return one share
+ $this->assertTrue(count($result->getData()) === 1);
+
+ // now also ask for the reshares
+ $_GET['reshares'] = 'true';
+
+ $result = Share\Api::getAllShares(array());
+
+ $this->assertTrue($result->succeeded());
+
+ // now we should get two shares, the initial share and the reshare
+ $this->assertTrue(count($result->getData()) === 2);
+
+ // unshare files again
+
+ \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
+
+ \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
+ \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER3);
+
+ \Test_Files_Sharing_Api::loginHelper(\Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER1);
+
+ \OCP\Share::unshare('file', $fileInfo['fileid'], \OCP\Share::SHARE_TYPE_USER,
+ \Test_Files_Sharing_Api::TEST_FILES_SHARING_API_USER2);
+
+ }
+
+ /**
+ * @medium
+ * @depends testCreateShare
+ */
function testGetShareFromId() {
$fileInfo = $this->view->getFileInfo($this->filename);
diff --git a/apps/files_trashbin/l10n/ru_RU.php b/apps/files_trashbin/l10n/ru_RU.php
new file mode 100644
index 00000000000..3129ff95eb4
--- /dev/null
+++ b/apps/files_trashbin/l10n/ru_RU.php
@@ -0,0 +1,5 @@
+<?php
+$TRANSLATIONS = array(
+"Error" => "Ошибка"
+);
+$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js
index 3f56a3eb698..d118456d62e 100644
--- a/apps/files_versions/js/versions.js
+++ b/apps/files_versions/js/versions.js
@@ -1,5 +1,12 @@
$(document).ready(function(){
+ if ($('#isPublic').val()){
+ // no versions actions in public mode
+ // beware of https://github.com/owncloud/core/issues/4545
+ // as enabling this might hang Chrome
+ return;
+ }
+
if (typeof FileActions !== 'undefined') {
// Add versions button to 'files/index.php'
FileActions.register(
diff --git a/apps/user_ldap/l10n/it.php b/apps/user_ldap/l10n/it.php
index 914cc3d32ae..173f359b2fa 100644
--- a/apps/user_ldap/l10n/it.php
+++ b/apps/user_ldap/l10n/it.php
@@ -76,6 +76,8 @@ $TRANSLATIONS = array(
"Internal Username Attribute:" => "Attributo nome utente interno:",
"Override UUID detection" => "Ignora rilevamento UUID",
"By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups." => "In modo predefinito, l'attributo UUID viene rilevato automaticamente. L'attributo UUID è utilizzato per identificare senza alcun dubbio gli utenti e i gruppi LDAP. Inoltre, il nome utente interno sarà creato sulla base dell'UUID, se non è specificato in precedenza. Puoi ignorare l'impostazione e fornire un attributo di tua scelta. Assicurati che l'attributo scelto possa essere ottenuto sia per gli utenti che per i gruppi e che sia univoco. Lascialo vuoto per ottenere il comportamento predefinito. Le modifiche avranno effetto solo sui nuovi utenti e gruppi LDAP associati (aggiunti).",
+"UUID Attribute for Users:" => "Attributo UUID per gli utenti:",
+"UUID Attribute for Groups:" => "Attributo UUID per i gruppi:",
"Username-LDAP User Mapping" => "Associazione Nome utente-Utente LDAP",
"Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." => "I nomi utente sono utilizzati per archiviare e assegnare i (meta) dati. Per identificare con precisione e riconoscere gli utenti, ogni utente LDAP avrà un nome utente interno. Ciò richiede un'associazione tra il nome utente e l'utente LDAP. In aggiunta, il DN viene mantenuto in cache per ridurre l'interazione con LDAP, ma non è utilizzato per l'identificazione. Se il DN cambia, le modifiche saranno rilevate. Il nome utente interno è utilizzato dappertutto. La cancellazione delle associazioni lascerà tracce residue ovunque e interesserà esclusivamente la configurazione LDAP. Non cancellare mai le associazioni in un ambiente di produzione, ma solo in una fase sperimentale o di test.",
"Clear Username-LDAP User Mapping" => "Cancella associazione Nome utente-Utente LDAP",
diff --git a/apps/user_ldap/l10n/ru_RU.php b/apps/user_ldap/l10n/ru_RU.php
new file mode 100644
index 00000000000..fc31eebbef1
--- /dev/null
+++ b/apps/user_ldap/l10n/ru_RU.php
@@ -0,0 +1,6 @@
+<?php
+$TRANSLATIONS = array(
+"Error" => "Ошибка",
+"Password" => "Пароль"
+);
+$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";
diff --git a/apps/user_ldap/l10n/sk_SK.php b/apps/user_ldap/l10n/sk_SK.php
index 08b32e75f93..a2ceb84d4eb 100644
--- a/apps/user_ldap/l10n/sk_SK.php
+++ b/apps/user_ldap/l10n/sk_SK.php
@@ -76,6 +76,8 @@ $TRANSLATIONS = array(
"Internal Username Attribute:" => "Atribút interného používateľského mena:",
"Override UUID detection" => "Prepísať UUID detekciu",
"By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups." => "V predvolenom nastavení je UUID atribút detekovaný automaticky. UUID atribút je použitý na jedinečnú identifikáciu používateľov a skupín z LDAP. Naviac je na základe UUID vytvorené tiež interné použivateľské meno, ak nie je nastavené inak. Môžete predvolené nastavenie prepísať a použiť atribút ktorý si sami zvolíte. Musíte sa ale ubezpečiť, že atribút ktorý vyberiete bude uvedený pri použivateľoch, aj pri skupinách a je jedinečný. Ponechajte prázdne pre predvolené správanie. Zmena bude mať vplyv len na novo namapovaných (pridaných) používateľov a skupiny z LDAP.",
+"UUID Attribute for Users:" => "UUID atribút pre používateľov:",
+"UUID Attribute for Groups:" => "UUID atribút pre skupiny:",
"Username-LDAP User Mapping" => "Mapovanie názvov LDAP používateľských mien",
"Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." => "Použivateľské mená sa používajú pre uchovávanie a priraďovanie (meta)dát. Pre správnu identifikáciu a rozpoznanie používateľov bude mať každý používateľ z LDAP interné používateľské meno. To je nevyhnutné pre namapovanie používateľských mien na používateľov v LDAP. Vytvorené používateľské meno je namapované na UUID používateľa v LDAP. Naviac je cachovaná DN pre obmedzenie interakcie s LDAP, ale nie je používaná pre identifikáciu. Ak sa DN zmení, bude to správne rozpoznané. Interné používateľské meno sa používa všade. Vyčistenie namapování vymaže zvyšky všade. Vyčistenie naviac nie je špecifické, bude mať vplyv na všetky LDAP konfigurácie! Nikdy nečistite namapovanie v produkčnom prostredí, len v testovacej alebo experimentálnej fáze.",
"Clear Username-LDAP User Mapping" => "Zrušiť mapovanie LDAP používateľských mien",
diff --git a/apps/user_ldap/l10n/sv.php b/apps/user_ldap/l10n/sv.php
index a5c060c717d..c081d70b950 100644
--- a/apps/user_ldap/l10n/sv.php
+++ b/apps/user_ldap/l10n/sv.php
@@ -76,6 +76,8 @@ $TRANSLATIONS = array(
"Internal Username Attribute:" => "Internt Användarnamn Attribut:",
"Override UUID detection" => "Åsidosätt UUID detektion",
"By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups." => "Som standard upptäcker ownCloud automatiskt UUID-attributet. Det UUID-attributet används för att utan tvivel identifiera LDAP-användare och grupper. Dessutom kommer interna användarnamn skapas baserat på detta UUID, om inte annat anges ovan. Du kan åsidosätta inställningen och passera ett attribut som du själv väljer. Du måste se till att attributet som du väljer kan hämtas för både användare och grupper och att det är unikt. Lämna det tomt för standard beteende. Förändringar kommer endast att påverka nyligen mappade (tillagda) LDAP-användare och grupper.",
+"UUID Attribute for Users:" => "UUID Attribut för Användare:",
+"UUID Attribute for Groups:" => "UUID Attribut för Grupper:",
"Username-LDAP User Mapping" => "Användarnamn-LDAP User Mapping",
"Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage." => "ownCloud använder sig av användarnamn för att lagra och tilldela (meta) data. För att exakt kunna identifiera och känna igen användare, kommer varje LDAP-användare ha ett internt användarnamn. Detta kräver en mappning från ownCloud-användarnamn till LDAP-användare. Det skapade användarnamnet mappas till UUID för LDAP-användaren. Dessutom cachas DN samt minska LDAP-interaktionen, men den används inte för identifiering. Om DN förändras, kommer förändringarna hittas av ownCloud. Det interna ownCloud-namnet används överallt i ownCloud. Om du rensar/raderar mappningarna kommer att lämna referenser överallt i systemet. Men den är inte konfigurationskänslig, den påverkar alla LDAP-konfigurationer! Rensa/radera aldrig mappningarna i en produktionsmiljö. Utan gör detta endast på i testmiljö!",
"Clear Username-LDAP User Mapping" => "Rensa Användarnamn-LDAP User Mapping",
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 6177693c489..0d4b09bac7e 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -1021,7 +1021,7 @@ class Access extends LDAPUtility {
$bases = $this->sanitizeDN($bases);
foreach($bases as $base) {
$belongsToBase = true;
- if(mb_strripos($dn, $base, 0, 'UTF-8') !== (mb_strlen($dn, 'UTF-8')-mb_strlen($base))) {
+ if(mb_strripos($dn, $base, 0, 'UTF-8') !== (mb_strlen($dn, 'UTF-8')-mb_strlen($base, 'UTF-8'))) {
$belongsToBase = false;
}
if($belongsToBase) {