docker.js and services.js: async'ify
This commit is contained in:
15
src/ldap.js
15
src/ldap.js
@@ -18,7 +18,7 @@ const addonConfigs = require('./addonconfigs.js'),
|
||||
ldap = require('ldapjs'),
|
||||
mail = require('./mail.js'),
|
||||
safe = require('safetydance'),
|
||||
services = require('./services.js'),
|
||||
settings = require('./settings.js'),
|
||||
users = require('./users.js');
|
||||
|
||||
var gServer = null;
|
||||
@@ -550,14 +550,13 @@ async function authenticateSftp(req, res, next) {
|
||||
res.end();
|
||||
}
|
||||
|
||||
function loadSftpConfig(req, res, next) {
|
||||
services.getServiceConfig('sftp', function (error, serviceConfig) {
|
||||
if (error) return next(new ldap.OperationsError(error.toString()));
|
||||
async function loadSftpConfig(req, res, next) {
|
||||
const [error, servicesConfig] = await settings.getServicesConfig();
|
||||
if (error) return next(new ldap.OperationsError(error.toString()));
|
||||
|
||||
req.requireAdmin = serviceConfig.requireAdmin;
|
||||
|
||||
next();
|
||||
});
|
||||
const sftpConfig = servicesConfig['sftp'] || {};
|
||||
req.requireAdmin = sftpConfig.requireAdmin;
|
||||
next();
|
||||
}
|
||||
|
||||
async function userSearchSftp(req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user