mirror of
https://git.unistra.fr/aius/root/ldap-overleaf-sl.git
synced 2025-05-04 11:45:26 +02:00
replace "replaceAll" function
This commit is contained in:
parent
f25cb05c8b
commit
4617bf690b
1 changed files with 6 additions and 3 deletions
|
@ -275,8 +275,11 @@ const AuthenticationManager = {
|
|||
const ldap_reader_pass = process.env.LDAP_BIND_PW
|
||||
const ldap_base = process.env.LDAP_BASE
|
||||
var uid = query.email
|
||||
const filterstr = process.env.LDAP_GROUP_FILTER.replaceAll('%u', ldapEscape.filter`${uid}`)
|
||||
const userDn = ldapEscape.filter`uid=${uid}` + ',' + ldap_bd;
|
||||
const searchTerm = "%u"
|
||||
const replacer = new RegExp(searchTerm, "g")
|
||||
const filterstr = process.env.LDAP_GROUP_FILTER.replace(replacer, ldapEscape.filter`${uid}`) //replace all appearances
|
||||
console.log("filterstr:" + filterstr)
|
||||
var userDn = "" //ldapEscape.filter`uid=${uid}` + ',' + ldap_bd;
|
||||
var mail = ""
|
||||
var firstname = ""
|
||||
var lastname = ""
|
||||
|
@ -315,7 +318,7 @@ const AuthenticationManager = {
|
|||
// if admin filter is set - only set admin for user in ldap group
|
||||
// does not matter - admin is deactivated: managed through ldap
|
||||
if (process.env.LDAP_ADMIN_GROUP_FILTER) {
|
||||
const adminfilter = process.env.LDAP_ADMIN_GROUP_FILTER.replaceAll('%u', ldapEscape.filter`${uid}`)
|
||||
const adminfilter = process.env.LDAP_ADMIN_GROUP_FILTER.replace(replacer, ldapEscape.filter`${uid}`)
|
||||
adminEntry = await client.search(ldap_base, {
|
||||
scope: 'sub',
|
||||
filter: adminfilter,
|
||||
|
|
Loading…
Add table
Reference in a new issue