? 412078-d5-user.patch
Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/CHANGELOG.txt,v
retrieving revision 1.66.2.50
diff -u -p -r1.66.2.50 CHANGELOG.txt
--- CHANGELOG.txt	6 Apr 2009 18:04:56 -0000	1.66.2.50
+++ CHANGELOG.txt	7 Apr 2009 15:38:10 -0000
@@ -1,6 +1,10 @@
 // $Id: CHANGELOG.txt,v 1.66.2.50 2009/04/06 18:04:56 agentken Exp $
 
 
+07-APR-2009
+
+-- #412078 by jolos. Fixes accidental deletion of user domains.
+
 06-APR-2009
 
 -- #418452 patch by nonsie. Implements domainupdate in Domain Conf.
Index: domain.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v
retrieving revision 1.40.2.26
diff -u -p -r1.40.2.26 domain.module
--- domain.module	20 Nov 2008 23:38:41 -0000	1.40.2.26
+++ domain.module	7 Apr 2009 15:38:14 -0000
@@ -320,6 +320,13 @@ function domain_user($op, &$edit, &$acco
     case 'validate':
       return array('domain_user' => $edit['domain_user']);
       break;
+    case 'insert':
+    case 'update':
+      // If our field element is missing, do nothing.
+      if (!isset($edit['domain_user'])) {
+        return;
+      }
+      break;
     case 'view':
       if (user_access('assign domain editors') && !empty($account->domain_user)) {
         $output = '<ul>';
Index: domain_user/domain_user.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_user/domain_user.module,v
retrieving revision 1.10.2.7
diff -u -p -r1.10.2.7 domain_user.module
--- domain_user/domain_user.module	28 Jul 2008 15:46:57 -0000	1.10.2.7
+++ domain_user/domain_user.module	7 Apr 2009 15:38:14 -0000
@@ -248,6 +248,10 @@ function domain_user_user($op, &$edit, &
       break;
     case 'insert':
     case 'update':
+      // If we did not come from our expected form, do nothing.
+      if (!isset($edit['domain_create_user'])) {
+        return;
+      }
       if (!empty($edit['domain_create_user']) && user_access('create personal domain', $account)) {
         $user_root = variable_get('domain_user_root', variable_get('domain_root', ''));
         $name = domain_user_strip_chars($account->name);
