steffen: server/kolab-webadmin/kolab-webadmin/www/admin/service index.php, 1.23, 1.24
cvs at intevation.de
cvs at intevation.de
Wed Jul 6 00:51:42 CEST 2005
Author: steffen
Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/service
In directory doto:/tmp/cvs-serv28201/kolab-webadmin/www/admin/service
Modified Files:
index.php
Log Message:
handle deletion of domains correctly. (but what about all the accounts in the deleted domain?)
Index: index.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/service/index.php,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- index.php 5 Jul 2005 10:31:51 -0000 1.23
+++ index.php 5 Jul 2005 22:51:40 -0000 1.24
@@ -208,16 +208,25 @@
// Delete domain
if( $_REQUEST['deletedestination'] ) {
extract_ldap_values();
+ debug_var_dump($_REQUEST['adestination']);
$key = array_search( trim($_REQUEST['adestination']),$postfixmydestination);
if( $key !== false ) {
unset( $postfixmydestination[ $key ] );
}
+ $postfixmydestination = array_values( $postfixmydestination );
+ debug_var_dump($postfixmydestination);
$attrs = array();
$attrs['postfix-mydestination'] = $postfixmydestination;
if( !($result = ldap_modify($ldap->connection, "k=kolab,".$_SESSION['base_dn'], $attrs)) ) {
- $errors[] = _("LDAP Error: failed to modify kolab configuration object: ")
+ $errors[] = _("LDAP Error: Failed to modify kolab configuration object: ")
.ldap_error($ldap->connection);
}
+ $domain_obj_dn = 'cn='.$ldap->escape(trim($_REQUEST['adestination'])).',cn=domains,cn=internal,'.$_SESSION['base_dn'];
+ debug("Trying to delete $domain_obj_dn");
+ if( !$errors && $ldap->read($domain_obj_dn) && !ldap_delete($ldap->connection, $domain_obj_dn ) ) {
+ $errors[] = _("LDAP Error: Failed to delete domain object $domain_obj_dn: ")
+ .ldap_error($ldap->connection);
+ }
}
// Add domain
if( $_REQUEST['adddestination'] ) {
@@ -239,6 +248,7 @@
if( $key !== false ) {
unset( $kolabhost[ $key ] );
}
+ $kolabhost = array_values( $kolabhost );
$attrs = array();
$attrs['kolabhost'] = $kolabhost;
if( !($result = ldap_modify($ldap->connection, "k=kolab,".$_SESSION['base_dn'], $attrs)) ) {
More information about the commits
mailing list