Code

Use recursive_move() instead of move() for server objects, there may be dns settings...
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Aug 2007 05:59:03 +0000 (05:59 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 13 Aug 2007 05:59:03 +0000 (05:59 +0000)
Updated check() for already existing server with given cn.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7042 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servGeneric.inc

index 060da024fb8ec4ae8e517681162814167f270bbb..fc3a089e6d04d1dbf8ed39c37a0e9c210786ad38 100644 (file)
@@ -259,7 +259,8 @@ class servgeneric extends plugin
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
           if ($attrs['dn'] != $this->orig_dn){
-            if(!preg_match("/,ou=incoming,/",$attrs['dn'])){
+            if(!preg_match("/,ou=incoming,/",$attrs['dn']) && preg_match("/,ou=servers,ou=systems,/",$attrs['dn'])){
+              echo $attrs['dn'];
             $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn);
             break;
             }
@@ -303,7 +304,7 @@ class servgeneric extends plugin
       /* cn is not case sensitive for ldap, but for php it is!! */ 
       if($this->config->current['DNMODE'] == "cn"){
         if (strtolower($this->orig_dn) != (strtolower($this->dn))){
-          $this->move($this->orig_dn, $this->dn);
+          $this->recursive_move($this->orig_dn, $this->dn);
           plugin::save();
         }
       }else{