On Fri, 28 Oct 1994, Nelson Minar wrote:
> Has anyone put any effort into making a WWW front end to Majordomo?
> http://coombs.anu.edu.au/CoombswebPages/Majordomo.html has the
> beginnings of one - you can use checkboxes to send a "subscribe" or
> "unsubscribe" message to their majordomo.
Ok, here it is!
There are two parts a WWW front end (which really only works as it should with
XMosiac 2.3 - not 2.4), and the C code backend. Please feel free to modified and
include this code with Majordomo (and rewrite it into Perl).
Gavin Longmuir
----
http://coombs.anu.edu.au/CoombswebPages/Majordomo.html
----
<HTML>
<HEAD>
<TITLE>Combslist E-Forum Subscriptions Form (Coombsweb,ANU)</TITLE>
</HEAD>
<BODY>
<H3>THE AUSTRALIAN NATIONAL UNIVERSITY</H3>
<B>Coombs Computing Unit, Research Schools of Social Sciences & Pacific and
Asian Studies,
Canberra ACT 0200, Australia</B>
<HR>
<H3>Coombslists - ANU Social Sciences & Asian Studies E-mail Forums</H3>
[Est. 20 April 1994; Last revised: 31 October 1994. This facility is
provided by the Australian National University (<A
HREF="http://cis.anu.edu.au">ANU</A>). This month's additions are marked "***";
This page is a part of the <B><A
HREF="http://coombs.anu.edu.au/CoombsHome.html">ANU Social Sciences
WWW Server</B></A> (Coombsweb)]
<P></P>
You can subscribe to several e-mail lists (on the
<B>majordomo@coombs.anu.edu.au </B> system) by entering your e-mail
address in the space provided and selecting the lists you wish to
subscribe, then press the <I>Submit</I> button at the bottom of this
form. All subscription requests submitted via this form are then
forwarded on to the various list owners for final approval.<P></P>
Details of the ANU academic electronic forums are available from the <LI><A
HREF="gopher://cheops.anu.edu.au/7waissrc%3a/Coombs-db/ANU-Coombslists-Index
.src">ANU-Coombslists-Index
</A> dbase
<P></P>
Transactions of most of these e-mail forums are archived and are
accessible world-wide via the ANU's
<A HREF="gopher://cheops.anu.edu.au:70/11/Coombs-db">Coombswais </A>
full-text databases system.
<P></P>
If you don't have a browser (eg. Mosaic v. 2)
which supports forms, you can still e-mail your request to
<B>majordomo@coombs.anu.edu.au</B> with a single message reading
<I>subscribe listname your-email-address</I> where listname is the
name of the list (see below) which what to subscribe to.
<P></P>
<B>[ Please note that Windows Mosaic 2.0 currently doesn't have full
forms support. This page is currently optimised for the
X-Windows browser and it may look a bit skimpy through other browsers]</B>
<P></P>
<HR>
For COOMBSLIST subscriptions please complete the following form:
<HR>
<form method=POST action="http://coombs.anu.edu.au/bin/mailin-majordomo">
YOUR E-MAIL ADDRESS:
<inPUT SIZE=50 NAME="email" VALUE="user.user@coombs.anu.edu.au"><p>
ACTION TO APPLY TO THE CHECKBOXES LISTED BELOW:
<SELECT NAME="admin">
<OPTION SELECTED>subscribe
<OPTION>unsubscribe
</SELECT>
<P></P>
<UL>
<inPUT TYPE="checkbox" NAME="aboriginal-studies-l" VALUE="true">
<UL>Indigenous Australia Studies Forum</UL>
<inPUT TYPE="checkbox" NAME="act-stat-l" VALUE="true">
<UL>ACT based Statistics & Research Techniques Forum</UL>
<inPUT TYPE="checkbox" NAME="ancient-dna-l" VALUE="true">
<UL>Ancient DNA & Other Biomolecules Study Group</UL>
<inPUT TYPE="checkbox" NAME="aphil-l" VALUE="true">
<UL>Australasian Philosophy Forum</UL>
<inPUT TYPE="checkbox" NAME="asia-pacific-security-l" VALUE="true">
<UL>Asia/Asia-Pacific Strategic & Defence Studies Forum</UL>
<inPUT TYPE="checkbox" NAME="asia-www-gopher-news-l" VALUE="true">
<UL>Asia/Asian Studies WWW & Gophers Inf. Systems Group</UL>
<inPUT TYPE="checkbox" NAME="austral-socpol-theory-l" VALUE="true">
<UL>Australian Social & Political Theory Forum</UL>
<inPUT TYPE="checkbox" NAME="australia-nz-history-l" VALUE="true">
<UL>Australian & New Zealand History Forum</UL>
<inPUT TYPE="checkbox" NAME="australian-linguistics-l" VALUE="true">
<UL>Australian Indigenous Languages Forum</UL>
<inPUT TYPE="checkbox" NAME="avsl-l" VALUE="true">
<UL>Australia-Vietnam Science-Technology Link Group</UL>
<inPUT TYPE="checkbox" NAME="central-asia-studies-l" VALUE="true">
<UL>Economics, demography & politics of Central Asia region</UL>
<inPUT TYPE="checkbox" NAME="coombseminars" VALUE="true">
<UL>Soc.Sciences/Pacific/Asian Studies seminars, lectures, visitors etc. at
ANU</UL>
<inPUT TYPE="checkbox" NAME="cornish-studies-l" VALUE="true">
<UL>Cornwall/Kernow Studies Forum</UL>
<inPUT TYPE="checkbox" NAME="demographic-list" VALUE="true">
<UL>Demography & Population Studies Forum</UL>
<inPUT TYPE="checkbox" NAME="development-studies-l" VALUE="true">
<UL>Economic & Social Development Research</UL>
<inPUT TYPE="checkbox" NAME="electronic-sociology-l" VALUE="true">
<UL>Electronic Jrnl of Sociology (ISSN 1198-3655) Mailing List</UL>
<inPUT TYPE="checkbox" NAME="endangered-languages-l" VALUE="true">
<UL>Endangered & Disappearing Languages Forum</UL>
<inPUT TYPE="checkbox" NAME="gesture-l" VALUE="true">
<UL>Gestures, Gesture Systems & Alternate Sign Languages Forum</UL>
<inPUT TYPE="checkbox" NAME="hist-aust-sci-tech-l" VALUE="true">
<UL>History of Australian Science & Technology Forum</UL>
<inPUT TYPE="checkbox" NAME="pacific-islands-l" VALUE="true">
<UL>Pacific Islands Study & Documentation Group</UL>
<inPUT TYPE="checkbox" NAME="philippinestudies-l" VALUE="true">
<UL>Philippines Studies Forum</UL>
<inPUT TYPE="checkbox" NAME="stepnet" VALUE="true">
<UL>Science, Technology & Economic Policy (STEP) Forum</UL>
<inPUT TYPE="checkbox" NAME="sociology-anu-rsss-l" VALUE="true">
<UL>Sociological Research Forum </UL>
<inPUT TYPE="checkbox" NAME="socsci-www-gopher-news-l" VALUE="true">
<UL>Social Sciences WWW & Gophers Inf. Systems Group</UL>
<inPUT TYPE="checkbox" NAME="south-asia-studies-l" VALUE="true">
<UL>Economics, demography & politics of South Asia region</UL>
<inPUT TYPE="checkbox" NAME="taoism-studies-l" VALUE="true">
<UL>Taoist Religion & Philosophy Forum</UL>
<inPUT TYPE="checkbox" NAME="urban-research-l" VALUE="true">
<UL>Urban & Regional Research Forum</UL>
<inPUT TYPE="checkbox" NAME="zenbuddhism-l" VALUE="true">
<UL>Zen & Ch'an Buddhism Studies Forum</UL>
</UL>
<P></P>TO SUBMIT YOUR CHOICES, PRESS THIS BUTTON:
<inPUT TYPE="submit" VALUE="Submit Request">
</FORM>
<P></P>
<HR>
<P></P>
Page administrator:
<A HREF="http://coombs.anu.edu.au/~gavin/.gavin.html">Gavin Longmuir</A>
(Gavin.Longmuir@anu.edu.au)
<P></P>
<A HREF="http://coombs.anu.edu.au/CoombsHome.html">Return to Coombsweb Home
Page</A>
<P></P>
</BODY>
</HTML>
----
----
mailin-majordomo.c
----
/*
* This is a simple program to mail the results of a feedback form to you.
* Please read the documentation at http://south.ncsa.uiuc.edu/forms.html
* before using.
*
* If you have a non-CGI server such as NCSA httpd 1.0a5 or earlier, please
* compile with the OLD flag defined.
*
* Thanks (Eric Bina & Rob McCool)
*
* Modified
* April 1994 - for Majordomo (coombslists) forms subscription
* http://coombs.anu.edu.au/CoombswebPages/Majordomo.html
* Gavin Longmuir (Gavin.Longmuir@anu.edu.au)
*/
#include <stdio.h>
#include <strings.h>
#define MAX_ENTRIES 10000
typedef struct {
char *name;
char *val;
} entry;
char *makeword(char *line, char stop);
char *fmakeword(FILE *f, char stop, int *len);
char x2c(char *what);
void unescape_url(char *url);
void plustospace(char *str);
mailit(register int m, entry *entries)
{
FILE *fp;
char filename[256];
char command[256];
register int x;
sprintf(filename, "/tmp/mailin%d", (int)getpid());
fp = fopen(filename, "w");
if (fp != NULL)
{
for(x=2;x<=m;x++) {
fprintf(fp, "%s %s %s\n", entries[1].val, entries[x].name,
entries[0].val);
}
fclose(fp);
/* mailit via local agent */
sprintf(command, "mailx -s WWW-forms-input majordomo < %s", filename);
system(command);
unlink(filename);
}
}
main(int argc, char *argv[]) {
entry entries[MAX_ENTRIES];
register int x,m=0;
int cl;
#ifdef OLD
cl = atoi(argv[1]);
#else
cl = atoi(getenv("CONTENT_LENGTH"));
#endif
printf("Content-type: text/html%c%c",10,10);
for(x=0;cl && (!feof(stdin));x++) {
m=x;
entries[x].val = fmakeword(stdin,'&',&cl);
plustospace(entries[x].val);
unescape_url(entries[x].val);
entries[x].name = makeword(entries[x].val,'=');
}
if ((entries[0].val != NULL)&&(entries[0].val[0] != '\0')&&
(strcmp(entries[0].val,"user.user@coombs.anu.edu.au") != 0))
{
mailit(m, entries);
printf("<HR><H4>User: %s</H4>\n", entries[0].val);
printf("Has submitted the following request(s) to
<I>majordomo@coombs.anu.edu.au</I>:<P>\n<PRE>\n");
for(x=2;x<=m;x++) {
printf("%s %s<BR>\n", entries[1].val, entries[x].name);
}
printf("\n\n\n</PRE>\n<P>\n");
printf("<UL>This/these request(s) have now been forwarded to the ");
printf("respective list owner(s) for final approval.\n</UL><P><HR>\n");
}
else
{
printf("<HR><P><b>Unknown User</b> - ignored");
printf("\n<P><HR>\n");
}
}
----
--
* Gavin Longmuir - Dog's Body and Programmer
* * Demography Program, Research School of Social Sciences
* Australian National University, Canberra 0200, AUSTRALIA
Voice: +61 6 249 0530 FAX: +61 6 249 3031 E-Mail: Gavin.Longmuir@anu.edu.au
* http://coombs.anu.edu.au/~gavin/.gavin.html
|
|