From a58f412238acda1d2d2f06d32cc868176b97bb05 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 22 Jun 2006 06:59:48 +0000 Subject: [PATCH] Fixed tripple saving of departments git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3863 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/departments/class_departmentManagement.inc | 5 +++-- plugins/admin/departments/tabs_department.inc | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc index abcf27081..efa59be94 100644 --- a/plugins/admin/departments/class_departmentManagement.inc +++ b/plugins/admin/departments/class_departmentManagement.inc @@ -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()){ diff --git a/plugins/admin/departments/tabs_department.inc b/plugins/admin/departments/tabs_department.inc index f5d771bde..794a0ef13 100644 --- a/plugins/admin/departments/tabs_department.inc +++ b/plugins/admin/departments/tabs_department.inc @@ -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)); } } -- 2.30.2