#!/usr/bin/perl
#------------------------------------------------------------------------------
# Copyright (C) 2001 Thomax Kaulmann
# 
# 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, 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.

use CGI;
use OPA;
use FileHandle;


                  ##
                  ##
  ####    ####   #####
 ##      ##  ##   ##
  ####   ######   ##
     ##  ##       ## ##
 #####    ####     ###

        ###                                ###     ##
         ##                                 ##
         ## ##    ####   ## ##    ####   #####    ###   ## ###
         ### ##  ##  ## #######  ##  ## ##  ##     ##    ### ##
         ##  ##  ##  ## ## # ##  ###### ##  ##     ##    ##
         ##  ##  ##  ## ## # ##  ##     ##  ##     ##    ##
        ###  ##   ####  ##   ##   ####   ### ##   ####  ####
########
sub get_homedir
{
	($t,$t,$t,$t,$t,$t,$t,$homedir)=getpwnam($_[0]);
}




   ###    ##                       ###     ##     ###
  ## ##   ##                      ## ##            ##
  ##     #####  ## ###            ##      ###      ##     ####
 ####     ##     ##  ##          ####      ##      ##    ##  ##
  ##      ##     ##  ##           ##       ##      ##    ######
  ##      ## ##  #####            ##       ##      ##    ##
 ####      ###   ##              ####     ####    ####    ####
                ####    ########
sub get_file
{

print "
<TITLE>Simple File Transfer Tool (ftp)</TITLE>
$OPA::OPA_BODY
<BODY TEXT=#000000 LINK=#ffcca4 VLINK=#ddcca4 ALINK=#FFFFFF BGCOLOR=#FF661E>
<b>[opa]</b>
<ul><ul>
you can use this easy upload thing. if your file is to large,<br>
it may happen that you run into timeout.<br>
<form method=POST action=$OPA::CGI_BINS/.sec/opa-upload-finish enctype=multipart/form-data>
<input type=file name=filename>
<br>
<input type=submit value=\"get it\">
</form>
<br>
<br>
";
}



##   ##            ##            ######         ##   ##
### ###           ####             ##           ###  ##
#######          ##  ##            ##           #### ##
#######          ##  ##            ##           ## ####
## # ##          ######            ##           ##  ###
##   ##          ##  ##            ##           ##   ##
##   ##          ##  ##          ######         ##   ##

&get_homedir($ENV{'REMOTE_USER'});

print "<TITLE>OMA Upload</TITLE>\n";


CGI::ReadParse();

&get_file;

print "\n\n";



