예제 #1
0
파일: claredit.php 프로젝트: sbaldrich/boca
                }
            }
            DBUpdateClar($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"], $_SESSION["usertable"]["usernumber"], $sitenumber, $number, $ans, $type);
        }
    }
    ForceLoad("clar.php");
}
if (!isset($_GET["clarnumber"]) || !isset($_GET["clarsitenumber"]) || !is_numeric($_GET["clarnumber"]) || !is_numeric($_GET["clarsitenumber"])) {
    IntrusionNotify("tried to open the judge/claredit.php with wrong parameters.");
    ForceLoad("clar.php");
}
$clarsitenumber = myhtmlspecialchars($_GET["clarsitenumber"]);
$clarnumber = myhtmlspecialchars($_GET["clarnumber"]);
if (($a = DBGetClarToAnswer($clarnumber, $clarsitenumber, $_SESSION["usertable"]["contestnumber"])) === false) {
    MSGError("Another judge got it first.");
    ForceLoad("clar.php");
}
?>
<br><br><center><b>Use the following fields to answer the clarification:
</b></center>
<form name="form1" method="post" action="claredit.php">
  <input type=hidden name="confirmation" value="noconfirm" />
  <center>
    <table border="0">
      <tr> 
        <td width="20%" align=right><b>Clarification Site:</b></td>
        <td width="80%"> 
		<input type=hidden name="sitenumber" value="<?php 
echo $a["sitenumber"];
?>
" />
예제 #2
0
파일: contest.php 프로젝트: sbaldrich/boca
                }
                if ($dd > 0) {
                    $param['keys'] = implode(',', $ar);
                    MSGError(count($ar) . ' keys are being imported from the file');
                    DBClearProblemTmp($_SESSION["usertable"]["contestnumber"]);
                }
            }
            $param['atualizasites'] = $at;
        }
        DBUpdateContest($param);
        if (strlen($param['unlockkey']) > 1) {
            DBClearProblemTmp($_SESSION["usertable"]["contestnumber"]);
            DBGetFullProblemData($_SESSION["usertable"]["contestnumber"], true);
        }
    }
    ForceLoad("contest.php");
}
?>
<br>

<form name="form1" enctype="multipart/form-data" method="post" action="contest.php">
  <input type=hidden name="confirmation" value="noconfirm" />
  <script language="javascript">
    function conf() {
      if (confirm("Confirm?")) {
        document.form1.confirmation.value='confirm';
      }
    }
    function conf2() {
      if (confirm("This will restart all start/stop related information in all the sites.\n\
If you have a contest running, the result is unpredictable. Are you really sure?")) {
예제 #3
0
파일: task.php 프로젝트: sbaldrich/boca
            MSGError("File size exceeds the limit allowed.");
            ForceLoad("task.php");
        }
        if (!is_uploaded_file($temp)) {
            IntrusionNotify("Printing file upload problem");
            ForceLoad("../index.php");
        }
        $param['contest'] = $_SESSION["usertable"]["contestnumber"];
        $param['site'] = $_SESSION["usertable"]["usersitenumber"];
        $param['user'] = $_SESSION["usertable"]["usernumber"];
        $param['desc'] = "File to print";
        $param['filename'] = $name;
        $param['filepath'] = $temp;
        DBNewTask($param);
    }
    ForceLoad("task.php");
}
?>
<br>
<table width="100%" border=1>
 <tr>
  <td><b>Task #</b></td>
  <td><b>Time</b></td>
  <td><b>Description</b></td>
  <td><b>File</b></td>
  <td><b>Status</b></td>
 </tr>
