| 1 |
#!/usr/local/bin/perl56 -I/home/systems/syb/work/publisher |
| 2 |
|
| 3 |
################################################################################### |
| 4 |
# Script modified from davtest.pl, probably originally by Daniel Varela Santoalla. |
| 5 |
# Modifications by Iain Russell, |
| 6 |
# December 2002 |
| 7 |
# |
| 8 |
# Takes one command-line parameter: the name/path of a file to be uploaded. |
| 9 |
# Strange behaviour: it actually requires a dummy command-line parameter |
| 10 |
# to be included after the real one. |
| 11 |
################################################################################### |
| 12 |
|
| 13 |
# use strict; |
| 14 |
use Tk; |
| 15 |
use Tk::DialogBox; |
| 16 |
|
| 17 |
|
| 18 |
my $username = $ENV{'USER'}; |
| 19 |
my $password = ""; |
| 20 |
|
| 21 |
|
| 22 |
# Create the user interface window for the user to enter |
| 23 |
# their username and password |
| 24 |
|
| 25 |
my $main = MainWindow->new(-title => "DAV User/Password"); |
| 26 |
|
| 27 |
$main->Label ( -text => "User name:") ->pack (); |
| 28 |
$main->Entry ( -textvariable => \$username, -width => 35) ->pack(); |
| 29 |
|
| 30 |
$main->Label ( -text => "Password:") ->pack ();; |
| 31 |
$main->Entry ( -textvariable => \$password, -width => 35, -show => "*") ->pack(); |
| 32 |
|
| 33 |
$main->Button (-text => "Upload to Internal www", -command => \&upload_files) ->pack(); |
| 34 |
$main->Button (-text => "Upload to Internal www (no plots)", -command => \&upload_files_noplots) ->pack(); |
| 35 |
$main->Button (-text => "Upload to Internal www (version table)", -command => \&upload_files_version) ->pack(); |
| 36 |
$main->Button (-text => "Upload to External www", -command => \&upload_files_external) ->pack(); |
| 37 |
|
| 38 |
|
| 39 |
# Run the Perl/Tk program |
| 40 |
|
| 41 |
MainLoop; |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
# ----------------------------------------------------------- |
| 47 |
# upload_files |
| 48 |
# Subroutine to call the shell script that uploads all the |
| 49 |
# web documentation using the supplied username/password. |
| 50 |
# After execution, it stops the program. |
| 51 |
# ----------------------------------------------------------- |
| 52 |
|
| 53 |
sub upload_files |
| 54 |
{ |
| 55 |
system ("tools/upload_files $username $password"); |
| 56 |
|
| 57 |
exit; |
| 58 |
} |
| 59 |
|
| 60 |
# ----------------------------------------------------------- |
| 61 |
# upload_files_noplots |
| 62 |
# Subroutine to call the shell script that uploads all the |
| 63 |
# web documentation using the supplied username/password. |
| 64 |
# The example plots are not uploaded. |
| 65 |
# After execution, it stops the program. |
| 66 |
# ----------------------------------------------------------- |
| 67 |
|
| 68 |
sub upload_files_noplots |
| 69 |
{ |
| 70 |
system ("tools/upload_files_noplots $username $password"); |
| 71 |
|
| 72 |
exit; |
| 73 |
} |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
# ----------------------------------------------------------- |
| 78 |
# upload_files_version |
| 79 |
# ----------------------------------------------------------- |
| 80 |
|
| 81 |
sub upload_files_version |
| 82 |
{ |
| 83 |
system ("tools/upload_files_version_table $username $password"); |
| 84 |
|
| 85 |
exit; |
| 86 |
} |
| 87 |
|
| 88 |
|
| 89 |
# ----------------------------------------------------------- |
| 90 |
# upload_files |
| 91 |
# Subroutine to call the shell script that uploads all the |
| 92 |
# web documentation using the supplied username/password. |
| 93 |
# After execution, it stops the program. |
| 94 |
# ----------------------------------------------------------- |
| 95 |
|
| 96 |
sub upload_files_external |
| 97 |
{ |
| 98 |
system ("tools/upload_files_external $username $password"); |
| 99 |
|
| 100 |
exit; |
| 101 |
} |