Skip to content

Commit

Permalink
Removed everything non-essentual to mldap2 to make an "mldap-2.0"
Browse files Browse the repository at this point in the history
release.
  • Loading branch information
meyersh committed Jan 28, 2014
1 parent affc084 commit 4d8e76c
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 3,225 deletions.
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include README.md
recursive-include mldap/
recursive-include mldap2/
recursive-exclude * *.py[co]
recursive-exclude * *.py[co]
45 changes: 25 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# MLDAP Doc

`mldap` is a thin wrapper around the python-ldap library written to operate
against our 2003-based Active Directory.

Specifically, it is used to programmatically create, delete, modify, and
query active directory via the LDAP protocol.
`mldap2` is a thin wrapper around the python-ldap library written to
operate against our 2003-based Active Directory.Specifically, it is
used to programmatically create, delete, modify, and query active
directory via the LDAP protocol by lifting the programmer away from
the context of working with LDAP and filters to working with user
attributes and groups.

# GOTCHA'S

Expand All @@ -19,27 +20,31 @@ adding `TLS_REQCERT allow` was a satisfactory work-around.

# INSTALLATION

Drop mldap.py into your python include path and include it. You will need
to create a configuration file for your network (default location is in
/etc/ldap.creds).
Drop mldap.py into your python include path and include it.

credsfile example:
```
[LDAP]
SERVER=ldap://my.server.url
[email protected]
PASSWORD=some_base64_encoded_str=
BASE=dc=my,dc=domain,dc=url
DOMAIN=my.domain.url
```

EXAMPLES
========
# EXAMPLES

## Basic connection, verify a user account.
```python
>>> include mldap
>>> ad = mldap.mldap()
>>> ad = mldap2.connect({'LDAP_USERNAME': 'your-ad-user@your-domain',
... 'LDAP_PASSWORD': 'xxxxx',
... 'LDAP_BASE': 'dc=YOUR,dc=DOMAIN'})
>>> ad.exists('some-username')
True
```

## Operate on a series of accounts (for instance, to change mail domains.)
```python
ad = mldap2.connect('''creds''')
users = ad.getusers_by_filter('mail', '*@olddomain.com')
for user in users:
user.mail.replace('@olddomain.com', '@newdomain.com') # user.mail is just a string.
user.commit() # updates any modified fields.
```

## Help!
```
>>> help(ad)
```
9 changes: 0 additions & 9 deletions mldap.rst

This file was deleted.

Loading

0 comments on commit 4d8e76c

Please sign in to comment.