#!/usr/bin/perl -w
####################################
### Site Manager by DigitalScan ###
####################################
### may be used as long as ###
### these credits remain in tact ###
### for questions on this Site ###
### Manager, email ###
### DigitalScan@hotmail.com ###
####################################
### Originally By BiggTroy78 ###
####################################
use CGI;
$q = new CGI;
print "Content-type: text/html\n\n";
### variables to be changed
$title = 'Digital Site Manager';
$body = "
";
### values for text inputs
$input = ' bgcolor=#000020 text=82A9D9 cursor=82A9D9 borderimage=noborder autoactivate nohighlight font=proportional';
### values for buttons and submits
$b_color = '';
$no_b_color = '';
$button = ' borderimage=file://rom/borders/buttonborder7.bif usestyle';
### values for textarea. values for text inputs are included.
$tarea = ' cols=75 rows=20 usestyle';
### color for changing directories and normal links
$cd_color = '';
### delete color
$rm_color = '';
### edit color
$ed_color = '';
### CHMOD color
$ch_color = '';
### time color
$ti_color = '';
### bytes format
$by_color = '';
### operation description color
$op_color = '';
### for the date
@months = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
################################################
### Script variables. DO NOT CHANGE ###
################################################
### find form and query data
$ch_dir = $q->param('cd') if $q->param('cd');
$action = $q->param('action') if $q->param('action');
$operation = $q->param('operation') if $q->param('operation');
if (($ch_dir) && (!$action) && (!$operation)) {
$done = "$ch_dir sub-directory files listed.";
}
### location of file. and location of top directory
$this_url = $ENV{'SCRIPT_NAME'};
$mgr = $this_url;
@urls = split(/\//,$this_url);
pop(@urls);
$top_dir = $urls[$#urls];
if ($top_dir) {
$top_dir = '/'.$top_dir;
}
$top_dir .= '/';
$c_l_c = '';
### find out if we are in another directory
if ($ch_dir) {
$new_dir = "$ch_dir";
} else {
$new_dir = '.';
}
if ($ch_dir) {
@ch_dirs = split(/\//,$ch_dir);
pop(@ch_dirs);
$up_dir = join("\/",@ch_dirs);
}
if ($up_dir) {
$last_dir = "cd=$up_dir";
}
### directory we are in
$this_dir = $top_dir.$ch_dir;
$cur_loc = "
This Directory is:
$this_dir
";
### read the contents of the directory
if ($action eq "chmod") {
&chmod;
&read_dir;
} elsif ($action) {
$go = $action;
&$go;
&read_dir;
} elsif ($operation) {
&parse_input;
if ($q->param('confirm')) {
$go = $operation;
&$go;
&read_dir;
} else {
&confirm;
}
exit;
} else {
&read_dir;
}
exit;
sub show_files {
$_ = $done;
if (!$_) {
$_ = 'Home directory files listed.';
}
if ($new_dir ne '.') {
$d = "\&cd=$new_dir";
}
if ($done) {
$p = "Previous Action:";
}
print <
$title
$body
$cur_loc