Add locked flag to settings table
This commit is contained in:
@@ -35,6 +35,7 @@ exports = module.exports = {
|
||||
getPlatformConfig: getPlatformConfig,
|
||||
setPlatformConfig: setPlatformConfig,
|
||||
|
||||
get: get,
|
||||
getAll: getAll,
|
||||
|
||||
// booleans. if you add an entry here, be sure to fix getAll
|
||||
@@ -54,7 +55,7 @@ exports = module.exports = {
|
||||
CLOUDRON_NAME_KEY: 'cloudron_name',
|
||||
|
||||
// blobs
|
||||
CLOUDRON_AVATAR_KEY: 'cloudron_avatar', // not stored in db
|
||||
CLOUDRON_AVATAR_KEY: 'cloudron_avatar', // not stored in db but can be used for locked flag
|
||||
|
||||
on: on,
|
||||
removeListener: removeListener
|
||||
@@ -488,3 +489,15 @@ function getAll(callback) {
|
||||
callback(null, result);
|
||||
});
|
||||
}
|
||||
|
||||
function get(name, callback) {
|
||||
assert.strictEqual(typeof name, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
settingsdb.get(name, function (error, result) {
|
||||
if (error && error.reason === DatabaseError.NOT_FOUND) return callback(null, gDefaults[exports.PLATFORM_CONFIG_KEY]);
|
||||
if (error) return callback(new SettingsError(SettingsError.INTERNAL_ERROR, error));
|
||||
|
||||
callback(null, result);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user