Code

Prevent automatic remove of phpgwaccount when not in tabbed mode
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 Nov 2005 13:20:48 +0000 (13:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 29 Nov 2005 13:20:48 +0000 (13:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2132 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/connectivity/class_phpgwAccount.inc

index b4d8df5fa28c567bd006d06777ba3bad8c9807f7..aa38d18780fe450c18b1be3d5261e3922aa3011c 100644 (file)
@@ -61,22 +61,24 @@ class phpgwAccount extends plugin
 
   function remove_from_parent()
   {
-    /* Cancel if there's nothing to do here */
-    if (!$this->initially_was_account){
-      return;
+    if ($this->parent != NULL){
+      /* Cancel if there's nothing to do here */
+      if (!$this->initially_was_account){
+        return;
+      }
+
+      plugin::remove_from_parent();
+      $ldap= $this->config->get_ldap_link();
+
+      $ldap->cd($this->dn);
+      @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
+          $this->attributes, "Save");
+      $ldap->modify($this->attrs);
+      show_ldap_error($ldap->get_error());
+
+      /* Optionally execute a command after we're done */
+      $this->handle_post_events('remove');
     }
-    
-    plugin::remove_from_parent();
-    $ldap= $this->config->get_ldap_link();
-
-    $ldap->cd($this->dn);
-    @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,
-        $this->attributes, "Save");
-    $ldap->modify($this->attrs);
-    show_ldap_error($ldap->get_error());
-
-    /* Optionally execute a command after we're done */
-    $this->handle_post_events('remove');
   }