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_fsma
/
matchlists.php
< prev
next >
Wrap
PHP Script
|
2010-09-07
|
7KB
|
174 lines
<?php
include ("..\common\commonphp.php");
$Page_Settings = array( array(oid => '1.3.6.1.4.1.2213.20.1.100.40.10', type => GLOBAL_TBL));
$MatchlistTypes = array(fsloc('Keywords'), fsloc('File patterns'), fsloc('Email addresses'));
$oid_base = '1.3.6.1.4.1.2213.20.1';
$Page_Affected_Settings = array(
'200.10.10.20', '200.10.10.30', '200.10.10.70', '200.10.10.290',
'200.10.20.20', '200.10.20.30', '200.10.20.130', '200.10.20.290',
'200.10.30.20', '200.10.30.30', '200.10.30.110', '200.10.50.110',
'200.10.50.130', '200.10.50.230', '200.10.60.20', '200.10.60.30',
'200.10.70.122', '200.10.70.123', '200.10.70.132', '200.10.70.133',
'200.10.110.10', '200.10.110.20', '200.20.10.20', '200.20.10.30',
'200.20.10.70', '200.20.10.290', '200.20.20.20', '200.20.20.30',
'200.20.20.130', '200.20.20.290', '200.20.30.20', '200.20.30.30',
'200.20.30.110', '200.20.50.110', '200.20.50.130', '200.20.50.230',
'200.20.60.20', '200.20.60.30', '200.20.110.10', '200.20.110.20',
'200.30.10.20', '200.30.10.30', '200.30.10.70', '200.30.10.290',
'200.30.20.20', '200.30.20.30', '200.30.20.130', '200.30.20.290',
'200.30.30.20', '200.30.30.30', '200.30.30.110', '200.30.50.110',
'200.30.50.130', '200.30.50.230', '200.30.60.20', '200.30.60.30',
'200.30.110.10', '200.30.110.20',
'300.10.20.80', '300.10.20.90', '300.10.20.330', '300.10.30.20',
'300.10.30.30', '300.10.50.110', '300.10.50.130', '300.30.10.20',
'300.30.10.30', '300.30.10.70', '300.30.20.20', '300.30.20.30',
'300.30.20.130', '300.30.30.20','300.30.30.30', '300.30.30.110',
'300.30.50.110', '300.30.50.130'
);
$tab_name = "tabFSMAMatchLists";
$AFFECTED = array();
if(!isset($_POST[SUBMIT_TABLE]))
{
/* first load of the page */
readSettings(&$Page_Settings);
foreach($Page_Affected_Settings as $entry)
{
settings_get_str($oid_base . '.' . $entry, &$value);
if($value != '')
$AFFECTED[$value] = 1;
}
// not allowed to remove defaults
$PageDefSettings = array();
settings_get_default_table($Page_Settings[0][oid], &$PageDefSettings);
foreach($PageDefSettings as $entry)
if($entry[1] != '')
$AFFECTED[$entry[1]] = 2;
}
else
{
if($_POST[RESTORE_TABLE] == 1)
{
readDefaultSettings(&$Page_Settings);
}
else
{
readSettings(&$Page_Settings);
if($_POST[REMOVE_ITEM] != -1)
{
foreach ($Page_Settings[0][value] as $next_row)
$sortarr[] = $next_row[1];
array_multisort($sortarr, $Page_Settings[0][value]);
unset($Page_Settings[0][value][$_POST[REMOVE_ITEM]]);
}
writeSettings($Page_Settings);
}
exit(0);
}
show_form_management($tab_name);
foreach ($Page_Settings[0][value] as $next_row)
$sortarr[] = $next_row[1];
array_multisort($sortarr, $Page_Settings[0][value]);
?>
<script language="javascript">
var matchlists = new Array();
var matchlistsReserved = new Array();
<?php
$index = 0;
foreach($AFFECTED as $key => $entry)
echo "matchlistsReserved[" . $index++ . "] = ".EscapeJSCodeString($key).";\n";
$index = 0;
foreach($Page_Settings[0][value] as $entry)
echo "matchlists[" . $index++ . "] = ".EscapeJSCodeString($entry[1]).";\n";
?>
tabFSMAMatchLists_remove_hit = function(item_index)
{
if(have_such_entry_simple(matchlistsReserved, matchlists[item_index]))
{
show_webui_message_box(localized_strings.Warning, localized_strings.RemoveListConfirmation, 0);
return;
}
refreshed = true;
document.form_<?php echo $tab_name;?>.REMOVE_ITEM.value = item_index;
dojo.byId("tabFSMAMatchLists_submitit").click();
}
</script>
<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="RESTORE_TABLE" value="0">
<input type="hidden" name="SUBMIT_TABLE" value="0">
<input type="hidden" name="APPLY_SETTINGS" value="0">
<input type="hidden" name="REMOVE_ITEM" value="-1">
<button style='display:none' type='submit' id='tabFSMAMatchLists_submitit'></button>
<?php show_action_menu('Match Lists', $tab_name); ?>
<table border=0 cellspacing="5" cellpadding="0">
<tr valign=top>
<td valign="top" style="padding: 5px;">
<table style="table-layout:fixed;" border=0 cellpadding=0 cellspacing=0 bordercolorlight=D4D0C8>
<tr>
<td width="10px"><div class="table_stats_heading"><img src="../pics/layout/corner_up_left.gif" alt="" class="left_top"/></div></td>
<td align="left" width=140><div class="table_stats_heading"><span><?php echo $Page_Settings[0][lock] . fsloc('List name')?></span></div></td>
<td align="left" width=120><div class="table_stats_heading"><span><?=fsloc('Type')?></span></div></td>
<td align="left"><div class="table_stats_heading"><span><?=fsloc('Filter')?></span></div></td>
<td align="right" nowrap><div class="table_stats_heading"><span><?php echo ($global_can_edit && !isset($Page_Settings[0][lock]) ? "<a href='javascript:;' onClick='EnableMatchlistDialog(\"NewItem\", \"\");'>" . fsloc('Add new list...') . "</a>" : ' ');?></span></div></td>
<td width="10px"><div class="table_stats_heading"><img src="../pics/layout/corner_up_right.gif" alt="" class="right_top"/></div></td>
</tr>
<?php
$index = 0;
$editable_as_word = $global_can_edit && !isset($Page_Settings[0][lock]) ? 'Edit' : 'View';
$tr_type = '';
foreach($Page_Settings[0][value] as $entry)
{
$tr_type = ($tr_type == '_odd') ? '_even' : '_odd';
$remove_text = ' ';
$oper_mode = $editable_as_word . 'ItemDefault';
$font_color = $entry[0] ? '' : ' color: #999999; ';
if($AFFECTED[$entry[1]] != 2 && $global_can_edit && !isset($Page_Settings[0][lock]))
{
$remove_text = "<a href='javascript:;' onClick='javascript: tabFSMAMatchLists_remove_hit({$index});'>" . fsloc('remove') . "</a>";
$oper_mode = isset($AFFECTED[$entry[1]]) ? 'EditItemLimited' : 'EditItemFull';
}
echo "
<tr class='tr_setting$tr_type' style='height: 45px;'>
<td></td>
<td style='padding-left: 5px;'>
<a href='javascript:;'
onClick='javascript: EnableMatchlistDialog(\"{$oper_mode}\", ".EscapeJSCodeString($entry[1]).");'
title='".htmlspecialchars($entry[4], ENT_QUOTES)."'>
".htmlspecialchars($entry[1])."
</a>
</td>
<td style='padding-left: 10px; $font_color'>{$MatchlistTypes[$entry[2]]}</td>
<td style='padding-left: 10px; $font_color'>".htmlspecialchars($entry[3])."</td>
<td align='right' style='padding-left: 5px;'>$remove_text</td>
<td> </td>
</tr>
";
$index++;
}
?>
</table>
</td>
</tr>
<?php show_action_buttons($tab_name, true, true); ?>
</table>
</form>