Prevent users from creating a pad when visiting a deleted profile (read-only mode)
This commit is contained in:
parent
a0d452bbd9
commit
206ac14438
@ -37,6 +37,7 @@ define(function () {
|
|||||||
out.chainpadError = 'Une erreur critique est survenue lors de la mise à jour du contenu. Le pad est désormais en mode lecture seule afin de s\'assurer que vous ne perdiez pas davantage de données.<br>' +
|
out.chainpadError = 'Une erreur critique est survenue lors de la mise à jour du contenu. Le pad est désormais en mode lecture seule afin de s\'assurer que vous ne perdiez pas davantage de données.<br>' +
|
||||||
'Appuyez sur <em>Échap</em> pour voir le pad ou rechargez la page pour pouvoir le modifier à nouveau.';
|
'Appuyez sur <em>Échap</em> pour voir le pad ou rechargez la page pour pouvoir le modifier à nouveau.';
|
||||||
out.errorCopy = ' Vous pouvez toujours copier son contenu ailleurs en appuyant sur <em>Échap</em>.<br> Dés que vous aurez quitté la page, il sera impossible de le récupérer.';
|
out.errorCopy = ' Vous pouvez toujours copier son contenu ailleurs en appuyant sur <em>Échap</em>.<br> Dés que vous aurez quitté la page, il sera impossible de le récupérer.';
|
||||||
|
out.errorRedirectToHome = 'Appuyez sur <em>Échap</em> pour retourner vers votre CryptDrive.';
|
||||||
|
|
||||||
out.loading = "Chargement...";
|
out.loading = "Chargement...";
|
||||||
out.error = "Erreur";
|
out.error = "Erreur";
|
||||||
|
|||||||
@ -38,6 +38,7 @@ define(function () {
|
|||||||
out.chainpadError = 'A critical error occurred when updating your content. This page is in read-only mode to make sure you won\'t lose your work.<br>' +
|
out.chainpadError = 'A critical error occurred when updating your content. This page is in read-only mode to make sure you won\'t lose your work.<br>' +
|
||||||
'Hit <em>Esc</em> to continue to view this pad, or reload to try editing again.';
|
'Hit <em>Esc</em> to continue to view this pad, or reload to try editing again.';
|
||||||
out.errorCopy = ' You can still copy the content to another location by pressing <em>Esc</em>.<br>Once you leave this page, it will disappear forever!';
|
out.errorCopy = ' You can still copy the content to another location by pressing <em>Esc</em>.<br>Once you leave this page, it will disappear forever!';
|
||||||
|
out.errorRedirectToHome = 'Press <em>Esc</em> to be redirected to your CryptDrive.';
|
||||||
|
|
||||||
out.loading = "Loading...";
|
out.loading = "Loading...";
|
||||||
out.error = "Error";
|
out.error = "Error";
|
||||||
|
|||||||
@ -650,6 +650,12 @@ define([
|
|||||||
Cryptpad.getMetadata(waitFor(function (err, m) {
|
Cryptpad.getMetadata(waitFor(function (err, m) {
|
||||||
cpNfCfg.owners = [m.priv.edPublic];
|
cpNfCfg.owners = [m.priv.edPublic];
|
||||||
}));
|
}));
|
||||||
|
} else if (isNewFile && !cfg.useCreationScreen && window.location.hash) {
|
||||||
|
console.log("new file with hash in the address bar in an app without pcs and which requires owners");
|
||||||
|
sframeChan.onReady(function () {
|
||||||
|
sframeChan.query("EV_LOADING_ERROR", "DELETED");
|
||||||
|
});
|
||||||
|
waitFor.abort();
|
||||||
}
|
}
|
||||||
}).nThen(function () {
|
}).nThen(function () {
|
||||||
Object.keys(rtConfig).forEach(function (k) {
|
Object.keys(rtConfig).forEach(function (k) {
|
||||||
|
|||||||
@ -435,6 +435,15 @@ define([
|
|||||||
Feedback.init(feedback);
|
Feedback.init(feedback);
|
||||||
} catch (e) { Feedback.init(false); }
|
} catch (e) { Feedback.init(false); }
|
||||||
|
|
||||||
|
ctx.sframeChan.on('EV_LOADING_ERROR', function (err) {
|
||||||
|
if (err === 'DELETED') {
|
||||||
|
var msg = Messages.deletedError + '<br>' + Messages.errorRedirectToHome;
|
||||||
|
UI.errorLoadingScreen(msg, false, function () {
|
||||||
|
funcs.gotoURL('/drive/');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
ctx.sframeChan.on('EV_LOGOUT', function () {
|
ctx.sframeChan.on('EV_LOGOUT', function () {
|
||||||
$(window).on('keyup', function (e) {
|
$(window).on('keyup', function (e) {
|
||||||
if (e.keyCode === 27) {
|
if (e.keyCode === 27) {
|
||||||
|
|||||||
@ -227,4 +227,7 @@ define({
|
|||||||
// This is for sending data out of the iframe when we are in testing mode
|
// This is for sending data out of the iframe when we are in testing mode
|
||||||
// The exact protocol is defined in common/test.js
|
// The exact protocol is defined in common/test.js
|
||||||
'EV_TESTDATA': true,
|
'EV_TESTDATA': true,
|
||||||
|
|
||||||
|
// Critical error outside the iframe during loading screen
|
||||||
|
'EV_LOADING_ERROR': true,
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user