home *** CD-ROM | disk | FTP | other *** search
- #!/bin/csh -f
-
- echo "This script will help you install a WWW simple membership form that accepts"
- echo "membership applications with payment via First Virtual. All that you need to do"
- echo "is to answer a few simple questions."
- echo "This form can also be used to solicit donations in any amount."
- echo ""
- echo "If you do not already have a First Virtual PIN for collecting"
- echo "the money, you can interrupt this script now and send mail to"
- echo "info@fv.com (for information) or apply@card.com (for a blank"
- echo "application form)."
- echo -n "Press return to continue..."
- set junk=$<
-
- echo ""
- echo -n "What is the name of your organization? "
- set ORGNAME=$<
- set t=`echo $ORGNAME | tr -d '#&$'`
- if ("$t" != "$ORGNAME") then
- set ORGNAME="$t"
- echo ""
- echo " - - - - - WARNING! - - - - -"
- echo "Problematic characters stripped from your organization name."
- echo "Please edit them back into the HTML files after configuration is complete."
- echo "Sorry about that!"
- endif
-
- echo ""
- echo "Please enter a textual description of your organization. This text"
- echo "will be used as the initial text at the top of your WWW membership form."
- echo "When you are finished, type control-D."
- echo ""
- set DESCRIPFILE=/tmp/descrip.$$
- cat > $DESCRIPFILE
-
- echo ""
-
- echo "Next, we need to know how much money you wish to charge people for "
- echo "membership. There are three basic options here. Either you can charge "
- echo "everyone the same amount, or you can have multiple membership categories"
- echo '(e.g. "normal", "student", etc.), or you can allow the user to fill in'
- echo "any amount he or she wants."
-
- echo ""
- echo "If you wish to use a single price for everyone, please enter the price"
- echo "in US Dollars. If you wish to allow each user to enter the amount"
- echo 'he or she wants to donate, type "any" (without the quotes) here.'
- echo -n "Otherwise just press RETURN now: "
-
- set rawprice=$<
- set PRICE=`echo $rawprice | tr -cd '0-9.'`
- if ("$rawprice" == "any") then
- echo " Enter the amount to donate in US Dollars: <input name=price type=text size=8>" >price.tmp
- else
- if ("$PRICE" != "") then
- # You must be kidding me.
- echo " You will be charged @PRICE for your application." | \
- tr @ $ >price.tmp
- else
- echo ""
- echo "Next, you will be asked to enter each of the different membership"
- echo "prices, and the descriptive name for each membership category (e.g."
- echo '"student membership"). Please enter each membership category in turn,'
- echo "and then press RETURN alone on a line when you have entered them all."
- cat /dev/null >price.tmp
- echo ""
- echo -n "Enter a membership price, or press RETURN if done: "
- set p=$<
- set p=`echo $p | tr -cd '0-9.'`
- while ("$p" != "")
- set d=`echo "Enter a description for the @$p membership category: " |tr @ $`
- echo -n "$d "
- set d=$<
- echo -n "Is this the default [n]? "
- set x=$<
- set y=""
- if ( "$x" == "y" ) set y=checked
- echo " <input type=radio name=price value=$p $y> $d (@$p)" | tr @ $ >>price.tmp
- echo -n "Enter a price, or RETURN: "
- set p=$<
- set p=`echo $p | tr -cd '0-9.'`
- end
- endif
- endif
-
- echo ""
- set once=1
- set mydesc="Membership in $ORGNAME"
- set DESC=" "
- while ($once || 40 < `echo -n $DESC | wc -c`)
- set once=0
- echo "A description must be less than 40 characters."
- echo "What description should be used for the charge [$mydesc] ? "
- echo " 1234567890123456789012345678901234567890"
- echo -n "? "
- set DESC=$<
- if ("$DESC" == "") set DESC="$mydesc"
- set t=`echo $DESC | tr -d '#&$'`
- if ("$t" != "$DESC") then
- set DESC="$t"
- echo ""
- echo " - - - - - WARNING! - - - - -"
- echo "Problematic characters stripped from your description."
- echo "Please edit them back into the HTML files after configuration is complete."
- echo "Sorry about that!"
- endif
- end
-
- echo ""
- set me=`whoami`
- set mymachine=`hostname`
- set myaddr="$me@$mymachine"
- echo "What is the email address that should receive all email regarding"
- echo -n "membership applications [$myaddr] ? "
- set HANDLERADDR=$<
- if ("$HANDLERADDR" == "") set HANDLERADDR=$myaddr
-
- echo ""
- echo "What is your organization's First Virtual PIN, to which all money"
- echo -n "that is received should be credited? "
- set SELLERID=$<
- set SELLERID=`echo $SELLERID | tr -cd 'a-zA-Z0-9'`
-
-
- set idhost=`hostname`
- echo ""
- echo -n "What is the name of the server this web page will run on? [$idhost] "
- set IDHOST=$<
- if ("$IDHOST" == "") set IDHOST=$idhost
-
- echo ""
- echo "Without any action on your part, the form asks for"
- echo "the user's name, company, address, city, state zip,"
- echo "phone, fax, email address, First Virtual PIN, and other comments."
- echo ""
- echo "If you would like to add additional fields to this list, you can"
- echo "specify the new fields now or you can edit the final HTML files later."
- cat /dev/null >extrafields.tmp
- echo ""
- echo "Enter the prompt for a new field,"
- echo -n " or hit return to continue: "
- set fpr=$<
- while ("$fpr" != "")
- set deffield=`echo $fpr | tr -cd a-zA-Z0-9`
- echo -n "Enter the name of the field [$deffield]: "
- set field=$<
- if ("$field" == "") set field="$deffield"
- set field=`echo $field | tr -cd a-zA-Z0-9`
- echo "${fpr}: <input type=text name=QS_$field>" >>extrafields.tmp
- echo -n "Enter another prompt or hit return: "
- set fpr=$<
- end
-
- set fingprog=`which finger`
- echo ""
- echo -n "Where is the 'finger' program on this system? [$fingprog] "
- set FINGPROG=$<
- if ("$FINGPROG" == "") set FINGPROG=$fingprog
-
- set sendmailprog=/usr/lib/sendmail
- echo ""
- echo -n "Where is the 'sendmail' program on your system? [$sendmailprog] "
- set SENDMAILPROG=$<
- if ("$SENDMAILPROG" == "") set SENDMAILPROG=$sendmailprog
-
-
- cat config.x | sed -e "s#DESC#$DESC#;s#FINGPROG#$FINGPROG#;s#SENDMAILPROG#$SENDMAILPROG#;s#IDHOST#$IDHOST#;s#SELLERID#$SELLERID#;s#ORGNAME#$ORGNAME#;s#PRICE#$PRICE#;s#HANDLERADDR#$HANDLERADDR#" > config.h
-
- cat membership.x1 $DESCRIPFILE membership.x2 extrafields.tmp membership.x3 price.tmp membership.x4 | sed -e "s#DESC#$DESC#;s#FINGPROG#$FINGPROG#;s#SENDMAILPROG#$SENDMAILPROG#;s#IDHOST#$IDHOST#;s#SELLERID#$SELLERID#;s#ORGNAME#$ORGNAME#;s#PRICE#$PRICE#;s#HANDLERADDR#$HANDLERADDR#" > membership.html
-