Code

Fixed tripple saving of departments
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 22 Jun 2006 06:59:48 +0000 (06:59 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 22 Jun 2006 06:59:48 +0000 (06:59 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3863 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/departments/class_departmentManagement.inc
plugins/admin/departments/tabs_department.inc

index abcf27081e829650c397a29f9655c4759edc8213..efa59be94e2fa17b9b33299b8ffdfc46bff889e8 100644 (file)
@@ -195,8 +195,9 @@ class departmentManagement extends plugin
       /* Save, or display error message? */
       if (count($message) == 0){
 
-        $this->deptabs->save(true);
-        $this->deptabs->by_object['department']->save();     
+        if(!$this->deptabs->by_object['department']->am_i_moved()){
+          $this->deptabs->save(true);
+        }
 
         /* This object must be tagged, so set ObjectTaggingRequested to true */
         if($this->deptabs->by_object['department']->must_be_tagged()){
index f5d771bde0170033e5bdfba5a331a79edfe40024..794a0ef130ef6feef12de91fb854bcf3543d6c35 100644 (file)
@@ -21,7 +21,6 @@ class deptabs extends tabs
     $baseobject= $this->by_object['department'];
     $ou= preg_replace('/,/', '\,', $baseobject->ou);
     $new_dn= @LDAP::convert('ou='.$ou.','.$baseobject->base);
-    
     if($justsave){
       if ($this->dn != $new_dn && $this->dn != "new"){
         /* if( new_dn is subtree of this->dn ) */
@@ -35,9 +34,10 @@ class deptabs extends tabs
           return;
         }
       }
+    }else{
+      $this->dn= $new_dn;
+      return(tabs::save(TRUE));
     }
-    $this->dn= $new_dn;
-    return(tabs::save(TRUE));
   }
 
 }