aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/js/app.js6
-rw-r--r--apps/files/js/file-upload.js4
-rw-r--r--apps/files/js/filelist.js82
-rw-r--r--apps/files/js/files.js7
-rw-r--r--apps/files/l10n/az.php1
-rw-r--r--apps/files/l10n/bn_BD.php3
-rw-r--r--apps/files/l10n/de.php8
-rw-r--r--apps/files/l10n/de_DE.php6
-rw-r--r--apps/files/l10n/et_EE.php1
-rw-r--r--apps/files/l10n/pl.php2
-rw-r--r--apps/files/tests/js/filelistSpec.js11
-rw-r--r--apps/files_encryption/l10n/et_EE.php1
-rw-r--r--apps/files_external/l10n/de_DE.php6
-rw-r--r--apps/files_external/l10n/ja.php4
-rw-r--r--apps/user_ldap/l10n/bn_BD.php32
-rw-r--r--apps/user_webdavauth/l10n/bn_BD.php4
-rw-r--r--core/l10n/az.php3
-rw-r--r--core/l10n/de_DE.php8
-rw-r--r--core/l10n/et_EE.php4
-rw-r--r--l10n/templates/core.pot16
-rw-r--r--l10n/templates/files.pot36
-rw-r--r--l10n/templates/files_encryption.pot2
-rw-r--r--l10n/templates/files_external.pot2
-rw-r--r--l10n/templates/files_sharing.pot2
-rw-r--r--l10n/templates/files_trashbin.pot2
-rw-r--r--l10n/templates/files_versions.pot2
-rw-r--r--l10n/templates/lib.pot16
-rw-r--r--l10n/templates/private.pot16
-rw-r--r--l10n/templates/settings.pot2
-rw-r--r--l10n/templates/user_ldap.pot2
-rw-r--r--l10n/templates/user_webdavauth.pot2
-rw-r--r--lib/base.php30
-rw-r--r--lib/l10n/et_EE.php3
-rw-r--r--lib/private/connector/sabre/file.php13
-rw-r--r--lib/private/files/cache/changepropagator.php8
-rw-r--r--lib/private/files/cache/homecache.php3
-rw-r--r--lib/private/files/cache/updater.php214
-rw-r--r--lib/private/files/view.php65
-rw-r--r--search/js/result.js2
-rw-r--r--settings/l10n/ar.php15
-rw-r--r--settings/l10n/az.php1
-rw-r--r--settings/l10n/et_EE.php9
-rw-r--r--tests/lib/connector/sabre/file.php12
-rw-r--r--tests/lib/files/cache/updater.php368
-rw-r--r--tests/lib/files/cache/updaterlegacy.php328
-rw-r--r--tests/lib/files/view.php2
46 files changed, 779 insertions, 587 deletions
diff --git a/apps/files/js/app.js b/apps/files/js/app.js
index 6f5206fcdb6..89098e3a8a3 100644
--- a/apps/files/js/app.js
+++ b/apps/files/js/app.js
@@ -24,6 +24,7 @@
initialize: function() {
this.navigation = new OCA.Files.Navigation($('#app-navigation'));
+ var urlParams = OC.Util.History.parseUrlQuery();
var fileActions = new OCA.Files.FileActions();
// default actions
fileActions.registerDefaultActions();
@@ -47,7 +48,8 @@
dragOptions: dragOptions,
folderDropOptions: folderDropOptions,
fileActions: fileActions,
- allowLegacyActions: true
+ allowLegacyActions: true,
+ scrollTo: urlParams.scrollto
}
);
this.files.initialize();
@@ -58,7 +60,7 @@
this._setupEvents();
// trigger URL change event handlers
- this._onPopState(OC.Util.History.parseUrlQuery());
+ this._onPopState(urlParams);
},
/**
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 310799b9513..460c2435642 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -629,7 +629,7 @@ OC.Upload = {
},
function(result) {
if (result.status === 'success') {
- FileList.add(result.data, {hidden: hidden, animate: true});
+ FileList.add(result.data, {hidden: hidden, animate: true, scrollTo: true});
} else {
OC.dialogs.alert(result.data.message, t('core', 'Could not create file'));
}
@@ -645,7 +645,7 @@ OC.Upload = {
},
function(result) {
if (result.status === 'success') {
- FileList.add(result.data, {hidden: hidden, animate: true});
+ FileList.add(result.data, {hidden: hidden, animate: true, scrollTo: true});
} else {
OC.dialogs.alert(result.data.message, t('core', 'Could not create folder'));
}
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 037e04db21c..522ff627529 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -110,9 +110,10 @@
* @param $el container element with existing markup for the #controls
* and a table
* @param options map of options, see other parameters
- * @param scrollContainer scrollable container, defaults to $(window)
- * @param dragOptions drag options, disabled by default
- * @param folderDropOptions folder drop options, disabled by default
+ * @param options.scrollContainer scrollable container, defaults to $(window)
+ * @param options.dragOptions drag options, disabled by default
+ * @param options.folderDropOptions folder drop options, disabled by default
+ * @param options.scrollTo name of file to scroll to after the first load
*/
initialize: function($el, options) {
var self = this;
@@ -172,6 +173,12 @@
this.setupUploadEvents();
this.$container.on('scroll', _.bind(this._onScroll, this));
+
+ if (options.scrollTo) {
+ this.$fileList.one('updated', function() {
+ self.scrollTo(options.scrollTo);
+ });
+ }
},
/**
@@ -715,9 +722,10 @@
*
* @param fileData map of file attributes
* @param options map of attributes:
- * - "updateSummary": true to update the summary after adding (default), false otherwise
- * - "silent": true to prevent firing events like "fileActionsReady"
- * - "animate": true to animate preview loading (defaults to true here)
+ * @param options.updateSummary true to update the summary after adding (default), false otherwise
+ * @param options.silent true to prevent firing events like "fileActionsReady"
+ * @param options.animate true to animate preview loading (defaults to true here)
+ * @param options.scrollTo true to automatically scroll to the file's location
* @return new tr element (not appended to the table)
*/
add: function(fileData, options) {
@@ -766,6 +774,10 @@
});
}
+ if (options.scrollTo) {
+ this.scrollTo(fileData.name);
+ }
+
// defaults to true if not defined
if (typeof(options.updateSummary) === 'undefined' || !!options.updateSummary) {
this.fileSummary.add(fileData, true);
@@ -1523,16 +1535,15 @@
this.$table.removeClass('hidden');
},
scrollTo:function(file) {
- //scroll to and highlight preselected file
- var $scrollToRow = this.findFileEl(file);
- if ($scrollToRow.exists()) {
- $scrollToRow.addClass('searchresult');
- $(window).scrollTop($scrollToRow.position().top);
- //remove highlight when hovered over
- $scrollToRow.one('hover', function() {
- $scrollToRow.removeClass('searchresult');
- });
+ if (!_.isArray(file)) {
+ file = [file];
}
+ this.highlightFiles(file, function($tr) {
+ $tr.addClass('searchresult');
+ $tr.one('hover', function() {
+ $tr.removeClass('searchresult');
+ });
+ });
},
filter:function(query) {
this.$fileList.find('tr').each(function(i,e) {
@@ -1632,6 +1643,18 @@
},
/**
+ * Shows a "permission denied" notification
+ */
+ _showPermissionDeniedNotification: function() {
+ var message = t('core', 'You don’t have permission to upload or create files here');
+ OC.Notification.show(message);
+ //hide notification after 10 sec
+ setTimeout(function() {
+ OC.Notification.hide();
+ }, 5000);
+ },
+
+ /**
* Setup file upload events related to the file-upload plugin
*/
setupUploadEvents: function() {
@@ -1662,6 +1685,12 @@
// remember as context
data.context = dropTarget;
+ // if permissions are specified, only allow if create permission is there
+ var permissions = dropTarget.data('permissions');
+ if (!_.isUndefined(permissions) && (permissions & OC.PERMISSION_CREATE) === 0) {
+ self._showPermissionDeniedNotification();
+ return false;
+ }
var dir = dropTarget.data('file');
// if from file list, need to prepend parent dir
if (dir) {
@@ -1686,6 +1715,7 @@
// cancel uploads to current dir if no permission
var isCreatable = (self.getDirectoryPermissions() & OC.PERMISSION_CREATE) !== 0;
if (!isCreatable) {
+ self._showPermissionDeniedNotification();
return false;
}
}
@@ -1861,9 +1891,11 @@
/**
* Scroll to the last file of the given list
* Highlight the list of files
- * @param files array of filenames
+ * @param files array of filenames,
+ * @param {Function} [highlightFunction] optional function
+ * to be called after the scrolling is finished
*/
- highlightFiles: function(files) {
+ highlightFiles: function(files, highlightFunction) {
// Detection of the uploaded element
var filename = files[files.length - 1];
var $fileRow = this.findFileEl(filename);
@@ -1888,12 +1920,16 @@
duration: 500,
complete: function() {
// Highlighting function
- var highlightRow = function($fileRow) {
- $fileRow.addClass("highlightUploaded");
- setTimeout(function() {
- $fileRow.removeClass("highlightUploaded");
- }, 2500);
- };
+ var highlightRow = highlightFunction;
+
+ if (!highlightRow) {
+ highlightRow = function($fileRow) {
+ $fileRow.addClass("highlightUploaded");
+ setTimeout(function() {
+ $fileRow.removeClass("highlightUploaded");
+ }, 2500);
+ };
+ }
// Loop over uploaded files
for(var i=0; i<files.length; i++) {
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index df0c40a4405..5fcf99d24af 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -433,7 +433,12 @@ var folderDropOptions = {
return false;
}
- var targetPath = FileList.getCurrentDirectory() + '/' + $(this).closest('tr').data('file');
+ var $tr = $(this).closest('tr');
+ if (($tr.data('permissions') & OC.PERMISSION_CREATE) === 0) {
+ FileList._showPermissionDeniedNotification();
+ return false;
+ }
+ var targetPath = FileList.getCurrentDirectory() + '/' + $tr.data('file');
var files = FileList.getSelectedFiles();
if (files.length === 0) {
diff --git a/apps/files/l10n/az.php b/apps/files/l10n/az.php
index a41af8e8ca2..bfbb118b1b9 100644
--- a/apps/files/l10n/az.php
+++ b/apps/files/l10n/az.php
@@ -26,6 +26,7 @@ $TRANSLATIONS = array(
"Save" => "Saxlamaq",
"New folder" => "Yeni qovluq",
"Folder" => "Qovluq",
+"Nothing in here. Upload something!" => "Burda heçnə yoxdur. Nese yükləyin!",
"Download" => "Yüklə"
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files/l10n/bn_BD.php b/apps/files/l10n/bn_BD.php
index 7e7b8461720..eb50851c864 100644
--- a/apps/files/l10n/bn_BD.php
+++ b/apps/files/l10n/bn_BD.php
@@ -1,9 +1,12 @@
<?php
$TRANSLATIONS = array(
+"Storage not available" => "সংরক্ষণের স্থান নেই",
+"Storage invalid" => "সংরক্ষণাগার বৈধ নয়",
"Unknown error" => "অজানা জটিলতা",
"Could not move %s - File with this name already exists" => "%s কে স্থানান্তর করা সম্ভব হলো না - এই নামের ফাইল বিদ্যমান",
"Could not move %s" => "%s কে স্থানান্তর করা সম্ভব হলো না",
"File name cannot be empty." => "ফাইলের নামটি ফাঁকা রাখা যাবে না।",
+"\"%s\" is an invalid file name." => "\"%s\" টি একটি অননুমোদিত ফাইল নাম।",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "নামটি সঠিক নয়, '\\', '/', '<', '>', ':', '\"', '|', '?' এবং '*' অনুমোদিত নয়।",
"No file was uploaded. Unknown error" => "কোন ফাইল আপলোড করা হয় নি। সমস্যার কারণটি অজ্ঞাত।",
"There is no error, the file uploaded with success" => "কোন সমস্যা হয় নি, ফাইল আপলোড সুসম্পন্ন হয়েছে।",
diff --git a/apps/files/l10n/de.php b/apps/files/l10n/de.php
index 603177bae56..94f8eb5e86e 100644
--- a/apps/files/l10n/de.php
+++ b/apps/files/l10n/de.php
@@ -6,7 +6,7 @@ $TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Konnte %s nicht verschieben. Eine Datei mit diesem Namen existiert bereits",
"Could not move %s" => "Konnte %s nicht verschieben",
"File name cannot be empty." => "Der Dateiname darf nicht leer sein.",
-"\"%s\" is an invalid file name." => "\"%s\" ist kein gültiger Dateiname.",
+"\"%s\" is an invalid file name." => "»%s« ist kein gültiger Dateiname.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Ungültiger Name, '\\', '/', '<', '>', ':', '\"', '|', '?' und '*' sind nicht zulässig.",
"The target folder has been moved or deleted." => "Der Zielordner wurde verschoben oder gelöscht.",
"The name %s is already used in the folder %s. Please choose a different name." => "Der Name %s wird bereits im Ordner %s benutzt. Bitte wähle einen anderen Namen.",
@@ -61,8 +61,9 @@ $TRANSLATIONS = array(
"Modified" => "Geändert",
"_%n folder_::_%n folders_" => array("%n Ordner","%n Ordner"),
"_%n file_::_%n files_" => array("%n Datei","%n Dateien"),
+"You don’t have permission to upload or create files here" => "Du besitzt hier keine Berechtigung, um Dateien hochzuladen oder zu erstellen",
"_Uploading %n file_::_Uploading %n files_" => array("%n Datei wird hochgeladen","%n Dateien werden hochgeladen"),
-"\"{name}\" is an invalid file name." => "\"{name}\" ist kein gültiger Dateiname.",
+"\"{name}\" is an invalid file name." => "»{name}« ist kein gültiger Dateiname.",
"Your storage is full, files can not be updated or synced anymore!" => "Dein Speicher ist voll, daher können keine Dateien mehr aktualisiert oder synchronisiert werden!",
"Your storage is almost full ({usedSpacePercent}%)" => "Dein Speicher ist fast voll ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Die Verschlüsselung-App ist aktiviert, aber Deine Schlüssel sind nicht initialisiert. Bitte melden Dich nochmals ab und wieder an.",
@@ -77,14 +78,13 @@ $TRANSLATIONS = array(
"max. possible: " => "maximal möglich:",
"Save" => "Speichern",
"WebDAV" => "WebDAV",
-"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Verwenden Sie diese Adresse, um <a href=\"%s\" target=\"_blank\">via WebDAV auf Ihre Dateien zuzugreifen</a>",
+"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Diese Adresse benutzen, um <a href=\"%s\" target=\"_blank\">über WebDAV auf Ihre Dateien zuzugreifen</a>",
"New" => "Neu",
"New text file" => "Neue Textdatei",
"Text file" => "Textdatei",
"New folder" => "Neuer Ordner",
"Folder" => "Ordner",
"From link" => "Von einem Link",
-"You don’t have permission to upload or create files here" => "Du besitzt hier keine Berechtigung, um Dateien hochzuladen oder zu erstellen",
"Nothing in here. Upload something!" => "Alles leer. Lade etwas hoch!",
"Download" => "Herunterladen",
"Upload too large" => "Der Upload ist zu groß",
diff --git a/apps/files/l10n/de_DE.php b/apps/files/l10n/de_DE.php
index 5c5e4694630..29e74110e99 100644
--- a/apps/files/l10n/de_DE.php
+++ b/apps/files/l10n/de_DE.php
@@ -61,8 +61,9 @@ $TRANSLATIONS = array(
"Modified" => "Geändert",
"_%n folder_::_%n folders_" => array("%n Ordner","%n Ordner"),
"_%n file_::_%n files_" => array("%n Datei","%n Dateien"),
+"You don’t have permission to upload or create files here" => "Sie besitzen hier keine Berechtigung Dateien hochzuladen oder zu erstellen",
"_Uploading %n file_::_Uploading %n files_" => array("%n Datei wird hoch geladen","%n Dateien werden hoch geladen"),
-"\"{name}\" is an invalid file name." => "\"{name}\" ist kein gültiger Dateiname.",
+"\"{name}\" is an invalid file name." => "»{name}« ist kein gültiger Dateiname.",
"Your storage is full, files can not be updated or synced anymore!" => "Ihr Speicher ist voll, daher können keine Dateien mehr aktualisiert oder synchronisiert werden!",
"Your storage is almost full ({usedSpacePercent}%)" => "Ihr Speicher ist fast voll ({usedSpacePercent}%)",
"Encryption App is enabled but your keys are not initialized, please log-out and log-in again" => "Verschlüsselung-App ist aktiviert, aber Ihre Schlüssel sind nicht initialisiert. Bitte melden sich nochmals ab und wieder an.",
@@ -77,14 +78,13 @@ $TRANSLATIONS = array(
"max. possible: " => "maximal möglich:",
"Save" => "Speichern",
"WebDAV" => "WebDAV",
-"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Verwenden Sie diese Adresse, um <a href=\"%s\" target=\"_blank\">via WebDAV auf Ihre Dateien zuzugreifen</a>",
+"Use this address to <a href=\"%s\" target=\"_blank\">access your Files via WebDAV</a>" => "Diese Adresse benutzen, um <a href=\"%s\" target=\"_blank\">über WebDAV auf Ihre Dateien zuzugreifen</a>",
"New" => "Neu",
"New text file" => "Neue Textdatei",
"Text file" => "Textdatei",
"New folder" => "Neuer Ordner",
"Folder" => "Ordner",
"From link" => "Von einem Link",
-"You don’t have permission to upload or create files here" => "Sie besitzen hier keine Berechtigung Dateien hochzuladen oder zu erstellen",
"Nothing in here. Upload something!" => "Alles leer. Laden Sie etwas hoch!",
"Download" => "Herunterladen",
"Upload too large" => "Der Upload ist zu groß",
diff --git a/apps/files/l10n/et_EE.php b/apps/files/l10n/et_EE.php
index 46246047ac9..e566617a061 100644
--- a/apps/files/l10n/et_EE.php
+++ b/apps/files/l10n/et_EE.php
@@ -12,6 +12,7 @@ $TRANSLATIONS = array(
"The name %s is already used in the folder %s. Please choose a different name." => "Nimi %s on juba kasutusel kataloogis %s. Palun vali mõni teine nimi.",
"Not a valid source" => "Pole korrektne lähteallikas",
"Server is not allowed to open URLs, please check the server configuration" => "Server ei võimalda URL-ide avamist, palun kontrolli serveri seadistust",
+"The file exceeds your quota by %s" => "Fail ületab sinu limiidi: %s",
"Error while downloading %s to %s" => "Viga %s allalaadimisel %s",
"Error when creating the file" => "Viga faili loomisel",
"Folder name cannot be empty." => "Kataloogi nimi ei saa olla tühi.",
diff --git a/apps/files/l10n/pl.php b/apps/files/l10n/pl.php
index 09c460864eb..27be124bb29 100644
--- a/apps/files/l10n/pl.php
+++ b/apps/files/l10n/pl.php
@@ -61,6 +61,7 @@ $TRANSLATIONS = array(
"Modified" => "Modyfikacja",
"_%n folder_::_%n folders_" => array("%n katalog","%n katalogi","%n katalogów"),
"_%n file_::_%n files_" => array("%n plik","%n pliki","%n plików"),
+"You don’t have permission to upload or create files here" => "Nie masz uprawnień do wczytywania lub tworzenia plików w tym miejscu",
"_Uploading %n file_::_Uploading %n files_" => array("Wysyłanie %n pliku","Wysyłanie %n plików","Wysyłanie %n plików"),
"\"{name}\" is an invalid file name." => "\"{name}\" jest nieprawidłową nazwą pliku.",
"Your storage is full, files can not be updated or synced anymore!" => "Magazyn jest pełny. Pliki nie mogą zostać zaktualizowane lub zsynchronizowane!",
@@ -84,7 +85,6 @@ $TRANSLATIONS = array(
"New folder" => "Nowy folder",
"Folder" => "Folder",
"From link" => "Z odnośnika",
-"You don’t have permission to upload or create files here" => "Nie masz uprawnień do wczytywania lub tworzenia plików w tym miejscu",
"Nothing in here. Upload something!" => "Pusto. Wyślij coś!",
"Download" => "Pobierz",
"Upload too large" => "Ładowany plik jest za duży",
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index cad564323b4..65a89ef85cd 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -1835,7 +1835,6 @@ describe('OCA.Files.FileList tests', function() {
// but it makes it possible to simulate the event triggering to
// test the response of the handlers
$uploader = $('#file_upload_start');
- fileList.setupUploadEvents();
fileList.setFiles(testFiles);
});
@@ -1912,6 +1911,16 @@ describe('OCA.Files.FileList tests', function() {
ev = dropOn(fileList.$fileList.find('th:first'));
expect(ev.result).toEqual(false);
+ expect(notificationStub.calledOnce).toEqual(true);
+ });
+ it('drop on an folder does not trigger upload if no upload permission on that folder', function() {
+ var $tr = fileList.findFileEl('somedir');
+ var ev;
+ $tr.data('permissions', OC.PERMISSION_READ);
+ ev = dropOn($tr);
+
+ expect(ev.result).toEqual(false);
+ expect(notificationStub.calledOnce).toEqual(true);
});
it('drop on a file row inside the table triggers upload to current folder', function() {
var ev;
diff --git a/apps/files_encryption/l10n/et_EE.php b/apps/files_encryption/l10n/et_EE.php
index 7e298d8e663..bbf0ee4dca3 100644
--- a/apps/files_encryption/l10n/et_EE.php
+++ b/apps/files_encryption/l10n/et_EE.php
@@ -31,6 +31,7 @@ $TRANSLATIONS = array(
"Repeat New Recovery key password" => "Korda uut taastevõtme parooli",
"Change Password" => "Muuda parooli",
"Your private key password no longer matches your log-in password." => "Sinu provaatvõtme parool ei kattu enam sinu sisselogimise parooliga.",
+"Set your old private key password to your current log-in password:" => "Pane oma vana privaatvõtme parooliks oma praegune sisselogimise parool.",
" If you don't remember your old password you can ask your administrator to recover your files." => "Kui sa ei mäleta oma vana parooli, siis palu oma süsteemihalduril taastada ligipääs failidele.",
"Old log-in password" => "Vana sisselogimise parool",
"Current log-in password" => "Praegune sisselogimise parool",
diff --git a/apps/files_external/l10n/de_DE.php b/apps/files_external/l10n/de_DE.php
index e55b0f3dbf6..fbeacb43178 100644
--- a/apps/files_external/l10n/de_DE.php
+++ b/apps/files_external/l10n/de_DE.php
@@ -19,7 +19,7 @@ $TRANSLATIONS = array(
"Port" => "Port",
"Region" => "Region",
"Enable SSL" => "SSL aktivieren",
-"Enable Path Style" => "Pfad-Stil aktivieren",
+"Enable Path Style" => "Pfadstil aktivieren",
"App key" => "App-Schlüssel",
"App secret" => "Geheime Zeichenkette der App",
"Host" => "Host",
@@ -40,9 +40,9 @@ $TRANSLATIONS = array(
"Share" => "Teilen",
"SMB / CIFS using OC login" => "SMB / CIFS mit OC-Login",
"Username as share" => "Benutzername als Freigabe",
-"URL" => "URL",
+"URL" => "Adresse",
"Secure https://" => "Sicherer HTTPS://",
-"Remote subfolder" => "Remote-Unterordner:",
+"Remote subfolder" => "Entfernter Unterordner:",
"Access granted" => "Zugriff gestattet",
"Error configuring Dropbox storage" => "Fehler beim Einrichten von Dropbox",
"Grant access" => "Zugriff gestatten",
diff --git a/apps/files_external/l10n/ja.php b/apps/files_external/l10n/ja.php
index 84e261307b4..494708e63dd 100644
--- a/apps/files_external/l10n/ja.php
+++ b/apps/files_external/l10n/ja.php
@@ -15,6 +15,7 @@ $TRANSLATIONS = array(
"Amazon S3 and compliant" => "Amazon S3 と互換ストレージ",
"Access Key" => "アクセスキー",
"Secret Key" => "シークレットキー",
+"Hostname" => "ホスト名",
"Port" => "ポート",
"Region" => "都道府県",
"Enable SSL" => "SSLを有効",
@@ -35,6 +36,7 @@ $TRANSLATIONS = array(
"Password (required for OpenStack Object Storage)" => "パスワード (OpenStack Object Storage用に必要)",
"Service Name (required for OpenStack Object Storage)" => "サービス名 (OpenStack Object Storage用に必要)",
"URL of identity endpoint (required for OpenStack Object Storage)" => "識別用エンドポイントURL (OpenStack Object Storage用に必要)",
+"Timeout of HTTP requests in seconds" => "HTTP接続タイムアウト秒数",
"Share" => "共有",
"SMB / CIFS using OC login" => "ownCloudログインで SMB/CIFSを使用",
"Username as share" => "共有名",
@@ -47,6 +49,8 @@ $TRANSLATIONS = array(
"Error configuring Google Drive storage" => "Googleドライブストレージの設定エラー",
"Personal" => "個人",
"System" => "システム",
+"All users. Type to select user or group." => "全てのユーザー.ユーザー、グループを追加",
+"(group)" => "(グループ)",
"Saved" => "保存されました",
"<b>Note:</b> " => "<b>注意:</b> ",
" and " => "と",
diff --git a/apps/user_ldap/l10n/bn_BD.php b/apps/user_ldap/l10n/bn_BD.php
index 8cabd10a5d2..3fb6c18ca9e 100644
--- a/apps/user_ldap/l10n/bn_BD.php
+++ b/apps/user_ldap/l10n/bn_BD.php
@@ -1,14 +1,42 @@
<?php
$TRANSLATIONS = array(
+"Failed to clear the mappings." => "মানেচিত্রায়ন মুছতে ব্যার্থ হলো।",
+"Failed to delete the server configuration" => "সার্ভার কনফিগারেশন মোছা ব্যার্থ হলো",
+"The configuration is valid and the connection could be established!" => "কনফিগারেশনটি বৈধ এবং যোগাযোগ প্রতিষ্ঠা করা যায়!",
+"The configuration is valid, but the Bind failed. Please check the server settings and credentials." => "কনফিগারেশনটি বৈধ তবে Bind ব্যার্থ। দয়া করে সার্ভার নিয়ামকসমূহ এবং ব্যবহারকারী পরীক্ষা করুন।",
+"The configuration is invalid. Please have a look at the logs for further details." => "কনফিহারেশনটি অবৈধ। বিস্তারিত জানতে দয়া করে লগ দেখুন।",
+"No action specified" => "কোন কার্যাদেশ সুনির্দিষ্ট নয়",
+"No configuration specified" => " কোন কনফিগারেসন সুনির্দিষ্ট নয়",
+"No data specified" => "কোন ডাটা সুনির্দিষ্ট নয়",
+" Could not set configuration %s" => "%s কনফিগারেসন ঠিক করা গেল না",
"Deletion failed" => "মুছার আদেশ ব্যার্থ হলো",
+"Take over settings from recent server configuration?" => "সদ্য সার্ভার কনফিগারেসন থেকে নিয়ামকসমূহ নিতে হবে?",
+"Keep settings?" => "নিয়ামকসমূহ সংরক্ষণ করবো?",
+"{nthServer}. Server" => "{nthServer}. সার্ভার",
+"Cannot add server configuration" => "সার্ভার কনফিগারেসন যোগ করা যাবেনা",
+"mappings cleared" => "মানচিত্রায়ন মোছা হলো",
"Success" => "সাফল্য",
"Error" => "সমস্যা",
-"_%s group found_::_%s groups found_" => array("",""),
-"_%s user found_::_%s users found_" => array("",""),
+"Select groups" => "গ্রুপ নির্ধারণ",
+"Select object classes" => "অবজেক্ট ক্লাস নির্ধারণ",
+"Select attributes" => "বৈশিষ্ট্য নির্ধারণ",
+"Connection test succeeded" => "যোগাযোগ পরীক্ষা সার্থক",
+"Connection test failed" => "যোগাযোগ পরীক্ষা ব্যার্থ",
+"Do you really want to delete the current Server Configuration?" => "আপনি কি সত্যিই চলতি সার্ভার কনফিগারেসন মুছতে চান?",
+"Confirm Deletion" => "মোছার আদেশ নিশ্চিত করুন",
+"_%s group found_::_%s groups found_" => array("%s গ্রুপ পাওয়া গেছে","%s গ্রুপ পাওয়া গেছে"),
+"_%s user found_::_%s users found_" => array("%s ব্যাবহারকারী পাওয়া গেছে","%s ব্যাবহারকারী পাওয়া গেছে"),
"Server" => "সার্ভার",
+"User Filter" => "ব্যবহারকারী তালিকা ছাঁকনী",
+"Login Filter" => "প্রবেশ ছাঁকনী",
"Group Filter" => "গোষ্ঠী ছাঁকনী",
"Save" => "সংরক্ষণ",
+"Test Configuration" => "পরীক্ষামূলক কনফিগারেসন",
"Help" => "সহায়িকা",
+"1. Server" => "1. সার্ভার",
+"%s. Server:" => "%s. সার্ভার:",
+"Add Server Configuration" => "সার্ভার কনফিগারেসন যোগ কর",
+"Delete Configuration" => "কনফিগারেসন মুছে ফেল",
"Host" => "হোস্ট",
"You can omit the protocol, except you require SSL. Then start with ldaps://" => "SSL আবশ্যক না হলে আপনি এই প্রটোকলটি মুছে ফেলতে পারেন । এরপর শুরু করুন এটা দিয়ে ldaps://",
"Port" => "পোর্ট",
diff --git a/apps/user_webdavauth/l10n/bn_BD.php b/apps/user_webdavauth/l10n/bn_BD.php
index 30ca2cdfa06..e182e26e9f5 100644
--- a/apps/user_webdavauth/l10n/bn_BD.php
+++ b/apps/user_webdavauth/l10n/bn_BD.php
@@ -1,6 +1,8 @@
<?php
$TRANSLATIONS = array(
+"WebDAV Authentication" => "WebDAV অনুমোদন",
"Address:" => "ঠিকানা",
-"Save" => "সংরক্ষণ"
+"Save" => "সংরক্ষণ",
+"The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "ব্যবহারকারীর তথ্যাদি এই ঠিকানায় পাঠানো হবে। এই প্লাগইন প্রত্যুত্তর পরীক্ষা করে দেখবে এবং HTTP statuscodes 401 and 403 কে অবৈধ তথ্যাদিরূপে অনুবাদ করে অন্য সকল প্রত্যুত্তরকে বৈধতা দেবে। "
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/core/l10n/az.php b/core/l10n/az.php
index a214bb0334b..a2b65e38217 100644
--- a/core/l10n/az.php
+++ b/core/l10n/az.php
@@ -13,6 +13,8 @@ $TRANSLATIONS = array(
"Settings" => "Quraşdırmalar",
"Folder" => "Qovluq",
"Saving..." => "Saxlama...",
+"No" => "Xeyir",
+"Yes" => "Bəli",
"Ok" => "Oldu",
"_{count} file conflict_::_{count} file conflicts_" => array("",""),
"Cancel" => "Dayandır",
@@ -23,6 +25,7 @@ $TRANSLATIONS = array(
"Strong password" => "Çətin şifrə",
"Share" => "Yayımla",
"Error" => "Səhv",
+"Share link" => "Linki yayımla",
"Send" => "Göndər",
"group" => "qrup",
"can share" => "yayımlaya bilərsiniz",
diff --git a/core/l10n/de_DE.php b/core/l10n/de_DE.php
index e7532730969..1e81dbf80c8 100644
--- a/core/l10n/de_DE.php
+++ b/core/l10n/de_DE.php
@@ -6,7 +6,7 @@ $TRANSLATIONS = array(
"Updated database" => "Datenbank aktualisiert",
"Checked database schema update" => "Datenbank-Schemenaktualisierung geprüft",
"Checked database schema update for apps" => "Datenbank-Schemenaktualisierung für Apps geprüft",
-"Updated \"%s\" to %s" => "\"%s\" zu %s aktualisiert",
+"Updated \"%s\" to %s" => "»%s« zu %s aktualisiert",
"Disabled incompatible apps: %s" => "Deaktivierte inkompatible Apps: %s",
"No image or file provided" => "Weder Bild noch ein Datei wurden zur Verfügung gestellt",
"Unknown filetype" => "Unbekannter Dateityp",
@@ -37,7 +37,7 @@ $TRANSLATIONS = array(
"Folder" => "Ordner",
"Image" => "Bild",
"Audio" => "Audio",
-"Saving..." => "Speichern...",
+"Saving..." => "Speichervorgang …",
"Couldn't send reset email. Please contact your administrator." => "Die E-Mail zum Zurücksetzen konnte nicht versendet werden. Bitte kontaktieren Sie Ihren Administrator.",
"The link to reset your password has been sent to your email. If you do not receive it within a reasonable amount of time, check your spam/junk folders.<br>If it is not there ask your local administrator." => "Der Link zum Rücksetzen Ihres Passworts ist an Ihre E-Mail-Adresse geschickt worden. Wenn Sie ihn nicht innerhalb einer vernünftigen Zeit empfängen, prüfen Sie Ihre Spam-Verzeichnisse.<br>Wenn er nicht dort ist, fragen Sie Ihren lokalen Administrator.",
"Your files are encrypted. If you haven't enabled the recovery key, there will be no way to get your data back after your password is reset.<br />If you are not sure what to do, please contact your administrator before you continue. <br />Do you really want to continue?" => "Ihre Dateien sind verschlüsselt. Wenn Sie den Wiederherstellungsschlüssel nicht aktiviert haben, wird es keine Möglichkeit geben, um Ihre Daten wiederzubekommen, nachdem Ihr Passwort zurückgesetzt wurde.<br />Wenn Sie sich nicht sicher sind, was Sie tun sollen, wenden Sie sich bitte an Ihren Administrator, bevor Sie fortfahren.<br />Wollen Sie wirklich fortfahren?",
@@ -166,7 +166,7 @@ $TRANSLATIONS = array(
"This application requires JavaScript to be enabled for correct operation. Please <a href=\"http://enable-javascript.com/\" target=\"_blank\">enable JavaScript</a> and re-load this interface." => "Diese Anwendung benötigt ein aktiviertes JavaScript zum korrekten Betrieb. Bitte <a href=\"http://enable-javascript.com/\" target=\"_blank\">aktivieren Sie JavaScript</a> und laden Sie diese Schnittstelle neu.",
"%s is available. Get more information on how to update." => "%s ist verfügbar. Holen Sie weitere Informationen zu Aktualisierungen ein.",
"Log out" => "Abmelden",
-"Server side authentication failed!" => "Die Authentifizierung auf dem Server ist fehlgeschlagen!",
+"Server side authentication failed!" => "Die Legitimierung auf dem Server ist fehlgeschlagen!",
"Please contact your administrator." => "Bitte kontaktieren Sie Ihren Administrator.",
"Forgot your password? Reset it!" => "Passwort vergessen? Setzen Sie es zurück!",
"remember" => "merken",
@@ -180,7 +180,7 @@ $TRANSLATIONS = array(
"You are accessing the server from an untrusted domain." => "Sie greifen von einer nicht vertrauenswürdigen Domain auf den Server zu.",
"Please contact your administrator. If you are an administrator of this instance, configure the \"trusted_domain\" setting in config/config.php. An example configuration is provided in config/config.sample.php." => "Bitte kontaktieren Sie Ihren Administrator. Wenn Sie aktuell Administrator dieser Instanz sind, konfigurieren Sie bitte die \"trusted_domain\" - Einstellung in config/config.php. Eine Beispielkonfiguration wird unter config/config.sample.php bereit gestellt.",
"Depending on your configuration, as an administrator you might also be able to use the button below to trust this domain." => "Abhängig von Ihrer Konfiguration können Sie auch als Administrator, zum Vertrauen dieser Domain, den unteren Button verwenden.",
-"Add \"%s\" as trusted domain" => "\"%s\" als vertrauenswürdige Domain hinzufügen",
+"Add \"%s\" as trusted domain" => "»%s« als vertrauenswürdige Domain hinzufügen",
"%s will be updated to version %s." => "%s wird auf Version %s aktualisiert.",
"The following apps will be disabled:" => "Die folgenden Apps werden deaktiviert:",
"The theme %s has been disabled." => "Das Theme %s wurde deaktiviert.",
diff --git a/core/l10n/et_EE.php b/core/l10n/et_EE.php
index 74277e96641..91c0a7fb009 100644
--- a/core/l10n/et_EE.php
+++ b/core/l10n/et_EE.php
@@ -5,6 +5,8 @@ $TRANSLATIONS = array(
"Turned off maintenance mode" => "Haldusrežiimis välja lülitatud",
"Updated database" => "Uuendatud andmebaas",
"Checked database schema update" => "Andmebaasi skeemi uuendus kontrollitud",
+"Checked database schema update for apps" => "Andmebaasi skeemi uuendus rakendustele on kontrollitud",
+"Updated \"%s\" to %s" => "Uuendatud \"%s\" -> %s",
"Disabled incompatible apps: %s" => "Keelatud mitteühilduvad rakendid: %s",
"No image or file provided" => "Ühtegi pilti või faili pole pakutud",
"Unknown filetype" => "Tundmatu failitüüp",
@@ -177,12 +179,14 @@ $TRANSLATIONS = array(
"Thank you for your patience." => "Täname kannatlikkuse eest.",
"You are accessing the server from an untrusted domain." => "Sa kasutad serverit usalduseta asukohast",
"Please contact your administrator. If you are an administrator of this instance, configure the \"trusted_domain\" setting in config/config.php. An example configuration is provided in config/config.sample.php." => "Palun võta ühendust oma saidi administraatoriga. Kui sa oled ise administraator, siis seadista failis config/config.php sätet \"trusted_domain\". Näidis seadistused leiad failist config/config.sample.php.",
+"Depending on your configuration, as an administrator you might also be able to use the button below to trust this domain." => "Sõltuvalt sinu seadetest võib ka administraator kasutada allolevat nuppu, et seda domeeni usaldusväärseks märkida.",
"Add \"%s\" as trusted domain" => "Lisa \"%s\" usaldusväärse domeenina",
"%s will be updated to version %s." => "%s uuendatakse versioonile %s.",
"The following apps will be disabled:" => "Järgnevad rakendid keelatakse:",
"The theme %s has been disabled." => "Teema %s on keelatud.",
"Please make sure that the database, the config folder and the data folder have been backed up before proceeding." => "Enne jätkamist veendu, et andmebaas, seadete ning andmete kataloog on varundatud.",
"Start update" => "Käivita uuendus",
+"To avoid timeouts with larger installations, you can instead run the following command from your installation directory:" => "Suurtel saitidel aegumise vältimiseks võid sa paigalduskaustas käivitada järgmise käsu:",
"This ownCloud instance is currently being updated, which may take a while." => "Seda ownCloud instantsi hetkel uuendatakse, võib võtta veidi aega.",
"Please reload this page after a short time to continue using ownCloud." => "Palun laadi see leht uuesti veidi aja pärast jätkamaks ownCloud kasutamist."
);
diff --git a/l10n/templates/core.pot b/l10n/templates/core.pot
index c924aee33f0..76d20f72c14 100644
--- a/l10n/templates/core.pot
+++ b/l10n/templates/core.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -23,32 +23,32 @@ msgstr ""
msgid "Couldn't send mail to following users: %s "
msgstr ""
-#: ajax/update.php:10
+#: ajax/update.php:14
msgid "Turned on maintenance mode"
msgstr ""
-#: ajax/update.php:13
+#: ajax/update.php:17
msgid "Turned off maintenance mode"
msgstr ""
-#: ajax/update.php:16
+#: ajax/update.php:20
msgid "Updated database"
msgstr ""
-#: ajax/update.php:19
+#: ajax/update.php:23
msgid "Checked database schema update"
msgstr ""
-#: ajax/update.php:22
+#: ajax/update.php:26
msgid "Checked database schema update for apps"
msgstr ""
-#: ajax/update.php:25
+#: ajax/update.php:29
#, php-format
msgid "Updated \"%s\" to %s"
msgstr ""
-#: ajax/update.php:33
+#: ajax/update.php:37
#, php-format
msgid "Disabled incompatible apps: %s"
msgstr ""
diff --git a/l10n/templates/files.pot b/l10n/templates/files.pot
index 5cd169612b9..23a1565ad9b 100644
--- a/l10n/templates/files.pot
+++ b/l10n/templates/files.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -194,7 +194,7 @@ msgstr ""
msgid "URL cannot be empty"
msgstr ""
-#: js/file-upload.js:579 js/filelist.js:1290
+#: js/file-upload.js:579 js/filelist.js:1302
msgid "{new_name} already exists"
msgstr ""
@@ -234,55 +234,59 @@ msgstr ""
msgid "Rename"
msgstr ""
-#: js/filelist.js:685 js/filelist.js:1818
+#: js/filelist.js:692 js/filelist.js:1848
msgid "Pending"
msgstr ""
-#: js/filelist.js:1241
+#: js/filelist.js:1253
msgid "Error moving file."
msgstr ""
-#: js/filelist.js:1249
+#: js/filelist.js:1261
msgid "Error moving file"
msgstr ""
-#: js/filelist.js:1249
+#: js/filelist.js:1261
msgid "Error"
msgstr ""
-#: js/filelist.js:1338
+#: js/filelist.js:1350
msgid "Could not rename file"
msgstr ""
-#: js/filelist.js:1460
+#: js/filelist.js:1472
msgid "Error deleting file."
msgstr ""
-#: js/filelist.js:1563 templates/list.php:61
+#: js/filelist.js:1574 templates/list.php:61
msgid "Name"
msgstr ""
-#: js/filelist.js:1564 templates/list.php:72
+#: js/filelist.js:1575 templates/list.php:72
msgid "Size"
msgstr ""
-#: js/filelist.js:1565 templates/list.php:75
+#: js/filelist.js:1576 templates/list.php:75
msgid "Modified"
msgstr ""
-#: js/filelist.js:1575 js/filesummary.js:141 js/filesummary.js:168
+#: js/filelist.js:1586 js/filesummary.js:141 js/filesummary.js:168
msgid "%n folder"
msgid_plural "%n folders"
msgstr[0] ""
msgstr[1] ""
-#: js/filelist.js:1581 js/filesummary.js:142 js/filesummary.js:169
+#: js/filelist.js:1592 js/filesummary.js:142 js/filesummary.js:169
msgid "%n file"
msgid_plural "%n files"
msgstr[0] ""
msgstr[1] ""
-#: js/filelist.js:1711 js/filelist.js:1750
+#: js/filelist.js:1649 templates/list.php:47
+msgid "You don’t have permission to upload or create files here"
+msgstr ""
+
+#: js/filelist.js:1741 js/filelist.js:1780
msgid "Uploading %n file"
msgid_plural "Uploading %n files"
msgstr[0] ""
@@ -388,10 +392,6 @@ msgstr ""
msgid "From link"
msgstr ""
-#: templates/list.php:47
-msgid "You don’t have permission to upload or create files here"
-msgstr ""
-
#: templates/list.php:52
msgid "Nothing in here. Upload something!"
msgstr ""
diff --git a/l10n/templates/files_encryption.pot b/l10n/templates/files_encryption.pot
index ac2e9b71a79..1dbe42f0032 100644
--- a/l10n/templates/files_encryption.pot
+++ b/l10n/templates/files_encryption.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/l10n/templates/files_external.pot b/l10n/templates/files_external.pot
index 3b7fd6f758a..14874be5d38 100644
--- a/l10n/templates/files_external.pot
+++ b/l10n/templates/files_external.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/l10n/templates/files_sharing.pot b/l10n/templates/files_sharing.pot
index 6a713e2dfb2..3fc34466a76 100644
--- a/l10n/templates/files_sharing.pot
+++ b/l10n/templates/files_sharing.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/l10n/templates/files_trashbin.pot b/l10n/templates/files_trashbin.pot
index 4834904b584..3865a9f6398 100644
--- a/l10n/templates/files_trashbin.pot
+++ b/l10n/templates/files_trashbin.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/l10n/templates/files_versions.pot b/l10n/templates/files_versions.pot
index a9b8a4d53e5..1ec8b552a71 100644
--- a/l10n/templates/files_versions.pot
+++ b/l10n/templates/files_versions.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/l10n/templates/lib.pot b/l10n/templates/lib.pot
index 55beb671351..bc7c14e535b 100644
--- a/l10n/templates/lib.pot
+++ b/l10n/templates/lib.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -51,34 +51,34 @@ msgid ""
"before performing changes on config.php"
msgstr ""
-#: private/app.php:374
+#: private/app.php:391
msgid "Help"
msgstr ""
-#: private/app.php:387
+#: private/app.php:404
msgid "Personal"
msgstr ""
-#: private/app.php:398
+#: private/app.php:415
msgid "Settings"
msgstr ""
-#: private/app.php:410
+#: private/app.php:427
msgid "Users"
msgstr ""
-#: private/app.php:423
+#: private/app.php:440
msgid "Admin"
msgstr ""
-#: private/app.php:1118
+#: private/app.php:1135
#, php-format
msgid ""
"App \\\"%s\\\" can't be installed because it is not compatible with this "
"version of ownCloud."
msgstr ""
-#: private/app.php:1130
+#: private/app.php:1147
msgid "No app name specified"
msgstr ""
diff --git a/l10n/templates/private.pot b/l10n/templates/private.pot
index bac4a7bdd7c..c8abfe73e24 100644
--- a/l10n/templates/private.pot
+++ b/l10n/templates/private.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,34 +18,34 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
-#: app.php:374
+#: app.php:391
msgid "Help"
msgstr ""
-#: app.php:387
+#: app.php:404
msgid "Personal"
msgstr ""
-#: app.php:398
+#: app.php:415
msgid "Settings"
msgstr ""
-#: app.php:410
+#: app.php:427
msgid "Users"
msgstr ""
-#: app.php:423
+#: app.php:440
msgid "Admin"
msgstr ""
-#: app.php:1118
+#: app.php:1135
#, php-format
msgid ""
"App \\\"%s\\\" can't be installed because it is not compatible with this "
"version of ownCloud."
msgstr ""
-#: app.php:1130
+#: app.php:1147
msgid "No app name specified"
msgstr ""
diff --git a/l10n/templates/settings.pot b/l10n/templates/settings.pot
index 8cb42ae470f..29b34dc8397 100644
--- a/l10n/templates/settings.pot
+++ b/l10n/templates/settings.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/l10n/templates/user_ldap.pot b/l10n/templates/user_ldap.pot
index 957254e5633..463253190ea 100644
--- a/l10n/templates/user_ldap.pot
+++ b/l10n/templates/user_ldap.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/l10n/templates/user_webdavauth.pot b/l10n/templates/user_webdavauth.pot
index d340e2c8e71..12e2e79eded 100644
--- a/l10n/templates/user_webdavauth.pot
+++ b/l10n/templates/user_webdavauth.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ownCloud Core 6.0.0\n"
"Report-Msgid-Bugs-To: translations@owncloud.org\n"
-"POT-Creation-Date: 2014-09-04 01:54-0400\n"
+"POT-Creation-Date: 2014-09-07 01:54-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
diff --git a/lib/base.php b/lib/base.php
index 18331dd86aa..fb445124011 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -583,6 +583,21 @@ class OC {
);
return;
}
+
+ $host = OC_Request::insecureServerHost();
+ // if the host passed in headers isn't trusted
+ if (!OC::$CLI
+ // overwritehost is always trusted
+ && OC_Request::getOverwriteHost() === null
+ && !OC_Request::isTrustedDomain($host)
+ ) {
+ header('HTTP/1.1 400 Bad Request');
+ header('Status: 400 Bad Request');
+ $tmpl = new OCP\Template('core', 'untrustedDomain', 'guest');
+ $tmpl->assign('domain', $_SERVER['SERVER_NAME']);
+ $tmpl->printPage();
+ return;
+ }
}
private static function registerLocalAddressBook() {
@@ -683,21 +698,6 @@ class OC {
exit();
}
- $host = OC_Request::insecureServerHost();
- // if the host passed in headers isn't trusted
- if (!OC::$CLI
- // overwritehost is always trusted
- && OC_Request::getOverwriteHost() === null
- && !OC_Request::isTrustedDomain($host)
- ) {
- header('HTTP/1.1 400 Bad Request');
- header('Status: 400 Bad Request');
- $tmpl = new OCP\Template('core', 'untrustedDomain', 'guest');
- $tmpl->assign('domain', $_SERVER['SERVER_NAME']);
- $tmpl->printPage();
- return;
- }
-
$request = OC_Request::getPathInfo();
if (substr($request, -3) !== '.js') { // we need these files during the upgrade
self::checkMaintenanceMode();
diff --git a/lib/l10n/et_EE.php b/lib/l10n/et_EE.php
index 365c2e1f96a..9209d9bb6b3 100644
--- a/lib/l10n/et_EE.php
+++ b/lib/l10n/et_EE.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"See %s" => "Vaata %s",
"This can usually be fixed by %sgiving the webserver write access to the config directory%s." => "Tavaliselt saab selle lahendada %s andes veebiserverile seadete kataloogile \"config\" kirjutusõigused %s",
"Sample configuration detected" => "Tuvastati näidisseaded",
+"It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" => "Tuvastati, et kopeeriti näidisseaded. See võib lõhkuda sinu saidi ja see pole toetatud. Palun loe enne faili config.php muutmist dokumentatsiooni",
"Help" => "Abiinfo",
"Personal" => "Isiklik",
"Settings" => "Seaded",
@@ -65,6 +66,7 @@ $TRANSLATIONS = array(
"Share type %s is not valid for %s" => "Jagamise tüüp %s ei ole õige %s jaoks",
"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" => "Lubade seadistus %s jaoks ebaõnnestus, kuna antud õigused ületavad %s jaoks määratud õigusi",
"Setting permissions for %s failed, because the item was not found" => "Lubade seadistus %s jaoks ebaõnnestus, kuna üksust ei leitud",
+"Cannot set expiration date. Shares cannot expire later than %s after they have been shared" => "Aegumise kuupäeva ei saa määrata. Jagamised ei saa aeguda hiljem kui %s peale jagamist.",
"Cannot set expiration date. Expiration date is in the past" => "Aegumiskuupäeva ei saa määrata. Aegumise kuupäev on minevikus",
"Sharing backend %s must implement the interface OCP\\Share_Backend" => "Jagamise tagarakend %s peab kasutusele võtma OCP\\Share_Backend liidese",
"Sharing backend %s not found" => "Jagamise tagarakendit %s ei leitud",
@@ -97,6 +99,7 @@ $TRANSLATIONS = array(
"Cannot create \"data\" directory (%s)" => "Ei suuda luua \"data\" kataloogi (%s)",
"This can usually be fixed by <a href=\"%s\" target=\"_blank\">giving the webserver write access to the root directory</a>." => "Tavaliselt saab selle lahendada <a href=\"%s\" target=\"_blank\">andes veebiserverile juur-kataloogile kirjutusõigused</a>.",
"Setting locale to %s failed" => "Lokaadi %s määramine ebaõnnestus.",
+"Please install one of these locales on your system and restart your webserver." => "Palun paigalda mõni neist lokaatides oma süsteemi ning taaskäivita veebiserver.",
"Please ask your server administrator to install the module." => "Palu oma serveri haldajal moodul paigadalda.",
"PHP module %s not installed." => "PHP moodulit %s pole paigaldatud.",
"PHP %s or higher is required." => "PHP %s või uuem on nõutav.",
diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php
index 44c86e69719..5333583e78d 100644
--- a/lib/private/connector/sabre/file.php
+++ b/lib/private/connector/sabre/file.php
@@ -102,13 +102,16 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements \Sabre\
throw new OC_Connector_Sabre_Exception_FileLocked($e->getMessage(), $e->getCode(), $e);
}
+ // if content length is sent by client:
// double check if the file was fully received
// compare expected and actual size
- $expected = $_SERVER['CONTENT_LENGTH'];
- $actual = $this->fileView->filesize($partFilePath);
- if ($actual != $expected) {
- $this->fileView->unlink($partFilePath);
- throw new \Sabre\DAV\Exception\BadRequest('expected filesize ' . $expected . ' got ' . $actual);
+ if (isset($_SERVER['CONTENT_LENGTH'])) {
+ $expected = $_SERVER['CONTENT_LENGTH'];
+ $actual = $this->fileView->filesize($partFilePath);
+ if ($actual != $expected) {
+ $this->fileView->unlink($partFilePath);
+ throw new \Sabre\DAV\Exception\BadRequest('expected filesize ' . $expected . ' got ' . $actual);
+ }
}
// rename to correct path
diff --git a/lib/private/files/cache/changepropagator.php b/lib/private/files/cache/changepropagator.php
index 30f2e675e2e..2967c8f6259 100644
--- a/lib/private/files/cache/changepropagator.php
+++ b/lib/private/files/cache/changepropagator.php
@@ -57,9 +57,11 @@ class ChangePropagator {
*/
list($storage, $internalPath) = $this->view->resolvePath($parent);
- $cache = $storage->getCache();
- $id = $cache->getId($internalPath);
- $cache->update($id, array('mtime' => $time, 'etag' => $storage->getETag($internalPath)));
+ if ($storage) {
+ $cache = $storage->getCache();
+ $id = $cache->getId($internalPath);
+ $cache->update($id, array('mtime' => $time, 'etag' => $storage->getETag($internalPath)));
+ }
}
}
diff --git a/lib/private/files/cache/homecache.php b/lib/private/files/cache/homecache.php
index 06ae62015a5..2b3967c8807 100644
--- a/lib/private/files/cache/homecache.php
+++ b/lib/private/files/cache/homecache.php
@@ -39,6 +39,9 @@ class HomeCache extends Cache {
$totalSize = 0 + $sum;
$unencryptedSize = 0 + $unencryptedSum;
$entry['size'] += 0;
+ if (!isset($entry['unencrypted_size'])) {
+ $entry['unencrypted_size'] = 0;
+ }
$entry['unencrypted_size'] += 0;
if ($entry['size'] !== $totalSize) {
$this->update($id, array('size' => $totalSize));
diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php
index 0e5e07c587d..c303ff24b1f 100644
--- a/lib/private/files/cache/updater.php
+++ b/lib/private/files/cache/updater.php
@@ -1,6 +1,6 @@
<?php
/**
- * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
+ * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
@@ -9,165 +9,116 @@
namespace OC\Files\Cache;
/**
- * listen to filesystem hooks and change the cache accordingly
+ * Update the cache and propagate changes
*/
class Updater {
+ /**
+ * @var \OC\Files\View
+ */
+ protected $view;
/**
- * resolve a path to a storage and internal path
- *
- * @param string $path the relative path
- * @return array an array consisting of the storage and the internal path
+ * @var \OC\Files\Cache\ChangePropagator
*/
- static public function resolvePath($path) {
- $view = \OC\Files\Filesystem::getView();
- return $view->resolvePath($path);
+ protected $propagator;
+
+ /**
+ * @param \OC\Files\View $view
+ */
+ public function __construct($view) {
+ $this->view = $view;
+ $this->propagator = new ChangePropagator($view);
}
/**
- * perform a write update
+ * Update the cache for $path
*
- * @param string $path the relative path of the file
+ * @param string $path
+ * @param int $time
*/
- static public function writeUpdate($path) {
+ public function update($path, $time = null) {
/**
* @var \OC\Files\Storage\Storage $storage
* @var string $internalPath
*/
- list($storage, $internalPath) = self::resolvePath($path);
+ list($storage, $internalPath) = $this->view->resolvePath($path);
if ($storage) {
+ $this->propagator->addChange($path);
$cache = $storage->getCache($internalPath);
$scanner = $storage->getScanner($internalPath);
$data = $scanner->scan($internalPath, Scanner::SCAN_SHALLOW);
+ $this->correctParentStorageMtime($storage, $internalPath);
$cache->correctFolderSize($internalPath, $data);
- self::correctFolder($path, $storage->filemtime($internalPath));
- self::correctParentStorageMtime($storage, $internalPath);
+ $this->propagator->propagateChanges($time);
}
}
/**
- * perform a delete update
+ * Remove $path from the cache
*
- * @param string $path the relative path of the file
+ * @param string $path
*/
- static public function deleteUpdate($path) {
+ public function remove($path) {
/**
* @var \OC\Files\Storage\Storage $storage
* @var string $internalPath
*/
- list($storage, $internalPath) = self::resolvePath($path);
+ list($storage, $internalPath) = $this->view->resolvePath($path);
if ($storage) {
$parent = dirname($internalPath);
if ($parent === '.') {
$parent = '';
}
+ $this->propagator->addChange($path);
$cache = $storage->getCache($internalPath);
$cache->remove($internalPath);
$cache->correctFolderSize($parent);
- self::correctFolder($path, time());
- self::correctParentStorageMtime($storage, $internalPath);
+ $this->correctParentStorageMtime($storage, $internalPath);
+ $this->propagator->propagateChanges();
}
}
/**
- * preform a rename update
- *
- * @param string $from the relative path of the source file
- * @param string $to the relative path of the target file
+ * @param string $source
+ * @param string $target
*/
- static public function renameUpdate($from, $to) {
+ public function rename($source, $target) {
/**
- * @var \OC\Files\Storage\Storage $storageFrom
- * @var \OC\Files\Storage\Storage $storageTo
- * @var string $internalFrom
- * @var string $internalTo
+ * @var \OC\Files\Storage\Storage $sourceStorage
+ * @var \OC\Files\Storage\Storage $targetStorage
+ * @var string $sourceInternalPath
+ * @var string $targetInternalPath
*/
- list($storageFrom, $internalFrom) = self::resolvePath($from);
+ list($sourceStorage, $sourceInternalPath) = $this->view->resolvePath($source);
// if it's a moved mountpoint we dont need to do anything
- if ($internalFrom === '') {
+ if ($sourceInternalPath === '') {
return;
}
- list($storageTo, $internalTo) = self::resolvePath($to);
- if ($storageFrom && $storageTo) {
- if ($storageFrom === $storageTo) {
- $cache = $storageFrom->getCache($internalFrom);
- $cache->move($internalFrom, $internalTo);
- if (pathinfo($internalFrom, PATHINFO_EXTENSION) !== pathinfo($internalTo, PATHINFO_EXTENSION)) {
- // redetect mime type change
- $mimeType = $storageTo->getMimeType($internalTo);
- $fileId = $storageTo->getCache()->getId($internalTo);
- $storageTo->getCache()->update($fileId, array('mimetype' => $mimeType));
+ list($targetStorage, $targetInternalPath) = $this->view->resolvePath($target);
+
+ if ($sourceStorage && $targetStorage) {
+ if ($sourceStorage === $targetStorage) {
+ $cache = $sourceStorage->getCache($sourceInternalPath);
+ $cache->move($sourceInternalPath, $targetInternalPath);
+
+ if (pathinfo($sourceInternalPath, PATHINFO_EXTENSION) !== pathinfo($targetInternalPath, PATHINFO_EXTENSION)) {
+ // handle mime type change
+ $mimeType = $sourceStorage->getMimeType($targetInternalPath);
+ $fileId = $cache->getId($targetInternalPath);
+ $cache->update($fileId, array('mimetype' => $mimeType));
}
- $cache->correctFolderSize($internalFrom);
- $cache->correctFolderSize($internalTo);
- self::correctFolder($from, time());
- self::correctFolder($to, time());
- self::correctParentStorageMtime($storageFrom, $internalFrom);
- self::correctParentStorageMtime($storageTo, $internalTo);
- } else {
- self::deleteUpdate($from);
- self::writeUpdate($to);
- }
- }
- }
- /**
- * get file owner and path
- * @param string $filename
- * @return string[] with the owner's uid and the owner's path
- */
- private static function getUidAndFilename($filename) {
-
- $uid = \OC\Files\Filesystem::getOwner($filename);
- \OC\Files\Filesystem::initMountPoints($uid);
-
- $filename = (strpos($filename, '/') !== 0) ? '/' . $filename : $filename;
- if ($uid != \OCP\User::getUser()) {
- $info = \OC\Files\Filesystem::getFileInfo($filename);
- if (!$info) {
- return array($uid, '/files' . $filename);
- }
- $ownerView = new \OC\Files\View('/' . $uid . '/files');
- $filename = $ownerView->getPath($info['fileid']);
- }
- return array($uid, '/files' . $filename);
- }
-
- /**
- * Update the mtime and ETag of all parent folders
- *
- * @param string $path
- * @param string $time
- */
- static public function correctFolder($path, $time) {
- if ($path !== '' && $path !== '/' && $path !== '\\') {
- list($owner, $realPath) = self::getUidAndFilename(dirname($path));
-
- /**
- * @var \OC\Files\Storage\Storage $storage
- * @var string $internalPath
- */
- $view = new \OC\Files\View('/' . $owner);
-
- list($storage, $internalPath) = $view->resolvePath($realPath);
- $cache = $storage->getCache();
- $id = $cache->getId($internalPath);
-
- while ($id !== -1) {
- $cache->update($id, array('mtime' => $time, 'etag' => $storage->getETag($internalPath)));
- if ($realPath !== '') {
- $realPath = dirname($realPath);
- if ($realPath === DIRECTORY_SEPARATOR) {
- $realPath = "";
- }
- // check storage for parent in case we change the storage in this step
- list($storage, $internalPath) = $view->resolvePath($realPath);
- $cache = $storage->getCache();
- $id = $cache->getId($internalPath);
- } else {
- $id = -1;
- }
+ $cache->correctFolderSize($sourceInternalPath);
+ $cache->correctFolderSize($targetInternalPath);
+ $this->correctParentStorageMtime($sourceStorage, $sourceInternalPath);
+ $this->correctParentStorageMtime($targetStorage, $targetInternalPath);
+ $this->propagator->addChange($source);
+ $this->propagator->addChange($target);
+ } else {
+ $this->remove($source);
+ $this->update($target);
}
+ $this->propagator->propagateChanges();
}
}
@@ -177,52 +128,17 @@ class Updater {
* @param \OC\Files\Storage\Storage $storage
* @param string $internalPath
*/
- static private function correctParentStorageMtime($storage, $internalPath) {
+ private function correctParentStorageMtime($storage, $internalPath) {
$cache = $storage->getCache();
$parentId = $cache->getParentId($internalPath);
$parent = dirname($internalPath);
-
- if ($parent === '.' || $parent === '/' || $parent === '\\') {
- $parent = '';
- }
-
if ($parentId != -1) {
$cache->update($parentId, array('storage_mtime' => $storage->filemtime($parent)));
}
}
- /**
- * @param array $params
- */
- static public function writeHook($params) {
- self::writeUpdate($params['path']);
- }
-
- /**
- * @param array $params
- */
- static public function touchHook($params) {
- $path = $params['path'];
- list($storage, $internalPath) = self::resolvePath($path);
- $cache = $storage->getCache();
- $id = $cache->getId($internalPath);
- if ($id !== -1) {
- $cache->update($id, array('etag' => $storage->getETag($internalPath)));
- }
- self::writeUpdate($path);
- }
-
- /**
- * @param array $params
- */
- static public function renameHook($params) {
- self::renameUpdate($params['oldpath'], $params['newpath']);
- }
-
- /**
- * @param array $params
- */
- static public function deleteHook($params) {
- self::deleteUpdate($params['path']);
+ public function __destruct() {
+ // propagate any leftover changes
+ $this->propagator->propagateChanges();
}
}
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index d310a0fa4e1..95f3e9a2c7f 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -31,8 +31,14 @@ use OC\Files\Mount\MoveableMount;
class View {
private $fakeRoot = '';
+ /**
+ * @var \OC\Files\Cache\Updater
+ */
+ protected $updater;
+
public function __construct($root = '') {
$this->fakeRoot = $root;
+ $this->updater = new Updater($this);
}
public function getAbsolutePath($path = '/') {
@@ -168,10 +174,10 @@ class View {
* @param string $path relative to data/
* @return boolean
*/
- protected function removeMount($mount, $path){
+ protected function removeMount($mount, $path) {
if ($mount instanceof MoveableMount) {
// cut of /user/files to get the relative path to data/user/files
- $pathParts= explode('/', $path, 4);
+ $pathParts = explode('/', $path, 4);
$relPath = '/' . $pathParts[3];
\OC_Hook::emit(
Filesystem::CLASSNAME, "umount",
@@ -194,7 +200,7 @@ class View {
}
public function rmdir($path) {
- $absolutePath= $this->getAbsolutePath($path);
+ $absolutePath = $this->getAbsolutePath($path);
$mount = Filesystem::getMountManager()->find($absolutePath);
if ($mount->getInternalPath($absolutePath) === '') {
return $this->removeMount($mount, $path);
@@ -304,7 +310,16 @@ class View {
$hooks[] = 'write';
}
$result = $this->basicOperation('touch', $path, $hooks, $mtime);
- if (!$result) { //if native touch fails, we emulate it by changing the mtime in the cache
+ if (!$result) {
+ // If create file fails because of permissions on external storage like SMB folders,
+ // check file exists and return false if not.
+ if(!$this->file_exists($path)){
+ return false;
+ }
+ if (is_null($mtime)) {
+ $mtime = time();
+ }
+ //if native touch fails, we emulate it by changing the mtime in the cache
$this->putFileInfo($path, array('mtime' => $mtime));
}
return true;
@@ -368,10 +383,8 @@ class View {
list ($count, $result) = \OC_Helper::streamCopy($data, $target);
fclose($target);
fclose($data);
+ $this->updater->update($path);
if ($this->shouldEmitHooks($path) && $result !== false) {
- Updater::writeHook(array(
- 'path' => $this->getHookPath($path)
- ));
$this->emit_file_hooks_post($exists, $path);
}
\OC_FileProxy::runPostProxies('file_put_contents', $absolutePath, $count);
@@ -396,7 +409,7 @@ class View {
$postFix = (substr($path, -1, 1) === '/') ? '/' : '';
$absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path));
$mount = Filesystem::getMountManager()->find($absolutePath . $postFix);
- if ($mount->getInternalPath($absolutePath) === '') {
+ if ($mount and $mount->getInternalPath($absolutePath) === '') {
return $this->removeMount($mount, $absolutePath);
}
return $this->basicOperation('unlink', $path, array('delete'));
@@ -489,15 +502,14 @@ class View {
}
}
}
- if ($this->shouldEmitHooks() && (Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2)) && $result !== false) {
+ if ((Cache\Scanner::isPartialFile($path1) && !Cache\Scanner::isPartialFile($path2)) && $result !== false) {
// if it was a rename from a part file to a regular file it was a write and not a rename operation
- Updater::writeHook(array('path' => $this->getHookPath($path2)));
- $this->emit_file_hooks_post($exists, $path2);
+ $this->updater->update($path2);
+ if ($this->shouldEmitHooks()) {
+ $this->emit_file_hooks_post($exists, $path2);
+ }
} elseif ($this->shouldEmitHooks() && $result !== false) {
- Updater::renameHook(array(
- 'oldpath' => $this->getHookPath($path1),
- 'newpath' => $this->getHookPath($path2)
- ));
+ $this->updater->rename($path1, $path2);
\OC_Hook::emit(
Filesystem::CLASSNAME,
Filesystem::signal_post_rename,
@@ -576,6 +588,7 @@ class View {
fclose($target);
}
}
+ $this->updater->update($path2);
if ($this->shouldEmitHooks() && $result !== false) {
\OC_Hook::emit(
Filesystem::CLASSNAME,
@@ -754,7 +767,19 @@ class View {
} else {
$result = $storage->$operation($internalPath);
}
+
$result = \OC_FileProxy::runPostProxies($operation, $this->getAbsolutePath($path), $result);
+
+ if (in_array('delete', $hooks)) {
+ $this->updater->remove($path);
+ }
+ if (in_array('write', $hooks)) {
+ $this->updater->update($path);
+ }
+ if (in_array('touch', $hooks)) {
+ $this->updater->update($path, $extraParam);
+ }
+
if ($this->shouldEmitHooks($path) && $result !== false) {
if ($operation != 'fopen') { //no post hooks for fopen, the file stream is still open
$this->runHooks($hooks, $path, true);
@@ -808,16 +833,6 @@ class View {
$run = true;
if ($this->shouldEmitHooks($path)) {
foreach ($hooks as $hook) {
- // manually triger updater hooks to ensure they are called first
- if ($post) {
- if ($hook == 'write') {
- Updater::writeHook(array('path' => $path));
- } elseif ($hook == 'touch') {
- Updater::touchHook(array('path' => $path));
- } else if ($hook == 'delete') {
- Updater::deleteHook(array('path' => $path));
- }
- }
if ($hook != 'read') {
\OC_Hook::emit(
Filesystem::CLASSNAME,
diff --git a/search/js/result.js b/search/js/result.js
index 857b4fe1f22..13be0b552bf 100644
--- a/search/js/result.js
+++ b/search/js/result.js
@@ -80,7 +80,7 @@ OC.search.showResults=function(results){
containerName = '/';
}
var containerLink = OC.linkTo('files', 'index.php')
- +'?dir='+encodeURIComponent(parent)
+ +'/?dir='+encodeURIComponent(parent)
+'&scrollto='+encodeURIComponent(type[i].name);
row.find('td.result a')
.attr('href', containerLink)
diff --git a/settings/l10n/ar.php b/settings/l10n/ar.php
index f9acc08ce52..6d4880502dc 100644
--- a/settings/l10n/ar.php
+++ b/settings/l10n/ar.php
@@ -19,6 +19,7 @@ $TRANSLATIONS = array(
"Invalid email" => "البريد الإلكتروني غير صالح",
"Unable to delete group" => "فشل إزالة المجموعة",
"Unable to delete user" => "فشل إزالة المستخدم",
+"Backups restored successfully" => "تم إسترجاع النسخة الإحتياطية بنجاح",
"Language changed" => "تم تغيير اللغة",
"Invalid request" => "طلب غير مفهوم",
"Admins can't remove themself from the admin group" => "لا يستطيع المدير إزالة حسابه من مجموعة المديرين",
@@ -31,9 +32,11 @@ $TRANSLATIONS = array(
"Wrong admin recovery password. Please check the password and try again." => "خطا في كلمة مرور المسؤول المستردة, يرجى التاكد من كلمة المرور والمحاولة مرة اخرى.",
"Back-end doesn't support password change, but the users encryption key was successfully updated." => "Back-end لا يدعم تغيير كلمة المرور, لاكن مفتاح تشفير المستخدمين تم تحديثة بنجاح.",
"Unable to change password" => "لا يمكن تغيير كلمة المرور",
+"Are you really sure you want add \"{domain}\" as trusted domain?" => "هل أنت متأكد انك تريد إضافة \"{domain}\" كنطاق موثوق فيه.",
"Sending..." => "جاري الارسال ...",
"User Documentation" => "كتاب توثيق المستخدم",
"Update to {appversion}" => "تم التحديث الى ",
+"Uninstall App" => "أزالة تطبيق",
"Disable" => "إيقاف",
"Enable" => "تفعيل",
"Please wait...." => "الرجاء الانتظار ...",
@@ -44,6 +47,8 @@ $TRANSLATIONS = array(
"Error" => "خطأ",
"Update" => "حدث",
"Updated" => "تم التحديث بنجاح",
+"Uninstalling ...." => "جاري إلغاء التثبيت ...",
+"Uninstall" => "ألغاء التثبيت",
"Select a profile picture" => "اختر صورة الملف الشخصي ",
"Very weak password" => "كلمة السر ضعيفة جدا",
"Weak password" => "كلمة السر ضعيفة",
@@ -89,9 +94,12 @@ $TRANSLATIONS = array(
"cron.php is registered at a webcron service to call cron.php every 15 minutes over http." => "الملف cron.php تم تسجيله فى خدمه webcron لاستدعاء الملف cron.php كل 15 دقيقه",
"Sharing" => "مشاركة",
"Allow apps to use the Share API" => "السماح للتطبيقات بالمشاركة عن طريق الAPI",
+"Allow users to share via link" => "السماح للمستخدم بمشاركة الملف عن طريق رابط",
"Allow public uploads" => "السماح بالرفع للعامة ",
+"Expire after " => "ينتهي بعد",
+"days" => "أيام",
"Allow resharing" => "السماح بإعادة المشاركة ",
-"Security" => "حماية",
+"Security" => "الأمان",
"Enforce HTTPS" => "فرض HTTPS",
"Forces the clients to connect to %s via an encrypted connection." => "اجبار العميل للاتصال بـ %s عن طريق اتصال مشفر",
"Please connect to your %s via HTTPS to enable or disable the SSL enforcement." => "يرجى الاتصال بـ %s عن طريق HTTPS لتفعيل او تعطيل SSL enforcement.",
@@ -131,13 +139,14 @@ $TRANSLATIONS = array(
"Profile picture" => "صورة الملف الشخصي",
"Upload new" => "رفع الان",
"Select new from Files" => "اختر جديد من الملفات ",
-"Remove image" => "احذف الصورة ",
+"Remove image" => "إزالة الصورة",
"Either png or jpg. Ideally square but you will be able to crop it." => "سواء png او jpg. بامكانك قص الصورة ",
"Your avatar is provided by your original account." => "صورتك الرمزية يتم توفيرها عن طريق حسابك الاصلي.",
"Cancel" => "الغاء",
"Choose as profile image" => "اختر صورة الملف الشخصي",
"Language" => "اللغة",
"Help translate" => "ساعد في الترجمه",
+"Valid until" => "صالح حتى",
"The encryption app is no longer enabled, please decrypt all your files" => "البرنامج المشفر لم يعد مفعل, يرجى فك التشفير عن كل ملفاتك",
"Log-in password" => "كلمه سر الدخول",
"Decrypt all Files" => "فك تشفير جميع الملفات ",
@@ -146,12 +155,14 @@ $TRANSLATIONS = array(
"Admin Recovery Password" => "استعادة كلمة المرور للمسؤول",
"Enter the recovery password in order to recover the users files during password change" => "ادخل كلمة المرور المستعادة من اجل استرداد ملفات المستخدمين اثناء تغيير كلمة المرور",
"Group" => "مجموعة",
+"Everyone" => "الجميع",
"Default Quota" => "الحصة النسبية الإفتراضية",
"Please enter storage quota (ex: \"512 MB\" or \"12 GB\")" => "يرجى ادخال تخزين quota (مثل:\"512 MB\" او \"12 GB\")",
"Unlimited" => "غير محدود",
"Other" => "شيء آخر",
"Username" => "إسم المستخدم",
"Quota" => "حصه",
+"Last Login" => "آخر تسجيل دخول",
"change full name" => "تغيير اسمك الكامل",
"set new password" => "اعداد كلمة مرور جديدة",
"Default" => "افتراضي"
diff --git a/settings/l10n/az.php b/settings/l10n/az.php
index 9db69929bab..c0937e271e2 100644
--- a/settings/l10n/az.php
+++ b/settings/l10n/az.php
@@ -106,6 +106,7 @@ $TRANSLATIONS = array(
"More" => "Yenə",
"Get the apps to sync your files" => "Fayllarınızın sinxronizasiyası üçün proqramları götürün",
"Password" => "Şifrə",
+"Change password" => "Şifrəni dəyiş",
"Cancel" => "Dayandır",
"Username" => "İstifadəçi adı"
);
diff --git a/settings/l10n/et_EE.php b/settings/l10n/et_EE.php
index dc46a70b9e2..55b6586f737 100644
--- a/settings/l10n/et_EE.php
+++ b/settings/l10n/et_EE.php
@@ -66,6 +66,7 @@ $TRANSLATIONS = array(
"So-so password" => "Enam-vähem sobiv parool",
"Good password" => "Hea parool",
"Strong password" => "Väga hea parool",
+"Valid until {date}" => "Kehtib kuni {date}",
"Delete" => "Kustuta",
"Decrypting files... Please wait, this can take some time." => "Dekrüpteerin faile... Palun oota, see võib võtta veidi aega.",
"Delete encryption keys permanently." => "Kustuta krüpteerimisvõtmed lõplikult",
@@ -111,6 +112,7 @@ $TRANSLATIONS = array(
"Your PHP version is outdated" => "PHP versioon on aegunud",
"Your PHP version is outdated. We strongly recommend to update to 5.3.8 or newer because older versions are known to be broken. It is possible that this installation is not working correctly." => "Sinu PHP versioon on aegunud. Soovitame tungivalt uuenda versioonile 5.3.8 või uuemale, kuna varasemad versioonid on teadaolevalt vigased. On võimalik, et see käesolev paigaldus ei toimi korrektselt.",
"PHP charset is not set to UTF-8" => "PHP märgistik pole UTF-8",
+"PHP charset is not set to UTF-8. This can cause major issues with non-ASCII characters in file names. We highly recommend to change the value of 'default_charset' php.ini to 'UTF-8'." => "PHP märgistikuks pole määratud UTF-8. See võib tekitada failinimedes mitte-ASCII märkidega suuri probleeme. Me soovitame tungivalt panna failis php.ini sätte 'default_charset' väärtuseks 'UTF-8'.",
"Locale not working" => "Lokalisatsioon ei toimi",
"System locale can not be set to a one which supports UTF-8." => "Süsteemi lokaliseeringuks ei saa panna sellist, mis toetab UTF-8-t.",
"This means that there might be problems with certain characters in file names." => "See tähendab, et võib esineda probleeme failide nimedes mõnede sümbolitega.",
@@ -118,6 +120,7 @@ $TRANSLATIONS = array(
"Internet connection not working" => "Internetiühendus ei toimi",
"This server has no working internet connection. This means that some of the features like mounting of external storage, notifications about updates or installation of 3rd party apps don´t work. Accessing files from remote and sending of notification emails might also not work. We suggest to enable internet connection for this server if you want to have all features." => "Serveril puudub toimiv internetiühendus. See tähendab, et mõned funktsionaalsused, nagu näiteks väliste andmehoidlate ühendamine, teavitused uuendustest või kolmandate osapoolte rakenduste paigaldamine ei tööta. Eemalt failidele ligipääs ning teadete saatmine emailiga ei pruugi samuti toimida. Kui soovid täielikku funktsionaalsust, siis soovitame serverile tagada ligipääs internetti.",
"URL generation in notification emails" => "URL-ide loomine teavituskirjades",
+"If your installation is not installed in the root of the domain and uses system cron, there can be issues with the URL generation. To avoid these problems, please set the \"overwritewebroot\" option in your config.php file to the webroot path of your installation (Suggested: \"%s\")" => "Kui sinu sait pole paigaldatud domeeni juurkausta ja see kasutab ajastatud tegevusi, siis võib tekkide probleeme URL-ide loomisega. Nende probleemide vältimiseks sisesta palun failis config.php valikusse \"overwritewebroot\" oma veebiserveri juurkaust (Soovituslik: \"%s\")",
"Cron" => "Cron",
"Last cron was executed at %s." => "Cron käivitati viimati %s.",
"Last cron was executed at %s. This is more than an hour ago, something seems wrong." => "Cron käivitati viimati %s. See on rohkem kui tund tagasi, midagi on valesti.",
@@ -200,6 +203,10 @@ $TRANSLATIONS = array(
"Language" => "Keel",
"Help translate" => "Aita tõlkida",
"SSL root certificates" => "SSL root sertifikaadid",
+"Common Name" => "Üldnimetus",
+"Valid until" => "Kehtib kuni",
+"Issued By" => "isas",
+"Valid until %s" => "Kehtib kuni %s",
"Import Root Certificate" => "Impordi root sertifikaadid",
"The encryption app is no longer enabled, please decrypt all your files" => "Küpteeringu rakend pole lubatud, dekrüpteeri kõik oma failid",
"Log-in password" => "Sisselogimise parool",
@@ -207,6 +214,8 @@ $TRANSLATIONS = array(
"Your encryption keys are moved to a backup location. If something went wrong you can restore the keys. Only delete them permanently if you are sure that all files are decrypted correctly." => "Sinu krüpteerimisvõtmed on tõstetud varukoopiasse. Kui midagi läheb valesti, siis saad võtmed taastada. Kustuta lõplikult ainult juhul kui oled kindel, et failid on dekrüteeritud korrektselt.",
"Restore Encryption Keys" => "Taasta krüpteerimisvõtmed",
"Delete Encryption Keys" => "Kustuta krüpteerimisvõtmed",
+"Show storage location" => "Näita salvestusruumi asukohta",
+"Show last log in" => "Viimane sisselogimine",
"Login Name" => "Kasutajanimi",
"Create" => "Lisa",
"Admin Recovery Password" => "Admini parooli taastamine",
diff --git a/tests/lib/connector/sabre/file.php b/tests/lib/connector/sabre/file.php
index ba4e775813b..f9f485a5400 100644
--- a/tests/lib/connector/sabre/file.php
+++ b/tests/lib/connector/sabre/file.php
@@ -13,7 +13,7 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
*/
public function testSimplePutFails() {
// setup
- $view = $this->getMock('\OC\Files\View', array('file_put_contents', 'getRelativePath'), array(), '', false);
+ $view = $this->getMock('\OC\Files\View', array('file_put_contents', 'getRelativePath'), array());
$view->expects($this->any())
->method('file_put_contents')
->will($this->returnValue(false));
@@ -38,8 +38,7 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
public function testSimplePutFailsOnRename() {
// setup
$view = $this->getMock('\OC\Files\View',
- array('file_put_contents', 'rename', 'getRelativePath', 'filesize'),
- array(), '', false);
+ array('file_put_contents', 'rename', 'getRelativePath', 'filesize'));
$view->expects($this->any())
->method('file_put_contents')
->withAnyParameters()
@@ -72,7 +71,7 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
*/
public function testSimplePutInvalidChars() {
// setup
- $view = $this->getMock('\OC\Files\View', array('file_put_contents', 'getRelativePath'), array(), '', false);
+ $view = $this->getMock('\OC\Files\View', array('file_put_contents', 'getRelativePath'));
$view->expects($this->any())
->method('file_put_contents')
->will($this->returnValue(false));
@@ -96,7 +95,7 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
*/
public function testSetNameInvalidChars() {
// setup
- $view = $this->getMock('\OC\Files\View', array('getRelativePath'), array(), '', false);
+ $view = $this->getMock('\OC\Files\View', array('getRelativePath'));
$view->expects($this->any())
->method('getRelativePath')
@@ -115,8 +114,7 @@ class Test_OC_Connector_Sabre_File extends PHPUnit_Framework_TestCase {
public function testUploadAbort() {
// setup
$view = $this->getMock('\OC\Files\View',
- array('file_put_contents', 'rename', 'getRelativePath', 'filesize'),
- array(), '', false);
+ array('file_put_contents', 'rename', 'getRelativePath', 'filesize'));
$view->expects($this->any())
->method('file_put_contents')
->withAnyParameters()
diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php
index b874e418100..96b4207ad43 100644
--- a/tests/lib/files/cache/updater.php
+++ b/tests/lib/files/cache/updater.php
@@ -8,324 +8,128 @@
namespace Test\Files\Cache;
-use \OC\Files\Filesystem as Filesystem;
+use OC\Files\Filesystem;
use OC\Files\Storage\Temporary;
+use OC\Files\View;
class Updater extends \PHPUnit_Framework_TestCase {
/**
- * @var \OC\Files\Storage\Storage $storage
+ * @var \OC\Files\Storage\Storage
*/
- private $storage;
+ protected $storage;
/**
- * @var \OC\Files\Cache\Scanner $scanner
+ * @var \OC\Files\Cache\Cache
*/
- private $scanner;
-
- private $stateFilesEncryption;
+ protected $cache;
/**
- * @var \OC\Files\Cache\Cache $cache
+ * @var \OC\Files\View
*/
- private $cache;
+ protected $view;
- private static $user;
+ /**
+ * @var \OC\Files\Cache\Updater
+ */
+ protected $updater;
public function setUp() {
-
- // remember files_encryption state
- $this->stateFilesEncryption = \OC_App::isEnabled('files_encryption');
- // we want to tests with the encryption app disabled
- \OC_App::disable('files_encryption');
-
- $this->storage = new \OC\Files\Storage\Temporary(array());
- $textData = "dummy file data\n";
- $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png');
- $this->storage->mkdir('folder');
- $this->storage->file_put_contents('foo.txt', $textData);
- $this->storage->file_put_contents('foo.png', $imgData);
- $this->storage->file_put_contents('folder/bar.txt', $textData);
- $this->storage->file_put_contents('folder/bar2.txt', $textData);
-
- $this->scanner = $this->storage->getScanner();
- $this->scanner->scan('');
+ $this->storage = new Temporary(array());
+ Filesystem::clearMounts();
+ Filesystem::mount($this->storage, array(), '/');
+ $this->view = new View('');
+ $this->updater = new \OC\Files\Cache\Updater($this->view);
$this->cache = $this->storage->getCache();
+ }
- \OC\Files\Filesystem::tearDown();
- if (!self::$user) {
- self::$user = uniqid();
- }
+ public function testNewFile() {
+ $this->storage->file_put_contents('foo.txt', 'bar');
+ $this->assertFalse($this->cache->inCache('foo.txt'));
- \OC_User::createUser(self::$user, 'password');
- \OC_User::setUserId(self::$user);
+ $this->updater->update('/foo.txt');
- \OC\Files\Filesystem::init(self::$user, '/' . self::$user . '/files');
+ $this->assertTrue($this->cache->inCache('foo.txt'));
+ $cached = $this->cache->get('foo.txt');
+ $this->assertEquals(3, $cached['size']);
+ $this->assertEquals('text/plain', $cached['mimetype']);
+ }
- Filesystem::clearMounts();
- Filesystem::mount($this->storage, array(), '/' . self::$user . '/files');
+ public function testUpdatedFile() {
+ $this->view->file_put_contents('/foo.txt', 'bar');
+ $cached = $this->cache->get('foo.txt');
+ $this->assertEquals(3, $cached['size']);
+ $this->assertEquals('text/plain', $cached['mimetype']);
- \OC_Hook::clear('OC_Filesystem');
- }
+ $this->storage->file_put_contents('foo.txt', 'qwerty');
- public function tearDown() {
- if ($this->cache) {
- $this->cache->clear();
- }
- $result = \OC_User::deleteUser(self::$user);
- $this->assertTrue($result);
- Filesystem::tearDown();
- // reset app files_encryption
- if ($this->stateFilesEncryption) {
- \OC_App::enable('files_encryption');
- }
- }
+ $cached = $this->cache->get('foo.txt');
+ $this->assertEquals(3, $cached['size']);
- public function testWrite() {
- $textSize = strlen("dummy file data\n");
- $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png');
- $this->cache->put('foo.txt', array('mtime' => 100, 'storage_mtime' => 150));
- $rootCachedData = $this->cache->get('');
- $this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']);
-
- $fooCachedData = $this->cache->get('foo.txt');
- Filesystem::file_put_contents('foo.txt', 'asd');
- $cachedData = $this->cache->get('foo.txt');
- $this->assertEquals(3, $cachedData['size']);
- $this->assertInternalType('string', $fooCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($fooCachedData['etag'], $cachedData['etag']);
- $cachedData = $this->cache->get('');
- $this->assertEquals(2 * $textSize + $imageSize + 3, $cachedData['size']);
- $this->assertInternalType('string', $rootCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
- $rootCachedData = $cachedData;
+ $this->updater->update('/foo.txt');
- $this->assertFalse($this->cache->inCache('bar.txt'));
- Filesystem::file_put_contents('bar.txt', 'asd');
- $this->assertTrue($this->cache->inCache('bar.txt'));
- $cachedData = $this->cache->get('bar.txt');
- $this->assertEquals(3, $cachedData['size']);
- $mtime = $cachedData['mtime'];
- $cachedData = $this->cache->get('');
- $this->assertEquals(2 * $textSize + $imageSize + 2 * 3, $cachedData['size']);
- $this->assertInternalType('string', $rootCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
- $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $mtime);
+ $cached = $this->cache->get('foo.txt');
+ $this->assertEquals(6, $cached['size']);
}
- public function testWriteWithMountPoints() {
- $storage2 = new \OC\Files\Storage\Temporary(array());
- $storage2->getScanner()->scan(''); //initialize etags
- $cache2 = $storage2->getCache();
- Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
- $folderCachedData = $this->cache->get('folder');
- $substorageCachedData = $cache2->get('');
- Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
- $this->assertTrue($cache2->inCache('foo.txt'));
- $cachedData = $cache2->get('foo.txt');
- $this->assertEquals(3, $cachedData['size']);
- $mtime = $cachedData['mtime'];
-
- $cachedData = $cache2->get('');
- $this->assertInternalType('string', $substorageCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($substorageCachedData['etag'], $cachedData['etag']);
- $this->assertEquals($mtime, $cachedData['mtime']);
-
- $cachedData = $this->cache->get('folder');
- $this->assertInternalType('string', $folderCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($folderCachedData['etag'], $cachedData['etag']);
- $this->assertEquals($mtime, $cachedData['mtime']);
- }
+ public function testParentSize() {
+ $this->storage->getScanner()->scan('');
- public function testDelete() {
- $textSize = strlen("dummy file data\n");
- $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png');
- $rootCachedData = $this->cache->get('');
- $this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']);
+ $parentCached = $this->cache->get('');
+ $this->assertEquals(0, $parentCached['size']);
- $this->assertTrue($this->cache->inCache('foo.txt'));
- Filesystem::unlink('foo.txt');
- $this->assertFalse($this->cache->inCache('foo.txt'));
- $cachedData = $this->cache->get('');
- $this->assertEquals(2 * $textSize + $imageSize, $cachedData['size']);
- $this->assertInternalType('string', $rootCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
- $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $cachedData['mtime']);
- $rootCachedData = $cachedData;
-
- Filesystem::mkdir('bar_folder');
- $this->assertTrue($this->cache->inCache('bar_folder'));
- $cachedData = $this->cache->get('');
- $this->assertInternalType('string', $rootCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
- $rootCachedData = $cachedData;
- Filesystem::rmdir('bar_folder');
- $this->assertFalse($this->cache->inCache('bar_folder'));
- $cachedData = $this->cache->get('');
- $this->assertInternalType('string', $rootCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
- $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $cachedData['mtime']);
- }
+ $this->storage->file_put_contents('foo.txt', 'bar');
+
+ $parentCached = $this->cache->get('');
+ $this->assertEquals(0, $parentCached['size']);
+
+ $this->updater->update('foo.txt');
- public function testDeleteWithMountPoints() {
- $storage2 = new \OC\Files\Storage\Temporary(array());
- $cache2 = $storage2->getCache();
- Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
- Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
- $this->assertTrue($cache2->inCache('foo.txt'));
- $folderCachedData = $this->cache->get('folder');
- $substorageCachedData = $cache2->get('');
- Filesystem::unlink('folder/substorage/foo.txt');
- $this->assertFalse($cache2->inCache('foo.txt'));
-
- $cachedData = $cache2->get('');
- $this->assertInternalType('string', $substorageCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($substorageCachedData['etag'], $cachedData['etag']);
- $this->assertGreaterThanOrEqual($substorageCachedData['mtime'], $cachedData['mtime']);
-
- $cachedData = $this->cache->get('folder');
- $this->assertInternalType('string', $folderCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($folderCachedData['etag'], $cachedData['etag']);
- $this->assertGreaterThanOrEqual($folderCachedData['mtime'], $cachedData['mtime']);
+ $parentCached = $this->cache->get('');
+ $this->assertEquals(3, $parentCached['size']);
+
+ $this->storage->file_put_contents('foo.txt', 'qwerty');
+
+ $parentCached = $this->cache->get('');
+ $this->assertEquals(3, $parentCached['size']);
+
+ $this->updater->update('foo.txt');
+
+ $parentCached = $this->cache->get('');
+ $this->assertEquals(6, $parentCached['size']);
+
+ $this->storage->unlink('foo.txt');
+
+ $parentCached = $this->cache->get('');
+ $this->assertEquals(6, $parentCached['size']);
+
+ $this->updater->remove('foo.txt');
+
+ $parentCached = $this->cache->get('');
+ $this->assertEquals(0, $parentCached['size']);
}
- public function testRename() {
- $textSize = strlen("dummy file data\n");
- $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png');
- $rootCachedData = $this->cache->get('');
- $this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']);
+ public function testMove() {
+ $this->storage->file_put_contents('foo.txt', 'qwerty');
+ $this->updater->update('foo.txt');
$this->assertTrue($this->cache->inCache('foo.txt'));
- $fooCachedData = $this->cache->get('foo.txt');
$this->assertFalse($this->cache->inCache('bar.txt'));
- Filesystem::rename('foo.txt', 'bar.txt');
- $this->assertFalse($this->cache->inCache('foo.txt'));
- $this->assertTrue($this->cache->inCache('bar.txt'));
- $cachedData = $this->cache->get('bar.txt');
- $this->assertEquals($fooCachedData['fileid'], $cachedData['fileid']);
- $mtime = $cachedData['mtime'];
- $cachedData = $this->cache->get('');
- $this->assertEquals(3 * $textSize + $imageSize, $cachedData['size']);
- $this->assertInternalType('string', $rootCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
- }
+ $cached = $this->cache->get('foo.txt');
- public function testRenameExtension() {
- $fooCachedData = $this->cache->get('foo.txt');
- $this->assertEquals('text/plain', $fooCachedData['mimetype']);
- Filesystem::rename('foo.txt', 'foo.abcd');
- $fooCachedData = $this->cache->get('foo.abcd');
- $this->assertEquals('application/octet-stream', $fooCachedData['mimetype']);
- }
+ $this->storage->rename('foo.txt', 'bar.txt');
- public function testRenameWithMountPoints() {
- $storage2 = new \OC\Files\Storage\Temporary(array());
- $cache2 = $storage2->getCache();
- Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
- Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
- $this->assertTrue($cache2->inCache('foo.txt'));
- $folderCachedData = $this->cache->get('folder');
- $substorageCachedData = $cache2->get('');
- $fooCachedData = $cache2->get('foo.txt');
- Filesystem::rename('folder/substorage/foo.txt', 'folder/substorage/bar.txt');
- $this->assertFalse($cache2->inCache('foo.txt'));
- $this->assertTrue($cache2->inCache('bar.txt'));
- $cachedData = $cache2->get('bar.txt');
- $this->assertEquals($fooCachedData['fileid'], $cachedData['fileid']);
- $mtime = $cachedData['mtime'];
-
- $cachedData = $cache2->get('');
- $this->assertInternalType('string', $substorageCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($substorageCachedData['etag'], $cachedData['etag']);
- // rename can cause mtime change - invalid assert
-// $this->assertEquals($mtime, $cachedData['mtime']);
-
- $cachedData = $this->cache->get('folder');
- $this->assertInternalType('string', $folderCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($folderCachedData['etag'], $cachedData['etag']);
- // rename can cause mtime change - invalid assert
-// $this->assertEquals($mtime, $cachedData['mtime']);
- }
+ $this->assertTrue($this->cache->inCache('foo.txt'));
+ $this->assertFalse($this->cache->inCache('bar.txt'));
- public function testTouch() {
- $rootCachedData = $this->cache->get('');
- $fooCachedData = $this->cache->get('foo.txt');
- Filesystem::touch('foo.txt');
- $cachedData = $this->cache->get('foo.txt');
- $this->assertInternalType('string', $fooCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($fooCachedData['etag'], $cachedData['etag']);
- $this->assertGreaterThanOrEqual($fooCachedData['mtime'], $cachedData['mtime']);
-
- $cachedData = $this->cache->get('');
- $this->assertInternalType('string', $rootCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
- $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $cachedData['mtime']);
- $rootCachedData = $cachedData;
-
- $time = 1371006070;
- $barCachedData = $this->cache->get('folder/bar.txt');
- $folderCachedData = $this->cache->get('folder');
- Filesystem::touch('folder/bar.txt', $time);
- $cachedData = $this->cache->get('folder/bar.txt');
- $this->assertInternalType('string', $barCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($barCachedData['etag'], $cachedData['etag']);
- $this->assertEquals($time, $cachedData['mtime']);
-
- $cachedData = $this->cache->get('folder');
- $this->assertInternalType('string', $folderCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($folderCachedData['etag'], $cachedData['etag']);
-
- $cachedData = $this->cache->get('');
- $this->assertInternalType('string', $rootCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
- $this->assertEquals($time, $cachedData['mtime']);
- }
+ $this->updater->rename('foo.txt', 'bar.txt');
- public function testTouchWithMountPoints() {
- $storage2 = new \OC\Files\Storage\Temporary(array());
- $cache2 = $storage2->getCache();
- Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
- Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
- $this->assertTrue($cache2->inCache('foo.txt'));
- $folderCachedData = $this->cache->get('folder');
- $substorageCachedData = $cache2->get('');
- $fooCachedData = $cache2->get('foo.txt');
- $cachedData = $cache2->get('foo.txt');
- $time = 1371006070;
- Filesystem::touch('folder/substorage/foo.txt', $time);
- $cachedData = $cache2->get('foo.txt');
- $this->assertInternalType('string', $fooCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($fooCachedData['etag'], $cachedData['etag']);
- $this->assertEquals($time, $cachedData['mtime']);
-
- $cachedData = $cache2->get('');
- $this->assertInternalType('string', $substorageCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($substorageCachedData['etag'], $cachedData['etag']);
-
- $cachedData = $this->cache->get('folder');
- $this->assertInternalType('string', $folderCachedData['etag']);
- $this->assertInternalType('string', $cachedData['etag']);
- $this->assertNotSame($folderCachedData['etag'], $cachedData['etag']);
- $this->assertEquals($time, $cachedData['mtime']);
- }
+ $this->assertFalse($this->cache->inCache('foo.txt'));
+ $this->assertTrue($this->cache->inCache('bar.txt'));
+ $cachedTarget = $this->cache->get('bar.txt');
+ $this->assertEquals($cached['etag'], $cachedTarget['etag']);
+ $this->assertEquals($cached['mtime'], $cachedTarget['mtime']);
+ $this->assertEquals($cached['size'], $cachedTarget['size']);
+ $this->assertEquals($cached['fileid'], $cachedTarget['fileid']);
+ }
}
diff --git a/tests/lib/files/cache/updaterlegacy.php b/tests/lib/files/cache/updaterlegacy.php
new file mode 100644
index 00000000000..c80c3168ad6
--- /dev/null
+++ b/tests/lib/files/cache/updaterlegacy.php
@@ -0,0 +1,328 @@
+<?php
+/**
+ * Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace Test\Files\Cache;
+
+use \OC\Files\Filesystem as Filesystem;
+use OC\Files\Storage\Temporary;
+
+class UpdaterLegacy extends \PHPUnit_Framework_TestCase {
+ /**
+ * @var \OC\Files\Storage\Storage $storage
+ */
+ private $storage;
+
+ /**
+ * @var \OC\Files\Cache\Scanner $scanner
+ */
+ private $scanner;
+
+ private $stateFilesEncryption;
+
+ /**
+ * @var \OC\Files\Cache\Cache $cache
+ */
+ private $cache;
+
+ private static $user;
+
+ public function setUp() {
+
+ // remember files_encryption state
+ $this->stateFilesEncryption = \OC_App::isEnabled('files_encryption');
+ // we want to tests with the encryption app disabled
+ \OC_App::disable('files_encryption');
+
+ $this->storage = new \OC\Files\Storage\Temporary(array());
+ $textData = "dummy file data\n";
+ $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png');
+ $this->storage->mkdir('folder');
+ $this->storage->file_put_contents('foo.txt', $textData);
+ $this->storage->file_put_contents('foo.png', $imgData);
+ $this->storage->file_put_contents('folder/bar.txt', $textData);
+ $this->storage->file_put_contents('folder/bar2.txt', $textData);
+
+ $this->scanner = $this->storage->getScanner();
+ $this->scanner->scan('');
+ $this->cache = $this->storage->getCache();
+
+ \OC\Files\Filesystem::tearDown();
+ if (!self::$user) {
+ self::$user = uniqid();
+ }
+
+ \OC_User::createUser(self::$user, 'password');
+ \OC_User::setUserId(self::$user);
+
+ \OC\Files\Filesystem::init(self::$user, '/' . self::$user . '/files');
+
+ Filesystem::clearMounts();
+ Filesystem::mount($this->storage, array(), '/' . self::$user . '/files');
+
+ \OC_Hook::clear('OC_Filesystem');
+ }
+
+ public function tearDown() {
+ if ($this->cache) {
+ $this->cache->clear();
+ }
+ $result = \OC_User::deleteUser(self::$user);
+ $this->assertTrue($result);
+ Filesystem::tearDown();
+ // reset app files_encryption
+ if ($this->stateFilesEncryption) {
+ \OC_App::enable('files_encryption');
+ }
+ }
+
+ public function testWrite() {
+ $textSize = strlen("dummy file data\n");
+ $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png');
+ $this->cache->put('foo.txt', array('mtime' => 100, 'storage_mtime' => 150));
+ $rootCachedData = $this->cache->get('');
+ $this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']);
+
+ $fooCachedData = $this->cache->get('foo.txt');
+ Filesystem::file_put_contents('foo.txt', 'asd');
+ $cachedData = $this->cache->get('foo.txt');
+ $this->assertEquals(3, $cachedData['size']);
+ $this->assertInternalType('string', $fooCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($fooCachedData['etag'], $cachedData['etag']);
+ $cachedData = $this->cache->get('');
+ $this->assertEquals(2 * $textSize + $imageSize + 3, $cachedData['size']);
+ $this->assertInternalType('string', $rootCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
+ $rootCachedData = $cachedData;
+
+ $this->assertFalse($this->cache->inCache('bar.txt'));
+ Filesystem::file_put_contents('bar.txt', 'asd');
+ $this->assertTrue($this->cache->inCache('bar.txt'));
+ $cachedData = $this->cache->get('bar.txt');
+ $this->assertEquals(3, $cachedData['size']);
+ $mtime = $cachedData['mtime'];
+ $cachedData = $this->cache->get('');
+ $this->assertEquals(2 * $textSize + $imageSize + 2 * 3, $cachedData['size']);
+ $this->assertInternalType('string', $rootCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
+ $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $mtime);
+ }
+
+ public function testWriteWithMountPoints() {
+ $storage2 = new \OC\Files\Storage\Temporary(array());
+ $storage2->getScanner()->scan(''); //initialize etags
+ $cache2 = $storage2->getCache();
+ Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
+ $folderCachedData = $this->cache->get('folder');
+ $substorageCachedData = $cache2->get('');
+ Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
+ $this->assertTrue($cache2->inCache('foo.txt'));
+ $cachedData = $cache2->get('foo.txt');
+ $this->assertEquals(3, $cachedData['size']);
+ $mtime = $cachedData['mtime'];
+
+ $cachedData = $cache2->get('');
+ $this->assertInternalType('string', $substorageCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($substorageCachedData['etag'], $cachedData['etag']);
+
+ $cachedData = $this->cache->get('folder');
+ $this->assertInternalType('string', $folderCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($folderCachedData['etag'], $cachedData['etag']);
+ }
+
+ public function testDelete() {
+ $textSize = strlen("dummy file data\n");
+ $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png');
+ $rootCachedData = $this->cache->get('');
+ $this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']);
+
+ $this->assertTrue($this->cache->inCache('foo.txt'));
+ Filesystem::unlink('foo.txt');
+ $this->assertFalse($this->cache->inCache('foo.txt'));
+ $cachedData = $this->cache->get('');
+ $this->assertEquals(2 * $textSize + $imageSize, $cachedData['size']);
+ $this->assertInternalType('string', $rootCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
+ $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $cachedData['mtime']);
+ $rootCachedData = $cachedData;
+
+ Filesystem::mkdir('bar_folder');
+ $this->assertTrue($this->cache->inCache('bar_folder'));
+ $cachedData = $this->cache->get('');
+ $this->assertInternalType('string', $rootCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
+ $rootCachedData = $cachedData;
+ Filesystem::rmdir('bar_folder');
+ $this->assertFalse($this->cache->inCache('bar_folder'));
+ $cachedData = $this->cache->get('');
+ $this->assertInternalType('string', $rootCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
+ $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $cachedData['mtime']);
+ }
+
+ public function testDeleteWithMountPoints() {
+ $storage2 = new \OC\Files\Storage\Temporary(array());
+ $cache2 = $storage2->getCache();
+ Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
+ Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
+ $this->assertTrue($cache2->inCache('foo.txt'));
+ $folderCachedData = $this->cache->get('folder');
+ $substorageCachedData = $cache2->get('');
+ Filesystem::unlink('folder/substorage/foo.txt');
+ $this->assertFalse($cache2->inCache('foo.txt'));
+
+ $cachedData = $cache2->get('');
+ $this->assertInternalType('string', $substorageCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($substorageCachedData['etag'], $cachedData['etag']);
+ $this->assertGreaterThanOrEqual($substorageCachedData['mtime'], $cachedData['mtime']);
+
+ $cachedData = $this->cache->get('folder');
+ $this->assertInternalType('string', $folderCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($folderCachedData['etag'], $cachedData['etag']);
+ $this->assertGreaterThanOrEqual($folderCachedData['mtime'], $cachedData['mtime']);
+ }
+
+ public function testRename() {
+ $textSize = strlen("dummy file data\n");
+ $imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png');
+ $rootCachedData = $this->cache->get('');
+ $this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']);
+
+ $this->assertTrue($this->cache->inCache('foo.txt'));
+ $fooCachedData = $this->cache->get('foo.txt');
+ $this->assertFalse($this->cache->inCache('bar.txt'));
+ Filesystem::rename('foo.txt', 'bar.txt');
+ $this->assertFalse($this->cache->inCache('foo.txt'));
+ $this->assertTrue($this->cache->inCache('bar.txt'));
+ $cachedData = $this->cache->get('bar.txt');
+ $this->assertEquals($fooCachedData['fileid'], $cachedData['fileid']);
+ $mtime = $cachedData['mtime'];
+ $cachedData = $this->cache->get('');
+ $this->assertEquals(3 * $textSize + $imageSize, $cachedData['size']);
+ $this->assertInternalType('string', $rootCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
+ }
+
+ public function testRenameExtension() {
+ $fooCachedData = $this->cache->get('foo.txt');
+ $this->assertEquals('text/plain', $fooCachedData['mimetype']);
+ Filesystem::rename('foo.txt', 'foo.abcd');
+ $fooCachedData = $this->cache->get('foo.abcd');
+ $this->assertEquals('application/octet-stream', $fooCachedData['mimetype']);
+ }
+
+ public function testRenameWithMountPoints() {
+ $storage2 = new \OC\Files\Storage\Temporary(array());
+ $cache2 = $storage2->getCache();
+ Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
+ Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
+ $this->assertTrue($cache2->inCache('foo.txt'));
+ $folderCachedData = $this->cache->get('folder');
+ $substorageCachedData = $cache2->get('');
+ $fooCachedData = $cache2->get('foo.txt');
+ Filesystem::rename('folder/substorage/foo.txt', 'folder/substorage/bar.txt');
+ $this->assertFalse($cache2->inCache('foo.txt'));
+ $this->assertTrue($cache2->inCache('bar.txt'));
+ $cachedData = $cache2->get('bar.txt');
+ $this->assertEquals($fooCachedData['fileid'], $cachedData['fileid']);
+ $mtime = $cachedData['mtime'];
+
+ $cachedData = $cache2->get('');
+ $this->assertInternalType('string', $substorageCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($substorageCachedData['etag'], $cachedData['etag']);
+ // rename can cause mtime change - invalid assert
+// $this->assertEquals($mtime, $cachedData['mtime']);
+
+ $cachedData = $this->cache->get('folder');
+ $this->assertInternalType('string', $folderCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($folderCachedData['etag'], $cachedData['etag']);
+ // rename can cause mtime change - invalid assert
+// $this->assertEquals($mtime, $cachedData['mtime']);
+ }
+
+ public function testTouch() {
+ $rootCachedData = $this->cache->get('');
+ $fooCachedData = $this->cache->get('foo.txt');
+ Filesystem::touch('foo.txt');
+ $cachedData = $this->cache->get('foo.txt');
+ $this->assertInternalType('string', $fooCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertGreaterThanOrEqual($fooCachedData['mtime'], $cachedData['mtime']);
+
+ $cachedData = $this->cache->get('');
+ $this->assertInternalType('string', $rootCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
+ $this->assertGreaterThanOrEqual($rootCachedData['mtime'], $cachedData['mtime']);
+ $rootCachedData = $cachedData;
+
+ $time = 1371006070;
+ $barCachedData = $this->cache->get('folder/bar.txt');
+ $folderCachedData = $this->cache->get('folder');
+ Filesystem::touch('folder/bar.txt', $time);
+ $cachedData = $this->cache->get('folder/bar.txt');
+ $this->assertInternalType('string', $barCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($barCachedData['etag'], $cachedData['etag']);
+ $this->assertEquals($time, $cachedData['mtime']);
+
+ $cachedData = $this->cache->get('folder');
+ $this->assertInternalType('string', $folderCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($folderCachedData['etag'], $cachedData['etag']);
+
+ $cachedData = $this->cache->get('');
+ $this->assertInternalType('string', $rootCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($rootCachedData['etag'], $cachedData['etag']);
+ $this->assertEquals($time, $cachedData['mtime']);
+ }
+
+ public function testTouchWithMountPoints() {
+ $storage2 = new \OC\Files\Storage\Temporary(array());
+ $cache2 = $storage2->getCache();
+ Filesystem::mount($storage2, array(), '/' . self::$user . '/files/folder/substorage');
+ Filesystem::file_put_contents('folder/substorage/foo.txt', 'asd');
+ $this->assertTrue($cache2->inCache('foo.txt'));
+ $folderCachedData = $this->cache->get('folder');
+ $substorageCachedData = $cache2->get('');
+ $fooCachedData = $cache2->get('foo.txt');
+ $cachedData = $cache2->get('foo.txt');
+ $time = 1371006070;
+ Filesystem::touch('folder/substorage/foo.txt', $time);
+ $cachedData = $cache2->get('foo.txt');
+ $this->assertInternalType('string', $fooCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($fooCachedData['etag'], $cachedData['etag']);
+ $this->assertEquals($time, $cachedData['mtime']);
+
+ $cachedData = $cache2->get('');
+ $this->assertInternalType('string', $substorageCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($substorageCachedData['etag'], $cachedData['etag']);
+
+ $cachedData = $this->cache->get('folder');
+ $this->assertInternalType('string', $folderCachedData['etag']);
+ $this->assertInternalType('string', $cachedData['etag']);
+ $this->assertNotSame($folderCachedData['etag'], $cachedData['etag']);
+ $this->assertEquals($time, $cachedData['mtime']);
+ }
+
+}
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index a0f4d97d5b4..522535946a5 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -382,7 +382,7 @@ class View extends \PHPUnit_Framework_TestCase {
$rootView->putFileInfo('foo.txt', array('storage_mtime' => 1000)); //make sure the watcher detects the change
$rootView->file_put_contents('foo.txt', 'asd');
$cachedData = $rootView->getFileInfo('foo.txt');
- $this->assertGreaterThanOrEqual($cachedData['mtime'], $oldCachedData['mtime']);
+ $this->assertGreaterThanOrEqual($oldCachedData['mtime'], $cachedData['mtime']);
$this->assertEquals($cachedData['storage_mtime'], $cachedData['mtime']);
}