summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-11-21 16:00:37 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-11-21 16:00:37 +0100
commit7a6d55c34d58f5901d6e3b27167574a97160c0fd (patch)
tree0f8eb0bbf23ecda9e250f96e82b972964c231429
parent0c105fd4f0a1b014e458fb3c09091f1defe72008 (diff)
parent7a0721806f4326b5c28a94e83df88ed3455e3792 (diff)
downloadpykolab-7a6d55c34d58f5901d6e3b27167574a97160c0fd.tar.gz
Merge branch 'master' of ssh://git.kolabsys.com/git/pykolab
-rw-r--r--pykolab/setup/setup_ldap.py9
-rw-r--r--pykolab/wap_client/__init__.py12
-rw-r--r--pykolab/wap_client/connect.py9
3 files changed, 16 insertions, 14 deletions
diff --git a/pykolab/setup/setup_ldap.py b/pykolab/setup/setup_ldap.py
index 9944403..2681160 100644
--- a/pykolab/setup/setup_ldap.py
+++ b/pykolab/setup/setup_ldap.py
@@ -584,6 +584,10 @@ ServerAdminPwd = %(admin_pass)s
'localhost.localdomain',
'localhost'
]
+
+ # De-duplicate attribute values before attempting to insert the object (#2205)
+ attrs['associateddomain'] = list(set(attrs['associateddomain']))
+
attrs['aci'] = '(targetattr = "*") (version 3.0;acl "Read Access for %(domain)s Users";allow (read,compare,search)(userdn = "ldap:///%(rootdn)s??sub?(objectclass=*)");)' % (_input)
# Add inetdomainbasedn in case the configured root dn is not the same as the
@@ -647,9 +651,10 @@ ServerAdminPwd = %(admin_pass)s
aci = []
if schema_error:
- aci.append('(targetattr = "homePhone || preferredDeliveryMethod || jpegPhoto || postalAddress || carLicense || userPassword || mobile || displayName || description || labeledURI || homePostalAddress || postOfficeBox || registeredAddress || postalCode || photo || title || street || pager || o || l || initials || telephoneNumber || preferredLanguage || facsimileTelephoneNumber") (version 3.0;acl "Enable self write for common attributes";allow (read,compare,search,write)(userdn = "ldap:///self");)')
+ aci.append('(targetattr = "carLicense || description || displayName || facsimileTelephoneNumber || homePhone || homePostalAddress || initials || jpegPhoto || l || labeledURI || mobile || o || pager || photo || postOfficeBox || postalAddress || postalCode || preferredDeliveryMethod || preferredLanguage || registeredAddress || roomNumber || secretary || seeAlso || st || street || telephoneNumber || telexNumber || title || userCertificate || userPassword || userSMIMECertificate || x500UniqueIdentifier") (version 3.0; acl "Enable self write for common attributes"; allow (read,compare,search,write)(userdn = "ldap:///self");)')
else:
- aci.append('(targetattr = "homePhone || preferredDeliveryMethod || jpegPhoto || postalAddress || carLicense || userPassword || mobile || displayName || kolabDelegate || description || labeledURI || homePostalAddress || postOfficeBox || registeredAddress || postalCode || photo || title || street || kolabInvitationPolicy || pager || o || l || initials || kolabAllowSMTPSender || telephoneNumber || preferredLanguage || facsimileTelephoneNumber") (version 3.0;acl "Enable self write for common attributes";allow (read,compare,search,write)(userdn = "ldap:///self");)')
+ aci.append('(targetattr = "carLicense || description || displayName || facsimileTelephoneNumber || homePhone || homePostalAddress || initials || jpegPhoto || l || labeledURI || mobile || o || pager || photo || postOfficeBox || postalAddress || postalCode || preferredDeliveryMethod || preferredLanguage || registeredAddress || roomNumber || secretary || seeAlso || st || street || telephoneNumber || telexNumber || title || userCertificate || userPassword || userSMIMECertificate || x500UniqueIdentifier || kolabDelegate || kolabInvitationPolicy || kolabAllowSMTPSender") (version 3.0; acl "Enable self write for common attributes"; allow (read,compare,search,write)(userdn = "ldap:///self");)')
+
aci.append('(targetattr = "*") (version 3.0;acl "Directory Administrators Group";allow (all)(groupdn = "ldap:///cn=Directory Administrators,%(rootdn)s" or roledn = "ldap:///cn=kolab-admin,%(rootdn)s");)' % (_input))
aci.append('(targetattr="*")(version 3.0; acl "Configuration Administrators Group"; allow (all) groupdn="ldap:///cn=Configuration Administrators,ou=Groups,ou=TopologyManagement,o=NetscapeRoot";)')
diff --git a/pykolab/wap_client/__init__.py b/pykolab/wap_client/__init__.py
index 1dd6aab..674673c 100644
--- a/pykolab/wap_client/__init__.py
+++ b/pykolab/wap_client/__init__.py
@@ -19,6 +19,7 @@ if not hasattr(conf, 'defaults'):
API_HOSTNAME = "localhost"
API_SCHEME = "http"
API_PORT = 80
+API_SSL = False
API_BASE = "/kolab-webadmin/api/"
kolab_wap_url = conf.get('kolab_wap', 'api_url')
@@ -28,6 +29,10 @@ if not kolab_wap_url == None:
else:
result = None
+if hasattr(result, 'scheme') and result.scheme == 'https':
+ API_SSL = True
+ API_PORT = 443
+
if hasattr(result, 'hostname'):
API_HOSTNAME = result.hostname
@@ -41,8 +46,6 @@ session_id = None
conn = None
-from connect import connect
-
def authenticate(username=None, password=None, domain=None):
global session_id
@@ -71,7 +74,10 @@ def connect():
global conn
if conn == None:
- conn = httplib.HTTPConnection(API_HOSTNAME, API_PORT)
+ if API_SSL:
+ conn = httplib.HTTPSConnection(API_HOSTNAME, API_PORT)
+ else:
+ conn = httplib.HTTPConnection(API_HOSTNAME, API_PORT)
conn.connect()
return conn
diff --git a/pykolab/wap_client/connect.py b/pykolab/wap_client/connect.py
deleted file mode 100644
index 1c4c7ad..0000000
--- a/pykolab/wap_client/connect.py
+++ /dev/null
@@ -1,9 +0,0 @@
-def connect():
- global conn
-
- if conn == None:
- conn = httplib.HTTPConnection(API_HOSTNAME, API_PORT)
- conn.connect()
-
- return conn
-