From b0c30e39a99713d4e3ced5c2100c5c6fca9a33ed Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 30 Jan 2007 03:54:46 +0000 Subject: [PATCH] Added patch from 2.5. don't save $ within dns entries for winstations don't display $ when editing entry git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5650 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_termDNS.inc | 6 +++--- plugins/admin/systems/class_winGeneric.inc | 7 ++++--- plugins/admin/systems/tabs_winstation.inc | 6 ++++++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index 0e5263634..f0712a6b2 100644 --- a/plugins/admin/systems/class_termDNS.inc +++ b/plugins/admin/systems/class_termDNS.inc @@ -44,10 +44,10 @@ class termDNS extends plugin plugin::plugin ($config, $dn); if(isset($this->attrs['cn'][0])){ - $this->OrigCn = $this->attrs['cn'][0]; - $this->cn = $this->attrs['cn'][0]; + $this->OrigCn = preg_replace("/\\\$\$/","",$this->attrs['cn'][0]); + $this->cn = preg_replace("/\\\$\$/","",$this->attrs['cn'][0]); } - + /* Do we have autonet support? */ if (isset($this->config->data['MAIN']['AUTO_NETWORK_HOOK'])){ $this->autonet= true; diff --git a/plugins/admin/systems/class_winGeneric.inc b/plugins/admin/systems/class_winGeneric.inc index 4eb61c7c6..b7f0eb765 100644 --- a/plugins/admin/systems/class_winGeneric.inc +++ b/plugins/admin/systems/class_winGeneric.inc @@ -60,6 +60,8 @@ class wingeneric extends plugin /* Save dn for later references */ $this->orig_dn= $this->dn; + + $this->cn= preg_replace("/\\\$\$/","",$this->cn); } @@ -254,9 +256,8 @@ class wingeneric extends plugin $this->handle_post_events("modify"); } - # FIXME can't save mac address - #$this->netConfigDNS->cn = $this->cn; - #$this->netConfigDNS->save($this->dn); + $this->netConfigDNS->cn = preg_replace("/\\\$\$/","",$this->cn); + $this->netConfigDNS->save($this->dn); show_ldap_error($ldap->get_error(), sprintf(_("Saving of system wingeneric/generic with dn '%s' failed."),$this->dn)); /* Optionally execute a command after we're done */ diff --git a/plugins/admin/systems/tabs_winstation.inc b/plugins/admin/systems/tabs_winstation.inc index 2b884c1d8..7dba804dc 100644 --- a/plugins/admin/systems/tabs_winstation.inc +++ b/plugins/admin/systems/tabs_winstation.inc @@ -21,7 +21,13 @@ class wintabs extends tabs { /* Check for new 'dn', in order to propagate the 'dn' to all plugins */ + + /* add $ to end of name if mising */ $baseobject= $this->by_object['wingeneric']; + if(!preg_match("/\\\$\$/",$baseobject->cn)){ + $baseobject->cn .= "$"; + } + $this->dn= "uid=$baseobject->cn,".get_winstations_ou().$baseobject->base; $baseobject->dn= $this->dn; -- 2.30.2