From 385569ae656e1a2858fbeb8d5c20b4da49fa9f50 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 15 Jun 2007 07:34:19 +0000 Subject: [PATCH] Updated workstation copy & paste git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6599 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_workstationGeneric.inc | 51 +++++++++++++++++++ plugins/admin/systems/paste_generic.tpl | 10 ++++ 2 files changed, 61 insertions(+) diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index 516c807a9..344c3b930 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -529,6 +529,57 @@ class workgeneric 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","workstation"); + $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->ipHostNumber = $source['ipHostNumber'][0]; + } + + /* Create used ntp server array */ + $this->gotoNtpServer= array(); + if(isset($source['gotoNtpServer'])){ + $this->inheritTimeServer = false; + unset($source['gotoNtpServer']['count']); + foreach($source['gotoNtpServer'] as $server){ + $this->gotoNtpServer[$server] = $server; + } + } + + /* Set inherit checkbox state */ + if((in_array("default",$this->gotoNtpServer)) || (count($this->gotoNtpServer)==0)){ + $this->inheritTimeServer = true; + $this->gotoNtpServer=array(); + } + } + + /* Return plugin informations for acl handling #FIXME FAIscript seams to ununsed within this class... */ function plInfo() diff --git a/plugins/admin/systems/paste_generic.tpl b/plugins/admin/systems/paste_generic.tpl index a15b0dddb..2f7ae1060 100644 --- a/plugins/admin/systems/paste_generic.tpl +++ b/plugins/admin/systems/paste_generic.tpl @@ -8,6 +8,16 @@ {/if} +{if $object == "workstation"} + + + + + +
{$must} + +
+{/if} {if $object == "terminal"} -- 2.30.2