xminstrel
Зарегистрирован: 09.10.2002 Сообщения: 1
|
Добавлено: Ср Окт 09 2002 08:17 Заголовок сообщения: Script question |
|
|
Как сделать чтобы в этом скрипте при запуске появлялось окно для ввода passa а сам пас определялся в переменных скрипта: вот source самого сккрипта: #!/usr/bin/perl
########################################.. Do not edit this file with SiteMgr; it will break. # # Use a shell editor,such as pico, vi, or emacs. # # If you are viewing this in SiteMgr's editor, # # do not save changes. # ######################################################
# SiteMgr -- A web site file manager # Copyright 1996-98 Sanford Morton. See # http://www.pobox.com/~smorton/copyright.html # for copying permissions. See # http://www.pobox.com/~smorton/sitemgr # for instructions and discussion.
use CGI::Carp qw(fatalsToBrowser carpout); use CGI; use File::Copy; # use strict; my ($q, $script_url, $top_dir, $target_item, $current_dir, $target_dir, $errMsg ); # use cgidebug;
$q = new CGI;
### INITIALIZATION -- ### Find out who and where we are. ### We assume top web directory is parent of script's directory ### We won't browse or write above the top directory.
$script_url = $ENV{'SCRIPT_NAME'}; ($top_dir = $script_url) =~ s%/[^/]+/[^/]+$%%; # parent of script directory
# some servers do not report this $ENV{'SCRIPT_FILENAME'} = $0 unless $ENV{'SCRIPT_FILENAME'};
### set initial defaults $target_dir = $top_dir; $errMsg = '';
### Many form requests will supply a current directory and target ### item, both full paths.
$target_item = $q->param('item') if $q->param('item'); $current_dir = $q->param('dir') if $q->param('dir');
### SOME SECURITY. ### If the referring url is not this script, then we refuse to ### process requests; display the default top level page instead.
unless ($ENV{'HTTP_REFERER'} =~ m/^https*:\/\/$ENV{'SERVER_NAME'}$ENV{'SCRIPT_NAME'}/ ) {
### if any form data was submitted if ($q->param or $ENV{'PATH_INFO'} or $ENV{'QUERY_STRING'} ) { $errMsg = "Request failed: SiteMgr will not accept requests from web forms other than itself. You must submit your request through this page."; }
### debugging: ### reset errMsg to list of environment variables if ($ENV{'QUERY_STRING'} eq 'debug') { $errMsg = "Debugging information:\n\n \$0: $0\n"; foreach (keys %ENV) { $errMsg .= " $_: $ENV{$_}\n"; } $errMsg .="\n"; }
&print_web_page ($script_url, $top_dir, $target_dir, $errMsg); exit; }
### ### PROCESS REQUESTS ### Now we begin to process requests, which can be of two sorts: ### a directory index request or a request for a file operation. ###
### Directory index request: ### ### Check for PATH_INFO. It should come from clicking on a ### directory in the index list, requesting a listing of that ### directory.
if ( $ENV{'PATH_INFO'} ) { $target_ ... |
|