Diff for /capa/capa51/Discuss/Ver1.3/Attic/capadiscuss between versions 1.5 and 1.6

version 1.5, 1999/12/16 22:08:57 version 1.6, 2000/01/05 21:11:15
Line 1 Line 1
 #!/usr/ucb/perl  #!/usr/ucb/perl
 #  #
 # CAPA Discussion Forum  # CAPA Discussion Forum
 # version 1.3  # version 1.3.0
 #  #
 # Michigan State University  # Michigan State University
 # Department of Physics and Astronomy  # Department of Physics and Astronomy
 #  #
 # Ryan J. Shaltry  # Ryan J. Shaltry
 # tech4@msue.msu.edu  # tech4@msue.msu.edu
   # Guy Albertelli
   # albertel@msu.edu
   
 print "Content-type: text/html\n\n";  print "Content-type: text/html\n\n";
   
Line 582  sub WriteMsg { Line 584  sub WriteMsg {
   $filename = shift(@_);    $filename = shift(@_);
   # add sr to grab e-mail address of user    # add sr to grab e-mail address of user
   
     
     # <B> <I> <P> <A> <LI> <OL> <UL> <EM> <BR> <TT> <STRONG> <BLOCKQUOTE> <DIV .*> <DIV> <P .
     %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1, BR=>1, TT=>1, STRONG=>1,
    BLOCKQUOTE=>1, DIV=>1, IMG=>1);
   
   $message = $form{'message'};    $message = $form{'message'};
   $message =~ s/</&lt;/g;  
   $message =~ s/>/&gt;/g;  
   $message =~ s/((\n\r)|(\n))\n/<p>/g;    $message =~ s/((\n\r)|(\n))\n/<p>/g;
   $message =~ s/\n/<br>/g;    $message =~ s/\n/<br>/g;
   
     $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/
       {($html{uc($2)}&(length($1)<1000))?"\<$1":"\&lt;$1"}/ge;
     $message =~ s/(\<?\s*(\w+)[^\<\>]*)\>/
       {($html{uc($2)}&(length($1)<1000))?"$1\>":"$1\&gt;"}/ge;
   
   #  $message =~ s/</&lt;/g;
   #  $message =~ s/>/&gt;/g;
   
   # check if posted anonymously    # check if posted anonymously
   if($form{'ANONYMOUS'} eq "yes") {    if($form{'ANONYMOUS'} eq "yes") {
     $username = "Anonymous|$username";      $username = "Anonymous|$username";
Line 688  sub ValidateUser { Line 702  sub ValidateUser {
   if($valid eq "no") { &InvalidVarsHTML; }    if($valid eq "no") { &InvalidVarsHTML; }
   
   # check w/ allcapaid program    # check w/ allcapaid program
   @allcapaid = `allcapaid51 -s $setid -e $setid -stu $snum -c $capadir/$class -i -checkopen`;    @allcapaid = `allcapaid -s $setid -e $setid -stu $snum -c $capadir/$class -i -checkopen`;
   
   chop $allcapaid[2];    chop $allcapaid[2];
   chop $allcapaid[2];    chop $allcapaid[2];
Line 793  sub form_info { Line 807  sub form_info {
   
   foreach $pair (@pairs) {    foreach $pair (@pairs) {
      ($name, $value) = split(/=/, $pair);       ($name, $value) = split(/=/, $pair);
        if ($name eq "message") {$allow_html=1;} else {$allow_html=0;}
      # Un-Webify plus signs and %-encoding       # Un-Webify plus signs and %-encoding
      $value =~ tr/+/ /;       $value =~ tr/+/ /;
      $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;       $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

Removed from v.1.5  
changed lines
  Added in v.1.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>