home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Connectivity / PPP / Docs / NeXTPPP_HTML / websale / configure < prev    next >
Encoding:
Text File  |  1997-09-18  |  6.0 KB  |  170 lines

  1. #!/bin/csh -f
  2.  
  3. echo "This script will help you install a WWW simple membership form that accepts"
  4. echo "membership applications with payment via First Virtual.  All that you need to do"
  5. echo "is to answer a few simple questions."
  6. echo "This form can also be used to solicit donations in any amount."
  7. echo ""
  8. echo "If you do not already have a First Virtual PIN for collecting"
  9. echo "the money, you can interrupt this script now and send mail to"
  10. echo "info@fv.com (for information) or apply@card.com (for a blank"
  11. echo "application form)."
  12. echo -n "Press return to continue..."
  13. set junk=$<
  14.  
  15. echo ""
  16. echo -n "What is the name of your organization? "
  17. set ORGNAME=$<
  18. set t=`echo $ORGNAME | tr -d '#&$'`
  19. if ("$t" != "$ORGNAME") then
  20.     set ORGNAME="$t"
  21.     echo ""
  22.     echo " - - - - - WARNING! - - - - -"
  23.     echo "Problematic characters stripped from your organization name."
  24.     echo "Please edit them back into the HTML files after configuration is complete."
  25.     echo "Sorry about that!"
  26. endif
  27.  
  28. echo ""
  29. echo "Please enter a textual description of your organization.  This text"
  30. echo "will be used as the initial text at the top of your WWW membership form."
  31. echo "When you are finished, type control-D."
  32. echo ""
  33. set DESCRIPFILE=/tmp/descrip.$$
  34. cat > $DESCRIPFILE
  35.  
  36. echo ""
  37.  
  38. echo "Next, we need to know how much money you wish to charge people for "
  39. echo "membership.  There are three basic options here.  Either you can charge "
  40. echo "everyone the same amount, or you can have multiple membership categories"
  41. echo '(e.g. "normal", "student", etc.), or you can allow the user to fill in'
  42. echo "any amount he or she wants."
  43.  
  44. echo ""
  45. echo "If you wish to use a single price for everyone, please enter the price"
  46. echo "in US Dollars.  If you wish to allow each user to enter the amount"
  47. echo 'he or she wants to donate, type "any" (without the quotes) here.'
  48. echo -n "Otherwise just press RETURN now: "
  49.  
  50. set rawprice=$<
  51. set PRICE=`echo $rawprice | tr -cd '0-9.'`
  52. if ("$rawprice" == "any") then
  53.     echo "      Enter the amount to donate in US Dollars: <input name=price type=text size=8>" >price.tmp
  54. else
  55. if ("$PRICE" != "") then
  56.     # You must be kidding me.
  57.     echo "      You will be charged @PRICE for your application." | \
  58.     tr @ $ >price.tmp
  59. else
  60. echo ""
  61. echo "Next, you will be asked to enter each of the different membership"
  62. echo "prices, and the descriptive name for each membership category (e.g."
  63. echo '"student membership").  Please enter each membership category in turn,'
  64. echo "and then press RETURN alone on a line when you have entered them all."
  65. cat /dev/null >price.tmp
  66. echo ""
  67. echo -n "Enter a membership price, or press RETURN if done: "
  68. set p=$<
  69. set p=`echo $p | tr -cd '0-9.'`
  70. while ("$p" != "")
  71. set d=`echo "Enter a description for the @$p membership category: " |tr @ $`
  72. echo -n "$d "
  73. set d=$<
  74. echo -n "Is this the default [n]? "
  75. set x=$<
  76. set y=""
  77. if ( "$x" == "y" ) set y=checked
  78. echo "      <input type=radio name=price value=$p $y> $d (@$p)" | tr @ $ >>price.tmp
  79. echo -n "Enter a price, or RETURN: "
  80. set p=$<
  81. set p=`echo $p | tr -cd '0-9.'`
  82. end
  83. endif
  84. endif
  85.  
  86. echo ""
  87. set once=1
  88. set mydesc="Membership in $ORGNAME"
  89. set DESC=" "
  90. while ($once || 40 < `echo -n $DESC | wc -c`)
  91.    set once=0
  92.    echo "A description must be less than 40 characters."
  93.    echo "What description should be used for the charge [$mydesc] ? "
  94.    echo    "  1234567890123456789012345678901234567890"
  95.    echo -n "? "
  96.    set DESC=$<
  97.    if ("$DESC" == "") set DESC="$mydesc"
  98.    set t=`echo $DESC | tr -d '#&$'`
  99.    if ("$t" != "$DESC") then
  100.     set DESC="$t"
  101.     echo ""
  102.     echo " - - - - - WARNING! - - - - -"
  103.     echo "Problematic characters stripped from your description."
  104.     echo "Please edit them back into the HTML files after configuration is complete."
  105.     echo "Sorry about that!"
  106.    endif
  107. end
  108.  
  109. echo ""
  110. set me=`whoami`
  111. set mymachine=`hostname`
  112. set myaddr="$me@$mymachine"
  113. echo "What is the email address that should receive all email regarding"
  114. echo -n "membership applications [$myaddr] ? "
  115. set HANDLERADDR=$<
  116. if ("$HANDLERADDR" == "") set HANDLERADDR=$myaddr
  117.  
  118. echo ""
  119. echo "What is your organization's First Virtual PIN, to which all money"
  120. echo -n "that is received should be credited? "
  121. set SELLERID=$<
  122. set SELLERID=`echo $SELLERID | tr -cd 'a-zA-Z0-9'`
  123.  
  124.  
  125. set idhost=`hostname`
  126. echo ""
  127. echo -n "What is the name of the server this web page will run on? [$idhost] "
  128. set IDHOST=$<
  129. if ("$IDHOST" == "") set IDHOST=$idhost
  130.  
  131. echo ""
  132. echo "Without any action on your part, the form asks for"
  133. echo "the user's name, company, address, city, state zip,"
  134. echo "phone, fax, email address, First Virtual PIN, and other comments."
  135. echo ""
  136. echo "If you would like to add additional fields to this list, you can"
  137. echo "specify the new fields now or you can edit the final HTML files later."
  138. cat /dev/null >extrafields.tmp
  139. echo ""
  140. echo "Enter the prompt for a new field,"
  141. echo -n "    or hit return to continue: "
  142. set fpr=$<
  143. while ("$fpr" != "")
  144.   set deffield=`echo $fpr | tr -cd a-zA-Z0-9`
  145.   echo -n "Enter the name of the field [$deffield]: "
  146.   set field=$<
  147.   if ("$field" == "") set field="$deffield"
  148.   set field=`echo $field | tr -cd a-zA-Z0-9`
  149.   echo "${fpr}: <input type=text name=QS_$field>" >>extrafields.tmp
  150.   echo -n "Enter another prompt or hit return: "
  151.   set fpr=$<
  152. end
  153.  
  154. set fingprog=`which finger`
  155. echo ""
  156. echo -n "Where is the 'finger' program on this system? [$fingprog] "
  157. set FINGPROG=$<
  158. if ("$FINGPROG" == "") set FINGPROG=$fingprog
  159.  
  160. set sendmailprog=/usr/lib/sendmail
  161. echo ""
  162. echo -n "Where is the 'sendmail' program on your system? [$sendmailprog] "
  163. set SENDMAILPROG=$<
  164. if ("$SENDMAILPROG" == "") set SENDMAILPROG=$sendmailprog
  165.  
  166.  
  167. 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
  168.  
  169. 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
  170.