From 8e850bf1919c75a647e82da607036fea75d7948c Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 29 Jan 2007 08:14:03 +0000 Subject: [PATCH] Fixed win Workstation. - Don't display the $ off the workstation name when editing. - Fixed dns entries, don't create entries like this name$.domain.de git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5639 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_termDNS.inc | 6 +++--- plugins/admin/systems/class_winGeneric.inc | 4 +++- plugins/admin/systems/tabs_winstation.inc | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/admin/systems/class_termDNS.inc b/plugins/admin/systems/class_termDNS.inc index d3c614a88..a7310a89f 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 4809e74e2..8b7fcbe95 100644 --- a/plugins/admin/systems/class_winGeneric.inc +++ b/plugins/admin/systems/class_winGeneric.inc @@ -62,6 +62,8 @@ class wingeneric extends plugin /* Save dn for later references */ $this->orig_dn= $this->dn; + + $this->cn= preg_replace("/\\\$\$/","",$this->cn); } function execute() @@ -226,7 +228,7 @@ class wingeneric extends plugin $this->handle_post_events("modify"); } - $this->netConfigDNS->cn = $this->cn; + $this->netConfigDNS->cn = preg_replace("/\\\$\$/","",$this->cn); $this->netConfigDNS->save($this->dn); show_ldap_error($ldap->get_error(), _("Saving Samba workstation failed")); diff --git a/plugins/admin/systems/tabs_winstation.inc b/plugins/admin/systems/tabs_winstation.inc index 429b8035d..3f03437fa 100644 --- a/plugins/admin/systems/tabs_winstation.inc +++ b/plugins/admin/systems/tabs_winstation.inc @@ -18,7 +18,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