Code

Removed netConfig if not needed
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Jul 2006 07:47:46 +0000 (07:47 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Jul 2006 07:47:46 +0000 (07:47 +0000)
One problem still remaining

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

plugins/admin/systems/class_printGeneric.inc
plugins/admin/systems/printer.tpl

index ca0dabf199bb7eba3a2f3c4edf2c0a1a390539bc..e60cd78f6598ea56307badf64304d504acbc8e62 100644 (file)
@@ -508,7 +508,11 @@ class printgeneric extends plugin
     $smarty->assign("AdminMember"    ,$this->AdminMember);
     $smarty->assign("AdminMembers"   ,$adminlist);
     $smarty->assign("AdminMemberKeys",array_flip($adminlist));
-    $smarty->assign("netconfig", $this->netConfigDNS->execute());
+    if($this->BelongsTo == "Printer"){
+      $smarty->assign("netconfig", $this->netConfigDNS->execute());
+    } else {
+      $smarty->assign("netconfig", "");
+    }
 
     return($display.$smarty->fetch (get_template_path('printer.tpl', TRUE)));
   }
@@ -577,7 +581,9 @@ class printgeneric extends plugin
   {
     /* Call common method to give check the hook */
     $message= plugin::check();
-    $message= array_merge($message, $this->netConfigDNS->check());
+    if ($this->BelongsTo == 'printer'){
+      $message= array_merge($message, $this->netConfigDNS->check());
+    }
 
     /* Don't display check messages if this is a template object */
     if(isset($this->parent->by_object['workgeneric'])){
@@ -736,9 +742,11 @@ class printgeneric extends plugin
     }
     show_ldap_error($ldap->get_error(), sprintf(_("Saving of system print/generic with dn '%s' failed."),$this->dn));
 
-    $this->netConfigDNS->cn = $this->cn;
-    $this->netConfigDNS->dn = $this->dn;
-    $this->netConfigDNS->save($this->dn);
+    if($this->BelongsTo == "Printer"){
+      $this->netConfigDNS->cn = $this->cn;
+      $this->netConfigDNS->dn = $this->dn;
+      $this->netConfigDNS->save($this->dn);
+    }
 
     /* Optionally execute a command after we're done */
     $this->postcreate();
@@ -853,7 +861,7 @@ class printgeneric extends plugin
       print_red(sprintf(_("Can't add '%s' to list of members, it is not reachable."),$dn));
       return(FALSE);
     }
-  return(TRUE);
+    return(TRUE);
   }
 }
 
index 876ae22baf1153f4c942217f9f641d47c43cc73a..9b20e927858224fa1e1ff90a7b4f8a4d13cd6d04 100644 (file)
 </table>
 
 
+{if $netconfig ne ''}
 <p class="plugbottom" style="margin-bottom:0px; padding:0px;">&nbsp;</p>
 {$netconfig}
+{/if}
 
 <!-- Place cursor -->
 <script language="JavaScript" type="text/javascript">