<?php 
$task = DBUserTasks($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"], $_SESSION["usertable"]["usernumber"]);
for ($i = 0; $i < count($task); $i++) {
    echo " <tr>\n";
예제 #4
0
    ForceLoad("../index.php");
}
if (isset($_GET["delete"]) && is_numeric($_GET["delete"])) {
    $param["number"] = $_GET["delete"];
    DBDeleteLanguage($_SESSION["usertable"]["contestnumber"], $param);
    ForceLoad("language.php");
}
if (isset($_POST["Submit3"]) && isset($_POST["langnumber"]) && is_numeric($_POST["langnumber"]) && isset($_POST["langname"]) && $_POST["langname"] != "") {
    if ($_POST["confirmation"] == "confirm") {
        $param = array();
        $param['number'] = $_POST['langnumber'];
        $param['name'] = $_POST['langname'];
        $param['extension'] = $_POST['langextension'];
        DBNewLanguage($_SESSION["usertable"]["contestnumber"], $param);
    }
    ForceLoad("language.php");
}
?>
<br>
  <script language="javascript">
    function conf2(url) {
      if (confirm("Confirm the DELETION of the LANGUAGE and ALL data associated to it (including the SUBMISSIONS)?")) {
		  if (confirm("Are you REALLY sure about what you are doing? DATA CANNOT BE RECOVERED!")) {
			  document.location=url;
		  } else {
			  document.location='language.php';
		  }
      } else {
        document.location='language.php';
      }
    }
예제 #5
0
                ForceLoad("../index.php");
            }
        } else {
            $name = "";
        }
        $param = array();
        $param['number'] = $_POST["problemnumber"];
        $param['name'] = $_POST["problemname"];
        $param['inputfilename'] = $name;
        $param['inputfilepath'] = $temp;
        $param['fake'] = 'f';
        $param['colorname'] = $_POST["colorname"];
        $param['color'] = $_POST["color"];
        DBNewProblem($_SESSION["usertable"]["contestnumber"], $param);
    }
    ForceLoad("problem.php");
}
?>
<br>
  <script language="javascript">
    function conf2(url) {
      if (confirm("Confirm the DELETION of the PROBLEM and ALL data associated to it?")) {
		  if (confirm("Are you REALLY sure about what you are doing? DATA CANNOT BE RECOVERED!")) {
			  document.location=url;
		  } else {
			  document.location='problem.php';
		  }
      } else {
        document.location='problem.php';
      }
    }
