Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6f041a4
updated to php7
Jan 5, 2018
18f443c
php5 to php7
Jan 6, 2018
28ca91b
php5 to 7
Jan 6, 2018
919a7f5
php5 to 7
Jan 6, 2018
9155373
php5 to 7
Jan 6, 2018
aeeb377
made changes to allow for php 7
Jan 8, 2018
9e0dd14
Delete develop
noahhamilton Jan 8, 2018
80a3fe1
Delete .~lock.Touche-Installation-Instructions.doc#
noahhamilton Jan 8, 2018
ef71493
php5 to 7
Jan 8, 2018
58dab6e
php5 to 7
Jan 8, 2018
6738534
Merge pull request #1 from StevenUlmer/bugfixing
Jan 8, 2018
b0d520a
contest edit fixed.
Jan 9, 2018
fc03b4b
Merge pull request #2 from StevenUlmer/contest-edit
Jan 9, 2018
49de52d
fixed clarification issues
Jan 10, 2018
d2bb900
Merge pull request #3 from StevenUlmer/clar-issue
Jan 11, 2018
5c53cec
added shell scripts for auto jail creation
Jan 11, 2018
d6cb5fa
fixed php5 issues within judge/
Jan 12, 2018
be88d2e
Merge pull request #4 from StevenUlmer/jails
Jan 12, 2018
b3e959c
fixed judge split errors
Jan 12, 2018
7d20c47
Merge pull request #5 from StevenUlmer/jails
Jan 12, 2018
bce5ceb
php5 to 7
Jan 12, 2018
c7980c3
php5 to 7, cronscript issues worked on
Jan 13, 2018
6bf620c
Merge branch 'master' of https://github.com/StevenUlmer/touche into j…
Jan 15, 2018
bebc561
Needed fix to crontab Merge remote-tracking branch 'geisler/master'
Jan 16, 2018
eeff37a
Fixing header push
Jan 16, 2018
08fb461
Merge branch 'master' into jails
JonRooge Jan 16, 2018
95787ed
fixed commented out error redirect
Jan 16, 2018
f1c72c0
Merge pull request #6 from StevenUlmer/jails
Jan 16, 2018
75b4f60
Merge branch 'jails' of https://github.com/StevenUlmer/touche into jails
Jan 16, 2018
a448218
links passed through functions in judge php folders
Jan 16, 2018
c61be0d
Merge branch 'master' of https://github.com/StevenUlmer/touche into j…
Jan 17, 2018
361a9d5
changed header for admin; removed judge.inc from admin
Jan 17, 2018
03551a6
data set changed
Jan 17, 2018
b93f028
final changes
Jan 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified COPYING
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ is in a directory named src):
ln ~/src/index.html public_html/index.html
ln -s ~/src/dbcreate.sql public_html/dbcreate.sql
ln -s ~/src/readme public_html/readme
ln -s ~/src/lib public_html/lib

suexec and userdir options must be active within Apache. We cannot use
symbolic links for the `createcontest` scripts since they are directly
Expand Down
Empty file modified Touche-Installation-Instructions.doc
100644 → 100755
Empty file.
17 changes: 8 additions & 9 deletions createcontest2.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

