Code

When removing no longer reacting gosa-si server from the known_server
authorwolffc <wolffc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Sep 2010 14:39:43 +0000 (14:39 +0000)
committerwolffc <wolffc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 16 Sep 2010 14:39:43 +0000 (14:39 +0000)
database, remove clients registered with them from the foreign_clients
database as well.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@19722 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-si/gosa-si-server

index 091402f963c0916a547b2f829aa5f39f9c54eb1d..a2a49db1e6e4ded0161e8c8f9f0ea4a60ac3c7ac 100755 (executable)
@@ -953,6 +953,10 @@ sub send_msg_to_target {
             $sql_statement = "DELETE FROM known_server WHERE hostname='$address'";
             $res = $known_server_db->del_dbentry($sql_statement);
             daemon_log("$session_id WARNING: failed 2x to send a message to host '$address', delete host from known_server", 3);
+
+            # Remove the registered clients of the server as well
+           $sql_statement = "DELETE FROM foreign_clients WHERE regserver='$address'";
+           $res = $foreign_clients_db->del_dbentry($sql_statement);
         } 
         else { 
             $sql_statement = "UPDATE known_server SET status='$new_status', timestamp='$timestamp' WHERE hostname='$address'";