Disable ldap/directory config/2fa in demo mode
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user