aboutsummaryrefslogtreecommitdiff
path: root/src/staff
diff options
context:
space:
mode:
authorcassiopc <cassiopc@gmail.com>2015-09-11 14:42:05 +0000
committercassiopc <cassiopc@gmail.com>2015-09-11 14:42:05 +0000
commit5702d8cdcaf4784545a893657edf5e5429bc0cc8 (patch)
tree453ab55ecbd79547f121ae6a2d9657d696a1cdf7 /src/staff
parentf9f21ae94bbdcc63907e46271cd87b7a588e1baf (diff)
parent40ed6646e902830881fe2c530ce110d73f5a5a0b (diff)
downloadboca-5702d8cdcaf4784545a893657edf5e5429bc0cc8.tar.gz
boca-5702d8cdcaf4784545a893657edf5e5429bc0cc8.zip
Merge branch 'master' of github.com:cassiopc/boca
Diffstat (limited to 'src/staff')
-rw-r--r--src/staff/task.php47
1 files changed, 44 insertions, 3 deletions
diff --git a/src/staff/task.php b/src/staff/task.php
index 640eae1..a447429 100644
--- a/src/staff/task.php
+++ b/src/staff/task.php
@@ -15,7 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////////////
-// Last modified 05/aug/2012 by cassio@ime.usp.br
+// Last modified 07/sep/2015 by cassio@ime.usp.br
require('header.php');
if(($ct = DBContestInfo($_SESSION["usertable"]["contestnumber"])) == null)
@@ -67,8 +67,49 @@ if (($s=DBSiteInfo($_SESSION["usertable"]["contestnumber"],$_SESSION["usertable"
$task = DBOpenTasksInSites($_SESSION["usertable"]["contestnumber"], $s["sitetasking"]);
+$ds = DIRECTORY_SEPARATOR;
+if($ds=="") $ds = "/";
+$limittasks=false;
+if(is_readable($_SESSION["locr"] . $ds . 'private' . $ds . 'score.sep')) {
+ $limittasks=true;
+ $rf=file($_SESSION["locr"] . $ds . 'private' . $ds . 'score.sep');
+ for($rfi=1;$rfi<=count($rf);$rfi++) {
+ $lin = explode('#',trim($rf[$rfi-1]));
+ if(isset($lin[1]) && $_SESSION["usertable"]["usertype"]!='admin') {
+ $arr=explode(' ',trim($lin[1]));
+ for($arri=0;$arri<count($arr);$arri++)
+ if(preg_match($arr[$arri],$_SESSION["usertable"]["username"])) break;
+ if($arri>=count($arr)) continue;
+ }
+ $lin = trim($lin[0]);
+ if($lin=='') continue;
+ $grname=explode(' ',$lin);
+
+ for ($i=0; $i<count($task); $i++) {
+ for($k=1;$k<count($grname);$k++) {
+ if($task[$i]["site"]==$grname[$k]) {
+ $task[$i]["ok"]=true;
+ break;
+ }
+ else if(strpos($grname[$k],'/') >= 1) {
+ $u1 = explode('/',$grname[$k]);
+ if(isset($u1[1]) && $task[$i]["user"] >= $u1[0] && $task[$i]["user"] <= $u1[1]) {
+ if(!isset($u1[2]) || $u1[2]==$task[$i]["site"]) {
+ $task[$i]["ok"]=true;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+$anyprinted=false;
for ($i=0; $i<count($task); $i++) {
- $st = $task[$i]["status"];
+ if($limittasks && (!isset($task[$i]["ok"]) || $task[$i]["ok"]!=true)) continue;
+ $anyprinted=true;
+ $st = $task[$i]["status"];
if($st == "processing" && $task[$i]["staff"]==$_SESSION["usertable"]["usernumber"] &&
$task[$i]["staffsite"]==$_SESSION["usertable"]["usersitenumber"]) $mine=1;
@@ -121,7 +162,7 @@ for ($i=0; $i<count($task); $i++) {
echo "&nbsp;</td>\n";
}
echo "</table>";
-if (count($task) == 0) echo "<br><center><b><font color=\"#ff0000\">NO TASKS FOUND</font></b></center>";
+if (!$anyprinted) echo "<br><center><b><font color=\"#ff0000\">NO TASKS FOUND</font></b></center>";
?>