Prevent users from creating a pad when visiting a deleted profile (read-only mode)
This commit is contained in:
@@ -650,6 +650,12 @@ define([
|
||||
Cryptpad.getMetadata(waitFor(function (err, m) {
|
||||
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 () {
|
||||
Object.keys(rtConfig).forEach(function (k) {
|
||||
|
||||
@@ -435,6 +435,15 @@ define([
|
||||
Feedback.init(feedback);
|
||||
} 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 () {
|
||||
$(window).on('keyup', function (e) {
|
||||
if (e.keyCode === 27) {
|
||||
|
||||
@@ -227,4 +227,7 @@ define({
|
||||
// This is for sending data out of the iframe when we are in testing mode
|
||||
// The exact protocol is defined in common/test.js
|
||||
'EV_TESTDATA': true,
|
||||
|
||||
// Critical error outside the iframe during loading screen
|
||||
'EV_LOADING_ERROR': true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user