don't allow editing if pad type is wrong
This commit is contained in:
@@ -430,6 +430,7 @@ define([
|
||||
});
|
||||
|
||||
proxy.version = 1;
|
||||
proxy.type = 'poll';
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -475,6 +476,16 @@ var ready = function (info, userid, readOnly) {
|
||||
var userDoc = JSON.stringify(proxy);
|
||||
if (userDoc === "" || userDoc === "{}") { isNew = true; }
|
||||
|
||||
if (!isNew && typeof(proxy.type) !== 'undefined' && proxy.type !== 'poll') {
|
||||
var errorText = Messages.typeError;
|
||||
Cryptpad.errorLoadingScreen(errorText);
|
||||
throw new Error(errorText);
|
||||
}
|
||||
|
||||
if (typeof(proxy.type) === 'undefined') {
|
||||
proxy.type = 'poll';
|
||||
}
|
||||
|
||||
var uncommitted = APP.uncommitted = {};
|
||||
prepareProxy(proxy, copyObject(Render.Example));
|
||||
prepareProxy(uncommitted, copyObject(Render.Example));
|
||||
|
||||
Reference in New Issue
Block a user