From 242ab2b4ba7048d708698efb48a13c94b85d1e39 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 5 Apr 2006 08:53:57 +0000 Subject: [PATCH] Updated copy paste method git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2986 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_CopyPasteHandler.inc | 11 +++-------- include/class_plugin.inc | 11 +++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/include/class_CopyPasteHandler.inc b/include/class_CopyPasteHandler.inc index d8fb89ab3..37e9a2e95 100644 --- a/include/class_CopyPasteHandler.inc +++ b/include/class_CopyPasteHandler.inc @@ -62,14 +62,9 @@ class CopyPasteHandler { $this->objectdn = $obj->dn; $this->current = $emptyObj; foreach($obj->by_object as $name => $obj){ - foreach($obj->attributes as $attr){ - $this->current->by_object[$name]->$attr = $obj->$attr; - } - if(isset($obj->CopyPasteVars)){ - foreach($obj->CopyPasteVars as $attr){ - $this->current->by_object[$name]->$attr = $obj->$attr; - } - } + + $this->current->by_object[$name]->PrepareForCopyPaste($obj); + foreach(array("is_account") as $attr){ if(isset($obj->$attr)){ $this->current->by_object[$name]->$attr = $obj->$attr; diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 1e6b5ba21..dc24a4b17 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -750,6 +750,17 @@ class plugin return(array("string"=>"","status"=>"")); } + function PrepareForCopyPaste($source){ + $todo = $this->attributes; + if(isset($this->CopyPasteVars)){ + $todo = array_merge($todo,$this->CopyPasteVars); + } + + foreach($todo as $var){ + $this->$var = $source->$var; + } + } + } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> -- 2.30.2