From be2491b093b1f0ca430bede679ecbb670041e483 Mon Sep 17 00:00:00 2001 From: cassio Date: Tue, 2 Jul 2013 09:46:45 +0400 Subject: restructuring of boca's git --- src/team/files.php | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 src/team/files.php (limited to 'src/team/files.php') diff --git a/src/team/files.php b/src/team/files.php new file mode 100644 index 0000000..42fba28 --- /dev/null +++ b/src/team/files.php @@ -0,0 +1,123 @@ +. +//////////////////////////////////////////////////////////////////////////////// +// Last modified 05/aug/2012 by cassio@ime.usp.br +require 'header.php'; + +if(($ct = DBContestInfo($_SESSION["usertable"]["contestnumber"])) == null) + ForceLoad("../index.php"); +if(($st = DBSiteInfo($_SESSION["usertable"]["contestnumber"],$_SESSION["usertable"]["usersitenumber"])) == null) + ForceLoad("../index.php"); + +if (isset($_GET["delete"]) && is_numeric($_GET["delete"])) { + DBBkpDelete($_GET["delete"],$_SESSION["usertable"]["usersitenumber"],$_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usernumber"]); + ForceLoad("files.php"); +} + +if (isset($_FILES["sourcefile"]) && isset($_POST["Submit"]) && $_FILES["sourcefile"]["name"]!="") { + if ($_POST["confirmation"] == "confirm") { + $type=myhtmlspecialchars($_FILES["sourcefile"]["type"]); + $size=myhtmlspecialchars($_FILES["sourcefile"]["size"]); + $name=myhtmlspecialchars($_FILES["sourcefile"]["name"]); + $temp=myhtmlspecialchars($_FILES["sourcefile"]["tmp_name"]); + + if ($size > $ct["contestmaxfilesize"]) { + LOGLevel("User {$_SESSION["usertable"]["username"]} tried to submit file " . + "$name with $size bytes ({$ct["contestmaxfilesize"]} max allowed).", 1); + MSGError("File size exceeds the limit allowed."); + ForceLoad("run.php"); + } + if (!is_uploaded_file($temp) || strlen($name)>100) { + IntrusionNotify("file upload problem."); + ForceLoad("../index.php"); + } + + DBNewBkp ($_SESSION["usertable"]["contestnumber"], + $_SESSION["usertable"]["usersitenumber"], + $_SESSION["usertable"]["usernumber"], + $name, + $temp, $size); + } + ForceLoad("files.php"); +} +?> +
+ + + + + + +\n"; + echo " \n"; + + echo " \n"; + echo "\n"; + echo " \n"; + +} +echo "
Bkp #TimeFile
" . $run[$i]["number"] . "" . dateconvsimple($run[$i]["timestamp"]) . ""; + echo $run[$i]["filename"] . ""; + + echo "
"; +if (count($run) == 0) echo "
NO BACKUPS AVAILABLE
"; + +?> + +

To erase a file, click on its number. To download a file, click on its name. +To submit a new backup file, just fill in the following fields:
+
+ + +
+ + + + + +
File (size restrictions apply): + +
+
+ +
+ +
+
+ + + -- cgit v1.2.3