예제 #6
0
파일: flog.php 프로젝트: justomiguel/boca
function DBLogInContest($name, $pass, $contest, $msg = true)
{
    $b = DBGetRow("select * from contesttable where contestnumber={$contest}", 0, null, "DBLogIn(get active contest)");
    if ($b == null) {
        LOGLevel("There is no contest {$contest}.", 0);
        if ($msg) {
            MSGError("There is no contest {$contest}, contact an admin.");
        }
        return false;
    }
    $d = DBSiteInfo($b["contestnumber"], $b["contestlocalsite"], null, false);
    if ($d == null) {
        if ($msg) {
            MSGError("There is no active site, contact an admin.");
        }
        return false;
    }
    $a = DBGetRow("select * from usertable where username='******' and contestnumber=" . $b["contestnumber"] . " and " . "usersitenumber=" . $b["contestlocalsite"], 0, null, "DBLogIn(get user)");
    if ($a == null) {
        if ($msg) {
            LOGLevel("User {$name} tried to log in contest {$contest} but it does not exist.", 2);
            MSGError("User does not exist or incorrect password.");
        }
        return false;
    }
    $a = DBUserInfo($b["contestnumber"], $b["contestlocalsite"], $a['usernumber'], null, false);
    $_SESSION['usertable'] = $a;
    $p = myhash($a["userpassword"] . session_id());
    $_SESSION['usertable']['userpassword'] = $p;
    if ($a["userpassword"] != "" && $p != $pass) {
        LOGLevel("User {$name} tried to log in contest {$contest} but password was incorrect.", 2);
        if ($msg) {
            MSGError("Incorrect password.");
        }
        unset($_SESSION["usertable"]);
        return false;
    }
    if ($d["sitepermitlogins"] == "f" && $a["usertype"] != "admin" && $a["usertype"] != "judge" && $a["usertype"] != "site") {
        LOGLevel("User {$name} tried to login contest {$contest} but logins are denied.", 2);
        if ($msg) {
            MSGError("Logins are not allowed.");
        }
        unset($_SESSION["usertable"]);
        return false;
    }
    if ($a["userenabled"] != "t") {
        LOGLevel("User {$name} tried to log in contest {$contest} but it is disabled.", 2);
        if ($msg) {
            MSGError("User disabled.");
        }
        unset($_SESSION["usertable"]);
        return false;
    }
    $gip = getIP();
    if ($a["userip"] != $gip && $a["userip"] != "" && $a["usertype"] != "score") {
        LOGLevel("User {$name} is using two different IPs: " . $a["userip"] . "(" . dateconv($a["userlastlogin"]) . ") and " . $gip, 1);
        if ($msg && $a["usertype"] != "admin") {
            MSGError("You are using two distinct IPs. Admin notified.");
        }
    }
    if ($a["userpermitip"] != "") {
        $ips = explode(';', $a["userpermitip"]);
        $gips = explode(';', $gip);
        if (count($gips) < count($ips)) {
            IntrusionNotify("Invalid IP: " . $gip);
            ForceLoad("index.php");
        }
        for ($ipss = 0; $ipss < count($ips); $ipss++) {
            $gipi = $gips[$ipss];
            $ipi = $ips[$ipss];
            if (!match_network($ipi, $gipi)) {
                IntrusionNotify("Invalid IP: " . $gip);
                ForceLoad("index.php");
            }
        }
    }
    $c = DBConnect();
    $t = time();
    if ($a["usertype"] == "team" && $a["usermultilogin"] != "t" && $a["userpermitip"] == "") {
        $r = DBExec($c, "update usertable set userip='" . $gip . "', updatetime=" . time() . ", userpermitip='" . $gip . "'," . "userlastlogin={$t}, usersession='" . session_id() . "' where username='******' and contestnumber=" . $b["contestnumber"] . " and usersitenumber=" . $b["contestlocalsite"], "DBLogIn(update session)");
    } else {
        DBExec($c, "begin work");
        $sql = "update usertable set usersessionextra='" . session_id() . "' where username='******' and contestnumber=" . $b["contestnumber"] . " and usersitenumber=" . $b["contestlocalsite"] . " and (usersessionextra='' or userip != '" . $gip . "' or userlastlogin<=" . ($t - 86400) . ")";
        DBExec($c, $sql);
        DBExec($c, "update usertable set userip='" . $gip . "', updatetime=" . time() . ", userlastlogin={$t}, " . "usersession='" . session_id() . "' where username='******' and contestnumber=" . $b["contestnumber"] . " and usersitenumber=" . $b["contestlocalsite"], "DBLogIn(update user)");
        if ($name == 'admin') {
            list($clockstr, $clocktime) = siteclock();
            if ($clocktime < -600) {
                DBExec($c, "update contesttable set contestunlockkey='' where contestnumber=" . $b["contestnumber"], "DBLogInContest(update contest)");
            }
        }
        DBExec($c, "commit work");
    }
    LOGLevel("User {$name} authenticated (" . $gip . ")", 2);
    return $a;
}
예제 #7
0
파일: user.php 프로젝트: sbaldrich/boca
 <tr>
  <td nowrap><b>Site</b></td><td><b>User #</b></td>
  <td><b>Password</b></td>
 </tr>
<?php 
                foreach ($userlist as $user => $pass) {
                    $x = explode('-', $user);
                    echo "<tr><td>" . $x[0] . "</td><td>" . $x[1] . "</td><td>{$pass}</td></tr>\n";
                }
                ?>
