Code

Added grey out to archive options, if archive options are disabled
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 1 Aug 2006 07:46:52 +0000 (07:46 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 1 Aug 2006 07:46:52 +0000 (07:46 +0000)
Added av user to template

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

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

index 7a1dde535f0174ca6160849cb0f9c957d28d4406..510db7ba2d1138da518e2a83f3e531e24fa49c68 100644 (file)
@@ -4,7 +4,7 @@ class govirusserver extends plugin{
        
   /* This plugin only writes its objectClass */
   var $objectclasses    = array("goVirusServer");
-  var $attributes       = array("avMaxThreads","avMaxDirectoryRecursions",/*"avUser",*/"avFlags","avArchiveMaxFileSize","avArchiveMaxRecursion",
+  var $attributes       = array("avMaxThreads","avMaxDirectoryRecursions","avUser","avFlags","avArchiveMaxFileSize","avArchiveMaxRecursion",
                                 "avArchiveMaxCompressionRatio","avDatabaseMirror","avChecksPerDay","avHttpProxyURL");
   var $StatusFlag       = "avStatus";
  
@@ -22,11 +22,11 @@ class govirusserver extends plugin{
 
   var $Flags            = array("D","S","A","E");
   
-  var $avFlags          = "DSAE";
+  var $avFlags          = "DS";
   var $avFlagsD         = TRUE;
   var $avFlagsS         = TRUE;
-  var $avFlagsA         = TRUE;
-  var $avFlagsE         = TRUE;
+  var $avFlagsA         = FALSE;
+  var $avFlagsE         = FALSE;
 
   var $avMaxThreads                 = 5;
   var $avMaxDirectoryRecursions     = 4;    
@@ -35,7 +35,7 @@ class govirusserver extends plugin{
   var $avArchiveMaxCompressionRatio = 95;
   var $avChecksPerDay               = 12;
 
-//  var $avUser                       = "";
+  var $avUser                       = "";
   var $avHttpProxyURL               = "";
   var $avDatabaseMirror             = "";
 
@@ -115,6 +115,12 @@ class govirusserver extends plugin{
     }
     $smarty->assign("ThreadValues",$tmp);
 
+    if($this->avFlagsA){
+      $smarty->assign("avFlagsAState" , "" );
+    }else{
+      $smarty->assign("avFlagsAState" , " disabled " );
+    }
+
     return($display.$smarty->fetch(get_template_path("goVirusServer.tpl",TRUE,dirname(__FILE__))));
   }
 
@@ -163,6 +169,14 @@ class govirusserver extends plugin{
 
     plugin::save();
 
+    if(!$this->avFlagsA){
+      $arr = array("avArchiveMaxFileSize","avArchiveMaxRecursion","avArchiveMaxCompressionRatio");
+      foreach($arr as $attr){
+        $this->attrs[$attr] =  array();
+      }
+      $this->attrs['avFlags'] = preg_replace("/E/","",$this->attrs['avFlags']);
+    }
+
     /* Check if this is a new entry ... add/modify */
     $ldap = $this->config->get_ldap_link();
     $ldap->cat($this->dn,array("objectClass"));
index f2a46867950790389f3beefc7acf13bceec9fe4b..f2ea67b7d4c1a839d1f9ee050e0bc9b8684436a8 100644 (file)
        <table>
         <tr>
          <td>
-               {t}Maximum threads{/t}
+               {t}Database user{/t}
          </td>
          <td>
-               <select name="avMaxThreads" title='{t}Select number of maximal threads{/t}'>
-                {html_options options=$ThreadValues selected=$avMaxThreads}
-               </select>
+               <input type='text' name='avUser' value='{$avUser}' {$avUserACL} style='width:220px;'>
          </td>
         </tr>
         <tr>
                <input type='text' name='avHttpProxyURL' value='{$avHttpProxyURL}' {$avHttpProxyURLACL} style='width:220px;'>
          </td>
         </tr>
+       </table>
+  </td>
+  <td style='border-left:1px solid #A0A0A0;vertical-align:top;'>
+  
+       <table>
         <tr>
          <td>
                {t}Checks per day{/t}
                <input type='text' name='avChecksPerDay' value='{$avChecksPerDay}' {$avChecksPerDayACL}>
          </td>
         </tr>
-       </table>
-  </td>
-  <td style='border-left:1px solid #A0A0A0;vertical-align:top;'>
-  
-       <table>
+        <tr>
+         <td>
+               {t}Maximum threads{/t}
+         </td>
+         <td>
+               <select name="avMaxThreads" title='{t}Select number of maximal threads{/t}'>
+                {html_options options=$ThreadValues selected=$avMaxThreads}
+               </select>
+         </td>
+        </tr>
         <tr>
          <td>
                <input type='checkbox' name='avFlagsD' {$avFlagsDACL} {$avFlagsDCHK} value='1'>
   </td>
  </tr>
  <tr>
-  <td  style="vertical-align:top;width:50%;">
+  <td style='vertical-align:top;'>
        <table>
         <tr>
-         <td>{t}Maximum file size{/t}
-         </td>
          <td>
-          <input name='avArchiveMaxFileSize' value='{$avArchiveMaxFileSize}' {$avArchiveMaxFileSizeACL} >
+               <input type='checkbox' name='avFlagsA' {$avFlagsAACL} {$avFlagsACHK} value='1'
+                       onClick=" changeState('avFlagsE') ; 
+                                 changeState('avArchiveMaxFileSize') ; 
+                                 changeState('avArchiveMaxRecursion') ; 
+                                 changeState('avArchiveMaxCompressionRatio') ; "
+               >
+               {t}Enable scanning of archives{/t}
          </td>
         </tr>
         <tr>
-         <td>{t}Maximum recursion{/t}
-         </td>
          <td>
-          <input name='avArchiveMaxRecursion' value='{$avArchiveMaxRecursion}' {$avArchiveMaxRecursionACL} >
+               <input type='checkbox' name='avFlagsE' {$avFlagsEACL} {$avFlagsECHK} {$avFlagsAState} value='1' id='avFlagsE'>
+               {t}Block encrypted archives{/t}
          </td>
         </tr>
+       </table>
+  
+  </td>
+  <td  style="vertical-align:top;width:50%;border-left:1px solid #A0A0A0;">
+       <table>
         <tr>
-         <td>{t}Maximum compression ratio{/t}
+         <td>{t}Maximum file size{/t}
          </td>
          <td>
-          <input name='avArchiveMaxCompressionRatio' value='{$avArchiveMaxCompressionRatio}' {$avArchiveMaxCompressionRatioACL} >
+          <input name='avArchiveMaxFileSize' id='avArchiveMaxFileSize' value='{$avArchiveMaxFileSize}'  {$avFlagsAState} {$avArchiveMaxFileSizeACL} >
          </td>
         </tr>
-       </table>
-  
-  </td>
-  <td style='border-left:1px solid #A0A0A0;vertical-align:top;'>
-       <table>
         <tr>
+         <td>{t}Maximum recursion{/t}
+         </td>
          <td>
-               <input type='checkbox' name='avFlagsA' {$avFlagsAACL} {$avFlagsACHK} value='1'>
-               {t}Enable scanning of archives{/t}
+          <input name='avArchiveMaxRecursion' id='avArchiveMaxRecursion' value='{$avArchiveMaxRecursion}'  {$avFlagsAState} {$avArchiveMaxRecursionACL} >
          </td>
         </tr>
         <tr>
+         <td>{t}Maximum compression ratio{/t}
+         </td>
          <td>
-               <input type='checkbox' name='avFlagsE' {$avFlagsEACL} {$avFlagsECHK} value='1'>
-               {t}Block encrypted archives{/t}
+          <input name='avArchiveMaxCompressionRatio' id='avArchiveMaxCompressionRatio' value='{$avArchiveMaxCompressionRatio}' {$avFlagsAState}  {$avArchiveMaxCompressionRatioACL} >
          </td>
         </tr>
        </table>