From 8bda0c05c046532014ae1b0772a3e4cb41586a17 Mon Sep 17 00:00:00 2001 From: "amit.kumar" Date: Thu, 15 Aug 2019 13:23:54 +0530 Subject: [PATCH 1/3] Clear old message by datetime, not by timestamp) --- server/services/sender-master.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/services/sender-master.js b/server/services/sender-master.js index db7c8b84..8ac5c06c 100644 --- a/server/services/sender-master.js +++ b/server/services/sender-master.js @@ -592,7 +592,7 @@ async function scheduleQueued() { const expiredCount = await knex('queued') .whereNotIn('send_configuration', sendConfigurationsIdsInProcessing) .where('type', type) - .where('created', '<', expirationThreshold.threshold) + .where('created', '<', new Date(expirationThreshold.threshold)) .del(); if (expiredCount) { @@ -731,4 +731,3 @@ async function init() { // noinspection JSIgnoredPromiseFromCall init(); - From 732a9e4d939163c77d3f446f0c3e6d44df867338 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 16 Aug 2019 13:00:27 +0200 Subject: [PATCH 2/3] LDAP edit users BUG fixed --- client/src/users/CUD.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/users/CUD.js b/client/src/users/CUD.js index 1db8b679..a6d47690 100644 --- a/client/src/users/CUD.js +++ b/client/src/users/CUD.js @@ -90,7 +90,7 @@ export default class CUD extends Component { } else if (usernameServerValidation && usernameServerValidation.exists) { state.setIn(['username', 'error'], t('theUserNameAlreadyExistsInTheSystem')); } else if (!usernameServerValidation) { - state.setIn(['email', 'error'], t('validationIsInProgress')); + state.setIn(['username', 'error'], t('validationIsInProgress')); } else { state.setIn(['username', 'error'], null); } From 2f9a75df9b47c4466c74cadaee3176ba50d10ec0 Mon Sep 17 00:00:00 2001 From: GuillaumeRemyCSI Date: Tue, 20 Aug 2019 10:00:51 +0200 Subject: [PATCH 3/3] Fixes the authMode name for passport-ldapjs and add a parameter for LDAP mailTag --- server/config/default.yaml | 2 ++ server/lib/passport.js | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/server/config/default.yaml b/server/config/default.yaml index 247d969e..d3d235fa 100644 --- a/server/config/default.yaml +++ b/server/config/default.yaml @@ -147,6 +147,8 @@ ldap: uidTag: username # nameTag identifies the attribute to be used for user's full name nameTag: username + # mailTag identifies the attribute to be used for user's email address + mailTag: mail passwordresetlink: newUserRole: master # Global namespace id diff --git a/server/lib/passport.js b/server/lib/passport.js index 52423d57..97976590 100644 --- a/server/lib/passport.js +++ b/server/lib/passport.js @@ -24,7 +24,7 @@ if (config.ldap.enabled) { if (!config.ldap.method || config.ldap.method === 'ldapjs') { try { LdapStrategy = require('passport-ldapjs').Strategy; // eslint-disable-line global-require - authMode = 'ldapjs'; + authMode = 'ldap'; log.info('LDAP', 'Found module "passport-ldapjs". It will be used for LDAP auth.'); ldapStrategyOpts = { @@ -34,7 +34,7 @@ if (config.ldap.enabled) { base: config.ldap.baseDN, search: { filter: config.ldap.filter, - attributes: [config.ldap.uidTag, config.ldap.nameTag, 'mail'], + attributes: [config.ldap.uidTag, config.ldap.nameTag, config.ldap.mailTag], scope: 'sub' }, uidTag: config.ldap.uidTag, @@ -58,7 +58,7 @@ if (config.ldap.enabled) { url: ldapProtocol + '://' + config.ldap.host + ':' + config.ldap.port, searchBase: config.ldap.baseDN, searchFilter: config.ldap.filter, - searchAttributes: [config.ldap.uidTag, config.ldap.nameTag, 'mail'], + searchAttributes: [config.ldap.uidTag, config.ldap.nameTag, config.ldap.mailTag], bindDN: config.ldap.bindUser, bindCredentials: config.ldap.bindPassword }, @@ -177,7 +177,7 @@ module.exports.restLogin = (req, res, next) => { }; if (LdapStrategy) { - log.info('Using LDAP auth (passport-' + authMode + ')'); + log.info('Using LDAP auth (passport-' + authMode === 'ldap' ? 'ldapjs' : authMode + ')'); module.exports.authMethod = 'ldap'; module.exports.isAuthMethodLocal = false;