--- capa/capa51/Discuss/Ver1.3/Attic/capadiscuss 1999/12/16 22:08:57 1.5
+++ capa/capa51/Discuss/Ver1.3/Attic/capadiscuss 2000/03/22 21:08:02 1.8
@@ -1,13 +1,15 @@
#!/usr/ucb/perl
#
# CAPA Discussion Forum
-# version 1.3
+# version 1.3.0
#
# Michigan State University
# Department of Physics and Astronomy
#
# Ryan J. Shaltry
# tech4@msue.msu.edu
+# Guy Albertelli
+# albertel@msu.edu
print "Content-type: text/html\n\n";
@@ -49,11 +51,17 @@ $validadmin = "unchecked";
$psetid = $form{'PSETID'};
if ($snum eq "A12345678") {$debug=1;}
if ($snum eq "a12345678") {$debug=1;}
+$debug=0;
if($psetid eq "") { $psetid = $setid; }
if ($debug) {print "GetTeacherInfo
";$BenchmarkTa = new Benchmark;}
&GetTeacherInfo;
if($debug) {$BenchmarkTb = new Benchmark;print "
",timestr(timediff($BenchmarkTb,$BenchmarkTa)),"\n";}
+ # check if student is banned from forum
+if ($debug) {print "BanUser
";$BenchmarkTa = new Benchmark;}
+if (&BanUser) {exit;}
+if($debug) {$BenchmarkTb = new Benchmark;print "
",timestr(timediff($BenchmarkTb,$BenchmarkTa)),"\n";}
+
# check for valid studentnumber/capaid, an exit will occur here if the set wasn't open
if ($debug) {print "ValidateUser
";$BenchmarkTa = new Benchmark;}
&ValidateUser;
@@ -170,6 +178,7 @@ if($debug) {$BenchmarkTb = new Benchmark
}
sub ViewSet {
+ local($hidden);
if ($debug) {print "InsideViewSet
";$BenchmarkTa = new Benchmark;}
&Log("ViewSet");
&CheckAdmin;
@@ -213,6 +222,7 @@ if($debug) {$BenchmarkTb = new Benchmark
$col = 1;
for($probnum=1; $probnum<=$maxprobs; $probnum++) {
+ $hidden=0;
if($col eq "1" && $probnum > $col1size && $bigtable eq "yes") {
$col = 2;
&ViewSetEndColHTML;
@@ -224,13 +234,19 @@ if($debug) {$BenchmarkTb = new Benchmark
closedir(MSG);
foreach $msg(@msgs) {
if(&RemZero(substr($msg,0,6)) eq $probnum) {
- push(@good,$msg);
+ &OpenMsg("$capadir/$class/discussion/$setid/$msg");
+ if(!($status eq "hidden" && $validadmin ne "yes")) {
+ push(@good,$msg);
+ } else { $hidden++; }
}
}
-
- &OpenMsg("$capadir/$class/discussion/$setid/$good[$#good]");
- $lastpost = "$date at $time";
- $posts = $found[$probnum];
+ $posts = $found[$probnum]-$hidden;
+ if ($posts >0) {
+ &OpenMsg("$capadir/$class/discussion/$setid/$good[$#good]");
+ $lastpost = "$date at $time";
+ } else {
+ $lastpost = "--";
+ }
}
else {
$lastpost = "--";
@@ -582,12 +598,24 @@ sub WriteMsg {
$filename = shift(@_);
# add sr to grab e-mail address of user
+
+ #