diff options
author | Frank Ch. Eigler <fche@gcc.gnu.org> | 2010-07-29 22:14:29 +0000 |
---|---|---|
committer | Frank Ch. Eigler <fche@gcc.gnu.org> | 2010-07-29 22:14:29 +0000 |
commit | f193287a54be1eda13683135e20b1767ca7ccbfe (patch) | |
tree | 949273ad01b4fdda317d326d393426956b22d8be /cgi-bin/ml-request | |
parent | c++0x update (diff) | |
download | gcc-wwwdocs-f193287a54be1eda13683135e20b1767ca7ccbfe.tar.gz gcc-wwwdocs-f193287a54be1eda13683135e20b1767ca7ccbfe.tar.bz2 gcc-wwwdocs-f193287a54be1eda13683135e20b1767ca7ccbfe.tar.xz |
unxss
Diffstat (limited to 'cgi-bin/ml-request')
-rwxr-xr-x | cgi-bin/ml-request | 67 |
1 files changed, 31 insertions, 36 deletions
diff --git a/cgi-bin/ml-request b/cgi-bin/ml-request index c0927504..45ccf36e 100755 --- a/cgi-bin/ml-request +++ b/cgi-bin/ml-request | |||
@@ -1,11 +1,15 @@ | |||
1 | #! /bin/sh | 1 | #! /bin/sh |
2 | 2 | ||
3 | HEADER='<body><h1 align="center"><a href="/">GCC</a> mailing list request-o-matic</h1>' | 3 | CONVAWK=/www/sourceware/cgi-bin/conv.awk |
4 | FOOTER='<hr><a href="/">Click here</a> to return to the front GCC web page</body></html>' | ||
5 | |||
6 | CONVAWK=/www/gcc/cgi-bin/conv.awk | ||
7 | MAIL=/usr/bin/Mail | 4 | MAIL=/usr/bin/Mail |
8 | 5 | ||
6 | HEADER=/www/sourceware/htdocs/include/header-subpages.html | ||
7 | FOOTER=/www/sourceware/htdocs/include/footer-subpages.html | ||
8 | |||
9 | case "$REQUEST_METHOD" in | ||
10 | POST) QUERY_STRING=`cat` ;; | ||
11 | esac | ||
12 | |||
9 | if [ ! -f /usr/bin/gawk ] | 13 | if [ ! -f /usr/bin/gawk ] |
10 | then | 14 | then |
11 | GAWK=gawk | 15 | GAWK=gawk |
@@ -24,11 +28,8 @@ normalize() | |||
24 | ## input on stdin will be of the format | 28 | ## input on stdin will be of the format |
25 | ## username=emailaddr@domain.com | 29 | ## username=emailaddr@domain.com |
26 | ## listname=mailing-list-name | 30 | ## listname=mailing-list-name |
27 | ## operation=[subscribe|unsubscribe] | ||
28 | ## digest=[on|off] | ||
29 | 31 | ||
30 | hasat=0 | 32 | hasgoodform=0 |
31 | hasdot=0 | ||
32 | email="" | 33 | email="" |
33 | cmdargs="" | 34 | cmdargs="" |
34 | prnum="" | 35 | prnum="" |
@@ -77,27 +78,21 @@ then | |||
77 | echo "<head>" | 78 | echo "<head>" |
78 | echo "<TITLE>Cannot add you to the mailing list at this time...</TITLE>" | 79 | echo "<TITLE>Cannot add you to the mailing list at this time...</TITLE>" |
79 | echo "</head>" | 80 | echo "</head>" |
80 | echo "$HEADER" | 81 | cat $HEADER |
81 | 82 | ||
82 | echo "<p>There was an internal error in this script. Please report" | 83 | echo "<p>There was an internal error in this script. Please report" |
83 | echo "this problem to sourcemaster@cygnus.com." | 84 | echo "this problem to sourcemaster@sourceware.org." |
84 | 85 | ||
85 | echo "$FOOTER" | 86 | cat $FOOTER |
86 | exit 0 | 87 | exit 0 |
87 | fi | 88 | fi |
88 | 89 | ||
89 | 90 | ||
90 | if echo "$email" | grep @ >/dev/null 2>&1 | 91 | if expr "$email" : '^[a-zA-Z0-9._-]*@[a-zA-Z0-9._-]*$' >/dev/null |
91 | then | 92 | then |
92 | hasat=1 | 93 | hasgoodform=1 |
93 | if echo "$email" | sed 's,^[^@]*@,,' | grep '\.' >/dev/null 2>&1 | ||
94 | then | ||
95 | hasdot=1 | ||
96 | else | ||
97 | hasdot=0 | ||
98 | fi | ||
99 | else | 94 | else |
100 | hasat=0 | 95 | hasgoodform=0 |
101 | fi | 96 | fi |
102 | 97 | ||
103 | if [ -z "$listname" ] | 98 | if [ -z "$listname" ] |
@@ -132,7 +127,7 @@ then | |||
132 | fi | 127 | fi |
133 | fi | 128 | fi |
134 | 129 | ||
135 | if [ -n "$email" -a "$hasat" -eq 1 -a "$hasdot" -eq 1 -a "$has_listname" -eq 1 ] | 130 | if [ -n "$email" -a "$hasgoodform" -eq 1 -a "$has_listname" -eq 1 ] |
136 | then | 131 | then |
137 | 132 | ||
138 | if [ "$operation" = "subscribe" ] | 133 | if [ "$operation" = "subscribe" ] |
@@ -150,13 +145,13 @@ then | |||
150 | echo "<head>" | 145 | echo "<head>" |
151 | echo "<TITLE>Your ${sub_prefix}subscribe request is being sent in...</TITLE>" | 146 | echo "<TITLE>Your ${sub_prefix}subscribe request is being sent in...</TITLE>" |
152 | echo "</head>" | 147 | echo "</head>" |
153 | echo "$HEADER" | 148 | cat $HEADER |
154 | 149 | ||
155 | QMAILHOST=gcc.gnu.org | 150 | QMAILHOST=sourceware.org |
156 | export QMAILHOST | 151 | export QMAILHOST |
157 | orig_email="${email}" | 152 | orig_email="${email}" |
158 | email="`echo ${email} | sed 's,@,=,g'`" | 153 | email="`echo ${email} | sed 's,@,=,g'`" |
159 | echo "" | $MAIL "${listname}-${digest}${operation}-${email}@gcc.gnu.org" | 154 | echo "" | $MAIL "${listname}-${digest}${operation}-${email}@sourceware.org" |
160 | 155 | ||
161 | echo "<h2>Your ${sub_prefix}subscribe request is being sent in...</h2>" | 156 | echo "<h2>Your ${sub_prefix}subscribe request is being sent in...</h2>" |
162 | 157 | ||
@@ -180,12 +175,12 @@ then | |||
180 | echo "confirmation note soon, please try submitting your request again. " | 175 | echo "confirmation note soon, please try submitting your request again. " |
181 | echo "<p>You can" | 176 | echo "<p>You can" |
182 | echo "also do your request by sending an e-mail note to" | 177 | echo "also do your request by sending an e-mail note to" |
183 | echo "<code>${listname}-${digest}${operation}@gcc.gnu.org</code>" | 178 | echo "<code>${listname}-${digest}${operation}@sourceware.org</code>" |
184 | echo "<p>The message body and Subject line are ignored." | 179 | echo "<p>The message body and Subject line are ignored." |
185 | 180 | ||
186 | echo "<p>See the" | 181 | echo "<p>See the" |
187 | echo "<a href=\"http://gcc.gnu.org/lists.html\">GCC mailing list page</a>" | 182 | echo "<a href=\"http://sourceware.org/lists.html#faqs\">mailing" |
188 | echo "for more information." | 183 | echo "list FAQ page</a> for more information." |
189 | else | 184 | else |
190 | if [ "$has_listname" -eq 1 ] | 185 | if [ "$has_listname" -eq 1 ] |
191 | then | 186 | then |
@@ -195,7 +190,7 @@ else | |||
195 | echo "<head>" | 190 | echo "<head>" |
196 | echo "<TITLE>Cannot handle your mailing list request...</TITLE>" | 191 | echo "<TITLE>Cannot handle your mailing list request...</TITLE>" |
197 | echo "</head>" | 192 | echo "</head>" |
198 | echo "$HEADER" | 193 | cat $HEADER |
199 | 194 | ||
200 | echo '<h2>Cannot handle your mailing list request...</h2>' | 195 | echo '<h2>Cannot handle your mailing list request...</h2>' |
201 | echo '<p>' | 196 | echo '<p>' |
@@ -207,12 +202,12 @@ else | |||
207 | 202 | ||
208 | echo "<p>You can" | 203 | echo "<p>You can" |
209 | echo "also subscribe by sending an e-mail note to" | 204 | echo "also subscribe by sending an e-mail note to" |
210 | echo "<code>${listname}-${digest}${operation}@gcc.gnu.org</code>" | 205 | echo "<code>${listname}-${digest}${operation}@sourceware.org</code>" |
211 | echo "<p>The message body and Subject line are ignored." | 206 | echo "<p>The message body and Subject line are ignored." |
212 | 207 | ||
213 | echo "<p>See the" | 208 | echo "<p>See the" |
214 | echo "<a href=\"http://gcc.gnu.org/lists.html\">GCC mailing list page</a>" | 209 | echo "<a href=\"http://sourceware.org/ml/index.html#faqs\">sourceware" |
215 | echo "for more information." | 210 | echo "mailing list FAQ page</a> for more information." |
216 | else | 211 | else |
217 | echo "Content-type: text/html" | 212 | echo "Content-type: text/html" |
218 | echo "" | 213 | echo "" |
@@ -220,24 +215,24 @@ else | |||
220 | echo "<head>" | 215 | echo "<head>" |
221 | echo "<TITLE>Cannot handle your mailing list request at this time...</TITLE>" | 216 | echo "<TITLE>Cannot handle your mailing list request at this time...</TITLE>" |
222 | echo "</head>" | 217 | echo "</head>" |
223 | echo "$HEADER" | 218 | cat $HEADER |
224 | 219 | ||
225 | echo '<h2>Cannot handle your mailing list request at this time...</h2>' | 220 | echo '<h2>Cannot handle your mailing list request at this time...</h2>' |
226 | 221 | ||
227 | echo '<p>' | 222 | echo '<p>' |
228 | echo "You did not provide a mailing list name, or you've entered a mailing" | 223 | echo "You did not provide a mailing list name, or you've entered a mailing" |
229 | echo 'list name which is not handled on <tt>gcc.gnu.org</tt>.' | 224 | echo 'list name which is not handled on <tt>sourceware.org</tt>.' |
230 | 225 | ||
231 | echo '<p>If you are trying to (un)subscribe to/from a mailing list hosted at <b>gnu.org</b>,' | 226 | echo '<p>If you are trying to (un)subscribe to/from a mailing list hosted at <b>gnu.org</b>,' |
232 | echo "send a mail note to <b>${listname}-request@gnu.org</b> with a message body" | 227 | echo "send a mail note to <b>${listname}-request@gnu.org</b> with a message body" |
233 | echo like, \"subscribe ${listname}\". | 228 | echo like, \"subscribe ${listname}\". |
234 | 229 | ||
235 | echo "<p>See the" | 230 | echo "<p>See the" |
236 | echo "<a href=\"http://gcc.gnu.org/lists.html\">GCC mailing list page</a>" | 231 | echo "<a href=\"http://sourceware.org/ml/index.html#faqs\">sourceware" |
237 | echo "for more information." | 232 | echo "mailing list FAQ page</a> for more information." |
238 | fi | 233 | fi |
239 | fi | 234 | fi |
240 | 235 | ||
241 | echo "$FOOTER" | 236 | cat $FOOTER |
242 | 237 | ||
243 | exit 0 | 238 | exit 0 |