[bin] backup.py: remove Data.fs.old before packing the ZODB to avoid disk space problems; [checkldap] added a param to define the scope of the LDAP query (base, onelevel or subtree); [shared] xml_parser: convert nbsp entity to the equivalent utf-8 char.

This commit is contained in:
Gaetan Delannay 2013-09-05 10:42:19 +02:00
parent 528cca9aa0
commit 1be7d9f0ab
8 changed files with 83 additions and 22 deletions

View file

@ -369,15 +369,22 @@ class User(Model):
# ------------------------------------------------------------------------------
class LdapConfig:
'''Parameters for authenticating users to an external LDAP.'''
server = '' # Name of the LDAP server
port = None # Port for this server.
# Login and password of the technical power user that the Appy application
# will use to connect to the LDAP.
adminLogin = ''
adminPassword = ''
# LDAP attribute to use as login for authenticating users.
loginAttribute = 'dn' # Can also be "mail", "sAMAccountName", "cn"
baseDn = '' # Base distinguished name where to find users in the LDAP.
def __init__(self):
self.server = '' # Name of the LDAP server
self.port = None # Port for this server.
# Login and password of the technical power user that the Appy
# application will use to connect to the LDAP.
self.adminLogin = ''
self.adminPassword = ''
# LDAP attribute to use as login for authenticating users.
self.loginAttribute = 'dn' # Can also be "mail", "sAMAccountName", "cn"
self.baseDn = '' # Base distinguished name where to find users.
def getServerUri(self):
'''Returns the complete URI for accessing the LDAP, ie
"ldap://some.ldap.server:389".'''
port = self.port or 389
return 'ldap://%s:%d' % (self.server, port)
# ------------------------------------------------------------------------------
class Config: