version 1.7, 2000/01/31 18:34:12
|
version 1.8, 2000/03/22 21:08:02
|
Line 51 $validadmin = "unchecked";
|
Line 51 $validadmin = "unchecked";
|
$psetid = $form{'PSETID'}; |
$psetid = $form{'PSETID'}; |
if ($snum eq "A12345678") {$debug=1;} |
if ($snum eq "A12345678") {$debug=1;} |
if ($snum eq "a12345678") {$debug=1;} |
if ($snum eq "a12345678") {$debug=1;} |
|
$debug=0; |
if($psetid eq "") { $psetid = $setid; } |
if($psetid eq "") { $psetid = $setid; } |
if ($debug) {print "GetTeacherInfo<BR>";$BenchmarkTa = new Benchmark;} |
if ($debug) {print "GetTeacherInfo<BR>";$BenchmarkTa = new Benchmark;} |
&GetTeacherInfo; |
&GetTeacherInfo; |
if($debug) {$BenchmarkTb = new Benchmark;print "<BR>",timestr(timediff($BenchmarkTb,$BenchmarkTa)),"\n";} |
if($debug) {$BenchmarkTb = new Benchmark;print "<BR>",timestr(timediff($BenchmarkTb,$BenchmarkTa)),"\n";} |
|
|
|
# check if student is banned from forum |
|
if ($debug) {print "BanUser<BR>";$BenchmarkTa = new Benchmark;} |
|
if (&BanUser) {exit;} |
|
if($debug) {$BenchmarkTb = new Benchmark;print "<BR>",timestr(timediff($BenchmarkTb,$BenchmarkTa)),"\n";} |
|
|
# check for valid studentnumber/capaid, an exit will occur here if the set wasn't open |
# check for valid studentnumber/capaid, an exit will occur here if the set wasn't open |
if ($debug) {print "ValidateUser<BR>";$BenchmarkTa = new Benchmark;} |
if ($debug) {print "ValidateUser<BR>";$BenchmarkTa = new Benchmark;} |
&ValidateUser; |
&ValidateUser; |
Line 697 sub CheckAdmin {
|
Line 703 sub CheckAdmin {
|
if($validadmin eq "no" && $mode eq "kill") { &NotAdminHTML; } |
if($validadmin eq "no" && $mode eq "kill") { &NotAdminHTML; } |
} |
} |
|
|
|
sub BanUser { |
|
local (@capaconfig,$line,$command,$value,$ban,@banned,$result); |
|
$result = 0; |
|
open(CAPACONFIG,"$capadir/$class/capa.config"); |
|
@capaconfig = <CAPACONFIG>; |
|
close(CAPACONFIG); |
|
foreach $line(@capaconfig) { |
|
chop $line; |
|
($command,$value) = split(/\ =\ /,$line); |
|
if($command eq "banned_users") { $ban = $value; last; } |
|
} |
|
|
|
if ($debug) { print "Banned Users: ".$ban } |
|
@banned = split(/\,/,$ban); |
|
$snum =~ tr/a-x/A-Z/; |
|
foreach $ban (@banned) { |
|
if ($debug) {print $ban . "is Banned <br>";} |
|
$ban =~ tr/a-z/A-Z/; |
|
$ban =~ tr/\ //d; |
|
if ( $ban eq $snum) { &BannedMessageHTML; $result=1 } |
|
} |
|
return $result |
|
} |
|
|
sub ValidateUser { |
sub ValidateUser { |
local(@allcapaid,@classl,$line); |
local(@allcapaid,@classl,$line); |
|
|