From cb8298bbc8cb69e04811a4da5a44f34a5d5d5291 Mon Sep 17 00:00:00 2001 From: Cassio de Campos Date: Fri, 8 Sep 2017 12:33:36 +0100 Subject: remove need of encryption to speed up server --- src/scoretable.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/scoretable.php b/src/scoretable.php index 855b66c..850ee9a 100644 --- a/src/scoretable.php +++ b/src/scoretable.php @@ -175,10 +175,11 @@ if(isset($_GET["remote"])) { } exit; } - if(!$redo) { $conf=globalconf(); - $strtmp = decryptData(substr($strtmp,strpos($strtmp,"\n")),$conf["key"],'score'); + if($conf['doenc']) + $strtmp = decryptData(substr($strtmp,strpos($strtmp,"\n")),$conf["key"],'score'); + else $strtmp = substr($strtmp,strpos($strtmp,"\n")); if($strtmp=="") $redo=TRUE; } if($redo) { @@ -396,7 +397,9 @@ if($redo) { } $conf=globalconf(); - $strtmp = " \n" . encryptData($strtmp,$conf["key"],false); + if($conf['doenc']) + $strtmp = " \n" . encryptData($strtmp,$conf["key"],false); + else $strtmp = " \n" . $strtmp; if(file_put_contents($scoretmp, $strtmp,LOCK_EX)===FALSE) { if($_SESSION["usertable"]["usertype"] == 'admin') { MSGError("Cannot write to the score cache file -- performance might be compromised"); @@ -404,7 +407,9 @@ if($redo) { LOGError("Cannot write to the ".$_SESSION["usertable"]["usertype"]."-score cache file -- performance might be compromised"); } $conf=globalconf(); - $strtmp = decryptData(substr($strtmp,strpos($strtmp,"\n")),$conf["key"]); + if($conf['doenc']) + $strtmp = decryptData(substr($strtmp,strpos($strtmp,"\n")),$conf["key"]); + else $strtmp = substr($strtmp,strpos($strtmp,"\n")); } echo $strtmp; ?> -- cgit v1.2.3 From 7f2fbf518866b88735b537163745d24870efea91 Mon Sep 17 00:00:00 2001 From: Cassio de Campos Date: Fri, 8 Sep 2017 14:17:12 +0100 Subject: new info when printing --- src/ftask.php | 2 +- src/staff/task.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ftask.php b/src/ftask.php index 8280109..73336c3 100644 --- a/src/ftask.php +++ b/src/ftask.php @@ -216,7 +216,7 @@ function DBOpenTasksInSites($contest,$site) { function DBOpenTasksSNS($contest,$site,$st,$order='task',$adm=false) { $c = DBConnect(); $sql = "select distinct t.tasknumber as number, t.taskdatediff as timestamp, t.usernumber as user, ". - "u.username as username, t.color as color, t.colorname as colorname, " . + "u.username as username, u.userfullname as fullname, t.color as color, t.colorname as colorname, " . "t.taskstatus as status, t.sitenumber as site, t.taskstaffnumber as staff, " . "t.taskstaffsite as staffsite, t.taskdesc as description, tasksystem as system, " . "t.taskfilename as filename, t.taskdata as oid, uu.username as staffname " . diff --git a/src/staff/task.php b/src/staff/task.php index 52d9665..3f95f75 100644 --- a/src/staff/task.php +++ b/src/staff/task.php @@ -128,8 +128,7 @@ for ($i=0; $i\n"; if ($task[$i]["oid"] != null) { - $msg = "///// " . $task[$i]["username"]." ".$task[$i]["username"]." ".$task[$i]["username"]." ". - $task[$i]["username"]." ".$task[$i]["username"]." ".$task[$i]["username"]; + $msg = "///// " . $task[$i]["username"]." -- ". substr($task[$i]["fullname"],0,40) ." -- ".$task[$i]["username"]." "; echo " " . $task[$i]["filename"] . ""; echo " Date: Fri, 8 Sep 2017 14:18:53 +0100 Subject: new info when printing --- src/admin/task.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/admin/task.php b/src/admin/task.php index ae142cb..8d21661 100644 --- a/src/admin/task.php +++ b/src/admin/task.php @@ -101,8 +101,7 @@ for ($i=0; $i\n"; if ($task[$i]["oid"] != null) { - $msg = "///// " . $task[$i]["username"]." ".$task[$i]["username"]." ".$task[$i]["username"]." ". - $task[$i]["username"]." ".$task[$i]["username"]." ".$task[$i]["username"]; + $msg = "///// " . $task[$i]["username"]." -- ". substr($task[$i]["fullname"],0,40) ." -- ".$task[$i]["username"]." "; echo " " . $task[$i]["filename"] . ""; echo " Date: Fri, 8 Sep 2017 14:20:24 +0100 Subject: more chars in the print --- src/admin/task.php | 2 +- src/staff/task.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/admin/task.php b/src/admin/task.php index 8d21661..a1446ce 100644 --- a/src/admin/task.php +++ b/src/admin/task.php @@ -101,7 +101,7 @@ for ($i=0; $i\n"; if ($task[$i]["oid"] != null) { - $msg = "///// " . $task[$i]["username"]." -- ". substr($task[$i]["fullname"],0,40) ." -- ".$task[$i]["username"]." "; + $msg = "///// " . $task[$i]["username"]." -- ". substr($task[$i]["fullname"],0,60) ." -- ".$task[$i]["username"]." "; echo " " . $task[$i]["filename"] . ""; echo " \n"; if ($task[$i]["oid"] != null) { - $msg = "///// " . $task[$i]["username"]." -- ". substr($task[$i]["fullname"],0,40) ." -- ".$task[$i]["username"]." "; + $msg = "///// " . $task[$i]["username"]." -- ". substr($task[$i]["fullname"],0,60) ." -- ".$task[$i]["username"]." "; echo " " . $task[$i]["filename"] . ""; echo " Date: Fri, 8 Sep 2017 17:16:51 +0100 Subject: remove limit of 20 chars --- src/optionlower.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/optionlower.php b/src/optionlower.php index 8fba3c9..b3f6055 100644 --- a/src/optionlower.php +++ b/src/optionlower.php @@ -96,19 +96,19 @@ function computeHASH() Old Password: - + New Password: - + Retype New Password: - + -- cgit v1.2.3 From f2616c784f4ecc07d8c846fe61bd1b798eb396b4 Mon Sep 17 00:00:00 2001 From: Cassio de Campos Date: Fri, 8 Sep 2017 17:27:06 +0100 Subject: move tst out of public --- src/images/tst.php | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 src/images/tst.php (limited to 'src') diff --git a/src/images/tst.php b/src/images/tst.php deleted file mode 100644 index 38f5fd0..0000000 --- a/src/images/tst.php +++ /dev/null @@ -1,11 +0,0 @@ - -- cgit v1.2.3 From efb6a1fc71aef20ac04f64f3f8f693aa037435ad Mon Sep 17 00:00:00 2001 From: Cassio de Campos Date: Sat, 9 Sep 2017 05:27:04 +0100 Subject: order the files by name in the aj --- src/private/autojudging.php | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/private/autojudging.php b/src/private/autojudging.php index 06d7006..dcb7398 100755 --- a/src/private/autojudging.php +++ b/src/private/autojudging.php @@ -395,6 +395,7 @@ while(42) { continue; } else { $errp=0; $ncor=0; $showcor=false; + sort($inputlist); foreach($inputlist as $file) { $file = basename($file); if(is_file($dir . $ds . "input" . $ds . $file)) { -- cgit v1.2.3 From 5876077b0279e71d6b6c8c8ba22c0c1e0af1536c Mon Sep 17 00:00:00 2001 From: Cassio de Campos Date: Sat, 9 Sep 2017 08:21:05 +0100 Subject: show runs to staff user --- src/frun.php | 20 +++++- src/staff/header.php | 5 +- src/staff/run.php | 199 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 220 insertions(+), 4 deletions(-) create mode 100755 src/staff/run.php (limited to 'src') diff --git a/src/frun.php b/src/frun.php index 3694f21..3624456 100644 --- a/src/frun.php +++ b/src/frun.php @@ -481,10 +481,28 @@ function DBUpdateRunAutojudging($contest, $site, $number, $ip, $answer, $stdout, $b = DBSiteInfo($contest, $site, $c); - if($b["siteautojudge"]!="t") { // && $retval != 1 && $retval != 6) { //cassiopc incluir automatic judging of some codes 1:YES WA:6 + if( true || + $a["runproblem"] == 1 || + $a["runproblem"] == 2 || + $a["runproblem"] == 3 || + $a["runproblem"] == 4 || + $a["runproblem"] == 5 || + $a["runproblem"] == 6 || + $a["runproblem"] == 7 || + $a["runproblem"] == 8 || + $a["runproblem"] == 9 || + $a["runproblem"] == 10 || + $a["runproblem"] == 11 || + $a["runproblem"] == 12 || + $a["runproblem"] == 13 || + ($retval != 1 && $retval != 6)) { + + if($b["siteautojudge"]!="t") { + // && (($retval != 1 && $retval != 6) || $a["runproblem"] == 1 || $a["runproblem"] == 2) ) { //cassiopc incluir automatic judging of some codes 1:YES WA:6 DBExec($c, "commit work", "DBUpdateRunAutojudging(commit)"); LOGLevel("Autojudging answered a run (run=$number, site=$site, contest=$contest, answer='$answer', retval=$retval)", 3); return true; + } } //echo "DEBUG: $contest, $site, " .$a["usernumber"].", $site, $number, $retval\n"; diff --git a/src/staff/header.php b/src/staff/header.php index 650489c..21f93f9 100644 --- a/src/staff/header.php +++ b/src/staff/header.php @@ -67,14 +67,13 @@ echo " \n"; echo " Tasks\n"; //echo " Tasks ($nr)\n"; echo " Score\n"; -//echo " Runs\n"; -echo " Options\n"; +echo " Runs\n"; echo " Statistics\n"; -//echo " Options\n"; +echo " Options\n"; echo " Logout\n"; echo " \n"; echo "\n"; diff --git a/src/staff/run.php b/src/staff/run.php new file mode 100755 index 0000000..0774fc7 --- /dev/null +++ b/src/staff/run.php @@ -0,0 +1,199 @@ +. +//////////////////////////////////////////////////////////////////////////////// +// Last modified 05/aug/2012 by cassio@ime.usp.br +require 'header.php'; +if(isset($_POST["order"]) && $_POST["order"] != "") { +$order = myhtmlspecialchars($_POST["order"]); + $_SESSION["runline"] = $order; +} else { + if(isset($_SESSION["runline"])) + $order = $_SESSION["runline"]; +else + $order = ''; +} +$ds = DIRECTORY_SEPARATOR; +if($ds=="") $ds = "/"; + +$runphp="run.php"; +?> +
+ +
+ + + + + + + + + + + + + + +=count($arr)) continue; + } + $lin = trim($lin[0]); + if($lin=='') continue; + $grname=explode(' ',$lin); + + for ($i=0; $i= 1) { + $u1 = explode('/',$grname[$k]); + if(isset($u1[1]) && $run[$i]["user"] >= $u1[0] && $run[$i]["user"] <= $u1[1]) { + if(!isset($u1[2]) || $u1[2]==$run[$i]["site"]) { + $run[$i]["okk"]=true; + break; + } + } + } + } + } + } +} else $run = array(); + +$anyprinted=false; + + +for ($i=0; $i\n"; + else echo "\n"; + echo " \n"; +echo $run[$i]["number"] . ""; + + echo " \n"; + if($runphp == "run.php") { + if ($run[$i]["user"] != "") { + $u = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $run[$i]["site"], $run[$i]["user"]); + echo " \n"; + } + } + echo " \n"; + echo " \n"; + echo " \n"; +// echo " \n"; + if ($run[$i]["judge"] == $_SESSION["usertable"]["usernumber"] && + $run[$i]["judgesite"] == $_SESSION["usertable"]["usersitenumber"] && $run[$i]["status"] == "judging") + $color="ff7777"; + else if ($run[$i]["status"]== "judged+" && $run[$i]["judge"]=="") $color="ffff00"; + else if ($run[$i]["status"]== "judged") $color="bbbbff"; + else if ($run[$i]["status"] == "judging" || $run[$i]["status"]== "judged+") $color="77ff77"; + else if ($run[$i]["status"] == "openrun") $color="ffff88"; + else $color="ffffff"; + + echo " \n"; +/* +if ($run[$i]["judge"] != "") { + $u = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $run[$i]["judgesite"], $run[$i]["judge"]); + echo " \n"; + + if ($run[$i]["autoend"] != "") { + $color="bbbbff"; + if ($run[$i]["autoanswer"]=="") $color="ff7777"; + } + else if ($run[$i]["autobegin"]=="") $color="ffff88"; + else $color="77ff77"; + echo "\n"; +*/ + if ($run[$i]["answer"] == "") { + echo " \n"; + } else { + echo " \n"; + } + echo " \n"; +} + +echo "
Run #SiteUserTimeProblemLanguageStatusAnswer
"; + } + else { + echo "
"; + } + //echo ""; + //echo " " . $run[$i]["number"] . "" . $run[$i]["site"] . "" . $u["username"] . "" . dateconvminutes($run[$i]["timestamp"]) . "" . $run[$i]["problem"] . "" . $run[$i]["language"] . "" . $run[$i]["filename"] . "" . $run[$i]["status"] . "" . $u["username"] . " (" . $run[$i]["judgesite"] . ")"; + } else + echo "  "; + + if ($run[$i]["judge1"] != "") { + $u = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $run[$i]["judgesite1"], $run[$i]["judge1"]); + echo " [" . $u["username"] . " (" . $run[$i]["judgesite1"] . ")]"; + } + if ($run[$i]["judge2"] != "") { + $u = DBUserInfo ($_SESSION["usertable"]["contestnumber"], $run[$i]["judgesite2"], $run[$i]["judge2"]); + echo " [" . $u["username"] . " (" . $run[$i]["judgesite2"] . ")]"; + } + + echo "   " . $run[$i]["answer"]; + if($run[$i]['yes']=='t') { + echo " \"".$run[$i]["colorname"]."\""; + } + echo "
"; +if (!$anyprinted) echo "
NO RUNS AVAILABLE
"; +else { +?> +
+ +
+Statistics
\n"; +} +?> + + -- cgit v1.2.3