</table><br><br><u><b>TAKE NOTE OF THE USERS AND PASSWORDS AND KEEP THEM SECRET</b></u></center></body></html>
<?php 
                exit;
            }
        }
        ForceLoad("user.php");
    }
}
if ($main) {
    $usr = DBAllUserInfo($_SESSION["usertable"]["contestnumber"]);
} else {
    $usr = DBAllUserInfo($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"]);
}
?>

  <script language="javascript">
    function conf2(url) {
      if (confirm("Are you sure?")) {
        document.location=url;
      } else {
        document.location='user.php';
예제 #8
0
파일: runchief.php 프로젝트: sbaldrich/boca
            }
            if (isset($_POST["open"]) && $_POST["open"] == "Open selected runs for rejudging") {
                DBGiveUpRunAutojudging($_SESSION["usertable"]["contestnumber"], $run[$i]["site"], $run[$i]["number"]);
                if (DBChiefRunGiveUp($run[$i]["number"], $run[$i]["site"], $_SESSION["usertable"]["contestnumber"])) {
                    $nreopen++;
                }
            }
        }
    }
    if ($nrenew > 0) {
        MSGError($nrenew . " runs renewed for autojudging.");
        ForceLoad($runphp);
    }
    if ($nreopen > 0) {
        MSGError($nreopen . " runs reopened.");
        ForceLoad($runphp);
    }
}
for ($i = 0; $i < count($run); $i++) {
    if ($run[$i]["answer1"] != 0 && $run[$i]["answer2"] != 0 && $run[$i]["status"] != "judged") {
        if ($runphp == "runchief.php") {
            echo " <tr bgcolor=\"ff0000\">\n";
        } else {
            echo "<tr>\n";
        }
        echo "  <td nowrap bgcolor=\"ff0000\">";
    } else {
        echo "  <tr><td nowrap>";
    }
    echo "<input type=\"checkbox\" name=\"cbox_" . $run[$i]["number"] . "_" . $run[$i]["site"] . "\" />";
    echo " <a href=\"" . $runeditphp . "?runnumber=" . $run[$i]["number"] . "&runsitenumber=" . $run[$i]["site"] . "\">" . $run[$i]["number"] . "</a></td>\n";
예제 #9
0
//$loc = $_SESSION['loc'];
$loc = $locr = "../..";
require_once $locr . "/globals.php";
if (!ValidSession()) {
    InvalidSession($_SERVER['PHP_SELF']);
    ForceLoad($loc . "/index.php");
}
if ($_SESSION["usertable"]["usertype"] != "admin") {
    IntrusionNotify($_SERVER['PHP_SELF']);
    ForceLoad($loc . "/index.php");
}
require_once $locr . "/db.php";
require_once $locr . "/freport.php";
echo "<html><head><title>Report Page</title>\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
echo "<link rel=stylesheet href=\"{$loc}/Css.php\" type=\"text/css\">\n";
$contest = $_SESSION["usertable"]["contestnumber"];
if (($ct = DBContestInfo($contest)) == null) {
    ForceLoad($loc . "/index.php");
}
$site = $_SESSION["usertable"]["usersitenumber"];
if (($st = DBSiteInfo($contest, $site)) == null) {
    ForceLoad($loc . "/index.php");
}
echo "</head><body><table border=1 width=\"100%\">\n";
echo "<tr><td bgcolor=\"eeee00\" nowrap align=center>";
echo "<img src=\"{$loc}/images/smallballoontransp.png\" alt=\"\">";
echo "<font color=\"#ffffff\"><a href=\"http://www.ime.usp.br/~cassio/boca/\">BOCA</a></font>";
echo "</td><td bgcolor=\"#eeee00\" width=\"99%\">\n";
echo $ct["contestname"] . " - " . $st["sitename"] . "</td>\n";
echo "</tr></table>\n";
예제 #10
0
파일: files.php 프로젝트: joffilyfe/boca
        $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");
}
?>
<br>
<table width="100%" class="table table-striped">
 <tr>
  <td><b>Bkp #</b></td>
  <td><b>Time</b></td>
  <td><b>File</b></td>
 </tr>
