aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcassio <cassiopc@gmail.com>2015-08-31 14:02:12 +0000
committercassio <cassiopc@gmail.com>2015-08-31 14:02:12 +0000
commitbfe007be672e973b3cd208434f10e5298657a392 (patch)
treeb7b9b42a24e94d5bed268a7d96a73ae584e7242f
parentdd3152be0442e577692067c5523da4f5ab9d9957 (diff)
downloadboca-bfe007be672e973b3cd208434f10e5298657a392.tar.gz
boca-bfe007be672e973b3cd208434f10e5298657a392.zip
small fixes
-rw-r--r--src/team/run.php16
-rwxr-xr-xtools/install_14_04_3.sh5
-rwxr-xr-xtools/installv2.sh5
3 files changed, 17 insertions, 9 deletions
diff --git a/src/team/run.php b/src/team/run.php
index caf3b3d..846fef0 100644
--- a/src/team/run.php
+++ b/src/team/run.php
@@ -123,14 +123,16 @@ if (isset($_POST["problem"]) && isset($_POST["language"]) &&
$pastvalhash = myhtmlspecialchars($_POST["pastvalhash"]);
$pastval = myhtmlspecialchars($_POST["pastval"]);
$pastabs = myhtmlspecialchars($_POST["pastabs"]);
- $pastsubmission = myhash(trim(@file_get_contents($_SESSION["locr"] . $ds . "private" . $ds . 'run-past.config')) . $pastcode . $pastval);
- if($pastsubmission != $pastvalhash) {
- $pastsubmission = myhash(trim(@file_get_contents($_SESSION["locr"] . $ds . "private" . $ds . 'run-past.config')) . $pastcode . $pastabs);
- if($pastsubmission != $pasthash) {
- echo "\nRESULT: INVALID SUBMISSION CODE";
- exit;
+ if(is_readable($_SESSION["locr"] . $ds . "private" . $ds . 'run-past.config')) {
+ $pastsubmission = myhash(trim(@file_get_contents($_SESSION["locr"] . $ds . "private" . $ds . 'run-past.config')) . $pastcode . $pastval);
+ if($pastsubmission != $pastvalhash) {
+ $pastsubmission = myhash(trim(@file_get_contents($_SESSION["locr"] . $ds . "private" . $ds . 'run-past.config')) . $pastcode . $pastabs);
+ if($pastsubmission != $pasthash) {
+ echo "\nRESULT: INVALID SUBMISSION CODE";
+ exit;
+ }
}
- }
+ } else $pastval = 0;
} else {
$pastval = 0;
}
diff --git a/tools/install_14_04_3.sh b/tools/install_14_04_3.sh
index d4f180e..e75f2e9 100755
--- a/tools/install_14_04_3.sh
+++ b/tools/install_14_04_3.sh
@@ -176,7 +176,10 @@ EOF
cp /usr/share/applications/gnome-terminal.desktop /etc/skel/Desktop/
chmod 755 /etc/skel/Desktop/*.desktop
-[ "`which gconftool`" == "" ] || gconftool -s -t bool /apps/update-notifier/auto_launch false
+if [ "`which gconftool`" != "" ]; then
+ su - icpcadmin -c "gconftool -s -t bool /apps/update-notifier/auto_launch false"
+ su - icpc -c "gconftool -s -t bool /apps/update-notifier/auto_launch false"
+fi
pass=`echo -n icpc | makepasswd --clearfrom - --crypt-md5 | cut -d'$' -f2-`
pass=\$`echo $pass`
diff --git a/tools/installv2.sh b/tools/installv2.sh
index d4f180e..e75f2e9 100755
--- a/tools/installv2.sh
+++ b/tools/installv2.sh
@@ -176,7 +176,10 @@ EOF
cp /usr/share/applications/gnome-terminal.desktop /etc/skel/Desktop/
chmod 755 /etc/skel/Desktop/*.desktop
-[ "`which gconftool`" == "" ] || gconftool -s -t bool /apps/update-notifier/auto_launch false
+if [ "`which gconftool`" != "" ]; then
+ su - icpcadmin -c "gconftool -s -t bool /apps/update-notifier/auto_launch false"
+ su - icpc -c "gconftool -s -t bool /apps/update-notifier/auto_launch false"
+fi
pass=`echo -n icpc | makepasswd --clearfrom - --crypt-md5 | cut -d'$' -f2-`
pass=\$`echo $pass`