steffen: server/kolab-webadmin/kolab-webadmin/www/admin/user user.php, 1.62.2.1, 1.62.2.2

cvs at intevation.de cvs at intevation.de
Sun Sep 18 00:30:15 CEST 2005


Author: steffen

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

Modified Files:
      Tag: kolab_2_0_branch
	user.php 
Log Message:
Backport of fix for Issue848 (dist list problem when deleting users)

Index: user.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user/user.php,v
retrieving revision 1.62.2.1
retrieving revision 1.62.2.2
diff -u -d -r1.62.2.1 -r1.62.2.2
--- user.php	29 Aug 2005 21:28:50 -0000	1.62.2.1
+++ user.php	17 Sep 2005 22:30:13 -0000	1.62.2.2
@@ -744,12 +744,20 @@
    // Check for distribution lists with only this user as member
    $ldap->search( $_SESSION['base_dn'], 
 				  '(&(objectClass=kolabGroupOfNames)(member='.$ldap->escape($dn).'))',
-				  array( 'dn', 'cn', 'member' ) );
+				  array( 'dn', 'cn', 'mail', 'member' ) );
    $distlists = $ldap->getEntries();
    foreach( $distlists as $distlist ) {
+	 $dlmail = $distlist['mail'][0];
+	 if( !$dlmail ) $dlmail = $distlist['cn'][0]; # Compatibility with old stuff
 	 if( $distlist['member']['count'] == 1 ) {
-	   $dlcn = $distlist['cn'][0];
-	   $errors[] = _("Account could not be deleted, distribution list '$dlcn' depends on it.");
+	   $errors[] = _("Account could not be deleted, distribution list '$dlmail' depends on it.");
+	 } else {
+	   if( ldap_mod_del( $ldap->connection, $distlist['dn'], array('member' => $dn ) ) ) {
+		 $messages[] = _("Account removed from distribution list '$dlmail'.");
+	   } else {
+		 $errors[] = _("Failure to remove account from distribution list '$dlmail', account will not be deleted.");
+		 break;
+	   }
 	 }
    }
 





More information about the commits mailing list