include_once("lib/session.inc");
include_once("lib/create.inc");
if($_POST['B1'] == "Submit") {
Expand Down Expand Up @@ -154,29 +155,26 @@
system($cmd2, $result);
echo"Finished.</p>\n";
echo "<p>Creating Database . . . ";
$mypwd = "pc2bgone";
$mypwd = "password";
$cmd3 = "mysqladmin --password=$mypwd -u root create $db_name";
echo "<br />[$cmd3]<br />";
system($cmd3, $result);
$cmd3 = "mysql --password=$mypwd -u root $db_name < dbcreate.sql";
echo "<br />[$cmd3]<br />";
system($cmd3, $result);
$cmd4 = "cp -r develop/ ./";
$cmd4 .= $contest;
echo "<br />[$cmd4]<br />";
system($cmd4, $result);
$dbU = "contest_skeleton";
$link = mysql_connect($dbhost, $dbU, $dbpw);
$link = mysqli_connect($dbhost, $dbU, $dbpw, $db_name);
if (!$link) {
print "Sorry. Database connect failed.";
exit;
}

$connect_good = mysql_select_db($db_name);
if (!$connect_good) {
print "Sorry. Database selection failed.";
exit;
}
$base_dir = "/home/contest/$contest";
$contest_info = mysql_query("INSERT INTO CONTEST_CONFIG (HOST, CONTEST_NAME, FREEZE_DELAY, CONTEST_END_DELAY, BASE_DIRECTORY, JUDGE_USER) VALUES ('$HOST', '$contest', '14400', '18000', '$base_dir', 'judge')");
$contest_info = mysqli_query($link, "INSERT INTO CONTEST_CONFIG (HOST, CONTEST_NAME, FREEZE_DELAY, CONTEST_END_DELAY, BASE_DIRECTORY, JUDGE_USER) VALUES ('$HOST', '$contest', '14400', '18000', '$base_dir', 'judge')");
if (!$contest_info) {
print "Sorry. Database request (INSERT) failed.";
exit;
Expand Down Expand Up @@ -239,7 +237,8 @@
$chk = fwrite($fhdl, $file);
fclose($fhdl);
#-----------------------------------------------------------------
echo "<p>To finish setting up the contest go to: <a href='http://jacob.cse.taylor.edu/~contest/$contest_noesc/admin'>Administration setup</a></p>";
$username = get_current_user();
echo "<p>To finish setting up the contest go to: <a href='http://$_SERVER[SERVER_NAME]/~$username/$contest_noesc/admin'>Administration setup</a></p>";
?>
</center></b></td></tr>
</body>
Expand Down
4 changes: 2 additions & 2 deletions dbcreate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ DROP TABLE IF EXISTS CONTEST_CONFIG;
CREATE TABLE CONTEST_CONFIG (
HOST char(30) NOT NULL default '',
CONTEST_NAME char(30) NOT NULL default '',
CONTEST_DATE date NOT NULL,
START_TIME time NOT NULL,
CONTEST_DATE date NOT NULL default '2001-01-01',
START_TIME time NOT NULL default '12:00',
FREEZE_DELAY int(11) NOT NULL default '0',
CONTEST_END_DELAY int(11) NOT NULL default '0',
BASE_DIRECTORY char(255) NOT NULL default '',
Expand Down
Empty file modified develop/chroot_wrapper.c
100644 → 100755
Empty file.
15 changes: 15 additions & 0 deletions develop/jail_scripts/c_jail.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
if [ ! -d "c_jail" ]; then
mkdir c_jail
fi

mkdir ./c_jail/usr
mkdir ./c_jail/usr/bin
mkdir ./c_jail/usr/lib
mkdir ./c_jail/bin
mkdir ./c_jail/lib64
mkdir ./c_jail/lib
mkdir ./c_jail/lib/x86_64-linux-gnu
cp /bin/sh ./c_jail/bin/sh
cp /lib/x86_64-linux-gnu/libc.so.6 ./c_jail/lib/x86_64-linux-gnu/libc.so.6
cp /lib64/ld-linux-x86-64.so.2 ./c_jail/lib64/ld-linux-x86-64.so.2
19 changes: 19 additions & 0 deletions develop/jail_scripts/cpp_jail.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
if [ ! -d "cpp_jail" ]; then
mkdir cpp_jail
fi

mkdir ./cpp_jail/usr
mkdir ./cpp_jail/usr/bin
mkdir ./cpp_jail/usr/lib
mkdir ./cpp_jail/bin
mkdir ./cpp_jail/lib64
mkdir ./cpp_jail/lib
mkdir ./cpp_jail/lib/x86_64-linux-gnu
cp /bin/sh ./cpp_jail/bin/sh
cp /lib/x86_64-linux-gnu/libc.so.6 ./cpp_jail/lib/x86_64-linux-gnu/libc.so.6
cp /lib/x86_64-linux-gnu/libgcc_s.so.1 ./cpp_jail/lib/x86_64-linux-gnu/libgcc_s.so.1
cp /lib/x86_64-linux-gnu/libm.so.6 ./cpp_jail/lib/x86_64-linux-gnu/libm.so.6
cp /lib64/ld-linux-x86-64.so.2 ./cpp_jail/lib64/ld-linux-x86-64.so.2
cp /usr/bin/sh ./cpp_jail/usr/bin/sh
cp /usr/lib/x86_64-linux-gnu ./cpp_jail/usr/lib/x86_64-linux-gnu
21 changes: 21 additions & 0 deletions develop/jail_scripts/java_jail.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
if [ ! -d "java_jail" ]; then
mkdir java_jail
fi
mkdir ./java_jail/usr
mkdir ./java_jail/usr/bin
mkdir ./java_jail/usr/lib
mkdir ./java_jail/usr/lib/jvm
mkdir ./java_jail/bin
mkdir ./java_jail/lib64
mkdir ./java_jail/lib
mkdir ./java_jail/lib/x86_64-linux-gnu
mkdir /usr/lib/jvm/java-6-openjdk-amd64
mkdir ./java_jail/usr/lib/jvm/java-1.8.0-openjdk-amd64
cp /bin/sh ./java_jail/bin/sh
cp /lib/x86_64-linux-gnu/libpthread.so.0 ./java_jail/lib/x86_64-linux-gnu/
cp /lib/x86_64-linux-gnu/libdl.so.2 ./java_jail/lib/x86_64-linux-gnu/
cp /lib/x86_64-linux-gnu/libc.so.6 ./java_jail/lib/x86_64-linux-gnu/
cp /lib64/ld-linux-x86-64.so.2 ./java_jail/lib64
cp /lib/x86_64-linux-gnu/libz.so.1 ./java_jail/lib/x86_64-linux-gnu/
cp -r /usr/lib/jvm/java-1.8.0-openjdk-amd64/* ./java_jail/usr/lib/jvm/java-1.8.0-openjdk-amd64/
Empty file modified develop/old_chroot_wrapper.c
100644 → 100755
Empty file.
Empty file modified develop/start_contest.crontab
100644 → 100755
Empty file.
Empty file modified develop/stop_contest.crontab
100644 → 100755
Empty file.
Empty file modified lib/create.inc
100644 → 100755
Empty file.
Empty file modified lib/session.inc
100644 → 100755
Empty file.
Empty file modified public_html/admin/email_body.txt
100644 → 100755
Empty file.
6 changes: 3 additions & 3 deletions public_html/admin/lib/contest_info.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
# arch-tag: lib/contest_info.inc
#

$contest_info = mysql_query("SELECT * FROM CONTEST_CONFIG");
$contest_info = mysqli_query($link, "SELECT * FROM CONTEST_CONFIG");
if (!$contest_info) {
print "Sorry. Database request (CONTEST_CONFIG) failed. Retrying...";
exit;
}

$row = mysql_fetch_assoc($contest_info);
if (mysql_num_rows($contest_info) < 1) {
$row = mysqli_fetch_assoc($contest_info);
if (mysqli_num_rows($contest_info) < 1) {
print "Sorry. No contest configuration information exists.<br /> ";
print "Please contact a system administrator.";
#exit;
Expand Down
33 changes: 14 additions & 19 deletions public_html/admin/lib/data.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,21 @@
# arch-tag: lib/data.inc
#

$link = mysql_connect($db_host, $db_user, $db_pass);
$link = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
if (!$link) {
print "Sorry. Database connect failed. Retrying...";
exit;
}

$connect_good = mysql_select_db($db_name);
if (!$connect_good) {
print "Sorry. Database selection failed. Retrying...";
exit;
}

$contest_info = mysql_query("SELECT * FROM CONTEST_CONFIG");
$contest_info = mysqli_query($link, "SELECT * FROM CONTEST_CONFIG");
if (!$contest_info) {
print "Sorry. Database request (CONTEST_CONFIG) failed. Retrying...";
exit;
}

$row = mysql_fetch_assoc($contest_info);
if (mysql_num_rows($contest_info) > 0) {
$row = mysqli_fetch_assoc($contest_info);
if (mysqli_num_rows($contest_info) > 0) {
$contest_host = $row['HOST'];
$contest_name = $row['CONTEST_NAME'];
$contest_date = $row['CONTEST_DATE'];
Expand All @@ -54,13 +49,13 @@ if (mysql_num_rows($contest_info) > 0) {
$contest_end_ts = $contest_start_ts + $contest_end_time;


$teams_query = mysql_query("SELECT * FROM TEAMS");
$teams_query = mysqli_query($link, "SELECT * FROM TEAMS");
if (!$teams_query) {
print "Sorry. Database request (TEAMS) failed. Retrying...";
exit;
}
$num_teams = mysql_num_rows($teams_query);
while ($row = mysql_fetch_assoc($teams_query)) {
$num_teams = mysqli_num_rows($teams_query);
while ($row = mysqli_fetch_assoc($teams_query)) {
$team_id = $row['TEAM_ID'];
$team_user = $row['USERNAME'];
$teams[$team_id]['user'] = $team_user;
Expand Down Expand Up @@ -102,12 +97,12 @@ while ($row = mysql_fetch_assoc($teams_query)) {
$sql = "SELECT ct.TEAM_ID, c.CATEGORY_NAME";
$sql .= " FROM CATEGORY_TEAM ct, CATEGORIES c";
$sql .= " WHERE ct.CATEGORY_ID = c.CATEGORY_ID";
$categories_query = mysql_query($sql);
$categories_query = mysqli_query($link, $sql);
if (!$categories_query) {
print "Sorry. Database request (CATEGORIES) failed. Retrying...";
exit;
}
while ($row = mysql_fetch_assoc($categories_query)) {
while ($row = mysqli_fetch_assoc($categories_query)) {
$cat_name = $row['CATEGORY_NAME'];
if ($cat_name) {
$categories[$cat_name]['name'] = $cat_name;
Expand All @@ -121,26 +116,26 @@ while ($row = mysql_fetch_assoc($categories_query)) {
}

$problem_url = "problems";
$problems_query = mysql_query("SELECT * FROM PROBLEMS");
$problems_query = mysqli_query($link, "SELECT * FROM PROBLEMS");
if (!$problems_query) {
print "Sorry. Database request (PROBLEMS) failed. Retrying...";
exit;
}

$num_problems = mysql_num_rows($problems_query);
while ($row = mysql_fetch_assoc($problems_query)) {
$num_problems = mysqli_num_rows($problems_query);
while ($row = mysqli_fetch_assoc($problems_query)) {
$problem_id = $row['PROBLEM_ID'];
$problems[$problem_id]['id'] = $row['PROBLEM_ID'];
$problems[$problem_id]['name'] = $row['PROBLEM_NAME'];
$problems[$problem_id]['loc'] = $row['PROBLEM_LOC'];
}

$responses_query = mysql_query("SELECT * FROM RESPONSES");
$responses_query = mysqli_query($link, "SELECT * FROM RESPONSES");
if (!$responses_query) {
print "Sorry. Database request (RESPONSES) failed. Retrying...";
exit;
}
while ($row = mysql_fetch_assoc($responses_query)) {
while ($row = mysqli_fetch_assoc($responses_query)) {
$response_id = $row['RESPONSE_ID'];
$responses[$response_id]['response'] = $row['RESPONSE'];
$responses[$response_id]['color'] = $row['RESPONSE_COLOR'];
Expand Down
15 changes: 5 additions & 10 deletions public_html/admin/lib/header.inc
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,17 @@
# arch-tag: admin/lib/header.inc
#

$link = mysql_connect($db_host, $db_user, $db_pass);
$link = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
if (!$link) {
print "Sorry. Database connect failed. Retrying...";
exit;
}

$connect_good = mysql_select_db($db_name);
if (!$connect_good) {
print "Sorry. Database selection failed. Retrying...";
exit;
}
include_once ("../lib/config.inc");
# include_once ("../lib/data.inc");
include_once ("lib/session.inc");
$result = mysql_query("SELECT * FROM CONTEST_CONFIG");
if (mysql_num_rows($result) > 0) {
$result = mysqli_query($link, "SELECT * FROM CONTEST_CONFIG");
if (mysqli_num_rows($result) > 0) {
include_once ("lib/contest_info.inc");
}
?>
Expand Down Expand Up @@ -68,13 +63,13 @@ if (!$connect_good) {
<?php $lang_sql = "SELECT sum(REPLACE_HEADERS) AS heads,";
$lang_sql .= " sum(CHECK_BAD_WORDS) AS bad_words ";
$lang_sql .= "FROM LANGUAGE";
$sel_sql = mysql_query($lang_sql);
$sel_sql = mysqli_query($link, $lang_sql);
if (!$sel_sql) {
echo "Error! Could not create the header ";
echo "correctly.<br /> Please contact an ";
echo "administrator.";
}
$contest_stuff = mysql_fetch_assoc($sel_sql);
$contest_stuff = mysqli_fetch_assoc($sel_sql);
if ($contest_stuff['heads'] > 0) { ?>
<a href="setup_headers.php">Headers</a> &nbsp;
<?php }
Expand Down
Loading