Disable ldap/directory config/2fa in demo mode

This commit is contained in:
Girish Ramakrishnan
2020-07-22 16:18:22 -07:00
parent 23c4550430
commit 4086f2671d
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -499,6 +499,8 @@ function setExternalLdapConfig(externalLdapConfig, callback) {
assert.strictEqual(typeof externalLdapConfig, 'object');
assert.strictEqual(typeof callback, 'function');
if (settings.isDemo()) return callback(new BoxError(BoxError.BAD_FIELD, 'Not allowed in demo mode'));
getExternalLdapConfig(function (error, currentConfig) {
if (error) return callback(error);
@@ -597,6 +599,8 @@ function setDirectoryConfig(directoryConfig, callback) {
assert.strictEqual(typeof directoryConfig, 'object');
assert.strictEqual(typeof callback, 'function');
if (settings.isDemo()) return callback(new BoxError(BoxError.BAD_FIELD, 'Not allowed in demo mode'));
settingsdb.set(exports.DIRECTORY_CONFIG_KEY, JSON.stringify(directoryConfig), function (error) {
if (error) return callback(error);