<?php 
$run = DBUserBkps($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"], $_SESSION["usertable"]["usernumber"]);
for ($i = 0; $i < count($run); $i++) {
    echo " <tr>\n";
    echo "  <td nowrap><a href=\"javascript:conf2('files.php?delete=" . $run[$i]["number"] . "')\">" . $run[$i]["number"] . "</a></td>\n";
    echo "  <td nowrap>" . dateconvsimple($run[$i]["timestamp"]) . "</td>\n";
예제 #11
0
파일: answer.php 프로젝트: sbaldrich/boca
if (isset($_GET["delete"]) && is_numeric($_GET["delete"])) {
    $param["number"] = $_GET["delete"];
    if (!DBDeleteAnswer($_SESSION["usertable"]["contestnumber"], $param)) {
        MSGError('Error deleting answer');
        LogError('Error deleting answer');
    }
    ForceLoad("answer.php");
}
if (isset($_POST["Submit3"]) && isset($_POST["answernumber"]) && is_numeric($_POST["answernumber"]) && isset($_POST["answername"]) && $_POST["answername"] != "" && isset($_POST["answeryes"])) {
    if ($_POST["confirmation"] == "confirm") {
        $param["number"] = $_POST["answernumber"];
        $param["name"] = $_POST["answername"];
        $param["yes"] = $_POST["answeryes"];
        DBNewAnswer($_SESSION["usertable"]["contestnumber"], $param);
    }
    ForceLoad("answer.php");
}
?>
<br>
  <script language="javascript">
    function conf() {
      if (confirm("Confirm?")) {
        document.form1.confirmation.value='confirm';
      }
    }
    function conf2(url) {
      if (confirm("Confirm the DELETION of the ANSWER and ALL data associated to it (including the SUBMISSIONS)?")) {
		  if (confirm("Are you REALLY sure about what you are doing? DATA CANNOT BE RECOVERED!")) {
			  document.location=url;
		  } else {
			  document.location='answer.php';
예제 #12
0
파일: contest.php 프로젝트: sbaldrich/boca
        $param['active'] = $ac;
        $param['mainsite'] = $_POST["mainsite"];
        $param['localsite'] = $_POST["localsite"];
        $param['mainsiteurl'] = $_POST["mainsiteurl"];
        DBUpdateContest($param);
        if ($ac == 1 && $_POST["contest"] != $_SESSION["usertable"]["contestnumber"]) {
            $cf = globalconf();
            if ($cf["basepass"] == "") {
                MSGError("You must log in the new contest. The standard admin password is empty (if not changed yet).");
            } else {
                MSGError("You must log in the new contest. The standard admin password is " . $cf["basepass"] . " (if not changed yet).");
            }
            ForceLoad("../index.php");
        }
    }
    ForceLoad("contest.php?contest=" . $_POST["contest"]);
}
?>
<br>

<form name="form1" enctype="multipart/form-data" method="post" action="contest.php">
  <input type=hidden name="confirmation" value="noconfirm" />
  <script language="javascript">
    function conf() {
      if (confirm("Confirm?")) {
        document.form1.confirmation.value='confirm';
      }
    }
    function newcontest() {
      document.location='contest.php?new=1';
    }
예제 #13
0
파일: site.php 프로젝트: sbaldrich/boca
 </tr>
<?php 
                    foreach ($userlist as $user => $pass) {
                        echo "<tr><td>{$user}</td><td>{$pass}</td></tr>\n";
                    }
                    ?>
</table><br><br><u><b>TAKE NOTE OF THE USERS AND PASSWORDS AND KEEP THEM SECRET</b></u></center></body></html>
<?php 
                    exit;
                }
            } else {
                MSGError('File format not recognized');
            }
        }
    }
    ForceLoad("site.php");
}
?>
<br>
<form name="form1" enctype="multipart/form-data" method="post" action="site.php">
  <input type=hidden name="confirmation" value="noconfirm" />
  <script language="javascript" type="text/javascript">
    function conf() {
      if (confirm("Confirm?")) {
        document.form1.confirmation.value='confirm';
      }
    }
    function conf2() {
      if (confirm("Confirm DELETING EVERYTHING?")) {
		  if (confirm("This operation has no come back. DATA WILL BE LOST. Confirm?")) {
			  document.form1.confirmation.value='confirm';
예제 #14
0
파일: fcontest.php 프로젝트: sbaldrich/boca
function siteclock()
{
    if (($s = DBSiteInfo($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"])) == null) {
        ForceLoad("../index.php");
    }
    ///////CASO DE COMECAR MAIS TARDE NO CENTRALIZADO
    if (substr($_SESSION["usertable"]["username"], 0, 3) == 'XXX') {
        $s["currenttime"] = $s["currenttime"] - 60 * 10;
        // 10 minutos
    }
    if ($s["siteactive"] != "t") {
        return array("site is not active", -1000000000);
    }
    if (!$s["siterunning"]) {
        return array("contest not running", -1000000000);
    }
    if ($s["currenttime"] < 0) {
        $t = -$s["currenttime"];
        if ($t > 3600) {
            $t = (int) ($t / 360) / 10;
            return array("&gt; " . $t . " hour(s) to start", $s["currenttime"]);
        }
        if ($t > 60) {
            $t = (int) ($t / 60);
            return array("&gt; " . $t . " min(s) to start", $s["currenttime"]);
        } else {
            return array($t . " second(s) to start", $s["currenttime"]);
        }
    }
    if ($s["currenttime"] >= 0) {
        $t = $s["siteduration"] - $s["currenttime"];
        $str = '';
        if ($t >= 3600) {
            $str .= (int) ($t / 3600) . 'h ';
            $t = $t % 3600;
        }
        if ($t > 60) {
            $t = (int) ($t / 60);
            return array($str . $t . " min(s) left", $s["currenttime"]);
        } else {
            if ($str == '') {
                if ($t > 0) {
                    return array($t . " second(s) left", $s["currenttime"]);
                } else {
                    $t = (int) (-$t / 60);
                    return array($t . "min. of extra time", $s["currenttime"]);
                }
            } else {
                return array($str . " left", $s["currenttime"]);
            }
        }
    } else {
        return array("not started", -1000000000);
    }
}
예제 #15
0
파일: header.php 프로젝트: joffilyfe/boca
require_once "{$locr}/globals.php";
require_once "{$locr}/db.php";
if (!isset($_POST['noflush'])) {
    require_once "{$locr}/version.php";
    echo "<html><head><title>Admin's Page</title>\n";
    echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
    echo "<link rel=stylesheet href=\"{$loc}/Css2.php\" type=\"text/css\">\n";
}
//echo "<meta http-equiv=\"refresh\" content=\"60\" />";
if (!ValidSession()) {
    InvalidSession("admin/index.php");
    ForceLoad("{$loc}/index.php");
}
if ($_SESSION["usertable"]["usertype"] != "admin") {
    IntrusionNotify("admin/index.php");
    ForceLoad("{$loc}/index.php");
}
if (!isset($_POST['noflush'])) {
    echo "</head><body><table border=1 width=\"100%\">\n";
    echo "<tr><td nowrap bgcolor=\"eeee00\" align=center>";
    echo "<img src=\"../images/smallballoontransp.png\" alt=\"\">";
    echo "<font color=\"#000000\">BOCA</font>";
    echo "</td><td bgcolor=\"#eeee00\" width=\"99%\">\n";
    echo "Username: "******"usertable"]["userfullname"] . " (site=" . $_SESSION["usertable"]["usersitenumber"] . ")<br>\n";
    list($clockstr, $clocktype) = siteclock();
    echo "</td><td bgcolor=\"#eeee00\" align=center nowrap>&nbsp;" . $clockstr . "&nbsp;</td></tr>\n";
    echo "</table>\n";
    echo "<table border=0 width=\"100%\" align=center>\n";
    echo " <tr>\n";
    echo "  <td align=center><a class=menu style=\"font-weight:bold\" href=run.php>Runs</a></td>\n";
    echo "  <td align=center><a class=menu style=\"font-weight:bold\" href=score.php>Score</a></td>\n";
예제 #16
0
        } else {
            if (($ct = DBContestInfo($_SESSION["usertable"]["contestnumber"])) == null) {
                ForceLoad("index.php");
            }
            if ($ct["contestlocalsite"] == $ct["contestmainsite"]) {
                $main = true;
            } else {
                $main = false;
            }
            if (isset($_GET['action']) && $_GET['action'] == 'scoretransfer') {
                echo "SCORETRANSFER OK";
            } else {
                if ($main && $_SESSION["usertable"]["usertype"] == 'site') {
                    MSGError('Direct login of this user is not allowed');
                    unset($_SESSION["usertable"]);
                    ForceLoad("index.php");
                    exit;
                }
                echo "<script language=\"JavaScript\">\n";
                echo "document.location='" . $_SESSION["usertable"]["usertype"] . "/index.php';\n";
                echo "</script>\n";
            }
            exit;
        }
    }
} else {
    echo "<script language=\"JavaScript\">\n";
    echo "alert('Unable to load config files. Possible file permission problem in the BOCA directory.');\n";
    echo "</script>\n";
}
?>
예제 #17
0
        LOGError("Unable to download file (" . basename($fname) . ")");
        MSGError("Unable to download file (" . basename($fname) . ")");
        ForceLoad("index.php");
    }
    DB_lo_close($lo);
    DBExec($c, "commit work");
    DBClose($c);
} else {
    header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
    //header ("Content-type: application/octet-stream");
    //if (strstr($_SERVER["HTTP_USER_AGENT"], "MSIE"))
    //	header("Content-Disposition: filename=" .$_GET["filename"]); // For IE
    //else
    header("Content-Disposition: attachment; filename=" . basename($fname));
    if (($str = file_get_contents($fname)) === false) {
        header("Content-type: text/html");
        echo "<html><head><title>Download Page</title>";
        MSGError("Unable to open file (" . basename($fname) . ")");
        LOGError("Unable to open file (" . basename($fname) . ")");
        ForceLoad('index.php');
        exit;
    } else {
        header("Content-transfer-encoding: binary\n");
        header("Content-type: application/force-download");
        echo decryptData($str, $cf["key"]);
    }
    ob_end_flush();
}
예제 #18
0
파일: header.php 프로젝트: joffilyfe/boca
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n";
echo "<link rel=stylesheet href=\"../Css.php\" type=\"text/css\">\n";
?>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="/assets/bootstrap/css/bootstrap.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="/assets/bootstrap/js/bootstrap.min.js"></script>
<?php 
//echo "<meta http-equiv=\"refresh\" content=\"60\" />";
if (!ValidSession()) {
    InvalidSession("team/index.php");
    ForceLoad("../index.php");
}
if ($_SESSION["usertable"]["usertype"] != "team") {
    IntrusionNotify("team/index.php");
    ForceLoad("../index.php");
}
?>


