#!/usr/local/bin/perl # Output Javascript in a loop to track an upload # XXX add to more modules require './web-lib.pl'; &init_config(); do './ui-lib.pl'; &ReadParse(); $id = $in{'id'}; $id || &error($text{'uptracker_eid'}); $id !~ /\.\./ && $id !~ /\0/ || &error($text{'uptracker_eid2'}); &popup_header($text{'uptracker_title'}, undef, "onunload='if (!window.doneupload) { opener.stop() }'"); $| = 1; # Output text boxes that get updated with filenames and progress $ff = "style='font-family: courier'"; print "
\n"; # Find the location of the user's upload progess file if ($in{'uid'}) { @uinfo = getpwuid($in{'uid'}); $upfile = "$uinfo[7]/.tmp/upload.$id"; } else { $upfile = "$ENV{'WEBMIN_VAR'}/upload.$id"; } # Read the tracker file in a loop until done, or until 1 minute has passed # with no progress print "\n"; while(1) { sleep(1); open(UPFILE, $upfile) || next; @lines =