changeset 300:32eda4ac8927

removal of old web interface
author mmj
date Fri, 20 Aug 2004 22:41:39 +1000
parents ec671807a97d
children 7ab14d828b00
files contrib/web/perl-admin/README contrib/web/perl-admin/config.pl contrib/web/perl-admin/dot.htaccess contrib/web/perl-admin/dot.htpasswd contrib/web/perl-admin/edit.cgi contrib/web/perl-admin/index.cgi contrib/web/perl-admin/save.cgi
diffstat 7 files changed, 5 insertions(+), 225 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/web/perl-admin/README	Fri Aug 20 21:02:20 2004 +1000
+++ b/contrib/web/perl-admin/README	Fri Aug 20 22:41:39 2004 +1000
@@ -1,5 +1,10 @@
+mlmmj-1.0.0                                                  August 20th 2004
+
 To use this web-interface you have to:
 
+0) Make sure you have the CGI::FastTemplate perl module installed. If not, then
+   install it. It has no dependencies to other perl modules.
+
 1) Copy the files from the perl-admin directory of the mlmmj distribution to a
    suitable location and point your webroot to the htdocs directory. If you
    don't want the webinterface in the root of your website it is recommended to
--- a/contrib/web/perl-admin/config.pl	Fri Aug 20 21:02:20 2004 +1000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-$topdir = "/var/spool/mlmmj";
--- a/contrib/web/perl-admin/dot.htaccess	Fri Aug 20 21:02:20 2004 +1000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-Options +ExecCGI
-DirectoryIndex index.cgi
-
-Require valid-user
-AuthType Basic
-AuthName "mlmmj web-interface"
-AuthUserFile /srv/www/htdocs/.htpasswd
--- a/contrib/web/perl-admin/dot.htpasswd	Fri Aug 20 21:02:20 2004 +1000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-admin:wQEi/IDlNVK82
--- a/contrib/web/perl-admin/edit.cgi	Fri Aug 20 21:02:20 2004 +1000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2004 Morten K. Poulsen <morten at afdelingp.dk>
-#
-# $Id$
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-
-use CGI qw(:standard);
-
-require "config.pl";
-
-sub mlmmj_boolean {
-    my $name = shift;
-    my $text = shift;
-    my $checked = -f "$topdir/$list/control/$name";
-
-    print("<tr>");
-    print("<td>", $query->checkbox(-name=>$name,-checked=>$checked), "</td>\n");
-    print("<td>$text</td>\n");
-    print("</tr>");
-}
-
-sub mlmmj_string {
-    my $name = shift;
-    my $text = shift;
-    my $file = "$topdir/$list/control/$name";
-    my $value;
-
-    if (! -f $file) {
-        $value = "";
-    } else {
-        open(F, $file) or die("can't open $file");
-        $value = <F>;
-        close(F);
-        chomp($value);
-    }
-    print("<tr>");
-    print("<td>$name ", $query->textfield(-name=>$name,-default=>$value),"</td>\n");
-    print("<td>$text</td>\n");
-    print("</tr>");
-}
-
-sub mlmmj_list {
-    my $name = shift;
-    my $text = shift;
-    my $file = "$topdir/$list/control/$name";
-    my $value;
-
-    if (! -f $file) {
-        $value = "";
-    } else {
-        open(F, $file) or die("can't open $file");
-        while (<F>) {
-            $value .= $_;
-        }
-        close(F);
-        chomp($value);
-    }
-
-    print("<tr>");
-    print("<td>$name ", $query->textarea(-name=>$name,-default=>$value,-columns=>40), "</td>\n");
-    print("<td>$text</td>\n");
-    print("</tr>");
-}
-
-$query = new CGI;
-$list = $query->url(-relative=>1,-path=>1);
-$list =~ s/^[^\/]*\/([^\/]+)\/$/$1/ or die('no list parameter');
-#printf("list = '%s'<br/>\n", $list);
-
-print header;
-print start_html('mlmmj config');
-
-print($query->startform("POST","/save.cgi/$list/"));
-print("<table>");
-mlmmj_boolean("closedlist", "If this option is set, subscribtion and unsubscription via mail is disabled.");
-mlmmj_boolean("moderated", "If this option is set, the emailaddresses in the file listdir/control/moderators will act as moderators for the list.");
-mlmmj_boolean("tocc", "If this option is set, the list address does not have to be in the To: or Cc: header of the email to the list.");
-mlmmj_boolean("addtohdr", "If this option is set, a To: header including the recipients emailaddress will be added to outgoing mail. Recommended usage is to remove existing To: headers with delheaders (see below) first.");
-mlmmj_boolean("subonlypost", "If this option is set, only people who are subscribed to the list, are allowed to post to it. The check is made against the \"From:\" header.");
-mlmmj_string("prefix", "The prefix for the Subject: line of mails to the list. This will alter the Subject: line, and add a prefix if it's not present elsewhere.");
-mlmmj_list("owner", "The emailaddresses in this list will get mails to $list+owner");
-mlmmj_list("delheaders", "In this file is specified *ONE* headertoken to match pr. line. If the file consists of: Received: Message-ID: Then all occurences of these headers in incoming list mail will be deleted. \"From \" and \"Return-Path:\" are deleted no matter what.");
-mlmmj_list("access", "If this option is set, all headers of a post to the list is matched against the rules. The first rule to match wins. See README.access for syntax and examples. NOTE: If this field is empty access control is *disabled*, unlike having an empty control/access file.");
-mlmmj_string("memorymailsize", "Here is specified in bytes how big a mail can be and still be prepared for sending in memory. It's greatly reducing the amount of write system calls to prepare it in memory before sending it, but can also lead to denial of service attacks. Default is 16k (16384 bytes).");
-print("</table>");
-print($query->submit());
-print($query->endform());
-
-print end_html;
--- a/contrib/web/perl-admin/index.cgi	Fri Aug 20 21:02:20 2004 +1000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2004 Morten K. Poulsen <morten at afdelingp.dk>
-#
-# $Id$
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-
-use CGI qw(:standard);
-
-require "config.pl";
-
-print header;
-print start_html('mlmmj config');
-
-opendir(DIR, $topdir);
-while ($list = readdir(DIR)) {
-    next if $list =~ /^\./;
-    printf("<a href=\"edit.cgi/%1\$s/\">%1\$s</a><br/>\n", $list);
-}
-closedir(DIR);
-
-print end_html;
--- a/contrib/web/perl-admin/save.cgi	Fri Aug 20 21:02:20 2004 +1000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2004 Morten K. Poulsen <morten at afdelingp.dk>
-#
-# $Id$
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-
-# We might want some kind of validation of the values we are about to save,
-# but that would require save.cgi to know about all kind of options that mlmmj
-# accepts. I am not sure we want that.  -- mortenp 20040709
-
-use CGI qw(:standard);
-
-require "config.pl";
-
-$query = new CGI;
-$list = $query->url(-relative=>1,-path=>1);
-$list =~ s/^[^\/]*\/([^\/]+)\/$/$1/ or die('no list parameter');
-#printf("list = '%s'<br/>\n", $list);
-
-($query->request_method() eq 'POST') or die('wrong method');
-
-@controls = $query->all_parameters();
-
-foreach $param (keys %{$query->{'.fieldnames'}}) {
-	#printf("B params=[%s]<br/>\n", $name);
-	if (!defined $query->param($param)) {
-		push(@controls, $param);
-	}
-}
-
-
-foreach $control (@controls) {
-	($control !~ /^[a-z]\+$/) or die("illegal control name '$control'");
-        my $file = "$topdir/$list/control/$control";
-	my $value = $query->param($control);
-	#printf("A params=[%s -> '%s']<br/>\n", $control, $value);
-
-	if (length($value) > 0) {
-		open(FILE, ">$file") or die("unable to open '$file'");
-		printf(FILE "%s\n", $query->param($control));
-		close(FILE);
-	} else {
-		if (-f $file) {
-			unlink($file) or die("unable to unlin '$file'");
-		}
-	}
-}
-
-print header;
-print start_html('mlmmj config');
-print "$list control values saved!";
-print end_html;