<div class="container">
<!-- 	<nav class="navbar navbar-default">
		<div class="container-fluid">
			<div class="navbar-header">
				<a class="navbar-brand" href="/team/index.php">
					<span><img alt="BOCA" src="../images/smallballoontransp.png"> Boca</span>
				</a>
			</div>
			<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-4">
				<p class="navbar-text navbar-right">
					<?php 
예제 #19
0
//optionlower.php: parte de baixo da tela de option.php, que eh igual para
//			todos os usuarios
require_once "globals.php";
if (!ValidSession()) {
    InvalidSession("scoretable.php");
    ForceLoad("index.php");
}
$loc = $_SESSION['loc'];
if (isset($_GET["username"]) && isset($_GET["userfullname"]) && isset($_GET["userdesc"]) && isset($_GET["passwordo"]) && isset($_GET["passwordn"])) {
    $username = myhtmlspecialchars($_GET["username"]);
    $userfullname = myhtmlspecialchars($_GET["userfullname"]);
    $userdesc = myhtmlspecialchars($_GET["userdesc"]);
    $passwordo = myhtmlspecialchars($_GET["passwordo"]);
    $passwordn = myhtmlspecialchars($_GET["passwordn"]);
    DBUserUpdate($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"], $_SESSION["usertable"]["usernumber"], $_SESSION["usertable"]["username"], $userfullname, $userdesc, $passwordo, $passwordn);
    ForceLoad("option.php");
}
$a = DBUserInfo($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"], $_SESSION["usertable"]["usernumber"]);
?>

<script language="JavaScript" src="<?php 
echo $loc;
?>
/sha256.js"></script>
<script language="JavaScript" src="<?php 
echo $loc;
?>
/hex.js"></script>
<script language="JavaScript">
function computeHASH()
{