diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/COPYING b/COPYING old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index fd2b293..109126d --- a/README.md +++ b/README.md @@ -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 diff --git a/Touche-Installation-Instructions.doc b/Touche-Installation-Instructions.doc old mode 100644 new mode 100755 diff --git a/createcontest2.php b/createcontest2.php index cf8fb58..9b83929 100755 --- a/createcontest2.php +++ b/createcontest2.php @@ -1,4 +1,5 @@ \n"; echo "
Creating Database . . . ";
- $mypwd = "pc2bgone";
+ $mypwd = "password";
$cmd3 = "mysqladmin --password=$mypwd -u root create $db_name";
+echo "
[$cmd3]
";
system($cmd3, $result);
$cmd3 = "mysql --password=$mypwd -u root $db_name < dbcreate.sql";
+echo "
[$cmd3]
";
system($cmd3, $result);
$cmd4 = "cp -r develop/ ./";
$cmd4 .= $contest;
echo "
[$cmd4]
";
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;
@@ -239,7 +237,8 @@
$chk = fwrite($fhdl, $file);
fclose($fhdl);
#-----------------------------------------------------------------
-echo "
To finish setting up the contest go to: Administration setup
"; +$username = get_current_user(); +echo "To finish setting up the contest go to: Administration setup
"; ?>