Code

Updated object handling, special chars in obejct dns
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Jul 2010 13:54:23 +0000 (13:54 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Jul 2010 13:54:23 +0000 (13:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19256 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/devices/tabs_devices.inc

index 518fe8469ca755c0dc3fef872d30a5158d3dfc0a..bd003116216327e5651878e4c6118d68671471d4 100644 (file)
@@ -2,36 +2,38 @@
 
 class devicetabs extends tabs
 {
-  var $Release= "";
+    var $Release= "";
 
-  function devicetabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE)
-  {
-    tabs::tabs($config, $data, $dn,$category,$hide_refs, $hide_acls);
+    function devicetabs($config, $data, $dn,$category,$hide_refs = FALSE, $hide_acls = FALSE)
+    {
+        tabs::tabs($config, $data, $dn,$category,$hide_refs, $hide_acls);
 
-    /* Add references/acls/snapshots */
-    $this->addSpecialTabs();
-  }
+        /* Add references/acls/snapshots */
+        $this->addSpecialTabs();
+    }
 
-  function save($ignore_account= FALSE)
-  {
-    $baseobject= $this->by_object['deviceGeneric'];
-    $new_dn= "cn=".$baseobject->cn.",".get_ou("deviceGeneric", "deviceRDN").$baseobject->base;
+    function save($ignore_account= FALSE)
+    {
+        $baseobject= $this->by_object['deviceGeneric'];
+        $nAV      = preg_replace('/,/', '\,', $baseobject->cn);
+        $nAV      = preg_replace('/"/', '\"', $nAV);
+        $new_dn= "cn=".$nAV.",".get_ou("deviceGeneric", "deviceRDN").$baseobject->base;
 
-    /* Move group? */
-    if ($this->dn != $new_dn){
+        /* Move group? */
+        if ($this->dn != $new_dn){
 
-      /* Write entry on new 'dn' */
-      if ($this->dn != "new"){
-        $baseobject->move($this->dn, $new_dn);
-        $this->by_object['deviceGeneric']= $baseobject;
-      }
+            /* Write entry on new 'dn' */
+            if ($this->dn != "new"){
+                $baseobject->move($this->dn, $new_dn);
+                $this->by_object['deviceGeneric']= $baseobject;
+            }
 
-      /* Happen to use the new one */
-      $this->dn= $new_dn;
-    }
+            /* Happen to use the new one */
+            $this->dn= $new_dn;
+        }
 
-    tabs::save();
-  }
+        tabs::save();
+    }
 
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: