Code

Display unkonwn Device in system Management
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Oct 2007 12:09:54 +0000 (12:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Oct 2007 12:09:54 +0000 (12:09 +0000)
Ensure that dns name is set.
Changed label from "Display name" to "Dns name"
DNS is activated as default for arp devices.

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

plugins/admin/systems/ArpNewDevice.tpl
plugins/admin/systems/class_ArpNewDevice.inc
plugins/admin/systems/class_systemManagement.inc
plugins/admin/systems/class_termDNS.inc
plugins/admin/systems/network.tpl

index a5083263092d6127ebdd2104cdceff2d1c57d495..ae15569ef823a8a3d57c475e312f02e9511b4650 100644 (file)
@@ -3,7 +3,7 @@
 <tr>
  <td style>
   <LABEL for="cn">
-   {t}Terminal name{/t}
+   {t}Dns name{/t}
   </LABEL>
  </td>
  <td>
index 763c4e8e37014c71b24f56c4a44e4fe4be30d72c..f2d7a754c3b637d907abf5051ae5a536ddc83dda 100644 (file)
@@ -11,9 +11,11 @@ class ArpNewDevice extends plugin
   function ArpNewDevice ($config, $dn= NULL, $parent= NULL)
   {
     plugin :: plugin($config,$dn);
+    $this->cn ="";
     $this->netConfigDNS = new termDNS($this->config,$this->dn,$this->objectclasses);
     $this->acl = "#all#";
     $this->netConfigDNS->acl = $this->acl;
+    $this->netConfigDNS->force_dns();
   }
 
   function execute()
@@ -41,6 +43,9 @@ class ArpNewDevice extends plugin
   {
     $message= plugin::check();
     $message= array_merge($message, $this->netConfigDNS->check());
+    if(empty($this->cn)){
+      $message[] = _("Please specify a valid dns name.");
+    }
     return($message);
   }
 
index 3e6da3dde20d5d98411222dd0fb5bc54dca67289..c9974d227dcae1b44877d38665252ac5e692d55b 100644 (file)
@@ -740,6 +740,8 @@ class systems extends plugin
           $add= "- "._("New terminal");
         }elseif (in_array_ics('gotoWorkstation', $value['objectClass'])){
           $add= "- "._("New workstation");
+        }elseif (in_array_ics('GOhard', $value['objectClass']) && !in_array_ics("gotoMode",$value['objectClass'])){
+          $add= "- "._("Unknown device");
         }elseif (in_array_ics('GOhard', $value['objectClass'])){
           $add= "- "._("New Device");
         }
index 97abc0633d57935de9f292ecb20025cab287a0b2..acc3ba3cb33b2a7cc67aa9ec3afe6494083efad5 100644 (file)
@@ -30,7 +30,7 @@ class termDNS extends plugin
   var $initial_dhcpParentNode   = "";
   var $initial_dhcpHostEntry    = array();
   var $initial_dhcp_is_Account  = FALSE;
-
+  
 
   /* DNS attributes  
    */
@@ -39,6 +39,7 @@ class termDNS extends plugin
   var $DNSinitially_was_account = false;
   var $dnsEntry                 = array();
   var $DNSenabled               = false;
+  var $hide_dns_check_box       = FALSE;
 
   /*  Terminal dns 
    */
@@ -310,6 +311,8 @@ class termDNS extends plugin
       $smarty->assign("DNSaccountACL",chkacl($this->acl,"termDNS"));
 
       $smarty->assign("DNSAccount",$this->DNS_is_account);
+      $smarty->assign("hide_dns_check_box",$this->hide_dns_check_box);
+  
       $smarty->assign("Zones",$this->Zones);
       $smarty->assign("ZoneCnt",count($this->Zones));
       $smarty->assign("ZoneKeys",($this->Zones));
@@ -406,6 +409,9 @@ class termDNS extends plugin
       }else{
         $this->DNS_is_account = false;
       }
+      if($this->hide_dns_check_box){
+        $this->DNS_is_account = true;
+      }
     }
   }
 
@@ -839,6 +845,14 @@ class termDNS extends plugin
     }
     return($ret);
   }
+
+  function force_dns()
+  {
+    if($this->DNSenabled){
+      $this->DNS_is_account  = TRUE;
+      $this->hide_dns_check_box = TRUE;
+    }
+  }
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 58515c594c2968a99537ad40358ede22aaa29310..be75f65e52df310b2c67fd9790dec8486e8bad2b 100644 (file)
     {if $DNS_is_account==true}
                <td     style="width:50%;vertical-align:top;border-left:1px solid #b0b0b0;" valign="top">
 
-      {if $ZoneCnt}
+      {if $ZoneCnt }
+
+      {if !$hide_dns_check_box}  
+  
         {if $DNSAccount == true}
         <input type="checkbox" name="enableDNS" value="1" {$DNSaccountACL} class='center' 
           checked="checked"
@@ -83,7 +86,8 @@
         "/>
         {/if}
       {t}Enable DNS for this device{/t}
-      <input type='image' src='images/list_reload.png' class='center' name="reloadThisDNSStuff" {$DNSaccountACL}/>
+        <input type='image' src='images/list_reload.png' class='center' name="reloadThisDNSStuff" {$DNSaccountACL}/>
+      {/if}
       {if $DNSAccount == true}
       <div style="padding-left:20px;visibility:visible;" id="test2">
       {else}