fake ldap transactions

Copied from: https://code.vpac.org/gitorious/placard/django-placard/merge_requests/4

Hello,

This implements fake transactions with LDAP - so that if an error occurs, changes to LDAP can be "rolled back" leaving a consistent database. As in no changes are made until `commit()` is called. Then if, say action 3 fails, actions 2 and 1 will be rolled back in that order.

Example usage:

    import client 
    import placard.tldap.transaction as t
    
    c = client.LDAPClient() 
    with t.commit_on_success(): 
    c.add_user(uid="tux", givenName="Tux",sn="Torvalds",telephoneNumber="000",mail="tux@example.org",o="Linux Rules",userPassword="silly")

`t.commit_on_success()` can also be used as a decorator (not tested), and there is a middleware layer for Django (also not tested).

The guts of the operation is placard.tldap.backend which is basically a wrapper for the ldap module.

For this to work properly (especially for the decorators and middleware), I had to make the LDAP connection global; similar to django. This is done in the placard.tldap class. I also changed the preferred LDAP config syntax, but the old syntax is still supported - and I don't see any need to change just yet.

Brian May