Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gdd-sigma-poc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume WANG
gdd-sigma-poc
Commits
63456b5c
Commit
63456b5c
authored
7 years ago
by
Quentin CHEVALIER
Browse files
Options
Downloads
Patches
Plain Diff
fix ES5 et config
parent
aa37fa10
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ldap/ldap_data.js
+6
-6
6 additions, 6 deletions
src/ldap/ldap_data.js
with
6 additions
and
6 deletions
src/ldap/ldap_data.js
+
6
−
6
View file @
63456b5c
...
...
@@ -2,13 +2,13 @@
* @file Ce fichier gère les requêtes LDAP de type données ; liste des groupe d'un individu, liste des membres d'un groupe... A ne pas confondre avec ldap_auth qui lui gère l'authentification.
* @author hawkspar
*/
import
{
ldapescape
}
from
'
ldap-escape
'
;
import
ldap
from
'
ldapj
s
'
;
import
fs
from
'
fs
'
;
var
ldap
=
require
(
'
ldapjs
'
)
;
var
fs
=
require
(
'
f
s
'
)
;
var
ldapEscape
=
require
(
'
ldap-escape
'
)
;
var
ensureLoggedin
=
require
(
'
connect-ensure-login
'
).
ensureLoggedIn
;
let
config
=
JSON
.
parse
(
fs
.
readFileSync
(
'
config.json
'
,
'
utf8
'
));
let
config
=
JSON
.
parse
(
fs
.
readFileSync
(
'
../../
config.json
'
,
'
utf8
'
));
var
client
=
ldap
.
createClient
({
url
:
config
.
ldap
.
server
,
timeout
:
10000
,
idleTimeout
:
10000
});
...
...
@@ -21,7 +21,7 @@ function listGroups(uid) {
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
groupsList
=
[];
client
.
search
(
config
.
ldap_data_gl
.
searchBase
,
{
scope
:
"
sub
"
,
attributes
:
"
uid
"
,
filter
:
ldap
e
scape
.
filter
(
config
.
ldap_data_gl
.
searchFilter
,
{
id
:
uid
})},
function
(
err
,
res
)
{
client
.
search
(
config
.
ldap_data_gl
.
searchBase
,
{
scope
:
"
sub
"
,
attributes
:
"
uid
"
,
filter
:
ldap
E
scape
.
filter
(
config
.
ldap_data_gl
.
searchFilter
,
{
id
:
uid
})},
function
(
err
,
res
)
{
if
(
err
)
{
reject
(
err
);
}
else
{
...
...
@@ -41,7 +41,7 @@ function listMembers(gid) {
return
new
Promise
(
function
(
resolve
,
reject
)
{
var
membersList
=
[];
client
.
search
(
config
.
ldap_data_ml
.
searchBase
,
{
scope
:
"
sub
"
,
attributes
:
"
uid
"
,
filter
:
ldap
e
scape
.
filter
(
config
.
ldap_data_ml
.
searchFilter
,
{
id
:
gid
})},
function
(
err
,
res
)
{
client
.
search
(
config
.
ldap_data_ml
.
searchBase
,
{
scope
:
"
sub
"
,
attributes
:
"
uid
"
,
filter
:
ldap
E
scape
.
filter
(
config
.
ldap_data_ml
.
searchFilter
,
{
id
:
gid
})},
function
(
err
,
res
)
{
if
(
err
)
{
reject
(
err
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment