From 331bdb5bca9f65f93443cfe6e046d88f7a98a5b9 Mon Sep 17 00:00:00 2001 From: Dave Cross Date: Sat, 9 Apr 2016 07:56:53 +0100 Subject: [PATCH] Initial import --- mail/mail.pl | 47 + ms/ms-env/COPYING | 4 + ms/ms-env/README | 102 + ms/ms-env/ms-env.pl | 76 + ms/ms-guest/COPYING | 4 + ms/ms-guest/README | 135 + ms/ms-guest/e-guest.pl | 190 + ms/ms-guest/ms-guest.pl | 183 + ms/ms-mail/COPYING | 4 + ms/ms-mail/README | 142 + ms/ms-mail/ms-mail.pl | 123 + ms/ms-webmail/ms-webmail.pl | 216 + slavorg/slavorg | 251 + spam/spam.pl | 15 + sqpl/COPYING | 4 + sqpl/README | 104 + sqpl/sqpl | 425 + sqpl/sqpl.sybperl | 454 + sybserv/COPYING | 4 + sybserv/README | 93 + sybserv/sybserv | 234 + toc/toc.pl | 68 + webged/royal.ged | 30682 ++++++++++++++++++++++++++++++++++ webged/tt/cross.cfg | 3 + webged/tt/family.tt | 7 + webged/tt/footer | 14 + webged/tt/header | 7 + webged/tt/index.tt | 18 + webged/tt/main.cfg | 3 + webged/tt/person.tt | 17 + webged/tt/royal.cfg | 3 + webged/webged.pl | 220 + 32 files changed, 33852 insertions(+) create mode 100644 mail/mail.pl create mode 100755 ms/ms-env/COPYING create mode 100755 ms/ms-env/README create mode 100755 ms/ms-env/ms-env.pl create mode 100644 ms/ms-guest/COPYING create mode 100644 ms/ms-guest/README create mode 100755 ms/ms-guest/e-guest.pl create mode 100755 ms/ms-guest/ms-guest.pl create mode 100755 ms/ms-mail/COPYING create mode 100755 ms/ms-mail/README create mode 100755 ms/ms-mail/ms-mail.pl create mode 100644 ms/ms-webmail/ms-webmail.pl create mode 100755 slavorg/slavorg create mode 100644 spam/spam.pl create mode 100755 sqpl/COPYING create mode 100755 sqpl/README create mode 100755 sqpl/sqpl create mode 100755 sqpl/sqpl.sybperl create mode 100755 sybserv/COPYING create mode 100755 sybserv/README create mode 100755 sybserv/sybserv create mode 100644 toc/toc.pl create mode 100755 webged/royal.ged create mode 100644 webged/tt/cross.cfg create mode 100644 webged/tt/family.tt create mode 100644 webged/tt/footer create mode 100644 webged/tt/header create mode 100644 webged/tt/index.tt create mode 100644 webged/tt/main.cfg create mode 100644 webged/tt/person.tt create mode 100644 webged/tt/royal.cfg create mode 100755 webged/webged.pl diff --git a/mail/mail.pl b/mail/mail.pl new file mode 100644 index 0000000..baba654 --- /dev/null +++ b/mail/mail.pl @@ -0,0 +1,47 @@ +#!/usr/bin/perl -w + +use strict; +use CGI qw(:standard); + +print header; + +my $mailprog = '/usr/sbin/sendmail'; + +my $recipient = 'dave@dave.org.uk'; + +open (MAIL, "|$mailprog -t") or &dienice("Can't access $mailprog: $!\n"); + +print MAIL "To: $recipient\n"; +print MAIL "Reply-to: ", param('email'), ' (', param('name'), ")\n"; +print MAIL "Subject: Form Data\n\n"; + +foreach (param) { + my ($key) = /^req(.*)$/; + + print MAIL "$key = ", param($_), "\n"; +} + +close(MAIL); + +print <Thank You + + Thank you for applying. Your application has been delivered.

