Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 69eb6d9

Browse files
committed
More docs clean-up
1 parent 622b748 commit 69eb6d9

File tree

2 files changed

+5
-26
lines changed

2 files changed

+5
-26
lines changed

docs/examples.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ with ldapjs.
1515
///--- Shared handlers
1616

1717
function authorize(req, res, next) {
18-
if (!req.connection.ldap.bindDN.equals('cn=root'))
18+
/* Any user may search after bind, only cn=root has full power */
19+
var isSearch = (req instanceof ldap.SearchRequest);
20+
if (!req.connection.ldap.bindDN.equals('cn=root') && !isSearch)
1921
return next(new ldap.InsufficientAccessRightsError());
2022

2123
return next();
@@ -54,10 +56,10 @@ with ldapjs.
5456
if (!db[dn])
5557
return next(new ldap.NoSuchObjectError(dn));
5658

57-
if (!dn[dn].userpassword)
59+
if (!db[dn].userpassword)
5860
return next(new ldap.NoSuchAttributeError('userPassword'));
5961

60-
if (db[dn].userpassword !== req.credentials)
62+
if (db[dn].userpassword.indexOf(req.credentials) === -1)
6163
return next(new ldap.InvalidCredentialsError());
6264

6365
res.end();

docs/persistent_search.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)