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 >
Wrap
PHP Script
|
2010-09-07
|
8KB
|
176 lines
<?php
include ("..\common\commonphp.php");
$Page_Settings = array(array(oid => '1.3.6.1.4.1.2213.42.1.11.1', type => GLOBAL_INT),
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),
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),
array(oid => '1.3.6.1.4.1.2213.42.1.11.50', type => GLOBAL_INT),
array(oid => '1.3.6.1.4.1.2213.42.1.11.3', type => GLOBAL_INT),
array(oid => '1.3.6.1.4.1.2213.42.1.11.4.1', type => GLOBAL_INT),
array(oid => '1.3.6.1.4.1.2213.42.1.11.4.3.1', type => GLOBAL_STR));
$tab_name = "tabAUAGeneral";
if(!isset($_POST[SUBMIT_TABLE]))
{
/* first load of the page */
readSettings(&$Page_Settings);
}
else
{
if($_POST[RESTORE_TABLE] == 1)
{
/* user wants to restore defaults */
readDefaultSettings(&$Page_Settings);
}
else
{
if(isset($_POST["VAR_PAGE_SETTINGS_1"]))
$_POST["VAR_PAGE_SETTINGS_1"] *= 360000;
if(isset($_POST["VAR_PAGE_SETTINGS_2"]))
$_POST["VAR_PAGE_SETTINGS_2"] *= 6000;
readPageData(&$Page_Settings);
if($_POST[SUBMIT_TABLE] == 1)
writeSettings($Page_Settings);
}
exit(0);
}
$Page_Settings[1][value] /= 360000;
$Page_Settings[2][value] /= 6000;
?>
<script language="javascript">
<?php echo $tab_name;?>enableControls = function(status_value)
{
var is_disabled = (status_value == 0);
control_enabler_arr('<?php echo $tab_name;?>', [1,2,3,4,5], is_disabled, disabled_settings_<?php echo $tab_name;?>);
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;?>);
}
startup<?php echo $tab_name;?>enableControls = function()
{
<?php echo "{$tab_name}enableControls('{$Page_Settings[0][value]}');"; ?>
}
//document.form_<?php echo $tab_name;?>.VAR_PAGE_SETTINGS_6.disabled = <?php echo ($Page_Settings[5][value] != 2) ? 'true' : 'false';?>;
mseconds2hours = function(bound)
{
return bound/360000;
}
mseconds2mins = function(bound)
{
return bound/6000;
}
<?php echo $tab_name;?>_settings_check = function()
{
<?php echo get_validation_script($Page_Settings[1], $tab_name, "VAR_PAGE_SETTINGS_1", "mseconds2hours")?>
<?php echo get_validation_script($Page_Settings[2], $tab_name, "VAR_PAGE_SETTINGS_2", "mseconds2mins")?>
var frm = document.form_<?php echo $tab_name;?>;
var msg = validate_string(frm.VAR_PAGE_SETTINGS_6.value);
if (msg != null)
{
show_webui_message_box(localized_strings.InvalidInput, msg, 0);
return false;
}
return true;
}
</script>
<?php show_form_management($tab_name); ?>
<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;">
<input type="hidden" name="SUBMIT_TABLE" value="0">
<input type="hidden" name="RESTORE_TABLE" value="0">
<input type="hidden" name="APPLY_SETTINGS" value="0">
<input type="hidden" name="EMPTY_TABLE" value="0">
<input type="hidden" name="ENTRIES_TABLE" value="<?php echo count($Page_Settings[0][shown]);?>">
<?php show_action_menu('General', $tab_name); ?>
<table border="0" cellspacing="5" cellpadding="0" class="main_page_table">
<tr>
<td valign="top" width="100%">
<input type="hidden" name="VAR_PAGE_SETTINGS_0" value="0">
<?=$Page_Settings[0][lock];?>
<input id='AUAGeneral: updates enabled' class='top_checkbox' type="checkbox"
name="VAR_PAGE_SETTINGS_0" onclick="javascript: <?php echo $tab_name;?>enableControls(this.checked);" value="1"
<?php if($Page_Settings[0][value] == 1) echo 'checked';?>/>
<label for='AUAGeneral: updates enabled'><?=fsloc("Turn on automatic updating")?></label>
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_settings">
<?php show_section_title('Database updates');?>
<tr align="left" class="tr_setting">
<td nowrap class="td_setting">
<label for='AUAGeneral: connection checking'>
<?=$Page_Settings[4][lock];?>
<?=fsloc("Internet connection checking:")?></label>
</td>
<td>
<select id='AUAGeneral: connection checking' name="VAR_PAGE_SETTINGS_4">
<option value="0" <?php if($Page_Settings[4][value] == 0) echo 'selected';?>><?=fsloc("Assume always connected")?>
<option value="1" <?php if($Page_Settings[4][value] == 1) echo 'selected';?>><?=fsloc("Detect connection")?>
<option value="2" <?php if($Page_Settings[4][value] == 2) echo 'selected';?>><?=fsloc("Detect traffic")?>
</select>
</td>
</tr>
<tr align="left" class="tr_setting">
<td nowrap class="td_setting">
<label for='AUAGeneral: HTTP proxy'>
<?=$Page_Settings[5][lock];?>
<?=fsloc("Use HTTP proxy:")?></label>
</td>
<td>
<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);">
<option value="0" <?php if($Page_Settings[5][value] == 0) echo 'selected';?>><?=fsloc("No HTTP proxy")?>
<option value="1" <?php if($Page_Settings[5][value] == 1) echo 'selected';?>><?=fsloc("Use browser's HTTP proxy")?>
<option value="2" <?php if($Page_Settings[5][value] == 2) echo 'selected';?>><?=fsloc("Manually configure HTTP proxy")?>
</select>
</td>
</tr>
<tr align="left" class="tr_setting">
<td nowrap class="td_setting">
<label for='AUAGeneral: user-defined proxy'>
<?=$Page_Settings[6][lock];?>
<?=fsloc("User defined proxy:")?></label>
</td>
<td width=100%>
<input id='AUAGeneral: user-defined proxy' type="text" size=50 name="VAR_PAGE_SETTINGS_6" value="<?php echo "{$Page_Settings[6][value]}";?>">
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="table_settings">
<?php show_section_title('Update server');?>
<tr align="left" class="tr_setting">
<td nowrap class="td_setting">
<input type="hidden" name="VAR_PAGE_SETTINGS_3" value="0"/>
<?=$Page_Settings[3][lock];?>
<input id='AUAGeneral: allow fetching' type="checkbox" name="VAR_PAGE_SETTINGS_3" value="1" <?php if($Page_Settings[3][value] == 1) echo 'checked';?>/>
<label for='AUAGeneral: allow fetching'><?=fsloc("Allow fetching updates from F-Secure Update Server")?></label>
</td>
</tr>
<tr align="left" class="tr_setting">
<td nowrap class="td_setting">
<table cellspacing=0 cellpadding=0 border=0 valign=center>
<tr height="30">
<td width="140"><label for='AUAGeneral: failover time'>
<?=$Page_Settings[1][lock];?>
<?=fsloc("Server failover time:")?></label> </td>
<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>
</tr>
<tr height=30>
<td><label for='AUAGeneral: polling interval'>
<?=$Page_Settings[2][lock];?>
<?=fsloc("Server polling interval:")?></label> </td>
<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>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<?php show_action_buttons($tab_name, true, true); ?>
</table>
</form>