summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorThomas Arendsen Hein <thomas@intevation.de>2008-03-04 18:12:03 (GMT)
committerThomas Arendsen Hein <thomas@intevation.de>2008-03-04 18:12:03 (GMT)
commit603f7e20e226a852bd98aa6013bfa5a3868998d5 (patch)
treed321bc873f332cce5a76b8099cbb246b68d0ce7e /www
parent701e86782ff0c1324d97df3572c59364c6883d2d (diff)
downloadkolab-webadmin-603f7e20e226a852bd98aa6013bfa5a3868998d5.tar.gz
Fix kolab/issue2329 (Domain Maintainer cannot create users)
Diffstat (limited to 'www')
-rw-r--r--www/admin/user/user.php.in20
1 files changed, 10 insertions, 10 deletions
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