', {'class': 'cp-app-drive-content-info-box'});
var msg;
switch (path[0]) {
@@ -3360,13 +3363,11 @@ define([
var readOnlyFolder = false;
if (APP.readOnly) {
// Read-only drive (team?)
- $readOnly.show();
- } else if (folders[sfId] && folders[sfId].readOnly) {
+ $content.prepend($readOnly.clone());
+ } else if (sfId && folders[sfId] && folders[sfId].readOnly) {
// If readonly shared folder...
- $readOnly.show();
+ $content.prepend($readOnly.clone());
readOnlyFolder = true;
- } else {
- $readOnly.hide();
}
$content.data('readOnlyFolder', readOnlyFolder);
diff --git a/www/common/outer/team.js b/www/common/outer/team.js
index 151dff6c9..b1be2baea 100644
--- a/www/common/outer/team.js
+++ b/www/common/outer/team.js
@@ -1035,6 +1035,10 @@ define([
team.userObject.setReadOnly(!secret.keys.secondaryKey, secret.keys.secondaryKey);
}
+ if (!secret.keys.secondaryKey && team.rpc) {
+ team.rpc.destroy();
+ }
+
// Upgrade the shared folders
var folders = Util.find(team, ['proxy', 'drive', 'sharedFolders']);
Object.keys(folders || {}).forEach(function (sfId) {
diff --git a/www/common/outer/userObject.js b/www/common/outer/userObject.js
index dd1f30692..7182d6ab2 100644
--- a/www/common/outer/userObject.js
+++ b/www/common/outer/userObject.js
@@ -115,9 +115,13 @@ define([
};
exp.deprecateSharedFolder = function (id) {
+ if (readOnly) { return; }
var data = files[SHARED_FOLDERS][id];
if (!data) { return; }
- files[SHARED_FOLDERS_TEMP][id] = JSON.parse(JSON.stringify(data));
+ var ro = !data.href || exp.cryptor.decrypt(data.href).indexOf('#') === -1;
+ if (!ro) {
+ files[SHARED_FOLDERS_TEMP][id] = JSON.parse(JSON.stringify(data));
+ }
var paths = exp.findFile(Number(id));
exp.delete(paths, null, true);
delete files[SHARED_FOLDERS][id];
diff --git a/www/common/translations/messages.de.json b/www/common/translations/messages.de.json
index 1ba5c1c03..9c2c67ab1 100644
--- a/www/common/translations/messages.de.json
+++ b/www/common/translations/messages.de.json
@@ -1233,5 +1233,14 @@
"driveOfflineError": "Die Verbindung zu CryptPad ist verloren gegangen. Änderungen an diesem Pad werden nicht in deinem CryptDrive gespeichert. Bitte schließe alle CryptPad-Tabs und versuche es in einem neuen Fenster erneut. ",
"storageStatus": "Speicher:
{0} von
{1} belegt",
"teams_table": "Rollen",
- "teams_table_generic": "Rollen und Berechtigungen"
+ "teams_table_generic": "Rollen und Berechtigungen",
+ "teams_table_generic_view": "Ansehen: Zugriff auf Ordner und Pads (nur Lesen)",
+ "teams_table_generic_edit": "Bearbeiten: Erstellen, Ändern und Löschen von Ordnern und Pads",
+ "teams_table_generic_admin": "Mitglieder verwalten: Einladen und Entfernen von Mitgliedern, Ändern von Benutzerrollen bis maximal Admin",
+ "teams_table_generic_own": "Team verwalten: Ändern von Namen und Avatar des Teams, Hinzufügen oder Entfernen von Eigentümerschaften des Teams, Löschung des Teams",
+ "teams_table_specific": "Ausnahmen",
+ "teams_table_specificHint": "Dies sind ältere geteilte Ordner, wo Benutzer noch Bearbeitungsrechte haben. Für hier erstellte oder hierhin kopierte Pads gelten Standard-Berechtigungen.",
+ "teams_table_admins": "Mitglieder verwalten",
+ "teams_table_owners": "Team verwalten",
+ "teams_table_role": "Rolle"
}
diff --git a/www/common/translations/messages.nl.json b/www/common/translations/messages.nl.json
new file mode 100644
index 000000000..7a73a41bf
--- /dev/null
+++ b/www/common/translations/messages.nl.json
@@ -0,0 +1,2 @@
+{
+}
\ No newline at end of file
diff --git a/www/drive/inner.html b/www/drive/inner.html
index abbb03414..b53b1a90e 100644
--- a/www/drive/inner.html
+++ b/www/drive/inner.html
@@ -17,7 +17,7 @@
diff --git a/www/drive/inner.js b/www/drive/inner.js
index 252ed68dc..e2415d2d0 100644
--- a/www/drive/inner.js
+++ b/www/drive/inner.js
@@ -58,6 +58,14 @@ define([
APP.newSharedFolder = null;
}
}
+ if (newObj && newObj.deprecated) {
+ delete folders[fId];
+ delete drive.sharedFolders[fId];
+ if (manager && manager.folders) {
+ delete manager.folders[fId];
+ }
+ return;
+ }
folders[fId] = folders[fId] || {};
copyObjectValue(folders[fId], newObj);
folders[fId].readOnly = !secret.keys.secondaryKey;
@@ -69,6 +77,16 @@ define([
manager.folders[fId].userObject.setReadOnly(readOnly, secret.keys.secondaryKey);
}));
});
+ // Remove from memory folders that have been deleted from the drive remotely
+ oldIds.forEach(function (fId) {
+ if (!drive.sharedFolders[fId]) {
+ delete folders[fId];
+ delete drive.sharedFolders[fId];
+ if (manager && manager.folders) {
+ delete manager.folders[fId];
+ }
+ }
+ });
}).nThen(function () {
cb();
});
@@ -117,7 +135,6 @@ define([
SFCommon.create(waitFor(function (c) { common = c; }));
}).nThen(function (waitFor) {
$('#cp-app-drive-connection-state').text(Messages.disconnected);
- $('#cp-app-drive-edition-state').text(Messages.readonly);
var privReady = Util.once(waitFor());
var metadataMgr = common.getMetadataMgr();
if (JSON.stringify(metadataMgr.getPrivateData()) !== '{}') {
diff --git a/www/kanban/inner.js b/www/kanban/inner.js
index 74abb7f8d..fb3ed93c1 100644
--- a/www/kanban/inner.js
+++ b/www/kanban/inner.js
@@ -152,6 +152,9 @@ define([
e.preventDefault();
e.stopPropagation();
save();
+ if (!$input.val()) { return; }
+ if (!$(el).closest('.kanban-item').is(':last-child')) { return; }
+ $(el).closest('.kanban-board').find('.kanban-title-button.fa-plus').click();
return;
}
if (e.which === 27) {
@@ -301,6 +304,8 @@ define([
e.preventDefault();
e.stopPropagation();
save();
+ if (!$input.val()) { return; }
+ $(el).closest('.kanban-board').find('.kanban-title-button.fa-plus').click();
return;
}
if (e.which === 27) {
diff --git a/www/teams/inner.js b/www/teams/inner.js
index 98bd1a70a..d33a214c1 100644
--- a/www/teams/inner.js
+++ b/www/teams/inner.js
@@ -80,6 +80,16 @@ define([
manager.folders[fId].userObject.setReadOnly(readOnly, secret.keys.secondaryKey);
}));
});
+ // Remove from memory folders that have been deleted from the drive remotely
+ oldIds.forEach(function (fId) {
+ if (!drive.sharedFolders[fId]) {
+ delete folders[fId];
+ delete drive.sharedFolders[fId];
+ if (manager && manager.folders) {
+ delete manager.folders[fId];
+ }
+ }
+ });
}).nThen(function () {
cb();
});
@@ -287,7 +297,7 @@ define([
// Provide secondaryKey
var teamData = (privateData.teams || {})[id] || {};
- driveAPP.readOnly = !teamData.secondaryKey;
+ driveAPP.readOnly = !teamData.hasSecondaryKey;
var drive = DriveUI.create(common, {
proxy: proxy,
folders: folders,
@@ -475,7 +485,6 @@ define([
h('div#cp-app-drive-content-container', [
h('div#cp-app-drive-toolbar'),
h('div#cp-app-drive-connection-state', {style: "display: none;"}, Messages.disconnected),
- h('div#cp-app-drive-edition-state', {style: "display: none;"}, Messages.readonly),
h('div#cp-app-drive-content', {tabindex:2})
])
])
@@ -745,7 +754,7 @@ define([
});
var pending = Object.keys(roster).filter(function (k) {
if (!roster[k].pending) { return; }
- return roster[k].role === "MEMBER" || !roster[k].role;
+ return roster[k].role === "VIEWER" || !roster[k].role;
}).map(function (k) {
return makeMember(common, roster[k], me);
});