Code

Fixed copy & paste
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Nov 2007 14:56:48 +0000 (14:56 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Nov 2007 14:56:48 +0000 (14:56 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7918 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofax/blocklists/class_blocklistGeneric.inc

index 4a5e013d5df9ab2a9bf637168d552492493500a3..19284661d0870feb2755e7d07218761567e0bba9 100644 (file)
@@ -287,9 +287,6 @@ class blocklistGeneric extends plugin
   }
 
 
-
-
-
   function getCopyDialog()
   { 
     $smarty = get_smarty();
@@ -308,18 +305,43 @@ class blocklistGeneric extends plugin
     }
   }
 
+  
   function PrepareForCopyPaste($source)
   {
     plugin::PrepareForCopyPaste($source);
-  }
-
-
-
-
-
 
+    /* We will not be able to rename edited blocklists */
+    $this->readonly = TRUE;
 
+    /* Get blocklist type and defined numbers */
+    if (in_array("goFaxSBlock",$source['objectClass'])){
+      if(isset($source["goFaxSBlocklist"])){
+        for ($i= 0; $i<$source["goFaxSBlocklist"]["count"]; $i++){
+          $this->goFaxBlocklist[]= $source["goFaxSBlocklist"][$i];
+        }
+      }
+      $this->type= BLOCK_LIST_SEND;
+    } elseif (in_array("goFaxRBlock",$source['objectClass'])){
+      if(isset($source["goFaxRBlocklist"])){
+        for ($i= 0; $i<$source["goFaxRBlocklist"]["count"]; $i++){
+          $this->goFaxBlocklist[]= $source["goFaxRBlocklist"][$i];
+        }
+      }
+      $this->type= BLOCK_LIST_RECEIVE;
+    }
 
+    /* Set base */
+    if ($this->dn == "new"){
+      if(isset($_SESSION['CurrentMainBase'])){
+        $this->base= $_SESSION['CurrentMainBase'];
+      }else{
+        $ui= get_userinfo();
+        $this->base= dn2base($ui->dn);
+      }
+    } else {
+      $this->base =preg_replace ("/^[^,]+,[^,]+,[^,]+,/","",$this->dn);
+    }
+  }
 
 
   /* Return plugin informations for acl handling */