summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2014-03-31 15:18:51 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2014-03-31 15:18:51 (GMT)
commit18ab4e9026c3e4f05687e393aa2a00e3176cf2ee (patch)
treed6766757cf5785c2462c5bbf0cd234520a890d78
parenteca9062e2f70e27e4679cfc74b2fb328a248fdd7 (diff)
downloadpfwbged.ocrloader-18ab4e9026c3e4f05687e393aa2a00e3176cf2ee.zip
pfwbged.ocrloader-18ab4e9026c3e4f05687e393aa2a00e3176cf2ee.tar.gz
pfwbged.ocrloader-18ab4e9026c3e4f05687e393aa2a00e3176cf2ee.tar.bz2
restrict ldap search scope
-rw-r--r--generate-ldap-users.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/generate-ldap-users.py b/generate-ldap-users.py
index 548a7bf..f9c3b38 100644
--- a/generate-ldap-users.py
+++ b/generate-ldap-users.py
@@ -24,7 +24,8 @@ ldap_conn.simple_bind_s(cfg.get('general', 'bind_dn'), options.bindpw)
users = []
-for entry in ldap_conn.search_s("dc=win,dc=info,dc=pcf", ldap.SCOPE_SUBTREE, "objectclass=user"):
+for entry in ldap_conn.search_s("ou=ouGED,ou=ouPCF,ou=ouUsers,dc=win,dc=info,dc=pcf",
+ ldap.SCOPE_SUBTREE, "objectclass=user"):
if not entry[0]:
continue
if not entry[1].get('profilePath'):
@@ -46,6 +47,7 @@ for user in users:
'mail': user.get('mail'),
}
vars.update(dict(cfg.items('variables')))
+ print username
print >> fd, '''[ged-gen-%(mail)s]
default_type = dmsdocument
default_directory = Members/%(username)s