Code

Updated layout and added some checks
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 1 Aug 2006 04:22:02 +0000 (04:22 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 1 Aug 2006 04:22:02 +0000 (04:22 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@4352 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_goVirusServer.inc
plugins/admin/systems/goVirusServer.tpl

index ee4bb64e31c8c52af72c5713f8ae1c5ca26300e4..273fba3ce389a68849db32ba884592ca16bce716 100644 (file)
@@ -22,21 +22,22 @@ class goVirusServer extends plugin{
 
   var $Flags            = array("D","S","A","E");
   
-  var $avFlags          = "";
-  var $avFlagsD         = FALSE;
-  var $avFlagsS         = FALSE;
-  var $avFlagsA         = FALSE;
-  var $avFlagsE         = FALSE;
+  var $avFlags          = "DSAE";
+  var $avFlagsD         = TRUE;
+  var $avFlagsS         = TRUE;
+  var $avFlagsA         = TRUE;
+  var $avFlagsE         = TRUE;
 
   var $avMaxThreads                 = 5;
   var $avMaxDirectoryRecursions     = 4;    
-//  var $avUser                       = "";
   var $avArchiveMaxFileSize         = 4000;
   var $avArchiveMaxRecursion        = 5;
   var $avArchiveMaxCompressionRatio = 95;
-  var $avDatabaseMirror             = "";
   var $avChecksPerDay               = 12;
+
+//  var $avUser                       = "";
   var $avHttpProxyURL               = "";
+  var $avDatabaseMirror             = "";
 
   function goVirusServer($config,$dn)
   {
@@ -98,27 +99,14 @@ class goVirusServer extends plugin{
       }
     }
 
-    return($display.$smarty->fetch(get_template_path("goVirusServer.tpl",TRUE,dirname(__FILE__))));
-  }
-
-
-  /* Add $post to list of configured trusted */
-  function AddTrust($post)
-  {
-    if(!empty($post)){
-      $this->TrustedNetworks[$post] = $post;
+    /* Assign value for max thread select box */
+    $tmp = array();
+    for($i = 1 ; $i <= 20 ; $i ++){
+      $tmp[$i] = $i;
     }
-  }
-
+    $smarty->assign("ThreadValues",$tmp);
 
-  /* Delete trusted network */
-  function DelTrust($posts)
-  {
-    foreach($posts as $post){
-      if(isset($this->TrustedNetworks[$post])){
-        unset($this->TrustedNetworks[$post]);     
-      }
-    }
+    return($display.$smarty->fetch(get_template_path("goVirusServer.tpl",TRUE,dirname(__FILE__))));
   }
 
 
@@ -159,8 +147,6 @@ class goVirusServer extends plugin{
 
     plugin::save();
 
-    print_a($this->attrs);
-
     /* Check if this is a new entry ... add/modify */
     $ldap = $this->config->get_ldap_link();
     $ldap->cat($this->dn,array("objectClass"));
@@ -183,6 +169,26 @@ class goVirusServer extends plugin{
   function check()
   { 
     $message = plugin::check();
+
+    $mustBeNumeric = array(
+          "avMaxThreads"                 =>_("Maximum threads"),
+          "avArchiveMaxFileSize"         =>_("Maximum file size"),
+          "avArchiveMaxRecursion"        =>_("Maximum recursions"),
+          "avArchiveMaxCompressionRatio" =>_("Maximum compression ratio"),
+          "avChecksPerDay"               =>_("Checks per day"));
+
+    foreach($mustBeNumeric as $key => $trans){
+      if(!is_numeric($this->$key)){
+        $message[] = sprintf(_("The specified value for '%s' must be a numeric value."),$trans);
+      }
+    }
+
+
+
+
+
+
+
     return($message);
   }
   
index f5a6fd9af96190993e4b7b3415ee6cdd7b66a3e0..70544dc3d922948b9ccd66952b8599524d42bf5a 100644 (file)
@@ -1,15 +1,21 @@
 
 <table style='width:100%;'>
  <tr>
-  <td>
-       <h2>{t}Generic virus filtering{/t}</h2> 
-       <table style='width:100%;'>
+  <td colspan=2>
+       <h2>{t}Generic virus filtering{/t}</h2>
+  </td>
+ </tr>
+ <tr>
+  <td style="vertical-align:top;">
+       <table>
         <tr>
          <td>
                {t}Maximum threads{/t}
          </td>
          <td>
-               <input type='text' name='avMaxThreads' value='{$avMaxThreads}' {$avMaxThreadsACL}>
+               <select name="avMaxThreads" title='{t}Select number of maximal threads{/t}'>
+                {html_options options=$ThreadValues selected=$avMaxThreads}
+               </select>
          </td>
         </tr>
         <tr>
                {t}Database mirror{/t}
          </td>
          <td>
-               <input type='text' name='avDatabaseMirror' value='{$avDatabaseMirror}' {$avDatabaseMirrorACL}>
+               <input type='text' name='avDatabaseMirror' value='{$avDatabaseMirror}' {$avDatabaseMirrorACL} style='width:220px;'>
          </td>
         </tr>
         <tr>
          <td>
-               {t}Checks per day{/t}
+               {t}Http proxy URL{/t}
          </td>
          <td>
-               <input type='text' name='avChecksPerDay' value='{$avChecksPerDay}' {$avChecksPerDayACL}>
+               <input type='text' name='avHttpProxyURL' value='{$avHttpProxyURL}' {$avHttpProxyURLACL} style='width:220px;'>
          </td>
         </tr>
         <tr>
          <td>
-               {t}Http proxy URL{/t}
+               {t}Checks per day{/t}
          </td>
          <td>
-               <input type='text' name='avHttpProxyURL' value='{$avHttpProxyURL}' {$avHttpProxyURLACL}>
+               <input type='text' name='avChecksPerDay' value='{$avChecksPerDay}' {$avChecksPerDayACL}>
          </td>
         </tr>
        </table>
  
   </td>
-  <td style='border-left:1px solid #A0A0A0;'>
+  <td style='border-left:1px solid #A0A0A0;vertical-align:top;'>
   
-       <table style='width:100%;'>
+       <table>
         <tr>
          <td>
                <input type='checkbox' name='avFlagsD' {$avFlagsDACL} {$avFlagsDCHK} value='1'>
                {t}Enable mail scanning{/t}
          </td>
         </tr>
-        <tr>
-         <td>
-               <input type='checkbox' name='avFlagsA' {$avFlagsAACL} {$avFlagsACHK} value='1'>
-               {t}Enable scanning of archives{/t}
-         </td>
-        </tr>
        </table>
   </td>
  </tr>
  <tr>
   <td colspan=2>
    <p class='seperator'>&nbsp;</p>
+       <h2>{t}Archive scanning{/t}</h2> 
   </td>
  </tr>
  <tr>
-  <td>
-       <h2>{t}Archive scanning{/t}</h2> 
-       <table style='width:100%;'>
+  <td  style="vertical-align:top;width:50%;">
+       <table>
         <tr>
          <td>{t}Maximum file size{/t}
          </td>
           <input name='avArchiveMaxRecursion' value='{$avArchiveMaxRecursion}' {$avArchiveMaxRecursionACL} >
          </td>
         </tr>
-       </table>
-  
-  </td>
-  <td style='border-left:1px solid #A0A0A0;'>
-       <table style='width:100%;'>
         <tr>
          <td>{t}Maximum compression ratio{/t}
          </td>
           <input name='avArchiveMaxCompressionRatio' value='{$avArchiveMaxCompressionRatio}' {$avArchiveMaxCompressionRatioACL} >
          </td>
         </tr>
+       </table>
+  
+  </td>
+  <td style='border-left:1px solid #A0A0A0;vertical-align:top;'>
+       <table>
+        <tr>
+         <td>
+               <input type='checkbox' name='avFlagsA' {$avFlagsAACL} {$avFlagsACHK} value='1'>
+               {t}Enable scanning of archives{/t}
+         </td>
+        </tr>
         <tr>
          <td>
                <input type='checkbox' name='avFlagsE' {$avFlagsEACL} {$avFlagsECHK} value='1'>