summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--www/admin/user/user.php.in20
2 files changed, 13 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index c989bbb..df88dc5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* php/admin/include/menu.php: Reverted extra spaces after the main
menu entries added on 2008-02-16, because this does not look good.
+ * www/admin/user/user.php.in: Fix kolab/issue2329 (Domain Maintainer
+ cannot create users)
+
2008-02-23 Richard Bos <richard@radoeka.nl>
* Makefile.am, php/admin/include/menu.php: move the url of the services
diff --git a/www/admin/user/user.php.in b/www/admin/user/user.php.in
index 70f72e8..a950a88 100644
--- a/www/admin/user/user.php.in
+++ b/www/admin/user/user.php.in
@@ -66,23 +66,23 @@ function inMaintainerDomain($dn) {
if ($auth->group() == 'user') {
return false;
}
-
- // we have a domain maintainer. Get his domains
- $domains = $ldap->domainsForMaintainerDn($auth->dn());
- // retrieve the mail for the current dn
- $mail = $ldap->mailForDn($dn);
+ // we have a domain maintainer.
- $ok = false;
+ // Before creating new users the DN is empty
+ if (!$dn) {
+ return true;
+ }
- // Check if the mail is within that domain
+ // Check if the user's mail is within the domain maintainer's domains
+ $mail = $ldap->mailForDn($dn);
+ $domains = $ldap->domainsForMaintainerDn($auth->dn());
foreach( $domains as $domain ) {
if( endsWith( $mail, '@'.$domain ) ) {
- $ok = true;
+ return true;
}
}
-
- return true;
+ return false;
}
// Check that a uid is unique