summaryrefslogtreecommitdiff
path: root/www/admin
diff options
context:
space:
mode:
Diffstat (limited to 'www/admin')
-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