<?php
// ====================================================================
// Copyright (c) 2002 by the ANDURAS AG, Passau, Germany.
// ====================================================================
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
// ====================================================================
// $Id: surfprot_gui_trans.inc,v 1.6 2002/08/16 08:55:06 anders Exp $
// ====================================================================
//==========================================================================
// PRIVATE FUNCTIONS
//==========================================================================
//--------------------------------------------------------------------------
// Show user/password formular
//--------------------------------------------------------------------------
function _output_userpass_form($type)
{
global $script_url, $url, $remote_addr, $http_referer, $nojavascript;
global $temp_datafile_name, $temp_headerfile_name;
echo '<form action="'.$script_url.'" method="post" onSubmit="OpenOnUnloadDisabled=1;">';
echo '<input type="hidden" name="action" value="download">';
echo '<input type="hidden" name="qurl" value="'.urlencode($url).'">';
echo '<input type="hidden" name="remote_addr" value="'.$remote_addr.'">';
echo '<input type="hidden" name="http_referer" value="'.$http_referer.'">';
echo '<input type="hidden" name="nojavascript" value="'.$nojavascript.'">';
echo '<table>';
echo '<tr><td>';
echo 'User:';
echo '</td><td>';
echo '<input type="text" name="'.$type.'_user" value="" size="8" maxlength="32">';
echo '</td><td>';
echo '</td></tr>';
echo '<tr><td>';
echo 'Password:';
echo '</td><td>';
echo '<input type="password" name="'.$type.'_password" value="" size="8" maxlength="32">';
echo '</td><td>';
echo '<input type="submit" value="ok">';
echo '</td></tr>';
echo '</table>';
echo '</form>';
}
//==========================================================================
// PUBLIC FUNCTIONS
//==========================================================================
//--------------------------------------------------------------------------
// Output GUI header
//--------------------------------------------------------------------------
function gui_header()
{
}
//--------------------------------------------------------------------------
// Output, that download has begun
//--------------------------------------------------------------------------
function gui_download_msg()
{
}
//--------------------------------------------------------------------------
// Output complete scale or piece of the bar (called from "read_data")
//--------------------------------------------------------------------------
function gui_scale_bar()
{
}
//--------------------------------------------------------------------------
// Output HTTP authorization form
//--------------------------------------------------------------------------
function gui_auth_form()
{
echo "Authorization required!<p>";
_output_userpass_form("auth");
flush();
}
//--------------------------------------------------------------------------
// Output FTP authorization form
//--------------------------------------------------------------------------
function gui_ftp_form()
{
echo "FTP Authorization required!<p>";
_output_userpass_form("ftp");
flush();
}
//--------------------------------------------------------------------------
// Output Error message
//--------------------------------------------------------------------------
function gui_error_msg($error)
{
echo $error;
flush();
}
//--------------------------------------------------------------------------
// Output message, that virus scanning is in progress
//--------------------------------------------------------------------------
function gui_scanning_msg()
{
}
//--------------------------------------------------------------------------
// Output message, that virus has been found!
//--------------------------------------------------------------------------
function gui_virus_found_msg()
{
global $url;
// Output/Deliver virus warning instead of file itself
header("Content-type: text/plain");
echo "\n";
echo "---------------------------------------------------------------------\n";
echo "SurfProtect (".VERSION.") Message:\n";
echo "---------------------------------------------------------------------\n";
echo "\n";
echo "This is not the original file!\n";
echo "\n";
echo "The file\n\n";
echo " $url\n\n";
echo "which you wanted to download contains a virus and had been blocked.\n";
echo "\n";
echo "---------------------------------------------------------------------\n";
echo "\n";
flush();
}
//--------------------------------------------------------------------------
// Output message, that NO virus has been found :-)
//--------------------------------------------------------------------------
function gui_no_virus_found_msg()
{
}
//--------------------------------------------------------------------------
// Output message, that no virus scanning was performed
//--------------------------------------------------------------------------
function gui_scan_disabled_msg()
{
}
//--------------------------------------------------------------------------
// Output message, that scanning has failed
//--------------------------------------------------------------------------
function gui_scan_failure_msg()
{
// Output/Deliver virus scanner failure instead of file itself
header("Content-type: text/plain");
echo "\n";
echo "---------------------------------------------------------------------\n";
echo "SurfProtect (".VERSION.") Message:\n";
echo "---------------------------------------------------------------------\n";
echo "\n";
echo "Virus scanning failed!\n";
echo "\n";
echo "---------------------------------------------------------------------\n";
echo "\n";
flush();
}
//--------------------------------------------------------------------------
// Output message, that virus was found and file has been disinfected
//--------------------------------------------------------------------------
function gui_virus_found_and_disinfected_msg()
{
}
//--------------------------------------------------------------------------
// Output message, that connection has timed out (and show retry button)
//--------------------------------------------------------------------------
function gui_timeout_msg()
{
gui_error_msg("Download timed out! (max: ".DOWNLOAD_TIMEOUT." secs)");
}
//--------------------------------------------------------------------------
// Output GUI footer
//--------------------------------------------------------------------------
function gui_footer()
{
}
?>