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-manual.php next >
PHP Script  |  2010-09-07  |  9KB  |  203 lines

  1. <?php
  2.     include ('../common/commonphp.php');
  3.  
  4.     $tab_name = "tabServerManualSettings";
  5.     $can_edit_settings = can_edit_settings();
  6.  
  7.     $Page_Settings = array(    
  8.         array(oid => "1.3.6.1.4.1.2213.12.1.112.2.100.38", type => GLOBAL_INT),
  9.         array(oid => "1.3.6.1.4.1.2213.12.1.112.2.200.100", type => GLOBAL_INT),
  10.         array(oid => "1.3.6.1.4.1.2213.12.1.112.2.100.20", type => GLOBAL_INT),
  11.         array(oid => "1.3.6.1.4.1.2213.38.1.300.200.100.200", type => GLOBAL_INT)
  12.     );
  13.  
  14.     $llock1 =  settings_is_final('1.3.6.1.4.1.2213.12.1.112.2.100.11', 0) || 
  15.            settings_is_final('1.3.6.1.4.1.2213.12.1.112.2.100.2', 0) ? getLockImg() : '';
  16.  
  17.     $llock2 =  settings_is_final('1.3.6.1.4.1.2213.12.1.112.2.100.100.21', 0) ? getLockImg() : '';
  18.  
  19.     if(!isset($_POST[SUBMIT_TABLE]))
  20.     {
  21.         readSettings(&$Page_Settings);
  22.     }
  23.     else 
  24.     {
  25.         if($_POST[RESTORE_TABLE] == 1)
  26.         {
  27.             readDefaultSettings(&$Page_Settings);
  28.             
  29.             $extraSettingsToReset = array(    
  30.                 array(oid => '1.3.6.1.4.1.2213.12.1.112.2.100.11', type => GLOBAL_INT),
  31.                 array(oid => '1.3.6.1.4.1.2213.12.1.112.2.100.100.2', type => GLOBAL_STR),
  32.                 array(oid => '1.3.6.1.4.1.2213.12.1.112.2.100.100.21', type => GLOBAL_INT),
  33.                 array(oid => '1.3.6.1.4.1.2213.12.1.112.2.100.100.22', type => GLOBAL_STR),
  34.                 array(oid => '1.3.6.1.4.1.2213.12.1.112.2.100.100.49', type => GLOBAL_INT),
  35.                 array(oid => '1.3.6.1.4.1.2213.12.1.112.2.100.100.50', type => GLOBAL_TBL),
  36.                 array(oid => '1.3.6.1.4.1.2213.38.2.300.100.200.300.310.100', type => GLOBAL_TBL)
  37.             );
  38.             readDefaultSettings(&$extraSettingsToReset);
  39.         }
  40.         else
  41.         {
  42.             readPageData(&$Page_Settings);
  43.             if($_POST[SUBMIT_TABLE] == 1)    
  44.                 writeSettings($Page_Settings);
  45.         }
  46.         exit(0);
  47.     }
  48. ?>
  49.  
  50. <script type="text/javascript" src="/common/extlistfuncs.js"></script>
  51. <script language='JavaScript' type='text/javascript'>
  52.     updateView1 = function(mode)
  53.     {
  54.         var label = dojo.byId("ServerManual: targets label");
  55.         label.innerHTML = dojo.string.escapeXml(GetAVTargetsText(mode));
  56.     }
  57.  
  58.     updateView2 = function(excludeObjects, excludeTypes, excludedAppsCount)
  59.     {
  60.         var label = dojo.byId("ServerManual: exclusions label");
  61.         label.innerHTML = dojo.string.escapeXml(GetAVExclusionsText(excludeObjects, excludeTypes, excludedAppsCount));
  62.     }
  63.  
  64.     <?php echo $tab_name;?>_init = function()
  65.     {
  66.         updateView1(
  67.             <?php settings_get_int("1.3.6.1.4.1.2213.12.1.112.2.100.11", &$mode); echo $mode; ?>            
  68.         );
  69.         updateView2(
  70.             <?php settings_get_int("1.3.6.1.4.1.2213.12.1.112.2.100.100.49", &$mode); echo $mode; ?>,
  71.             <?php settings_get_int("1.3.6.1.4.1.2213.12.1.112.2.100.100.21", &$mode); echo $mode; ?>,
  72.             <?php 
  73.                 $tbl1 = array();
  74.                 $tbl2 = array();
  75.                 settings_get_table("1.3.6.1.4.1.2213.38.1.300.100.200.300.210.100", &$tbl1); 
  76.                 settings_get_table("1.3.6.1.4.1.2213.38.2.300.100.200.300.310.100", &$tbl2); 
  77.                 echo (count($tbl1) + count($tbl2));
  78.             ?>
  79.         );
  80.     }
  81.     
  82.     dojo.addOnLoad(<?php echo $tab_name;?>_init);
  83. </script>
  84.  
  85. <?php    show_form_management($tab_name); ?>
  86.  
  87. <form method="POST" action='<?php echo "{$_SERVER['PHP_SELF']}?{$_SERVER['QUERY_STRING']}";?>' 
  88.         id="form_<?php echo $tab_name;?>" name="form_<?php echo $tab_name;?>" style="padding: 0; margin: 0;">
  89.     <input type="hidden" name="SUBMIT_TABLE" value="0">
  90.     <input type="hidden" name="RESTORE_TABLE" value="0">
  91.     <input type="hidden" name="APPLY_SETTINGS" value="0">
  92.  
  93.     <?php show_action_menu('Settings', $tab_name); ?>
  94.     <table border="0" cellspacing="5" cellpadding="0" class="main_page_table">
  95.         <tr>
  96.             <td valign="top" width="100%">
  97.                 
  98.                 <table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_settings">
  99.                     <?php show_section_title('Targets');?>
  100.                     <tr align="left" class="tr_setting">
  101.                         <td class="td_setting" nowrap width='245px'>
  102.                             <?=$llock1;?><?=fsloc("Scan these files:")?>
  103.                         </td>
  104.                         <td class="td_setting" id="ServerManual: targets label">
  105.                         </td>
  106.                         <td class="td_setting" >
  107.                             <button dojoType='fs:Button' 
  108.                                     onClick='javascript: EnableFileTypesDialog("edit", "ms&updateView1");'
  109.                                     style='width: 100px;' 
  110.                                     id="ServerManual: configureFiles">
  111.                                 <div class='button80p'>
  112.                                     <?=GetConfigurableAsWord($can_edit_settings && $llock1 == '', true)?>
  113.                                 </div>
  114.                             </button>
  115.                         </td>
  116.                     </tr>
  117.                     <tr align="left" class="tr_setting">
  118.                         <td class="td_setting" nowrap width='245px'>
  119.                             <?=$llock2;?><?=fsloc("Exclude from scanning:")?>
  120.                         </td>
  121.                         <td class="td_setting" id="ServerManual: exclusions label">
  122.                         </td>
  123.                         <td class="td_setting" >
  124.                             <button 
  125.                                     dojoType='fs:Button' 
  126.                                     onClick='javascript: EnableExclusionsDialog("edit", "ms&updateView2");'
  127.                                     style='width: 100px;' 
  128.                                     id="ServerManual: configureExclusions">
  129.                                 <div class='button80p'>
  130.                                     <?=GetConfigurableAsWord($can_edit_settings && $llock2 == '', true)?>
  131.                                 </div>
  132.                             </button>
  133.                         </td>
  134.                     </tr>
  135.                 </table>
  136.                 <table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_settings">
  137.                     <?php  show_section_title('Options');?>
  138.                     
  139.                     <tr align="left" class="tr_setting">
  140.                         <td class="td_setting" nowrap>
  141.                             <input type="hidden" name="VAR_PAGE_SETTINGS_0" value="0"/>
  142.                             <?=$Page_Settings[0][lock];?><input type="checkbox" id='ServerManual: scanArchives' name="VAR_PAGE_SETTINGS_0" 
  143.                                 value="1" <?php if($Page_Settings[0][value] == 1) echo 'checked';?> />
  144.                             <label for="ServerManual: scanArchives"><?=fsloc("Scan inside compressed files (zip, arj, lzh, ...)")?></label>
  145.                         </td>
  146.                         <td></td>
  147.                         <td></td>
  148.                     </tr>
  149.  
  150.                     <tr align="left" class="tr_setting">
  151.                         <td class="td_setting" nowrap>
  152.                             <input type="hidden" name="VAR_PAGE_SETTINGS_1" value="0"/>
  153.                             <?=$Page_Settings[1][lock];?><input type="checkbox" id="ServerManual: heuristics" name="VAR_PAGE_SETTINGS_1" 
  154.                                 value="1" <?php if($Page_Settings[1][value] == 1) echo 'checked';?> />
  155.                             <label for="ServerManual: heuristics"><?=fsloc("Use advanced heuristics")?></label>
  156.                         </td>
  157.                         <td></td>
  158.                         <td></td>
  159.                     </tr>
  160.                     
  161.                 </table>
  162.                 <table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_settings">
  163.                     <?php show_section_title('Actions');?>
  164.  
  165.                     <tr align="left" class="tr_setting">
  166.                         <td class="td_setting" nowrap width='245px'>
  167.                             <?=$Page_Settings[2][lock];?><label for="ServerManual: virusActiona"><?=fsloc("When virus is found")?></label>
  168.                         </td>
  169.                         <td class="td_setting" >
  170.                             <?php $virAction = $Page_Settings[2][value]; ?>
  171.                             <select id="ServerManual: virusAction" name="VAR_PAGE_SETTINGS_2">
  172.                                 <option value='8' <?php if($swAction == 0) echo 'selected';?>><?=fsloc('Ask what to do')?></option>
  173.                                 <option value="2" <?php if($virAction == 2) echo 'selected';?>><?=fsloc('Disinfect automatically')?></option>
  174.                                 <option value="260" <?php if($virAction == 260) echo 'selected';?>><?=fsloc('Quarantine automatically')?></option>
  175.                                 <option value="6" <?php if($virAction == 6) echo 'selected';?>><?=fsloc('Rename automatically')?></option>
  176.                                 <option value="4" <?php if($virAction == 4) echo 'selected';?>><?=fsloc('Delete automatically')?></option>
  177.                                 <option value="0" <?php if($virAction == 0) echo 'selected';?>><?=fsloc('Report only')?></option>
  178.                             </select>
  179.                         </td>
  180.                         <td></td>
  181.                     </tr>                    
  182.                     <tr align="left" class="tr_setting">
  183.                         <td class="td_setting" nowrap width='245px'>
  184.                             <?=$Page_Settings[3][lock];?><label for="ServerRealtime: spywareAction"><?=fsloc('When spyware is found')?></label>
  185.                         </td>
  186.                         <td class="td_setting" >
  187.                             <?php $swAction = $Page_Settings[3][value];?>
  188.                             <select id="ServerManual: spywareAction" name="VAR_PAGE_SETTINGS_3">
  189.                                 <option value='8' <?php if($swAction == 8) echo 'selected';?>><?=fsloc('Ask what to do')?></option>
  190.                                 <option value="0" <?php if($swAction == 0) echo 'selected';?>><?=fsloc('Report only')?></option>
  191.                                 <option value="4" <?php if($swAction == 4) echo 'selected';?>><?=fsloc('Remove automatically')?></option>
  192.                                 <option value="260" <?php if($swAction == 260) echo 'selected';?>><?=fsloc('Quarantine automatically')?></option>
  193.                             </select>
  194.                         </td>
  195.                         <td></td>
  196.                     </tr>
  197.                 </table>
  198.             </td>
  199.         </tr>
  200.         <?php show_action_buttons($tab_name, true, true); ?>
  201.     </table>
  202.     
  203. </form>