Code

Updated Copy & Paste
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Jun 2007 06:21:50 +0000 (06:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Jun 2007 06:21:50 +0000 (06:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6565 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_CopyPasteHandler.inc
include/class_plugin.inc

index 0c4738b4b8efbb951e75b62bcaf549bd27af5f8e..669eecbdb97a36aa9082aa00bea1da511a8e7ed0 100644 (file)
@@ -172,7 +172,7 @@ class CopyPasteHandler {
       if($entry['method'] == "copy"){
         $entry['object']      = new $tab_c($this->config,$this->config->data['TABS'][$tab_o],"new");
       }else{
-        $entry['object']      = new $tab_c($this->config,$this->config->data['TABS'][$tab_o],$entry['dn'],"users");
+        $entry['object']      = new $tab_c($this->config,$this->config->data['TABS'][$tab_o],$entry['dn']);
       }
 
       $entry['source_data'] = $this->load_attributes_from_hdd($entry['file_name']);
index b467f354a29ecaf89207cd6a0e152b3ac15b3f61..631a2d153c2b79ca823ea8f5a73aae18f9537a49 100644 (file)
@@ -913,7 +913,16 @@ class plugin
     if(isset($this->CopyPasteVars)){
       $todo = array_merge($todo,$this->CopyPasteVars);
     }
-    $todo[] = "is_account";
+
+    if(count($this->objectclasses)){
+      $this->is_account = TRUE;
+      foreach($this->objectclasses as $class){
+        if(!in_array($class,$source['objectClass'])){
+          $this->is_account = FALSE;
+        }
+      }
+    }
+
     foreach($todo as $var){
       if (isset($source[$var])){
         if(isset($source[$var]['count'])){
@@ -924,11 +933,14 @@ class plugin
               $tmp = $source[$var][$i];
             }
             $this->$var = $tmp;
+#            echo $var."=".$tmp."<br>";
           }else{
             $this->$var = $source[$var][0];
+#            echo $var."=".$source[$var][0]."<br>";
           }
         }else{
           $this->$var= $source[$var];
+#          echo $var."=".$source[$var]."<br>";
         }
       }
     }