Code

Added system copy & paste
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Jun 2007 13:43:15 +0000 (13:43 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Jun 2007 13:43:15 +0000 (13:43 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6573 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_acl.inc
plugins/admin/systems/class_servGeneric.inc
plugins/admin/systems/paste_generic.tpl [new file with mode: 0644]

index 999a20b9553b2a559472312b2281f442e512fb64..85ed6316235a3915948c60c2ba9e7d573f2f371f 100644 (file)
@@ -961,6 +961,16 @@ class acl extends plugin
     return FALSE;
   }
 
+  
+  function PrepareForCopyPaste($source)
+  {
+    plugin::PrepareForCopyPaste($source);
+    
+    $dn = $source['dn'];
+    $acl_c = new acl($this->config, $this->parent,$dn);
+    $this->gosaAclEntry = $acl_c->gosaAclEntry;
+  }
+
 
   function save()
   {
index bc04c77a7c5eeb84c981099759ea24fb48ffec66..ee00a7a349606932810c1f4c5699773bc6cb66f0 100644 (file)
@@ -369,6 +369,44 @@ class servgeneric extends plugin
   }
 
 
+  /* Display generic part for server copy & paste */
+  function getCopyDialog()
+  {
+    $vars = array("cn");
+
+    $smarty = get_smarty();
+    $smarty->assign("cn" ,$this->cn);
+    $smarty->assign("object","server");
+    $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE));
+    $ret = array();
+    $ret['string'] = $str;
+    $ret['status'] = "";
+    return($ret);
+  }
+
+
+  function saveCopyDialog()
+  {
+    if(isset($_POST['cn'])){
+      $this->cn = $_POST['cn'];
+    }
+  }
+
+  
+  function PrepareForCopyPaste($source)  
+  {
+    plugin::PrepareForCopyPaste($source);
+    if(isset($source['macAddress'][0])){
+      $this->netConfigDNS->macAddress = $source['macAddress'][0];
+    }
+    if(isset($source['ipHostNumber'][0])){
+      $this->netConfigDNS->macAddress = $source['ipHostNumber'][0];
+    }
+
+  }
+  
+
+
   /* Return plugin informations for acl handling */ 
   function plInfo()
   {
diff --git a/plugins/admin/systems/paste_generic.tpl b/plugins/admin/systems/paste_generic.tpl
new file mode 100644 (file)
index 0000000..0a6f066
--- /dev/null
@@ -0,0 +1,10 @@
+{if $object == "server"}
+    <table summary="">
+     <tr>
+      <td><LABEL for="cn">{t}Server name{/t}</LABEL>{$must}</td>
+      <td>
+       <input name="cn" id="cn" size=20 maxlength=60 value="{$cn}">
+      </td>
+     </tr>
+       </table>
+{/if}