diff --git a/customize.dist/application_config.js b/customize.dist/application_config.js index d609c487b..e0fcd2bf9 100644 --- a/customize.dist/application_config.js +++ b/customize.dist/application_config.js @@ -20,7 +20,7 @@ define([ // To inform users of the support ticket panel which languages your admins speak: //AppConfig.supportLanguages = [ 'en', 'fr' ]; - AppConfig.availablePadTypes = ['drive', 'teams', 'file', 'contacts', 'convert'].concat(ApiConfig.availableApps) + AppConfig.availablePadTypes = ['drive', 'teams', 'file', 'contacts', 'convert'].concat(ApiConfig.availableApps); return AppConfig; }); diff --git a/lib/commands/admin-rpc.js b/lib/commands/admin-rpc.js index 6f15d63e1..080073caf 100644 --- a/lib/commands/admin-rpc.js +++ b/lib/commands/admin-rpc.js @@ -726,8 +726,7 @@ var archivePinLog = function (Env, Server, cb, data) { var archiveBlock = function (Env, Server, cb, data) { var args = Array.isArray(data) && data[1]; - if (!args) { - return void cb("INVALID_ARGS"); } + if (!args) { return void cb("INVALID_ARGS"); } var key = args.key; var reason = args.reason; if (!isValidKey(key)) { return void cb("EINVAL"); } @@ -749,8 +748,7 @@ var archiveBlock = function (Env, Server, cb, data) { var restoreArchivedBlock = function (Env, Server, cb, data) { var args = Array.isArray(data) && data[1]; - if (!args) { - return void cb("INVALID_ARGS"); } + if (!args) { return void cb("INVALID_ARGS"); } var key = args.key; var reason = args.reason; if (!isValidKey(key)) { return void cb("EINVAL"); } @@ -1109,8 +1107,7 @@ Admin.addFirstAdmin = function (Env, data, cb) { if (!Env.installToken) { return void cb('EINVAL'); } var token = data.token; if (!token || !data.edPublic) { return void cb('MISSING_ARGS'); } - if (token.length !== 64 || data.edPublic.length !== 44) { console.log('here21') - return void cb('INVALID_ARGS'); } + if (token.length !== 64 || data.edPublic.length !== 44) { return void cb('INVALID_ARGS'); } if (token !== Env.installToken) { return void cb('FORBIDDEN'); } if (Array.isArray(Env.admins) && Env.admins.length) { return void cb('EEXISTS'); } diff --git a/lib/decrees.js b/lib/decrees.js index d83bcda7d..c2e29d6f3 100644 --- a/lib/decrees.js +++ b/lib/decrees.js @@ -167,10 +167,6 @@ var isInteger = function (n) { }; var args_isString = function (args) { -console.log('args', args) - console.log(typeof args) - console.log(Array.isArray(args)) - console.log(isString(args[0])) return !(!Array.isArray(args) || !isString(args[0])); }; var args_isInteger = function (args) { @@ -315,21 +311,19 @@ commands.SET_SUPPORT_KEYS = function (Env, args) { (Core.isValidPublicKey(curvePublic) || !curvePublic) && typeof(edPublic) === "string" && (Core.isValidPublicKey(edPublic) || !edPublic); - if (!validated) { - throw new Error('INVALID_ARGS'); } - if (Env.supportMailboxKey === curvePublic && Env.supportPinKey === edPublic) { return false; } - Env.supportMailboxKey = curvePublic; - Env.supportPinKey = edPublic; - return true; - }; + if (!validated) { throw new Error('INVALID_ARGS'); } + if (Env.supportMailboxKey === curvePublic && Env.supportPinKey === edPublic) { return false; } + Env.supportMailboxKey = curvePublic; + Env.supportPinKey = edPublic; + return true; + }; // CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_INSTANCE_PURPOSE', ["development"]]], console.log) commands.SET_INSTANCE_PURPOSE = makeGenericSetter('instancePurpose', args_isString); var makeTranslation = function (attr) { return function (Env, args) { - if (!Array.isArray(args)) { - throw new Error("INVALID_ARGS"); } + if (!Array.isArray(args)) { throw new Error("INVALID_ARGS"); } var value = args[0]; var state = Env[attr]; @@ -380,7 +374,7 @@ var args_isMaintenance = function (args) { // whenever that happens we can relax validation a bit to support more formats var makeBroadcastSetter = function (attr, validation) { return function (Env, args) { - if ((validation && !validation(args)) && !args_isString(args)) { + if ((validation && !validation(args)) &&!args_isString(args)) { throw new Error('INVALID_ARGS'); } var str = args[0]; @@ -490,11 +484,8 @@ commands.SET_BEARER_SECRET = function (Env, args) { // [, , ,