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.fsfix / iuwebui / forms / tree_updates / autoupdates-general.php next >
PHP Script  |  2010-09-07  |  8KB  |  176 lines

  1. <?php 
  2.     include ("..\common\commonphp.php");
  3.  
  4.     $Page_Settings = array(array(oid => '1.3.6.1.4.1.2213.42.1.11.1', type => GLOBAL_INT),
  5.                 array(oid => '1.3.6.1.4.1.2213.42.1.11.30', type => GLOBAL_INT, min => 1*60*60*100, max => 256*24*60*60*100),
  6.                 array(oid => '1.3.6.1.4.1.2213.42.1.11.40', type => GLOBAL_INT, min => 1*60*100, max => 256*24*60*60*100),
  7.                 array(oid => '1.3.6.1.4.1.2213.42.1.11.50', type => GLOBAL_INT),
  8.                 array(oid => '1.3.6.1.4.1.2213.42.1.11.3', type => GLOBAL_INT),
  9.                 array(oid => '1.3.6.1.4.1.2213.42.1.11.4.1', type => GLOBAL_INT),
  10.                 array(oid => '1.3.6.1.4.1.2213.42.1.11.4.3.1', type => GLOBAL_STR));
  11.  
  12.     $tab_name = "tabAUAGeneral";
  13.  
  14.     if(!isset($_POST[SUBMIT_TABLE]))
  15.     {
  16.         /* first load of the page */
  17.         readSettings(&$Page_Settings);
  18.     }
  19.     else 
  20.     {
  21.         if($_POST[RESTORE_TABLE] == 1)
  22.         {
  23.             /* user wants to restore defaults */
  24.             readDefaultSettings(&$Page_Settings);
  25.         }
  26.         else
  27.         {
  28.             if(isset($_POST["VAR_PAGE_SETTINGS_1"]))
  29.                 $_POST["VAR_PAGE_SETTINGS_1"] *= 360000;
  30.             if(isset($_POST["VAR_PAGE_SETTINGS_2"]))
  31.                 $_POST["VAR_PAGE_SETTINGS_2"] *= 6000;
  32.  
  33.             readPageData(&$Page_Settings);
  34.             if($_POST[SUBMIT_TABLE] == 1)    
  35.                 writeSettings($Page_Settings);
  36.         }
  37.         exit(0);
  38.     }    
  39.     
  40.     $Page_Settings[1][value] /= 360000;
  41.     $Page_Settings[2][value] /= 6000;
  42. ?>
  43.  
  44. <script language="javascript">
  45.     <?php echo $tab_name;?>enableControls = function(status_value) 
  46.     {
  47.         var is_disabled = (status_value == 0);
  48.         control_enabler_arr('<?php echo $tab_name;?>', [1,2,3,4,5], is_disabled,  disabled_settings_<?php echo $tab_name;?>);
  49.         control_enabler_arr('<?php echo $tab_name;?>', [6], is_disabled || document.form_<?php echo $tab_name;?>.VAR_PAGE_SETTINGS_5.value != 2,  disabled_settings_<?php echo $tab_name;?>);
  50.     }
  51.     startup<?php echo $tab_name;?>enableControls = function() 
  52.     {    
  53.         <?php echo "{$tab_name}enableControls('{$Page_Settings[0][value]}');"; ?> 
  54.     }
  55.     //document.form_<?php echo $tab_name;?>.VAR_PAGE_SETTINGS_6.disabled = <?php echo ($Page_Settings[5][value] != 2) ? 'true' : 'false';?>;
  56.     mseconds2hours = function(bound)
  57.     {
  58.         return bound/360000;
  59.     }
  60.     mseconds2mins = function(bound)
  61.     {
  62.         return bound/6000;
  63.     }
  64.     <?php echo $tab_name;?>_settings_check = function()
  65.     {
  66.         <?php echo get_validation_script($Page_Settings[1], $tab_name, "VAR_PAGE_SETTINGS_1", "mseconds2hours")?>
  67.         <?php echo get_validation_script($Page_Settings[2], $tab_name, "VAR_PAGE_SETTINGS_2", "mseconds2mins")?>
  68.         var frm = document.form_<?php echo $tab_name;?>;
  69.         var msg = validate_string(frm.VAR_PAGE_SETTINGS_6.value);
  70.         if (msg != null)
  71.         {
  72.             show_webui_message_box(localized_strings.InvalidInput, msg, 0);
  73.             return false;
  74.         }
  75.         return true;
  76.     }
  77. </script>
  78.  
  79. <?php    show_form_management($tab_name); ?>
  80.  
  81. <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;">
  82.     <input type="hidden" name="SUBMIT_TABLE" value="0">
  83.     <input type="hidden" name="RESTORE_TABLE" value="0">
  84.     <input type="hidden" name="APPLY_SETTINGS" value="0">
  85.     <input type="hidden" name="EMPTY_TABLE" value="0">
  86.     <input type="hidden" name="ENTRIES_TABLE" value="<?php echo count($Page_Settings[0][shown]);?>">
  87.  
  88.     <?php show_action_menu('General', $tab_name); ?>
  89.     <table border="0" cellspacing="5" cellpadding="0" class="main_page_table">
  90.         <tr>
  91.             <td valign="top" width="100%">
  92.                 <input type="hidden" name="VAR_PAGE_SETTINGS_0" value="0">
  93.           <?=$Page_Settings[0][lock];?>
  94.           <input id='AUAGeneral: updates enabled' class='top_checkbox' type="checkbox" 
  95.                     name="VAR_PAGE_SETTINGS_0" onclick="javascript: <?php echo $tab_name;?>enableControls(this.checked);" value="1" 
  96.                     <?php if($Page_Settings[0][value] == 1) echo 'checked';?>/>
  97.                 <label for='AUAGeneral: updates enabled'><?=fsloc("Turn on automatic updating")?></label>
  98.                 <table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_settings">
  99.                     <?php show_section_title('Database updates');?>
  100.                     <tr align="left" class="tr_setting">
  101.                         <td nowrap class="td_setting">
  102.                             <label for='AUAGeneral: connection checking'>
  103.                 <?=$Page_Settings[4][lock];?>
  104.                 <?=fsloc("Internet connection checking:")?></label>   
  105.                         </td>
  106.                         <td>
  107.                             <select id='AUAGeneral: connection checking' name="VAR_PAGE_SETTINGS_4">
  108.                                 <option value="0" <?php if($Page_Settings[4][value] == 0) echo 'selected';?>><?=fsloc("Assume always connected")?>
  109.                                 <option value="1" <?php if($Page_Settings[4][value] == 1) echo 'selected';?>><?=fsloc("Detect connection")?>
  110.                                 <option value="2" <?php if($Page_Settings[4][value] == 2) echo 'selected';?>><?=fsloc("Detect traffic")?>
  111.                             </select>
  112.                         </td>
  113.                     </tr>
  114.                     <tr align="left" class="tr_setting">
  115.                         <td nowrap class="td_setting">
  116.                             <label for='AUAGeneral: HTTP proxy'>
  117.                 <?=$Page_Settings[5][lock];?>
  118.                 <?=fsloc("Use HTTP proxy:")?></label>   
  119.                         </td>
  120.                         <td>
  121.                             <select id='AUAGeneral: HTTP proxy' name="VAR_PAGE_SETTINGS_5" onclick="javascript: document.form_<?php echo $tab_name;?>.VAR_PAGE_SETTINGS_6.disabled = (this.value != 2);">
  122.                                 <option value="0" <?php if($Page_Settings[5][value] == 0) echo 'selected';?>><?=fsloc("No HTTP proxy")?>
  123.                                 <option value="1" <?php if($Page_Settings[5][value] == 1) echo 'selected';?>><?=fsloc("Use browser's HTTP proxy")?>
  124.                                 <option value="2" <?php if($Page_Settings[5][value] == 2) echo 'selected';?>><?=fsloc("Manually configure HTTP proxy")?>
  125.                             </select>
  126.                         </td>
  127.                     </tr>
  128.                     <tr align="left" class="tr_setting">
  129.                         <td nowrap class="td_setting">
  130.                             <label for='AUAGeneral: user-defined proxy'>
  131.                 <?=$Page_Settings[6][lock];?>
  132.                 <?=fsloc("User defined proxy:")?></label>   
  133.                         </td>
  134.                         <td width=100%>
  135.                             <input id='AUAGeneral: user-defined proxy' type="text" size=50 name="VAR_PAGE_SETTINGS_6" value="<?php echo "{$Page_Settings[6][value]}";?>">
  136.                         </td>
  137.                     </tr>
  138.                 </table>
  139.                 <table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_settings">
  140.                     <?php show_section_title('Update server');?>
  141.                     <tr align="left" class="tr_setting">
  142.                         <td nowrap class="td_setting">
  143.                             <input type="hidden" name="VAR_PAGE_SETTINGS_3" value="0"/>
  144.               <?=$Page_Settings[3][lock];?>
  145.               <input id='AUAGeneral: allow fetching' type="checkbox" name="VAR_PAGE_SETTINGS_3" value="1" <?php if($Page_Settings[3][value] == 1) echo 'checked';?>/>
  146.                             <label for='AUAGeneral: allow fetching'><?=fsloc("Allow fetching updates from F-Secure Update Server")?></label>
  147.                         </td>
  148.                     </tr>
  149.                     <tr align="left" class="tr_setting">
  150.                         <td nowrap class="td_setting">
  151.                             <table cellspacing=0 cellpadding=0 border=0 valign=center>
  152.                                 <tr height="30">
  153.                                     <td width="140"><label for='AUAGeneral: failover time'>
  154.                     <?=$Page_Settings[1][lock];?>
  155.                     <?=fsloc("Server failover time:")?></label>   </td>
  156.                                     <td><input id='AUAGeneral: failover time' type="text" size="10" name="VAR_PAGE_SETTINGS_1" value="<?php echo $Page_Settings[1][value];?>"/>  <?=fsloc("hours")?></td>
  157.                                 </tr>
  158.                                 <tr height=30>
  159.                                     <td><label for='AUAGeneral: polling interval'>
  160.                     <?=$Page_Settings[2][lock];?>
  161.                     <?=fsloc("Server polling interval:")?></label>   </td>
  162.                                     <td><input id='AUAGeneral: polling interval' type="text" size=10 name="VAR_PAGE_SETTINGS_2" value="<?php echo $Page_Settings[2][value];?>"/>  <?=fsloc("minutes")?></td>
  163.                                 </tr>
  164.                             </table>
  165.                         </td>
  166.                     </tr>
  167.                 </table>
  168.             </td>
  169.         </tr>
  170.         <?php show_action_buttons($tab_name, true, true); ?>
  171.     </table>
  172. </form>    
  173.  
  174.  
  175.  
  176.