Code

Updated dhcp take over
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Sep 2007 12:04:25 +0000 (12:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 11 Sep 2007 12:04:25 +0000 (12:04 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7260 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servDHCP.inc
plugins/admin/systems/servdhcp.tpl

index da5a12a289d495b0d930351b724dac0f9539b8fa..aac60d367060e04a28d71596ccdfd9617f2914f1 100644 (file)
@@ -21,6 +21,7 @@ class servdhcp extends plugin
 
   var $dhcp_server_list   = array("ENTRIES"=> array(),"FOR_LIST"=> array());
   var $take_over_id       = -1;
+  var $display_warning  = TRUE;
 
   function servdhcp ($config, $dn= NULL, $parent= NULL)
   {
@@ -77,20 +78,6 @@ class servdhcp extends plugin
   }  
 
 
-  function get_dhcp_info_string($id)
-  {
-    $ret = "";
-    $ldap = $this->config->get_ldap_link();
-    $ldap->cd("cn=dhcp,".$this->dhcp_server_list['ENTRIES'][$id]['dn']);
-    $ldap->search("(|(objectClass=dhcpSharedNetwork)(objectClass=dhcpSubnet)(objectClass=dhcpPool)(objectClass=dhcpGroup)(objectClass=dhcpHost))",array("dn","cn"));
-    $ldap->search("(objectClass=*)",array("dn","cn"));
-    while($attrs = $ldap->fetch()){
-      $ret .= $attrs['dn']."\n";
-    }
-    return($ret);
-  }
-
-
   function execute()
   {
     /* Call parent execute */
@@ -131,13 +118,14 @@ class servdhcp extends plugin
     if($this->take_over_id != -1){
       $this->dialog = FALSE;
       $id = $this->take_over_id;
-      $info = $this->get_dhcp_info_string($id);
       $smarty->assign("dns_take_over",TRUE);
-      $smarty->assign("info",$info);
-      $warning = sprintf(_("You are going to migrate the DHCP setup from server '%s'."),$this->dhcp_server_list['ENTRIES'][$id]['cn'][0]);
-      $warning2 = _("The migration will be startet when you save this system. To cancel this action, use the cancel button below."); 
-      $smarty->assign("warning",$warning);
-      $smarty->assign("warning2",$warning2);
+      $warning= "&nbsp;"._("This includes 'all' DNS zones that are located within this server. Please double check if your really want to do this.");
+      $warning.= "&nbsp;"._("The migration will be startet when you save this system. To cancel this action, use the cancel button below.");
+
+      if($this->display_warning){
+        print_red($warning);
+        $this->display_warning = FALSE;
+      }
       return($smarty->fetch(get_template_path('servdhcp.tpl', TRUE)));
     }
 
index b394243a15d004a6d7bcd46da805430ce37b5bb7..89b26fb19688b903964704f528c2b029c33feca7 100644 (file)
@@ -3,10 +3,6 @@
        <tr>
                <td style="width:100%;vertical-align:top;">
                        <h2>{t}DHCP take over initiated{/t}</h2>
-                       {$warning}
-                       {t}This includes 'all' DHCP subsections that are located within this server. Please double check if your really want to do this.{/t}
-                       <p>
-                       {$warning2}
                </td>
        </tr>
 </table>