+ + Return to our home page. + + + +EndHTML + +sub dienice { + + my ($errmsg) = @_; + + print "

Error

\n"; + print "$errmsg

\n"; + print "\n"; + + exit; +} diff --git a/ms/ms-env/COPYING b/ms/ms-env/COPYING new file mode 100755 index 0000000..137921f --- /dev/null +++ b/ms/ms-env/COPYING @@ -0,0 +1,4 @@ +(c) 1998, Magnum Solutions Ltd, All rights reserved. + +This script is free software; you are free to redistibute it +and/or modify it under the same terms as Perl itself. \ No newline at end of file diff --git a/ms/ms-env/README b/ms/ms-env/README new file mode 100755 index 0000000..2f75624 --- /dev/null +++ b/ms/ms-env/README @@ -0,0 +1,102 @@ + M S - E N V v 1 . 4 + -------------------------- + +ms-env.pl is a simple CGI script for World Wide Web pages. +It allows you to find out various useful things about the +Perl environment on your web server. This is particularly +useful if you don't have telnet access to you ISP. + + + +AVAILABILITY + +The latest version of ms-mail should always be available from: + + http://www.mag-sol.com/Download.shtml + + + +PREREQUISITES + +In order to install and use this script you will need Perl version +5.002 or better. This package also depends on packages that are +distributed separately from perl. We recommend that you have +the following packages installed before you install ms-env: + + CGI (bundled with perl5.004 and better) + +These packages should be available on CPAN (the Comprehensive +Perl Archive Network) and your nearest CPAN mirror can be found +at www.perl.com. + + + +INSTALLATION + +ms-env is distributed as a gzipped tar file. To extract the files +from the archive type the following commands: + + gunzip ms-env.tar.gz + tar xvf ms-env.tar + +You will end up with three files called README (this file), COPYING +and ms-env.pl. + +Installation of ms-env is as simple as copying the file ms-env.pl +into the cgi directory of your web server. This directory may be called +cgi or cgi-bin or perhaps something completely different. If in doubt +ask the person responsible for running your web server. + + + +USAGE + +The simplest (and probably most useful) way to run ms-perl is simply +to enter the URL of the script in you browser. For example ms-perl +is installed on www.mag-sol.com in the cgi directory. Therefore if +you enter the address: + + http://www.mag-sol.com/cgi/ms-env.pl + +in you browser, you will see the output of the script which will +tell you various useful things about my Perl installation (like +how out of date my Perl is!) + +If you install ms-perl on your web server you shouild replace +www.mag-sol.com with the address of your web server. If in doubt +ask the person responsible for running your web server. + +ms-perl will give you a number of useful details about the Perl +environment on your web server. These are: + +* The version of Perl installed + +* The version of CGI.pm installed + +* The library path that Perl runs with + +* The complete list of modules installed on that path + + + +DOCUMENTATION + +This file is currently all of the documentation you get! if you think +you need any more, please let me know. + + + +SUPPORT + +Questions about using this script should be directed to the author at +dave@mag-sol.com. I also monitor the newsgroup comp.infosys.www.authoring.cgi +which would be another good place to ask questions. + + + +COPYRIGHT + +(c) 1999, 2000 Magnum Solutions Ltd, All rights reserved. + +This script is free software; you are free to redistibute it +and/or modify it under the same terms as Perl itself. diff --git a/ms/ms-env/ms-env.pl b/ms/ms-env/ms-env.pl new file mode 100755 index 0000000..b49f2c5 --- /dev/null +++ b/ms/ms-env/ms-env.pl @@ -0,0 +1,76 @@ +#!/usr/bin/perl -Tw +# +# ms-env.pl +# +# A simple script to get information about the Perl environment on a +# web server. +# +# Copyright (c) 1998, 1999, Magnum Solutions Ltd, All rights reserved. +# +# This script is free software; you are free to redistibute it +# and/or modify it under the same terms as Perl itself. +# +# $Id: ms-env.pl,v 1.4 2000/08/23 20:33:32 dave Exp $ +# +# $Log: ms-env.pl,v $ +# Revision 1.4 2000/08/23 20:33:32 dave +# Fixed so it _works_ in taint mode! +# +# Revision 1.3 2000/08/23 20:05:00 dave +# Added taint mode. +# +# Revision 1.2 2000/06/04 17:31:04 dave +# Renamed 'copying' and 'readme' to 'COPYING' and 'README'. +# Added header info. +# +# + +use lib '.'; + +use CGI qw(:standard); +use File::Find; +use strict; +use diagnostics; + +$ENV{PATH} = '/bin:/usr/bin'; +delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; + +my $VERSION = sprintf "%d.%02d", '$Revision: 1.4 $ ' =~ /(\d+)\.(\d+)/; + +print header, "\n"; +print start_html(-dtd=>'-//W3C//DTD HTML 4.0 Transitional//EN', + -title=>"Perl Environment: $ENV{SERVER_NAME}"), "\n"; + +print h1("Perl Environment: $ENV{SERVER_NAME}"), "\n"; + +print p("Perl Version: $]"), "\n"; + +print p("CGI.pm Version: $CGI::VERSION"), "\n"; + +print p("Library Path (\@INC):"), "\n"; + +print ul(li([@INC])), "\n"; + +print p('Modules:'), "\n"; + +my @mods; +my $list; +my $dir; +foreach (@INC) { + @mods = (); + $dir = $_; + find({wanted => \&wanted, untaint => 1}, $_); + + $list .= ul(li($dir), + ul(li([sort @mods]))); +} + +print $list, "\n"; + +sub wanted { + return unless /\.pm$/; + + push @mods, $File::Find::name; +} + + diff --git a/ms/ms-guest/COPYING b/ms/ms-guest/COPYING new file mode 100644 index 0000000..cb78d92 --- /dev/null +++ b/ms/ms-guest/COPYING @@ -0,0 +1,4 @@ +(c) 1998, Magnum Solutions Ltd, All rights reserved. + +This script is free software; you are free to redistibute it +and/or modify it under the same terms as Perl itself. \ No newline at end of file diff --git a/ms/ms-guest/README b/ms/ms-guest/README new file mode 100644 index 0000000..a96f79f --- /dev/null +++ b/ms/ms-guest/README @@ -0,0 +1,135 @@ + M S - G U E S T v 2 . 0 + ----------------------------- + +ms-guest.pl is a simple guest-book script for World Wide Web pages. +It allows visitors to a page to write comments which are stored +along with their name and email address. These comments can then be +viewed by later visitors to the same page. + + + +AVAILABILITY + +The latest version of ms-guest should always be available from: + + http://www.mag-sol.com/Download.shtml + + +PREREQUISITES + +In order to install and use this script you will need Perl version +5.002 or better. This package also depends on packages that are +distributed separately from perl. We recommend that you have +the following packages installed before you install ms-guest: + + CGI (bundled with perl5.004 and better) + FreezeThaw + +These packages should be available on CPAN (the Comprehensive +Perl Archive Network) and your nearest CPAN mirror can be found +at www.perl.com. + + + +INSTALLATION + +ms-guest is distributed as a gzipped tar file. To extract the files +from the archive type the following commands: + + gunzip ms-guest.tar.gz + tar xvf ms-guest.tar + +You will end up with three files called README (this file), COPYING +and ms-guest.pl. + +Installation of ms-guest is as simple as copying the file ms-guest.pl +into the cgi directory of your web server. This directory may be called +cgi or cgi-bin or perhaps something completely different. If in doubt +ask the person responsible for running your web server. + + + +USAGE + +ms-guest can be used in two modes. In the simple mode you just insert +a call to the cgi script in your HTML page. This might look something +like this: + +

