From: psc Date: Wed, 10 Mar 2010 16:10:13 +0000 (+0000) Subject: Bugfix for #4263 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=658a3694e880fbc3437cb7e02d6a52b50cc3e29b;p=gosa.git Bugfix for #4263 When copying workstations / terminals additional copy some missing attributes (FAIstate, gotoSysStatus, etc.) git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@16386 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/trunk/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc b/trunk/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc index 0c043fe3c..c9590f7b2 100644 --- a/trunk/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc +++ b/trunk/gosa-plugins/goto/admin/systems/goto/class_terminalGeneric.inc @@ -21,6 +21,8 @@ class termgeneric extends plugin var $ghScsiDev= array(); var $ghGfxAdapter= "-"; var $ghSoundAdapter= "-"; + var $gotoHardwareChecksum = ""; + var $gotoSysStatus = ""; var $gotoLastUser= "-"; var $netConfigDNS; var $auto_activate= FALSE; @@ -44,7 +46,7 @@ class termgeneric extends plugin "gotoSwapServer", "gotoSyslogServer", "gotoNtpServer", "gotoFloppyEnable", "gotoCdromEnable", "cn", "gotoSndModule", "ghCpuType", "ghMemSize","ghUsbSupport", "description", - "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser"); + "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser", 'gotoHardwareChecksum', 'gotoSysStatus'); var $objectclasses= array("top", "gotoTerminal", "GOhard"); var $validActions = array("reboot" => "", "rescan" => "", "wake" => "", "memcheck" => "", "sysinfo" => ""); @@ -646,6 +648,24 @@ class termgeneric extends plugin $this->inheritTimeServer = true; $this->gotoNtpServer=array(); } + + $source_o = new termgeneric($this->config, $source['dn']); + foreach (array('ghIdeDev', 'ghNetNic', 'ghScsiDev') as $attr) { + if (isset($source_o->$attr)) { + $this->$attr = $source_o->$attr; + } + } + + $ldap = $this->config->get_ldap_link(); + $res = $ldap->cat($source['dn'], array('gotoHardwareChecksum', 'gotoSysStatus')); + if ($res) { + $attrs = $ldap->fetch(); + foreach(array('gotoHardwareChecksum', 'gotoSysStatus') as $attr) { + if (isset($attrs[$attrs])) { + $this->$attr = $attrs[$attr][0]; + } + } + } } diff --git a/trunk/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/trunk/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc index a9c0d62d8..1872e0223 100644 --- a/trunk/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc +++ b/trunk/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc @@ -21,6 +21,8 @@ class workgeneric extends plugin var $ghScsiDev= array(); var $ghGfxAdapter= "-"; var $ghSoundAdapter= "-"; + var $gotoHardwareChecksum = ""; + var $gotoSysStatus = ""; var $gotoLastUser= "-"; var $FAIscript= ""; var $view_logged = FALSE; @@ -47,7 +49,8 @@ class workgeneric extends plugin var $attributes= array("gotoMode", "gotoSyslogServer", "gotoNtpServer", "gotoFloppyEnable", "gotoCdromEnable", "cn", "gotoSndModule", "ghCpuType", "ghMemSize", "ghUsbSupport", "description", - "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser", "l","FAIscript"); + "ghGfxAdapter", "ghSoundAdapter", "gotoLastUser", "l","FAIscript", + "gotoHardwareChecksum", "gotoSysStatus"); var $objectclasses= array("top", "gotoWorkstation", "GOhard"); var $validActions = array("reboot" => "", "localboot" => "", "halt" => "", "update" => "", "reinstall" => "", @@ -701,6 +704,24 @@ class workgeneric extends plugin $this->inheritTimeServer = true; $this->gotoNtpServer=array(); } + + $source_o = new workgeneric($this->config, $source['dn']); + foreach (array('ghIdeDev', 'ghNetNic', 'ghScsiDev') as $attr) { + if (isset($source_o->$attr)) { + $this->$attr = $source_o->$attr; + } + } + + $ldap = $this->config->get_ldap_link(); + $res = $ldap->cat($source['dn'], array('gotoHardwareChecksum', 'gotoSysStatus')); + if ($res) { + $attrs = $ldap->fetch(); + foreach(array('gotoHardwareChecksum', 'gotoSysStatus') as $attr) { + if (isset($attrs[$attr])) { + $this->$attr = $attrs[$attr][0]; + } + } + } } diff --git a/trunk/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc b/trunk/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc index b1ae491fc..eba1146bb 100644 --- a/trunk/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc +++ b/trunk/gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc @@ -19,7 +19,7 @@ class workstartup extends plugin /* attribute list for save action */ var $attributes = array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", - "FAIclass", "FAIstatus", "gotoShare","FAIdebianMirror", "FAIrelease"); + "FAIclass", "FAIstate", "FAIstatus", "gotoShare","FAIdebianMirror", "FAIrelease"); var $objectclasses = array("GOhard", "FAIobject"); /* Share */ @@ -36,6 +36,7 @@ class workstartup extends plugin var $FAIclass = array(); // The currently selected classes var $FAIrelease = ""; var $FAIdebianMirror = "auto"; + var $FAIstate = ""; var $si_active = FALSE; var $si_fai_action_failed = FALSE; @@ -1001,11 +1002,16 @@ class workstartup extends plugin function PrepareForCopyPaste($source) { plugin::PrepareForCopyPaste($source); + $source_o = new workstartup ($this->config, $source['dn']); foreach(array("FAIclass","gotoModules", "gotoAutoFs", "gotoFilesystem", - "gotoKernelParameters","gotoShares","gotoLdapServers", "gotoLdap_inherit") as $attr){ + "FAIstate", "FAIrelease", "gotoKernelParameters","gotoShares", + "gotoLdapServers", "gotoLdap_inherit") as $attr){ $this->$attr = $source_o->$attr; } + if (isset($source['FAIstate'])) { + $this->attrs['FAIstate'] = $source['FAIstate']; + } }