Code

Fixed printer movement
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 Jul 2006 03:24:44 +0000 (03:24 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 Jul 2006 03:24:44 +0000 (03:24 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4331 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_printGeneric.inc

index 27b4169a17157ef064d9247138c06a8b43715b08..30a164126d3c8700cabe1f55045e19e86b55ac4d 100644 (file)
@@ -728,25 +728,24 @@ class printgeneric extends plugin
       }
     }
 
+    /* Move object in necessary*/
+    if (($this->orig_dn != $this->dn) && ($this->orig_dn != 'new')){
+      $this->move($this->orig_dn, $this->dn);
+    }
+
     /* Write back to ldap */
     $ldap= $this->config->get_ldap_link();
     $ldap->cat($this->dn);
-    if($ldap->count() == 0){
+    if(!$ldap->count()){
       $ldap->cd($this->config->current['BASE']);
       $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $this->dn));
       $ldap->cd($this->dn);
       $ldap->add($this->attrs);
       $this->handle_post_events("add");
     } else {
-      
-      if (($this->orig_dn != $this->dn) && (!$this->orig_dn == 'new')){
-        $this->move($this->orig_dn, $this->dn);
-      }
-
       $ldap->cd($this->dn);
       $this->cleanup();
       $ldap->modify ($this->attrs); 
-
       $this->handle_post_events("modify");
     }
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of system print/generic with dn '%s' failed."),$this->dn));