home *** CD-ROM | disk | FTP | other *** search
/ ftp.f-secure.com / 2014.06.ftp.f-secure.com.tar / ftp.f-secure.com / support / hotfix / fsav-server / FSAVSRV900_HF07.jar / iuwebui / forms / tree_server / server-realtime.php < prev    next >
PHP Script  |  2010-09-07  |  11KB  |  262 lines

  1. <?php
  2.     include ('../common/commonphp.php');
  3.  
  4.     $tab_name = "tabServerRealtime";
  5.     $can_edit_settings = can_edit_settings();
  6.  
  7.     $Page_Settings = array(    
  8.         array(oid => "1.3.6.1.4.1.2213.12.1.111.2.10", type => GLOBAL_INT),
  9.         array(oid => "1.3.6.1.4.1.2213.12.1.111.2.100.38", type => GLOBAL_INT),
  10.         array(oid => "1.3.6.1.4.1.2213.38.1.300.100.100.300", type => GLOBAL_INT),
  11.         array(oid => "1.3.6.1.4.1.2213.38.1.300.100.70.500", type => GLOBAL_INT),        
  12.         array(oid => "1.3.6.1.4.1.2213.12.1.300.1200.111.2.100.18", type => GLOBAL_INT),
  13.         array(oid => "1.3.6.1.4.1.2213.12.1.300.1200.111.2.100.20", type => GLOBAL_INT),
  14.         array(oid => "1.3.6.1.4.1.2213.38.1.600.1200.300.100.100.200", type => GLOBAL_INT),        
  15.         array(oid => "1.3.6.1.4.1.2213.38.1.300.100.50", type => GLOBAL_INT)
  16.  
  17.     );
  18.  
  19.  
  20.     $llock1 =  settings_is_final('1.3.6.1.4.1.2213.12.1.111.2.100.11', 0) || 
  21.            settings_is_final('1.3.6.1.4.1.2213.12.1.111.2.100.2', 0) ? getLockImg() : '';
  22.  
  23.     $llock2 =  settings_is_final('1.3.6.1.4.1.2213.12.1.111.2.100.100.21', 0) ? getLockImg() : '';
  24.  
  25.  
  26.     if(!isset($_POST[SUBMIT_TABLE]))
  27.     {
  28.         /* first load of the page */
  29.         readSettings(&$Page_Settings);
  30.     }
  31.     else 
  32.     {
  33.         if($_POST[RESTORE_TABLE] == 1)
  34.         {
  35.             /* user wants to restore defaults */
  36.             readDefaultSettings(&$Page_Settings);
  37.             
  38.             $extraSettingsToReset = array(    
  39.                 array(oid => '1.3.6.1.4.1.2213.12.1.111.2.100.11', type => GLOBAL_INT),
  40.                 array(oid => '1.3.6.1.4.1.2213.12.1.111.2.100.100.2', type => GLOBAL_STR),
  41.                 array(oid => '1.3.6.1.4.1.2213.12.1.111.2.100.100.21', type => GLOBAL_INT),
  42.                 array(oid => '1.3.6.1.4.1.2213.12.1.111.2.100.100.22', type => GLOBAL_STR),
  43.                 array(oid => '1.3.6.1.4.1.2213.12.1.111.2.100.100.49', type => GLOBAL_INT),
  44.                 array(oid => '1.3.6.1.4.1.2213.12.1.111.2.100.100.50', type => GLOBAL_TBL),
  45.                 array(oid => '1.3.6.1.4.1.2213.38.2.300.100.200.300.310.100', type => GLOBAL_TBL)
  46.             );
  47.             readDefaultSettings(&$extraSettingsToReset);
  48.         }
  49.         else
  50.         {
  51.             readPageData(&$Page_Settings);
  52.             if($_POST[SUBMIT_TABLE] == 1)    
  53.                 writeSettings($Page_Settings);
  54.         }
  55.         exit(0);
  56.     }
  57. ?>
  58.  
  59. <script type="text/javascript" src="/common/extlistfuncs.js"></script>
  60. <script language='JavaScript' type='text/javascript'>        
  61.     <?php echo $tab_name;?>enableControls = function() 
  62.     {
  63.         if(!document.form_<?php echo $tab_name;?> || !document.form_<?php echo $tab_name;?>.VAR_PAGE_SETTINGS_0)
  64.             return;
  65.  
  66.         var is_disabled = !document.form_<?php echo $tab_name;?>.VAR_PAGE_SETTINGS_0[1].checked;
  67.         
  68.         control_enabler_arr('<?php echo $tab_name;?>', [0], false,  disabled_settings_<?php echo $tab_name;?>);
  69.         control_enabler_arr('<?php echo $tab_name;?>', [1,3,4,7], is_disabled,  disabled_settings_<?php echo $tab_name;?>);
  70.         
  71.         var action_disabled = is_disabled || document.form_<?php echo $tab_name;?>.VAR_PAGE_SETTINGS_4[1].checked;
  72.         
  73.         control_enabler_arr('<?php echo $tab_name;?>', [5,6], action_disabled,  disabled_settings_<?php echo $tab_name;?>);
  74.     }
  75.  
  76.     startup<?php echo $tab_name;?>enableControls = function() 
  77.     {    
  78.         <?php echo $tab_name;?>enableControls();
  79.     }
  80.     
  81.     updateView1 = function(mode)
  82.     {
  83.         var label = dojo.byId("ServerRealtime: targets label");
  84.         label.innerHTML = dojo.string.escapeXml(GetAVTargetsText(mode));
  85.     }
  86.  
  87.     updateView2 = function(excludeObjects, excludeTypes, excludedAppsCount)
  88.     {
  89.         var label = dojo.byId("ServerRealtime: exclusions label");
  90.         label.innerHTML = dojo.string.escapeXml(GetAVExclusionsText(excludeObjects, excludeTypes, excludedAppsCount));
  91.     }
  92.  
  93.     <?php echo $tab_name;?>_init = function()
  94.     {
  95.         updateView1(
  96.             <?php settings_get_int("1.3.6.1.4.1.2213.12.1.111.2.100.11", &$mode); echo $mode; ?>            
  97.         );
  98.         updateView2(
  99.             <?php settings_get_int("1.3.6.1.4.1.2213.12.1.111.2.100.100.49", &$mode); echo $mode; ?>,
  100.             <?php settings_get_int("1.3.6.1.4.1.2213.12.1.111.2.100.100.21", &$mode); echo $mode; ?>,
  101.             <?php 
  102.                 $tbl1 = array();
  103.                 $tbl2 = array();
  104.                 settings_get_table("1.3.6.1.4.1.2213.38.1.300.100.200.300.210.100", &$tbl1); 
  105.                 settings_get_table("1.3.6.1.4.1.2213.38.2.300.100.200.300.310.100", &$tbl2); 
  106.                 echo (count($tbl1) + count($tbl2));
  107.             ?>
  108.         );
  109.     }
  110.     
  111.     dojo.addOnLoad(<?php echo $tab_name;?>_init);
  112. </script>
  113.  
  114. <?php    show_form_management($tab_name); ?>
  115.  
  116. <form method="POST" action='<?php echo "{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}";?>' id="form_<?php echo $tab_name;?>" name="form_<?php echo $tab_name;?>" style="padding: 0; margin: 0;">
  117.     <input type="hidden" name="SUBMIT_TABLE" value="0">
  118.     <input type="hidden" name="RESTORE_TABLE" value="0">
  119.     <input type="hidden" name="APPLY_SETTINGS" value="0">
  120.  
  121.     <?php show_action_menu('Settings', $tab_name); ?>
  122.     <table border="0" cellspacing="5" cellpadding="0" class="main_page_table">
  123.         <tr>
  124.             <td valign="top" width="100%">
  125.                 <?=$Page_Settings[0][lock];?><input type="hidden" name="VAR_PAGE_SETTINGS_0" value="0"/>
  126.                 <input id='ServerRealtime: scanningEnabled' class='top_checkbox' type="checkbox" 
  127.                     name="VAR_PAGE_SETTINGS_0" value="1"
  128.                     onclick="javascript: <?php echo $tab_name;?>enableControls();"
  129.                     <?php if($Page_Settings[0][value] == 1) echo 'checked';?>/>
  130.                 <label for='ServerRealtime: scanningEnabled'><?=fsloc("Turn on real-time scanning");?></label>
  131.                 
  132.                 <table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_settings">
  133.                     <?php show_section_title('Targets');?>
  134.                     <tr align="left" class="tr_setting">
  135.                         <td class="td_setting" nowrap width='245px'>
  136.                             <?=$llock1;?><?=fsloc("Scan these files:")?>
  137.                         </td>
  138.                         <td class="td_setting" id="ServerRealtime: targets label">
  139.                         </td>
  140.                         <td class="td_setting" >
  141.                             <button dojoType='fs:Button' 
  142.                                     onClick='javascript: EnableFileTypesDialog("edit", "rts&updateView1");'
  143.                                     style='width: 100px;' 
  144.                                     id="ServerRealtime: configureFiles">
  145.                                 <div class='button80p'>
  146.                                     <?=GetConfigurableAsWord($can_edit_settings && $llock1 == '', true)?>
  147.                                 </div>
  148.                             </button>
  149.                         </td>
  150.                     </tr>
  151.                     <tr align="left" class="tr_setting">
  152.                         <td class="td_setting" nowrap width='245px'>
  153.                             <?=$llock2;?><?=fsloc("Exclude from scanning:")?>
  154.                         </td>
  155.                         <td class="td_setting" id="ServerRealtime: exclusions label">
  156.                         </td>
  157.                         <td class="td_setting" >
  158.                             <button 
  159.                                     dojoType='fs:Button' 
  160.                                     onClick='javascript: EnableExclusionsDialog("edit", "rts&updateView2");'
  161.                                     style='width: 100px;' 
  162.                                     id="ServerRealtime: configureExclusions">
  163.                                 <div class='button80p'>
  164.                                     <?=GetConfigurableAsWord($can_edit_settings && $llock2 == '', true)?>
  165.                                 </div>
  166.                             </button>
  167.                         </td>
  168.                     </tr>
  169.                 </table>
  170.                 <table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_settings">
  171.                     <?php show_section_title('Options');?>
  172.                     
  173.                     <tr align="left" class="tr_setting">
  174.                         <td class="td_setting" nowrap>
  175.                             <input type="hidden" name="VAR_PAGE_SETTINGS_1" value="0"/>
  176.                             <?=$Page_Settings[1][lock];?><input type="checkbox" id='ServerRealtime: scanArchives' name="VAR_PAGE_SETTINGS_1" 
  177.                                 value="1" <?php if($Page_Settings[1][value] == 1) echo 'checked';?> />
  178.                             <label for="ServerRealtime: scanArchives"><?=fsloc("Scan inside compressed files (zip, arj, lzh, ...)")?></label>
  179.                         </td>
  180.                         <td></td>
  181.                         <td></td>
  182.                     </tr>
  183.  
  184.                     <tr align="left" class="tr_setting">
  185.                         <td class="td_setting" nowrap>
  186.                             <input type="hidden" name="VAR_PAGE_SETTINGS_7" value="0"/>
  187.                             <?=$Page_Settings[7][lock];?><input type="checkbox" id="ServerRealtime: scan spyware" name="VAR_PAGE_SETTINGS_7" 
  188.                                 value="1" <?php if($Page_Settings[7][value] == 1) echo 'checked';?> />
  189.                             <label for="ServerRealtime: scan spyware"><?=fsloc("Scan for spyware")?></label>
  190.                         </td>
  191.                         <td></td>
  192.                         <td></td>
  193.                     </tr>
  194.                     
  195.                     <tr align="left" class="tr_setting">
  196.                         <td class="td_setting" nowrap>
  197.                             <input type="hidden" name="VAR_PAGE_SETTINGS_3" value="0"/>
  198.                             <?=$Page_Settings[3][lock];?><input type="checkbox" id="ServerRealtime: blockTrackingCookies" name="VAR_PAGE_SETTINGS_3" 
  199.                                 value="1" <?php if($Page_Settings[3][value] == 1) echo 'checked';?> />
  200.                             <label for="ServerRealtime: blockTrackingCookies"><?=fsloc("Block tracking cookies")?></label>
  201.                         </td>
  202.                         <td></td>
  203.                         <td></td>
  204.                     </tr>
  205.                 </table>
  206.                 <table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_settings">
  207.                     <?php show_section_title('Actions');?>
  208.  
  209.                     <tr align="left" class="tr_setting">
  210.                         <td class="td_setting" nowrap>
  211.                             <input type="hidden" name="VAR_PAGE_SETTINGS_4" value="0"/>
  212.                             <?=$Page_Settings[4][lock];?><input type="checkbox" id='ServerRealtime: decideActionAutomatically' 
  213.                                 name="VAR_PAGE_SETTINGS_4" value="1" 
  214.                                 onclick="javascript: <?php echo $tab_name;?>enableControls();"
  215.                                 <?php if($Page_Settings[4][value] == 1) echo 'checked';?> />
  216.                             <label for='ServerRealtime: decideActionAutomatically'><?=fsloc("Decide action automatically")?></label>
  217.                         </td>
  218.                         <td></td>
  219.                         <td></td>
  220.                     </tr>
  221.                     
  222.                     <tr align="left" class="tr_setting">
  223.                         <td class="td_setting" nowrap width='245px'>
  224.               <?=$Page_Settings[5][lock];?>
  225.               <label for="ServerRealtime: virusAction"><?=fsloc("When virus is found")?></label>
  226.                         </td>
  227.                         <td class="td_setting" >
  228.                             <?php $virAction = $Page_Settings[5][value]; ?>
  229.                             <select id="ServerRealtime: virusAction" name="VAR_PAGE_SETTINGS_5">
  230.                                 <option value='8'  <?php if($virAction == 8) echo 'selected';?>><?=fsloc('Ask what to do')?></option>
  231.                                 <option value="2" <?php if($virAction == 2) echo 'selected';?>><?=fsloc("Disinfect automatically")?></option>
  232.                                 <option value="260" <?php if($virAction == 260) echo 'selected';?>><?=fsloc("Quarantine automatically")?></option>
  233.                                 <option value="6" <?php if($virAction == 6) echo 'selected';?>><?=fsloc("Rename automatically")?></option>
  234.                                 <option value="4" <?php if($virAction == 4) echo 'selected';?>><?=fsloc("Delete automatically")?></option>
  235.                                 <option value="0" <?php if($virAction == 0) echo 'selected';?>><?=fsloc("Report only")?></option>
  236.                             </select>
  237.                         </td>
  238.                         <td></td>
  239.                     </tr>                    
  240.                     <tr align="left" class="tr_setting">
  241.                         <td class="td_setting" nowrap width='245px'>
  242.                             <label for="ServerRealtime: spywareAction">
  243.                 <?=$Page_Settings[6][lock];?>
  244.                 <?=fsloc("When spyware is found")?></label>
  245.                         </td>
  246.                         <td class="td_setting" >
  247.                             <?php $swAction = $Page_Settings[6][value];?>
  248.                             <select id="ServerRealtime: spywareAction" name="VAR_PAGE_SETTINGS_6">
  249.                                 <option value='8'  <?php if($swAction == 8) echo 'selected';?>><?=fsloc('Ask what to do')?></option>
  250.                                 <option value="0" <?php if($swAction == 0) echo 'selected';?>><?=fsloc("Report only")?></option>
  251.                                 <option value="4" <?php if($swAction == 4) echo 'selected';?>><?=fsloc("Remove automatically")?></option>
  252.                                 <option value="260" <?php if($swAction == 260) echo 'selected';?>><?=fsloc("Quarantine automatically")?></option>
  253.                             </select>
  254.                         </td>
  255.                         <td></td>
  256.                     </tr>
  257.                 </table>
  258.             </td>
  259.         </tr>
  260.         <?php show_action_buttons($tab_name, true, true); ?>
  261.     </table>
  262. </form>