Please sign our Guest Book.

+ +ms-guest will then generate a default guest book page. To see what +this looks like try entering the URL + +http://www.mag-sol.com/cgi/ms-guest.pl + +in your browser. + +If you want to maintain more than one guest book on a site you can +pass a file parameter to the script. The default file name is 'guest'. +A site that had two guest books might (just) have this HTML fragment +on it: + +

Please sign our first +or second guest books.

+ +ms-guest takes one other parameter which is a template file name. This +allows you to customise your guest book page to look however you like. + +A template is a normal HTML file that contains two special tags, +'!!FORM!!' is inserted where you want the form for entering comments +and '!!COMMENTS!!' is inserted where you want the comments displayed. +A link to one of these pages would look something like this: + +

Please sign our +guest +book.

+ +An example of this usage can be seen in the guest book link on the +Magnum Solutions main page at: + + http://www.mag-sol.com + +and if you want to see what the page looks like before the tags +are replaced by the cgi scripts, take a look at: + + http://www.mag-sol.com/Guest.html + +The default guest book page contains a copyright notice and a link +to the Magnum Solutions home page. I'd appreciate it if you would +do the same on any pages you create. + +As of version 2.0, the ms-guest distribution also includes another +progrma called e-guest.pl which allows you to edit your guest book. +e-guest is passed the name of the guest book file, like this: + + http://www.mag-sol.com/cgi/e-guest.pl?file=sample + +You should probably consider adding some sort of security on the +eecution of this file! + +Please let me know where you're using ms-guest so I can pop by and +have a look. I'll also keep you informed of new releases. + + + +DOCUMENTATION + +This file is currently all of the documentation you get! if you think +you need any more, please let me know. + + + +SUPPORT + +Questions about using this script should be directed to the author at +dave@mag-sol.com. I also monitor the newsgroup comp.infosys.www.authoring.cgi +which would be another good place to ask questions. + + + +COPYRIGHT + +(c) 1998, 2000 Magnum Solutions Ltd, All rights reserved. + +This script is free software; you are free to redistibute it +and/or modify it under the same terms as Perl itself. diff --git a/ms/ms-guest/e-guest.pl b/ms/ms-guest/e-guest.pl new file mode 100755 index 0000000..33eff8b --- /dev/null +++ b/ms/ms-guest/e-guest.pl @@ -0,0 +1,190 @@ +#!/usr/local/bin/perl -w + +use lib '.'; + +use Fcntl; +use CGI; +use CGI::Carp qw/fatalsToBrowser/; +use AnyDBM_File; +use FreezeThaw qw(freeze thaw); + +my $page = CGI->new; + +my %comments; + +umask 0; + +my $file = $page->param('file') || 'guest'; + +tie %comments, "AnyDBM_File", $file, O_RDWR | O_CREAT, 0777; + +print $page->header, "\n"; +print $page->start_html(-dtd=>'-//W3C//DTD HTML 4.0 Transitional//EN', + -title=>'Guest Book Maintenance'), "\n"; +print $page->h1('Guest Book Maintenance'), "\n"; + +my $mode = $page->param('mode'); +$page->delete('mode'); +$mode = 'list' unless defined($mode); + +my $entry; + +if ($mode eq 'list') { + &list_entries; +} elsif ($mode eq 'save') { + $entry->{user} = $page->param('user'); + $entry->{email} = $page->param('email'); + $entry->{text} = $page->param('text'); + $entry->{time} = $page->param('time'); + + $comments{$entry->{time}} = freeze($entry); + + print $page->p('Entry saved'); + + print &show_entry($entry); +} elsif ($mode eq 'delete') { + delete $comments{$page->param('time')}; + &list_entries; +} elsif ($mode eq 'edit') { + ($entry) = thaw($comments{$page->param('time')}); + $entry->{time} = $page->param('time'); + print $page->start_form(-action=>"e-guest.pl"), "\n"; + &edit_entry($entry); + print $page->hidden(-name=>'file', -value=>$file), "\n"; + print $page->hidden(-name=>'mode', -value=>'save'), "\n"; + print $page->submit(-value=>'Save'); + print $page->reset; + + print $page->end_form, "\n"; +} + +print $page->p($page->a({href=>"e-guest.pl?mode=list"}, + 'List current entries')), "\n"; + +sub show_entry { + my $entry = shift; + my $text = $entry->{text}; + + $text =~ s/\n/
/g; + + $entry->{user} =~ s/{email} =~ s/{text} =~ s/table($page->Tr($page->td('Date: '), + $page->td(scalar localtime($entry->{time}))), + $page->Tr($page->td('User: '), + $page->td($entry->{user})), + $page->Tr($page->td('Email: '), + $page->td($entry->{email})), + $page->Tr($page->td('Comments: '), + $page->td($text))); +} + +sub edit_entry { + my $old = scalar(@_); + my $entry = shift if $old; + + print $page->p('Old...'), "\n"; + print $page->table($page->Tr($page->td('Date: '), + $page->td(scalar localtime($entry->{time}))), + $page->Tr($page->td('User: '), + $page->td($page->textfield(-name=>'user', + -value=>$entry->{user}, + -size=>20))), + $page->Tr($page->td('Email: '), + $page->td($page->textfield(-name=>'email', + -value=>$entry->{email}, + -size=>20))), + $page->Tr($page->td('Comments: '), + $page->td($page->textarea(-name=>'text', + -rows=>10, + -columns=>50, + -value=>$entry->{text})))), + "\n"; + + print $page->hidden(-name=>'time', -value=>$entry->{time}), "\n"; +} + +sub small_form { + my ($action, $req) = @_; + + $page->start_form(-action=>"e-guest.pl"). + $page->hidden(-name=>'file', -value=>$file) . + $page->hidden(-name=>'time', -value=>$entry->{time}, -override=>1) . + $page->hidden(-name=>'mode', -value=>lc $action) . + $page->hidden(-name=>'start', -value=>$start) . + $page->hidden(-name=>'numb', -value=>$numb) . + $page->submit(-value=>$action) . + $page->end_form; +} + +sub list_entries { + my ($row, @rows); + + my $start = $page->param('start') || 0; + my $numb = $page->param('numb') || keys %comments; + + my $i = 0; + + foreach (reverse sort keys %comments) { + next unless $i++ >= $start; + last if $i > ($start + $numb); + + ($entry) = thaw($comments{$_}); + $entry->{time} = $_; + + $row = $page->Tr($page->td(&show_entry($entry)), + $page->td(&small_form('Edit', $entry), + &small_form('Delete', $entry))); + + push @rows, $row; + } + + my ($newest, $newer, $older, $oldest) = ('', '', '', '', ''); + + if ($start != 0) { + my $href = $page->url . "?start=0&numb=$numb"; + $href .= "&file=" . $page->param('file') if $page->param('file'); + $href .= "&template=" . $page->param('template') + if $page->param('template'); + + $newest = $page->a({-href=>$href}, "Newest entries"); + } + + if ($start - $numb >= 0) { + my $href = $page->url . "?start=" . ($start - $numb) . "&numb=$numb"; + $href .= "&file=" . $page->param('file') if $page->param('file'); + $href .= "&template=" . $page->param('template') + if $page->param('template'); + + $newer = $page->a({-href=>$href}, "<< Newer entries"); + } + + if ($start + $numb < keys %comments) { + my $href = $page->url . "?start=" . ($start + $numb) . "&numb=$numb"; + $href .= "&file=" . $page->param('file') if $page->param('file'); + $href .= "&template=" . $page->param('template') + if $page->param('template'); + + $older .= $page->a({-href=>$href}, "Older entries >>"); + } + + if ($start < ((keys %comments) - $numb)) { + my $href = $page->url . "?start=" . ((keys %comments) - $numb) + . "&numb=$numb"; + $href .= "&file=" . $page->param('file') if $page->param('file'); + $href .= "&template=" . $page->param('template') + if $page->param('template'); + + $oldest = $page->a({-href=>$href}, "Oldest entries"); + } + + print $page->p(join ' ', ($newest, $newer, $older, $oldest)), "\n"; + + print $page->table({-border=>1}, + @rows), "\n"; + + print $page->p(join ' ', ($newest, $newer, $older, $oldest)), "\n"; +} diff --git a/ms/ms-guest/ms-guest.pl b/ms/ms-guest/ms-guest.pl new file mode 100755 index 0000000..b9dcf6b --- /dev/null +++ b/ms/ms-guest/ms-guest.pl @@ -0,0 +1,183 @@ +#!/usr/local/bin/perl -w + +use lib '.'; + +use Fcntl; +use CGI qw(:standard); +use CGI::Carp qw(fatalsToBrowser); +use AnyDBM_File; +use FreezeThaw qw(freeze thaw); + +$|++; + +$VERSION = sprintf "%d.%02d", '$Revision: 2.0 $ ' =~ /(\d+)\.(\d+)/; + +my %comments; + +umask 0; + +my $file = param('file') || 'guest'; + +tie %comments, 'AnyDBM_File', $file, O_RDWR | O_CREAT, 0777; + +if (param('new_user')) { + my $rec = {}; + my $now = time; + $rec->{user} = param('new_user'); + $rec->{email} = param('new_email'); + $rec->{text} = param('new_text'); + + $comments{$now} = freeze $rec; + + param('new_user', ''); + param('new_email', ''); + param('new_text', ''); +} + +print header, "\n"; + +if (param('template')) { + my $err = 0; + my $template = "$ENV{DOCUMENT_ROOT}/" . param('template'); + open(TEMPLATE, $template) || do {$err = $!}; + + if ($err) { + &display_default($template, $err); + } else { + while (