forked from DOMjudge/domjudge
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add preferences for downloading problem data
Fine grained settings for whether teams or the public can download problemtext or sample testcases
- Loading branch information
Keith Johnson
committed
Nov 6, 2015
1 parent
d986f97
commit a94ab49
Showing
10 changed files
with
85 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
/** | ||
* View/download a specific problem text. This page could later be | ||
* extended to provide more details, like sample test cases. | ||
* | ||
* Part of the DOMjudge Programming Contest Jury System and licenced | ||
* under the GNU GPL. See README and COPYING for details. | ||
*/ | ||
|
||
require('init.php'); | ||
|
||
$show_sample = dbconfig_get('public_dl_samples', 0); | ||
if (!$show_sample) { | ||
error("Sample testcases disabled by admin"); | ||
} | ||
|
||
$id = getRequestID(); | ||
if ( empty($id) ) error("Missing testcase id"); | ||
|
||
$FILES = array('input','output'); | ||
if ( isset($_GET['fetch']) && in_array($_GET['fetch'], $FILES) ) { | ||
putSampleData($id, $_GET['fetch']); | ||
} else { | ||
error("Missing or invalid value for 'fetch'"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters