# File Upload Configuration Script        Version 5.03
# Created by Jeff Carnahan                jeffc@terminalp.com
# Created on: 4/8/95                      Last Modified on: 06/06/97 16:06
# Scripts Archive:                        http://www.terminalp.com/scripts/
#
# Copyright (C) 1996 - Jeffrey D. Carnahan
#   Copyright Information Can Be found in the attacted README file.
#
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
# Don't Modify Anything Past This Line Unless You Know What Your Doing!
# ---------------------------------------------------------------------
# ---------------------------------------------------------------------
#

print <<__END_OF_PROMPT__;
Thank You For Obtaining my File Upload Script.

This will now configure your copy of the script.

Please Answer The Following Questions:


What is The Complete Path used to access files\nin the directory you will be uploading files to?
         To find out this path, (if you don't already know it)
         press Control-Z now, and go into the directory you want
         uploaded files to reside in.  In this directory, type 'pwd'
         at the unix prompt.  The 'pwd' command returns the Complete Path
         to that directory.

  Notes: ** There should be *NO* trailing forward-slash
         on this path!! **
         ** Type 'fg' to return to this program. **
?
__END_OF_PROMPT__
$Path = &GetInput;

print <<__END_OF_PROMPT__;

What is The Internet URL used to access files\nin the directory you will be uploading files to?
     ie: If you want to upload files to the
         directory corresponding to: http://www.host.com/~jsmith
         type in 'http://www.host.com/~jsmith

   Note: ** There should be *NO* trailing forward-slash
         on this URL!! **
?
__END_OF_PROMPT__
$Url = &GetInput;

print <<__END_OF_PROMPT__;

Is it ok to overwrite existing files?
         If a file exists already, should the script overwrite the
         current contents?  (If This is set to 'NO' then the script will
         prompt the user for another filename)

         Please press 'Y' or 'N':
?
__END_OF_PROMPT__
$Overwrite = &GetInput;
if ($Overwrite =~ /[Yy]/) {
    $Overwrite = 1;
} else {
    $Overwrite = 0;
}

print <<__END_OF_PROMPT__;

What URL should users be redirected to when the script finishes?
         After the user finishes, a page returns informing him/her of
         the successful upload.  If you would like the user redirected to
         a page of your choice, enter the URL here.  If you would like the
         default page to return to the user, simply leave this item blank.

?
__END_OF_PROMPT__
$Success_Url = &GetInput;

print <<__END_OF_PROMPT__;

Are you going to be using this script under the Windows Operating System?

         Please press 'Y' or 'N':
?
__END_OF_PROMPT__
$Windows = &GetInput;
if ($Windows =~ /[Yy]/) {
    $Windows = 1;
} else {
    $Windows = 0;
}


&u($<);
$userid = $<;
$groupid = $(+0, &g($();


print "\n\n\n\n\n\n\n\n\n";
print "Ok. Please use the values in these variables inside the script.\n\n";
print "# <------- Snip Here ------->\n";
print "\$userid        = \"$userid\";\n";
print "\$groupid       = \"$groupid\";\n";
print "\$path          = \"$Path\";\n";
print "\$url           = \"$Url\";\n";
print "\$overwrite     = \$Overwrite\;\n";
print "\$success_url   = \"$Success_Url\";\n";
print "\$Windows       = $Windows\;\n";
print "# <------- Snip Here ------->\n";

print "\n\n";
exit 0;

# ---------------------------------------------------------------------

sub GetInput {
    my $Input = <STDIN>;
    chomp $Input;
    return $Input;
}
sub u { local($name) = getpwuid($_[0]); $name && "($name)";}
sub g { local($name) = getgrgid($_[0]); $name && "($name)";}

# ---------------------------------------------------------------------
# EOF
