#! /csuite/bin/bash # mdml-create,v 1.2 1998/12/04 19:08:04 potter Exp # Copyright (C) 1995, 1996 Chebucto Community Net Society # This file is part of Chebucto Suite. Use is governed by the terms # laid out in the file COPYRIGHT. # template version 1.0 ## mdml-create - MajorDomo List Creation # # This script processes a form used to request the creation # of majordomo mailing lists. cd /tmp . $DOCUMENT_ROOT/.cgi-funclib cs_html_head -t userhelp $"Mailing List Creation" trap cs_html_foot 0 # # Main # majordomodir=$MD_LISTS archivedir=$MD_VAR/archive digestdir=$MD_VAR/digests spooldir=$MD_HOME/spool if [ -z "$USER" ]; then echo $"

ERROR:

" echo $"

This form must be submitted using lynx.

" exit 1 fi if [ ! -d $majordomodir -o ! -d $archivedir -o ! -d $digestdir -o ! -d $spooldir ]; then echo $"

ERROR:

" echo $"

missing majordomo system directories.

" exit 2 fi if [ -z "$CONTENT_LENGTH" ] || [ "$CONTENT_LENGTH" -eq 0 ]; then cd $spooldir echo $"

Process Spooled Mailing List Requests

Please select the request you would like to process:

" for sf in * do if [ "$sf" = "*" ]; then echo $"No requests currently spooled." exit 0 fi cat < $sf EOM done echo $"

" exit 0 fi if [ ! -z "$cgi_spoolfile" ]; then echo $"

Approve Mailing List Creation

" cd $spooldir eval `gawk -F= ' { printf ("cgi_%s=%c%s%c\n", $1, 34, $2, 34) } ' $cgi_spoolfile` #echo "
"
	#set
	#echo "
" check_regular= check_digest= check_regular_digest= case "$cgi_type" in "regular") check_regular="checked" ;; "digest") check_digest="checked" ;; "regular-digest") check_regular_digest="checked" ;; esac check_open= check_closed= case "$cgi_subscribe_policy" in "open") check_open="checked" ;; "closed") check_closed="checked" ;; esac check_mno= check_myes= case "$cgi_moderate" in "no") check_mno="checked" ;; "yes") check_myes="checked" ;; esac check_pno= check_pyes= case "$cgi_private_who" in "no") check_pno="checked" ;; "yes") check_pyes="checked" ;; esac echo $"
You may need to update your sudo permissions.

Mailing List Approval Form

List Type:         Regular  Digest  
Regular+Digest

List Name:        
Description:      
List Owner:       
Admin Password:   
Approve Password: 

Subscribe Policy:  Open  Closed

Moderated:         No  Yes

Private:           No  Yes

Approve Request Deny Request

/

" exit 0 fi echo $"

Mailing List Creation Results

" cgi_listname=`echo $cgi_listname | cgi2text | tr -cd 0-9A-Za-z-_ | tr A-Z a-z` cgi_description=`echo $cgi_description | cgi2text` trap 'unlock $spooldir/$cgi_listname $$ >/dev/null 2>&1' 0 1 2 15 if lock $spooldir/$cgi_listname $$ then : else echo $"

ERROR:

" echo $"

unable to get system lock for $cgi_listname.

" exit 3 fi if [ -z "$cgi_listname" ]; then echo $"

ERROR:

" echo $"

No name for the list was entered.

" exit 4 fi # # recreate spoolfile and set permissions # cd $spooldir >$cgi_listname chmod 660 $spooldir/$cgi_listname # # add data to spoolfile # cat >>$cgi_listname < The mailing list \"$cgi_listname\" ($cgi_description) has been created.

" ;; *) echo $"

The mailing list \"$cgi_listname\" ($cgi_description) could not be created.

" unlock $spooldir/$cgi_listname $$ exit 5 ;; esac ;; "no") echo $"From: majordomo-owner (Mailing List Creator) To: $cgi_owner Subject: Request for mailing list ($cgi_listname) denied Your request for a mailing list has been denied. Please reply to this message if you require information on why your request has been denied. $FULL_NAME Mailing List Management " | $SENDMAIL echo $"

The mailing list \"$cgi_listname\" ($cgi_description) was denied approval for creation. " ;; esac echo $"


[ Mailing List Administration ]" unlock $spooldir/$cgi_listname $$ rm $spooldir/$cgi_listname echo "
" exit 0