Пример #1
0
    } else {
        echo base64_encode(serialize(array()));
    }
    exit;
}
if (!$redo) {
    $conf = globalconf();
    $strtmp = decryptData(substr($strtmp, strpos($strtmp, "\n")), $conf["key"], 'score');
    if ($strtmp == "") {
        $redo = TRUE;
    }
}
if ($redo) {
    $strtmp = "<script language=\"JavaScript\" src=\"" . $loc . "/hide.js\"></script>\n";
    $pr = DBGetProblems($_SESSION["usertable"]["contestnumber"]);
    $ct = DBGetActiveContest();
    $contest = $ct['contestnumber'];
    $duration = $ct['contestduration'];
    if (!isset($hor)) {
        $hor = -1;
    }
    if ($hor > $duration) {
        $hor = $duration;
    }
    $level = $s["sitescorelevel"];
    if ($level <= 0) {
        $level = -$level;
    } else {
        $des = true;
    }
    if (($s = DBSiteInfo($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"])) == null) {
Пример #2
0
}
if ($ds == '/') {
    system("find {$basdir} -user bocajail -delete >/dev/null 2>/dev/null");
    system("find {$basdir} -user nobody -delete >/dev/null 2>/dev/null");
    system("find {$basdir} -group users -exec chgrp root '{}' \\; 2>/dev/null");
    system("find {$basdir} -perm /1002 -type d > /tmp/boca.writabledirs.tmp 2>/dev/null");
    system('chmod 400 /tmp/boca.writabledirs.tmp 2>/dev/null');
}
umask(022);
$cache = $tmpdir . $ds . "bocacache.d";
cleardir($cache);
@mkdir($cache);
$key = md5(mt_rand() . rand() . mt_rand());
$cf = globalconf();
$ip = $cf["ip"];
$activecontest = DBGetActiveContest();
$prevsleep = 0;
//$dodebug=1;
while (42) {
    if (($run = DBGetRunToAutojudging($activecontest["contestnumber"], $ip)) === false) {
        if ($prevsleep == 0) {
            echo "Nothing to do. Sleeping...";
        } else {
            echo ".";
        }
        flush();
        sleep(10);
        $prevsleep = 1;
        continue;
    }
    if (!isset($dodebug)) {