2 # This is a module with functions for HTML output.
4 # I separate it from the main STUMP stuff because these functions are
5 # bulky and not very interesting.
10 use CGI qw/escapeHTML/;
13 my $title = pop( @_ );
15 "Content-Type: text/html\n\n
21 print "<B> You are operating in demonstration mode. User actions will have no effect.</B><HR>\n";
27 print "\n<HR>Thank you for using <A HREF=$STUMP_URL>STUMP Robomoderator</A>.
29 Click <A HREF=$base_address>here</A> to return to WebSTUMP. -->
33 # prints a link to help
34 # accepts topic id and topic name.
37 my $topic_name = pop( @_ );
38 my $topic = pop( @_ );
40 #&print_image( "help.gif", "" );
42 print "<A HREF=$base_address?action=help&topic=$topic TARGET=new>Click here for help on $topic_name</A>\n";
46 # prints image and an alt text
48 sub print_image { # image_file, alt_text
52 print "<IMG SRC=$base_address_for_files/images/$file ALT=\"$alt\" ALIGN=BOTTOMP>\n";
55 # prints the welcome page and login screen.
56 sub html_welcome_page {
57 &begin_html( "Welcome to WebSTUMP" );
61 "Welcome to WebSTUMP, the moderators' front end for <A
62 HREF=http://www.algebra.com/~ichudov/stump>STUMP</A> users -- USENET newsgroup
63 moderators. Only authorized users are allowed to log into this
68 my $motd_file = "$webstump_home/config/motd";
70 if( -f $motd_file && -r $motd_file ){
71 open( MOTD, $motd_file );
72 print "<B>Message of the Day:</B><BR><PRE>\n";
73 print while( <MOTD> );
79 Newsgroups Status:<BR>
82 for( sort @newsgroups_array ) {
85 my $count = &get_article_count( $_ );
87 print " <A HREF=$base_address?action=login_screen\&newsgroup=$_>$_</A>";
88 &print_image( "smiley.gif", "" ) if $count;
92 print "<TD>$count messages in queue<BR></TD>";
93 # print "<TD><A HREF=$base_address?action=init_request_newsgroup_creation\&newsgroup=$_>Request creation</A></TD>\n";
97 print "<HR>Note: click on the newsgroup to login in as moderator.
98 <!-- Click on 'Request Creation' to ask a sysadmin at a specific domain
99 to carry your newsgroup. -->\n<HR>
100 <A HREF=$base_address?action=admin_login>Click here to administer this WebSTUMP installation</A>
105 # prints the login screen for newsgroup.
106 sub html_login_screen {
107 my $newsgroup = $request{'newsgroup'} || &error( "newsgroup not defined" );
109 my $count = &get_article_count( $newsgroup );
113 &begin_html( "$count articles in queue for $newsgroup" );
115 &begin_html( "Empty Queue for $newsgroup" );
119 " Welcome to the Moderation Center for $newsgroup. Please bookmark
123 my $color = "", $end_color = "";
126 $color = "<font color=red>";
127 $end_color = "<font color=black>";
131 "<FORM METHOD=$request_method action=$base_address>
132 <INPUT NAME=action VALUE=moderation_screen TYPE=hidden>
135 &print_image( "new_tiny2.gif", "new" ) if $count;
137 print " articles available)<BR> $end_color
138 Login: <INPUT NAME=moderator VALUE=\"\" SIZE=20>
140 Password: <INPUT NAME=password TYPE=password VALUE=\"\" SIZE=20>
142 <INPUT TYPE=submit VALUE=\"Proceed with Login\">
143 <INPUT TYPE=reset VALUE=\"Reset\">
144 <INPUT NAME=newsgroup VALUE=\"$newsgroup\" TYPE=hidden>
146 Please log into $newsgroup. You can only log in if you know your login id
147 and know the secret password. You should not give your password to any
148 unauthorized user. Your login id and password are NOT case sentitive,
150 for example, \"xyzzy\" and \"XyZZY\" are equally valid.<P>
154 # Log in as \"admin\" if you want to
156 # <LI> edit filtering lists.";
158 # &link_to_help( "filter-lists", "Filter Lists" );
161 # <LI> add/delete users or change their passwords.
162 # <LI> First Time Users: You have to log in as admin and add a moderator user
163 # who will be able to moderate the newsgroup. Then log in again as that
164 # user. If you are a new user, you have to have your admin password assigned to
165 # you by the administrator.
172 # prints the login screen for newsgroup.
173 sub admin_login_screen {
174 &begin_html( "Administrative login" );
178 Attention: this page is only for the maintainer of the whole WebSTUMP
179 installation. Please return to the main page if you are not the maintainer
180 of this installation. <HR>
184 "<FORM METHOD=$request_method action=$base_address>
185 <INPUT NAME=action VALUE=webstump_admin_screen TYPE=hidden>
186 Password: <INPUT NAME=password TYPE=password VALUE=\"\" SIZE=20>
188 <INPUT TYPE=submit VALUE=\"Proceed with Login\">
189 <INPUT TYPE=reset VALUE=\"Reset\">
196 # main moderation page -- single-article version
197 sub html_moderate_article {
198 my $newsgroup = &required_parameter( 'newsgroup' );
199 my $moderator = $request{'moderator'};
200 my $password = $request{'password'};
201 my $file = shift @_ || &required_parameter('file');
203 &begin_html( "Main Moderation Screen: $newsgroup" );
206 &read_rejection_reasons;
208 my $dir = "$queues_dir/$newsgroup";
210 if( -d "$dir/$file" && open( TEXT_FILES, "$dir/$file/text.files.lst" ) ) {
212 print "<HR>\n" if &print_article_warning( $file );
217 while( $filename = <TEXT_FILES> ) {
218 open( ARTICLE, "$dir/$file/$filename" );
220 $embolden= m/^(?:from|subject)\s*\:/i;
224 $_= "<strong>$_</strong>" if $embolden;
226 $inhead= 0 unless m/\S/;
232 print "\n</PRE>\n\n";
234 &print_images( $newsgroup, "$dir/$file", $file);
237 print "This message ($dir/$file) no longer exists -- maybe it was " .
238 "approved or rejected by another moderator.";
242 <FORM NAME=decision METHOD=$request_method action=$base_address>
246 <INPUT NAME=action VALUE=approval_decision TYPE=hidden>";
247 &html_print_credentials;
248 print "<INPUT TYPE=radio NAME=\"decision_$file\" VALUE=approve>Approve\n";
249 print "<INPUT TYPE=radio NAME=\"decision_$file\" VALUE=skip>Leave\n";
250 print "<INPUT TYPE=radio NAME=\"decision_$file\" VALUE=leave>Back of queue\n";
251 foreach (@short_rejection_reasons) {
252 print "<INPUT TYPE=radio NAME=\"decision_$file\" VALUE=\"reject $_\">Reject \u$_\n";
255 print "<BR> <BR> Comment (to poster, in rejection message): <INPUT NAME=comment VALUE=\"\" SIZE=80><BR>";
258 <INPUT TYPE=radio NAME=poster_decision VALUE=nothing CHECKED>Don't change poster's status</INPUT>
259 <INPUT TYPE=radio NAME=poster_decision VALUE=preapprove
260 >White-list poster</INPUT>
261 <INPUT TYPE=radio NAME=poster_decision VALUE=ban
262 ONCLICK=\"alert( 'Banning a poster is a controversial practice'); \"
263 > Ban All Posts by this Person (Careful!)</INPUT>
267 NOTE: Decisions to ban and whitelist posters can be reversed by
268 logging in as \"admin\" and editing respective lists of whitelisted
272 &link_to_help( "filter-lists", "automatic filtering and filter lists, blacklisting and preapproved threads." );
274 print "Be really careful about blacklisting of everyone except spammers.</I><BR><BR>
276 <INPUT TYPE=radio NAME=next_screen VALUE=single CHECKED>
277 Review ONE article in next screen
278 <INPUT TYPE=radio NAME=next_screen VALUE=multiple>
279 Review multiple articles in next screen
282 <INPUT TYPE=submit VALUE=\"Submit\">
283 <INPUT TYPE=submit NAME=skip_submit VALUE=\"Skip\">
284 <INPUT TYPE=reset VALUE=\"Reset\">
288 print "<BR><A HREF=$base_address?action=change_password&newsgroup=$newsgroup&" .
289 "moderator=$moderator&password=$password>Change Password</A>";
295 # WebSTUMP administrative screen
296 sub webstump_admin_screen {
298 &verify_admin_password;
300 my $password = $request{'password'};
302 &begin_html( "WebSTUMP Administration" );
304 <FORM METHOD=$request_method action=$base_address>
305 <INPUT NAME=action VALUE=admin_add_newsgroup TYPE=hidden>
306 <INPUT NAME=password VALUE=\"$password\" TYPE=hidden>\n";
311 Create a new newsgroup on the server:<BR>
313 Newsgroup:<BR> <INPUT NAME=newsgroup_name VALUE=\"\" SIZE=50><BR>
314 Address to send approved/rejected messages <BR>
315 <INPUT NAME=newsgroup_approved_address VALUE=\"\" SIZE=30><BR>
316 Admin Password For this group:<BR> <INPUT NAME=newsgroup_password VALUE=\"\" SIZE=10><BR>
317 <INPUT TYPE=submit VALUE=\"Submit\">
318 <INPUT TYPE=reset VALUE=\"Reset\"><HR>
321 print "</FORM>\n\n<PRE>\n";
326 # WebSTUMP "add newsgroup" function
327 sub admin_add_newsgroup {
329 &verify_admin_password;
331 my $newsgroup = &required_parameter( 'newsgroup_name' );
333 $newsgroup =~ s/\///g;
334 $newsgroup = &untaint( $newsgroup );
336 my $address = &required_parameter( 'newsgroup_approved_address' );
337 my $password = &required_parameter( 'newsgroup_password' );
339 &user_error( "Newsgroup $newsgroup already exists" )
340 if defined $newsgroups_index{$newsgroup};
342 &user_error( "Password may only contain letters and digits" )
343 if( ! ($password =~ /^[a-zA-Z0-9]+$/ ) );
345 &begin_html( "WebSTUMP Administration: Newsgroup created" );
349 print "Adding $newsgroup to $webstump_home/config/newsgroups.lst...";
350 mkdir "$webstump_home/queues/$newsgroup", 0755;
353 $dir = "$webstump_home/config/newsgroups/$newsgroup";
355 print "Creating $dir...";
359 print "Creating files in $dir...";
361 &append_to_file( "$dir/address.txt", "$address\n" );
362 &append_to_file( "$dir/moderators", "ADMIN \U$password\n" );
363 &append_to_file( "$dir/rejection-reasons",
364 "offtopic::a blatantly offtopic article, spam
365 harassing::message of harassing content
366 charter::message poorly formatted
379 $web_subdir = pop( @_ );
381 $newsgroup = pop( @_ );
383 opendir( SUBDIR, $subdir );
387 while( $_ = readdir( SUBDIR ) ) {
388 my $file = "$subdir/$_";
389 next if( ! -f $file || ! -r $file );
390 my $extension = $file;
391 $extension =~ s/^.*\.//;
392 $extension = "\L$extension";
394 if( $extension eq "gif" || $extension eq "jpg" || $extension eq "jpeg" ) {
395 print "<CENTER> <IMG SRC=$base_address_for_files/queues/$newsgroup/$web_subdir/$_></CENTER><HR>\n";
399 $filename =~ s/^.*\///;
400 next if $filename eq "skeleton.skeleton"
401 || $filename eq "headers.txt"
402 || $filename eq "full_message.txt"
403 || $filename eq "text.files.lst"
404 || $filename eq "stump-prolog.txt"
405 || $filename eq "stump-warning.txt"
406 || $filename =~ /msg-.*\.doc/;
408 &print_image( "no_image.gif", "security warning" );
409 print "<B>Non-image attachment:</B><CODE>$filename</CODE> NOT SHOWN for security reasons.<BR>\n";
415 # prints warning if there is warning stored about the article
416 sub print_article_warning { # short-subdir
417 my $file = pop( @_ );
419 my $warning_file = &article_file_name( $file ) . "/stump-warning.txt";
421 if( -r $warning_file ) {
422 open( WARNING, $warning_file );
423 while ($warning = <WARNING>) {
424 next unless $warning =~ m/\S/;
425 $warning =~ s/\&/&/g;
426 $warning =~ s/</</g;
427 $warning =~ s/>/>/g;
428 &print_image( "star.gif", "warning" );
429 print "<FONT COLOR=red>$warning</FONT><br>\n";
438 sub get_queue_list ($) {
439 my ($newsgroup) = @_;
440 my $dir = "$queues_dir/$newsgroup";
443 opendir(QUEUED, $dir) or &error("could not open directory $dir");
447 my $subdir= scalar readdir(QUEUED);
448 last unless defined $subdir;
450 my $subpath= "$dir/$subdir";
451 next if $subdir =~ /^\.+/;
452 next unless -d $subpath;
454 if (!stat "$subpath/stump-warning.txt") {
455 $!==&ENOENT or die "$subpath $!";
458 $sortkey= (stat _)[9];
460 $sortkeys{$subdir}= $sortkey;
463 my @articles= sort { $sortkeys{$a} <=> $sortkeys{$b} } keys %sortkeys;
464 return ($dir, @articles);
467 # main moderation page -- multiple-articles version
468 sub html_moderation_screen {
469 my $newsgroup = &required_parameter( 'newsgroup' );
470 my $moderator = $request{'moderator'};
471 my $password = $request{'password'};
474 if( $request{'next_screen'} eq 'single' ) {
475 # we show a single article if the user so requested.
476 # just get the first article from the queue if any, otherwise show
477 # an empty main screen.
479 my ($dir, @articles)= get_queue_list($newsgroup);
482 for ($i=0; $i<@articles; $i++) {
483 my $subdir= shift @articles;
484 push @articles, $subdir;
485 last if $request{"decision_$subdir"};
488 while( $subdir = shift @articles ) {
489 if( -d "$dir/$subdir" && !($subdir =~ /^\.+/)
490 && open( PROLOG, "$dir/$subdir/stump-prolog.txt" ) ) {
491 &html_moderate_article( $subdir );
496 # otherwise just show the moderator an empty main screen.
499 &begin_html( "Main Moderation Screen: $newsgroup" );
500 print "Welcome to the main moderation screen. Its main purpose is to
501 help you process most messages extremely quickly. For every message, it
502 presents you who sent it, as well as the first three non-blank lines.
503 For those messages where the decision is obvious, simply select your
504 decision (approve/reject etc) and click submit. For those messages which
505 you would like to review in more details, do not select anything and
506 use Review/Comment function from this screen or from a subsequent screen.
507 Remember that if you do not make any decision, the article would stay in the
510 &read_rejection_reasons;
512 my ($dir, @articles)= get_queue_list($newsgroup);
515 <FORM METHOD=$request_method action=$base_address>
516 <INPUT NAME=action VALUE=approval_decision TYPE=hidden>";
517 &html_print_credentials;
519 print "<HR> <INPUT TYPE=submit VALUE=Submit>
520 <INPUT TYPE=reset VALUE=Reset>
523 my $file, $subject = "No Subject", $from = "From nobody";
524 my $form_not_empty = "";
525 my $article_count = 0;
527 while( ($subdir = shift @articles) && $article_count++ < 40 ) {
529 if( -d "$dir/$subdir" && !($subdir =~ /^\.+/)
530 && open( PROLOG, "$dir/$subdir/stump-prolog.txt" ) ) {
533 if( /^Real-Subject: /i ) {
537 s/^Real-Subject: //g;
538 $subject = substr( $_, 0, 50 );
539 } elsif( /^From: /i ){
543 $from = substr( $_, 0, 50 );
549 print "<HR><B>$from: $subject</B>(";
550 print "<A HREF=$base_address?action=moderate_article&newsgroup=$newsgroup&" .
551 "moderator=$moderator&password=$password&file=$subdir>Review/Comment/Whitelist</A>)<BR>\n";
552 print "<INPUT TYPE=radio NAME=\"decision_$file\" VALUE=approve>Approve\n";
553 print "<INPUT TYPE=radio NAME=\"decision_$file\" VALUE=skip>Leave\n";
554 print "<INPUT TYPE=radio NAME=\"decision_$file\" VALUE=leave>Back of queue\n";
555 foreach (@short_rejection_reasons) {
556 print "<INPUT TYPE=radio NAME=\"decision_$file\" VALUE=\"reject $_\">Reject \u$_\n";
561 &print_article_warning( $file );
567 while( ($_ = <PROLOG>) && $i < 5 ) {
574 print "] " . substr( $_, 0, 75 ) . "\n";
580 $form_not_empty = "yes";
582 $article_count += &print_images( $newsgroup, "$dir/$subdir", $subdir );
586 if( $form_not_empty ) {
587 print "<HR> <INPUT TYPE=submit VALUE=Submit>
588 <INPUT TYPE=reset VALUE=Reset>
593 No articles present in the queue
594 <INPUT TYPE=submit VALUE=Refresh>
598 print "<A HREF=$base_address?action=change_password&newsgroup=$newsgroup&" .
599 "moderator=$moderator&password=$password>Change Password</A>";
603 print "<FORM METHOD=$request_method action=$base_address>";
604 &html_print_credentials;
605 print "<INPUT NAME=action VALUE=moderator_admin TYPE=hidden>
606 <INPUT TYPE=submit VALUE=\"Management\">
612 # prints hidden fields -- credentials
613 sub html_print_credentials {
614 my $newsgroup = $request{'newsgroup'};
615 my $moderator = $request{'moderator'};
616 my $password = $request{'password'};
619 <INPUT NAME=newsgroup VALUE=\"$newsgroup\" TYPE=hidden>
620 <INPUT NAME=moderator VALUE=\"$moderator\" TYPE=hidden>
621 <INPUT NAME=password VALUE=\"$password\" TYPE=hidden>\n";
627 my ($forwards, $gotr, $callback) = @_;
628 my $dir= "$webstump_home/..";
629 opendir LOGSDIR, "$dir" or die "$dir $!";
634 m/^errs\.(\d+)(?:\.gz$)$/ ? $1 :
639 sort { $num->($a) <=> $num->($b) }
640 grep { defined $num->($_) }
643 my $file= "$dir/$leaf";
644 if ($file =~ m/\.gz$/) {
645 open LOGFILE, "zcat $file |" or die "zcat $file $!";
647 open LOGFILE, "< $file" or die "$file $!";
650 my $tgot= $callback->();
652 $$gotr= $tgot if $tgot > $$gotr;
655 $!=0; $?=0; close LOGFILE or die "$file $? $!";
658 closedir LOGSDIR or die "$dir $!";
661 sub html_search_logs {
662 &begin_html("Search logs for $request{'newsgroup'}");
666 if ($request{'download_logs'}) {
667 print "<h2>Complete log download</h2>\n";
669 } elsif ($request{'messagenum'} =~ m/^\s*(\d+)\s*$/) {
673 print "<h2>Log entry for single message $reqnum</h2>\n";
675 print "<h2>Log lookup - bad reference</h2>
676 Please supply the numerical reference as found in the \"recent activity\"
677 log or message headers. Reference numbers consist entirely of digits,
678 and are often quoted in message headers in [square brackets].<p>
683 if ($mod_log_access < $min) {
684 print "Not permitted [$mod_log_access<$min]. Consult administrator.\n";
690 &scanlogs($forwards, \$sofar, sub {
691 return 0 unless chomp;
692 return 0 unless m/^DECISION: /;
693 my @vals = split / \| /, $';
694 return 0 unless @vals >= 5;
696 my ($group,$dir,$act,$reason,$timet) = @vals;
697 my $date= $timet ? (strftime "%Y-%m-%d %H:%M:%S GMT", gmtime $timet)
699 return 0 unless $group eq $request{'newsgroup'};
700 return 0 unless $subj =~ m,/(\d+)$,;
702 return 0 if defined($reqnum) and $treqnum ne $reqnum;
703 print "<table rules=all><tr><th>Date<th>Reference<th>Disposal<th>Reason</tr>\n"
705 print "<tr>", (map { "<td>".escapeHTML($_) }
706 $date,$treqnum,$act,$reason);
708 return defined($reqnum) ? 2 : 1;
711 print "</table>" if $sofar;
714 print "Reference not found.".
715 " (Perhaps message has expired, or is still in the queue?)";
720 # newsgroup admin page
721 sub html_newsgroup_management {
722 &begin_html( "Administer $request{'newsgroup'}" );
724 print "All usernames and passwords are not case sensitive.\n";
725 print "<HR>Use this form to add new moderators or change passwords:<BR>
726 <FORM METHOD=$request_method action=$base_address>
727 <INPUT NAME=action VALUE=add_user TYPE=hidden>";
728 &html_print_credentials;
730 Username: <INPUT NAME=user VALUE=\"\" SIZE=20>
732 Password: <INPUT NAME=new_password VALUE=\"\" SIZE=20>
734 <INPUT TYPE=submit VALUE=\"Add/Change\">
735 <INPUT TYPE=reset VALUE=Reset>
739 print "<HR>Use this form to delete moderators:<BR>
740 <FORM METHOD=$request_method action=$base_address>
741 <INPUT NAME=action VALUE=delete_user TYPE=hidden>";
742 &html_print_credentials;
744 Username: <INPUT NAME=user VALUE=\"\" SIZE=20>
746 <INPUT TYPE=submit VALUE=\"Delete Moderator\">
747 <INPUT TYPE=reset VALUE=Reset>
750 <FORM METHOD=$request_method action=$base_address>
751 <INPUT NAME=action VALUE=edit_list TYPE=hidden>";
752 &html_print_credentials;
754 Configuration List: <SELECT NAME=list_to_edit>
756 <OPTION VALUE=good.posters.list>Good Posters List
757 <OPTION VALUE=watch.posters.list>Suspicious Posters List
758 <OPTION VALUE=bad.posters.list>Banned Posters List
759 <OPTION VALUE=watch.words.list>Suspicious Words List
762 <INPUT TYPE=submit VALUE=\"Edit\">
763 <INPUT TYPE=reset VALUE=Reset>";
765 &link_to_help( "filter-lists", "filtering lists" );
769 if ($mod_log_access) {
771 Use this form to search logs of past moderation decisions:
773 <form method=$request_method action=$base_address>
774 <input name=action value=search_logs type=hidden>";
776 &html_print_credentials;
779 Reference number: <input name=messagenum size=30>
780 <input type=submit value=\"Lookup\">";
783 <input type=submit value=\"Download all logs\" name=\"download_logs\">"
784 if $mod_log_access >= 2;
786 print "</form><hr>\n";
791 List of current moderators:<P>
795 foreach (keys %moderators) {
801 print "<HR><FORM METHOD=$request_method action=$base_address>";
802 &html_print_credentials;
803 print "<INPUT NAME=action VALUE=moderation_screen TYPE=hidden>
804 <INPUT TYPE=submit VALUE=\"Go to moderation screen\">
812 sub edit_configuration_list {
814 my $list_to_edit = &required_parameter( 'list_to_edit' );
816 $list_to_edit = &check_config_list( $list_to_edit );
818 my $list_file = &full_config_file_name( $list_to_edit );
820 my $list_content = "";
822 if( open( LIST, $list_file ) ) {
823 $list_content .= $_ while( <LIST> );
827 $list_content =~ s/\&/&/g;
828 $list_content =~ s/</</g;
829 $list_content =~ s/>/>/g;
831 &begin_html( "Edit $list_to_edit" );
834 " <FORM METHOD=$request_method action=$base_address>
835 <INPUT NAME=action VALUE=set_config_list TYPE=hidden>
836 <INPUT NAME=list_to_edit VALUE=$list_to_edit TYPE=hidden>";
837 &html_print_credentials;
838 &link_to_help( $list_to_edit, "$list_to_edit" );
841 <TEXTAREA NAME=list rows=20 COLS=50>
842 $list_content</TEXTAREA>
845 <INPUT TYPE=submit VALUE=\"Set\">
852 # password change page
853 sub html_change_password{
854 &begin_html( "Change Password" );
856 print "All usernames and passwords are not case sensitive.\n";
857 print "<HR>Use this form to change your password:<BR>
858 <FORM METHOD=$request_method action=$base_address>
859 <INPUT NAME=action VALUE=validate_change_password TYPE=hidden>";
860 &html_print_credentials;
863 New Password: <INPUT NAME=new_password VALUE=\"\" SIZE=20>
865 <INPUT TYPE=submit VALUE=Submit>
866 <INPUT TYPE=reset VALUE=Reset>
874 # newsgroup creation form
875 sub init_request_newsgroup_creation{
876 my $newsgroup = &required_parameter( 'newsgroup' );
878 &begin_html( "Request Creation of $newsgroup" );
880 print "This page helps you ask the system administrator of your domain
881 to create <B>$newsgroup</B> on your server. Type in your domain name and
882 click SUBMIT. An email will be sent to news\@domain and usenet\@domain
883 and postmaster\@domain
884 asking them to create your newsgroup. Please do NOT abuse this system.
885 NOTE: You can give the URL of this page to your group readers so that
886 they could request creation of their newsgroups by themselves.\n";
889 <FORM METHOD=$request_method action=$base_address>
890 <INPUT NAME=action VALUE=complete_newsgroup_creation_request TYPE=hidden>\n";
891 &html_print_credentials;
894 Domain Name ONLY: <INPUT NAME=domain_name VALUE=\"\" SIZE=40>
896 <INPUT TYPE=submit VALUE=Submit>
897 <INPUT TYPE=reset VALUE=Reset>
905 # newsgroup creation completion
906 sub complete_newsgroup_creation_request{
907 my $newsgroup = &required_parameter( 'newsgroup' );
908 my $domain_name = &required_parameter( 'domain_name' );
910 if( !($domain_name =~ /(^[a-zA-Z0-9\.-_]+$)/) ) {
911 &user_error( "invalid domain name" );
917 my $request = "To: news\@$domain_name, usenet\@$domain_name, postmaster\@$domain_name
918 Subject: Please create $newsgroup (Moderated)
919 From: devnull\@algebra.com ($newsgroup Moderator)
920 Organization: stump.algebra.com
922 Dear News Administrator:
924 A user of $domain_name has requested that you create a newsgroup
926 $newsgroup (Moderated)
928 on your server. $newsgroup
929 is a legitimately created moderated newsgroup that is available worldwide.
931 Thank you very much for your help and cooperation.
935 - Moderator of $newsgroup.
939 &email_message( $request, "news\@$domain_name" );
940 &email_message( $request, "usenet\@$domain_name" );
941 &email_message( $request, "postmaster\@$domain_name" );
943 &begin_html( "Request to create $newsgroup sent" );
945 print "The following request has been sent:<HR><PRE>\n";
947 print "$request</PRE>\n";
954 my $topic_name = &required_parameter( "topic" );
956 $topic_name =~ s/\///g;
957 $topic_name =~ s/\.\.//g;
958 $topic_name = &untaint( $topic_name );
960 my $file = "$webstump_home/doc/help/$topic_name.html";
962 &error( "Topic $topic_name not found in $file." )
965 open( FILE, "$file" );
967 $help .= $_ while( <FILE> );
970 $help =~ s/##/$base_address?action=help&topic=/g;
972 &begin_html( "$topic_name" );