75
75
print show_error_dlg($error_text);
77
my @proxy_auth_modes = (
78
{'ID' => 'basic', 'NAME' => 'Basic'},
79
{'ID' => 'digest', 'NAME' => 'Digest'},
80
{'ID' => 'ntlm', 'NAME' => 'NTLM'},
81
{'ID' => 'negotiate', 'NAME' => 'GSS-Negotiate'},
82
{'ID' => 'anyauth', 'NAME' => 'Autoselect'},
78
86
<div id="ajax_loading" style="display: none; position: fixed; width: 13em; height: 5.8em; top: 40%; left: 50%; margin-top: -2.9em; margin-left: -7.5em; border: solid 1px #00007f; background-color: #e7f0ff; text-align: center; padding: 6px;"><div align="center">
79
87
Please wait…<br />
124
132
<td valign="top" width="100%">
125
<table cellpadding="0" cellspacing="0" border="0" width="100%">
127
<td style="border: solid 1px #606090; background: #e0e0ff; text-align: center; font-size: large; padding: 0.3em;">Server Configuration</td>
130
<td style="border: solid 1px #606090; border-top: none; vertical-align: top; padding: 10px;">
131
Proxy server for connecting to the Linux Foundation FTP:<br />
132
<input type="text" name="proxy" id="proxy" value="$SERVER_PARAM{'PROXY'}" style="width: 35em;" onfocus="javascript:style.borderColor=input_border_color;" /><br />
134
<input type="button" name="apply_button" id="apply_button" value="Apply" style="width: 7em;" onclick="javascript:onSettingsApply();" /> <input type="button" name="clear_button" id="clear_button" value="Clear" style="width: 7em;" onclick="javascript:onSettingsClear();" /><span id="conf_saved_msg" style="display: none;"> <b>Configuration saved</b></span>
133
<form name="server_config" id="server_config" method="post" action="">
134
<table cellpadding="0" cellspacing="0" border="0" width="100%">
136
<td style="border: solid 1px #606090; background: #e0e0ff; text-align: center; font-size: large; padding: 0.3em;">Server Configuration</td>
139
<td style="border: solid 1px #606090; border-top: none; vertical-align: top; padding: 10px;">
140
Proxy servers for connecting to the Linux Foundation servers:<br />
141
<table cellpadding="2" cellspacing="0" border="0" style="margin-top: 0.3em;">
144
my $same_proxy_sel = '';
145
if ($SERVER_PARAM{'PROXY'} or (!$SERVER_PARAM{'PROXY'} and !$SERVER_PARAM{'HTTP_PROXY'} and !$SERVER_PARAM{'FTP_PROXY'})) {
146
$same_proxy_sel = ' checked="checked"';
151
<td colspan="3"><label><input type="checkbox" name="same_proxy_config" id="same_proxy_config"$same_proxy_sel onclick="javascript:onSameProxy();" /> Use one configuration for both HTTP and FTP</label></td>
155
foreach my $proto (qw/http ftp/) {
156
my $proto_name = uc($proto);
157
my ($user, $pswd, $host, $port) = ('', '', '', '');
158
my ($user_style, $pswd_style, $host_style, $port_style) = (' display: none;', ' display: none;', ' display: none;', ' display: none;');
159
my ($user_hstyle, $pswd_hstyle, $host_hstyle, $port_hstyle) = ('', '', '', '');
160
my $pswd_wstyle = ' display: none;';
161
if ($SERVER_PARAM{$proto_name.'_PROXY'} =~ m/^(?:([A-Za-z0-9\-_.\@]+)(?::(.*))?\@)?([A-Za-z0-9\-_.]+):(\d+)$/) {
165
$user_hstyle = ' display: none;';
170
$pswd_hstyle = ' display: none;';
176
$host_hstyle = ' display: none;';
181
$port_hstyle = ' display: none;';
187
<td rowspan="3" id="${proto}_title" style="vertical-align: top; font-weight: bold; width: 4em; height: 2em;">$proto_name:</td>
188
<td colspan="2"><input type="text" name="${proto}_proxy_host" id="${proto}_proxy_host" value="$host" style="width: 20em; height: 1.2em;$host_style" /><input type="text" name="${proto}_proxy_host_hint" id="${proto}_proxy_host_hint" value="hostname" style="width: 20em; height: 1.2em; color: #a0a0a0; font-style: italic;$host_hstyle" onfocus="javascript:hideHint(this, '${proto}_proxy_host');" /> <input type="text" name="${proto}_proxy_port" id="${proto}_proxy_port" value="$port" style="width: 5em; height: 1.2em;$port_style" /><input type="text" name="${proto}_proxy_port_hint" id="${proto}_proxy_port_hint" value="port" style="width: 5em; height: 1.2em; color: #a0a0a0; font-style: italic;$port_hstyle" onfocus="javascript:hideHint(this, '${proto}_proxy_port');" /></td>
191
<td rowspan="2" id="${proto}_auth_title" style="vertical-align: top; height: 2em;">Authentication:</td>
193
<select name="${proto}_proxy_auth" id="${proto}_proxy_auth" style="width: 13em;">
196
my ($proxy_auth, $proxy_auth_notunnel) = split(/,/, $SERVER_PARAM{$proto_name.'_PROXY_AUTH'});
197
foreach my $auth_mode (@proxy_auth_modes) {
198
if ($auth_mode->{'ID'} eq $proxy_auth) {
199
print " <option value=\"$auth_mode->{'ID'}\" selected=\"selected\">$auth_mode->{'NAME'}</option>\n";
202
print " <option value=\"$auth_mode->{'ID'}\">$auth_mode->{'NAME'}</option>\n";
205
my $proxy_auth_notunnel_sel = (($proxy_auth_notunnel and ($proxy_auth_notunnel eq 'notunnel')) ? ' checked="checked"' : '');
209
<label><input type="checkbox" name="${proto}_proxy_auth_notunnel" id="${proto}_proxy_auth_notunnel"$proxy_auth_notunnel_sel /> <span id="${proto}_auth_notunnel_title">No tunnelling</span></label>
213
<td style="height: 2em;"><input type="text" name="${proto}_proxy_user" id="${proto}_proxy_user" value="$user" style="width: 7em; height: 1.2em;$user_style" /><input type="text" name="${proto}_proxy_user_hint" id="${proto}_proxy_user_hint" value="username" style="width: 7em; height: 1.2em; color: #a0a0a0; font-style: italic;$user_hstyle" onfocus="javascript:hideHint(this, '${proto}_proxy_user');" /> <input type="password" name="${proto}_proxy_pswd" id="${proto}_proxy_pswd" value="$pswd" style="width: 7em; height: 1.2em;$pswd_style" onchange="javascript:controlPasswordWarning('$proto');" onkeyup="javascript:controlPasswordWarning('$proto');" /><input type="text" name="${proto}_proxy_pswd_hint" id="${proto}_proxy_pswd_hint" value="password" style="width: 7em; height: 1.2em; color: #a0a0a0; font-style: italic;$pswd_hstyle" onfocus="javascript:hideHint(this, '${proto}_proxy_pswd');" /><img src="images/environment-spacer.gif" alt="" style="width: 0.7em; height: 1.0em;" /><a href="tests_help.pl#password_insecure" target="_blank" id="${proto}_proxy_pswd_warning" style="color: red; text-decoration: underline;$pswd_wstyle">Storing the password is insecure!</a></td>
216
<td><img src="images/environment-spacer.gif" alt="" width="1" height="10" /></td>
225
<input type="button" name="apply_button" id="apply_button" value="Apply" style="width: 7em;" onclick="javascript:onSettingsApply();" /> <input type="button" name="clear_button" id="clear_button" value="Clear" style="width: 7em;" onclick="javascript:onSettingsClear();" /><span id="conf_saved_msg" style="display: none;"> <b>Configuration saved</b></span>
145
237
preload_images(new Array('expand.png', 'collapse.png', 'ajax_progress.gif'));
146
238
var input_border_color = ((navigator.appName == 'Konqueror') ? '#cccccc' : '');
240
// Work with "hint-boxes" (text boxes with "ghost" hint text inside)
241
function hideHint(hint_elem, id) {
242
var elem = document.getElementById(id);
245
hint_elem.style.display = 'none';
246
elem.style.display = '';
247
// Konqueror cannot set focus immediately for unknown reason. Oh, well, give him some time to think...
248
setTimeout('document.getElementById(\\'' + id + '\\').focus()', 10);
251
var saved_control_values = new Array();
253
function onSameProxy() {
254
var elem = document.getElementById('same_proxy_config');
257
var make_disabled = elem.checked;
258
// TODO: Get rid of plain enumeration (?)
259
var gray_out = new Array('ftp_title', 'ftp_auth_title', 'ftp_auth_notunnel_title');
260
var disable = new Array('ftp_proxy_host', 'ftp_proxy_port', 'ftp_proxy_auth', 'ftp_proxy_auth_notunnel', 'ftp_proxy_user', 'ftp_proxy_pswd');
261
for (var i in gray_out) {
262
document.getElementById(gray_out[i]).style.color = (make_disabled ? 'gray' : 'black');
264
for (var i in disable) {
266
elem = document.getElementById(id);
268
elem.disabled = make_disabled;
270
saved_control_values[id] = elem.value;
274
elem.value = saved_control_values[id];
277
var id_hint = id + '_hint';
278
elem = document.getElementById(id_hint);
280
elem.disabled = make_disabled;
282
saved_control_values[id_hint] = elem.value;
286
elem.value = saved_control_values[id_hint];
290
controlPasswordWarning('ftp');
293
function controlPasswordWarning(proto) {
294
var pswd = document.getElementById(proto + '_proxy_pswd');
295
document.getElementById(proto + '_proxy_pswd_warning').style.display = ((pswd.value == '') ? 'none' : '');
300
print "onSameProxy();\n\n" if ($same_proxy_sel);
149
304
function onStopServer(pid, what) {
150
305
if (!ajax_req_busy) {