thomas: server/kolab-webadmin/kolab-webadmin/www/admin/user user.php.in, 1.27, 1.28

cvs at kolab.org cvs at kolab.org
Tue Mar 4 19:12:05 CET 2008


Author: thomas

Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user
In directory doto:/tmp/cvs-serv10920/kolab-webadmin/kolab-webadmin/www/admin/user

Modified Files:
	user.php.in 
Log Message:
Fix kolab/issue2329 (Domain Maintainer cannot create users)


Index: user.php.in
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user/user.php.in,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- user.php.in	3 Dec 2007 11:27:19 -0000	1.27
+++ user.php.in	4 Mar 2008 18:12:03 -0000	1.28
@@ -66,23 +66,23 @@
   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





More information about the commits mailing list