diff options
| author | cassio <cassiopc@gmail.com> | 2015-08-30 15:17:40 +0000 |
|---|---|---|
| committer | cassio <cassiopc@gmail.com> | 2015-08-30 15:17:40 +0000 |
| commit | 198dcd42b9a44a838020c05999dfb263ae1628e8 (patch) | |
| tree | 0d878d74764882fe7bb6592d543954b29622d2f3 /src/team/run.php | |
| parent | be2798607fd15e8b116993a8d33d75b0a6ad0f50 (diff) | |
| download | boca-198dcd42b9a44a838020c05999dfb263ae1628e8.tar.gz boca-198dcd42b9a44a838020c05999dfb263ae1628e8.zip | |
small fixes
Diffstat (limited to 'src/team/run.php')
| -rw-r--r-- | src/team/run.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/team/run.php b/src/team/run.php index db142f4..9641386 100644 --- a/src/team/run.php +++ b/src/team/run.php @@ -33,6 +33,29 @@ if (isset($_FILES["sourcefile"]) && isset($_POST["problem"]) && isset($_POST["Su $prob = myhtmlspecialchars($_POST["problem"]); $lang = myhtmlspecialchars($_POST["language"]); + $probs = DBGetProblems($_SESSION["usertable"]["contestnumber"],$_SESSION["usertable"]["usertype"]=='judge'); + $i = 0; + $ss = ""; + for (;$i<count($probs);$i++) { + if($probs[$i]["problem"]==$prob) break; + $ss .= $probs[$i]["problem"] . " "; + } + if($i >= count($probs)) { + echo "RESULT: INVALID PROBLEM (options are: " . $ss . ")"; + exit; + } + $langs = DBGetLanguages($_SESSION["usertable"]["contestnumber"]); + $i = 0; + $ss = ""; + for (;$i<count($langs);$i++) { + if($langs[$i]["name"]==$lang) break; + $ss .= $langs[$i]["name"] . " "; + } + if($i >= count($langs)) { + echo "RESULT: INVALID LANGUAGE (options are: " . $ss . ")"; + exit; + } + $type=myhtmlspecialchars($_FILES["sourcefile"]["type"]); $size=myhtmlspecialchars($_FILES["sourcefile"]["size"]); $name=myhtmlspecialchars($_FILES["sourcefile"]["name"]); |