本文整理匯總了PHP中MSGError函數的典型用法代碼示例。如果您正苦於以下問題:PHP MSGError函數的具體用法?PHP MSGError怎麽用?PHP MSGError使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MSGError函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: decryptData
function decryptData($crypttext, $key, $txt = '')
{
$crypttext = base64_decode($crypttext);
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC);
$test1 = '';
$test2 = 'x';
$clen = strlen($crypttext);
if ($clen > $iv_size) {
$iv = substr($crypttext, $clen - $iv_size, $iv_size);
$crypttext = substr($crypttext, 0, $clen - $iv_size);
$key = myhash($key . "123456789012345678901234567890");
// . myhash($key);
$decrypttext = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, substr(pack("H*", $key), 0, 32), $crypttext, MCRYPT_MODE_CBC, $iv);
$pos = strrpos($decrypttext, "#");
$iscompressed = false;
if (substr($decrypttext, $pos - 1, 1) == '@') {
$iscompressed = true;
}
$ll = strlen(myshorthash("x"));
$test2 = substr($decrypttext, $pos - 1 - $ll, $ll);
$decrypttext = substr($decrypttext, 0, $pos - 1 - $ll);
$test1 = myshorthash($decrypttext);
}
if ($test1 != $test2) {
if ($txt == '') {
MSGError("Decryption error -- contact an admin now (" . getFunctionName() . ")");
}
// LogError("Decryption error -- contact an admin, possibly password wrong (" . getFunctionName() .",$txt)");
return "";
}
if ($iscompressed) {
return unzipstr($decrypttext);
}
return $decrypttext;
}
示例2: zipstr
function zipstr($str)
{
if (!function_exists('gzcompress')) {
MSGError("Compression error -- zlib not installed (" . getFunctionName() . ")");
LogError("Compression error -- zlib not installed (" . getFunctionName() . ")");
}
return gzcompress($str . '#' . myshorthash($str));
}
示例3: header
header("Content-Disposition: attachment; filename=" . basename($dir . '.zip'));
ob_end_flush();
echo $str;
exit;
} else {
@unlink($tfile);
ob_end_flush();
MSGError('Could not write to temporary directory');
}
}
ForceLoad('problem.php');
}
if (isset($_POST["Submit3"]) && isset($_POST["problemnumber"]) && is_numeric($_POST["problemnumber"]) && isset($_POST["problemname"]) && $_POST["problemname"] != "") {
if (strpos(trim($_POST["problemname"]), ' ') !== false) {
$_POST["confirmation"] = '';
MSGError('Problem short name cannot have spaces');
} else {
if ($_POST["confirmation"] == "confirm") {
if ($_FILES["probleminput"]["name"] != "") {
$type = myhtmlspecialchars($_FILES["probleminput"]["type"]);
$size = myhtmlspecialchars($_FILES["probleminput"]["size"]);
$name = myhtmlspecialchars($_FILES["probleminput"]["name"]);
$temp = myhtmlspecialchars($_FILES["probleminput"]["tmp_name"]);
if (!is_uploaded_file($temp)) {
IntrusionNotify("file upload problem.");
ForceLoad("../index.php");
}
} else {
$name = "";
}
$param = array();
示例4: DBGiveUpRunAutojudging
}
}
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"] . "\" />";
示例5: myhtmlspecialchars
$number = myhtmlspecialchars($_POST["number"]);
// $notuser = myhtmlspecialchars($_POST["notifyuser"]);
// $updscore = myhtmlspecialchars($_POST["updatescore"]);
DBUpdateRun($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"], $_SESSION["usertable"]["usernumber"], $sitenumber, $number, $answer);
//, $notuser, $updscore);
}
ForceLoad("run.php");
}
if (!isset($_GET["runnumber"]) || !isset($_GET["runsitenumber"]) || !is_numeric($_GET["runnumber"]) || !is_numeric($_GET["runsitenumber"])) {
IntrusionNotify("tried to open the judge/runedit.php with wrong parameters.");
ForceLoad("run.php");
}
$runsitenumber = myhtmlspecialchars($_GET["runsitenumber"]);
$runnumber = myhtmlspecialchars($_GET["runnumber"]);
if (($a = DBGetRunToAnswer($runnumber, $runsitenumber, $_SESSION["usertable"]["contestnumber"])) === false) {
MSGError("Another judge got it first.");
ForceLoad("run.php");
}
$b = DBGetProblemData($_SESSION["usertable"]["contestnumber"], $a["problemnumber"]);
?>
<br><br><center><b>Use the following fields to judge the run:
</b></center>
<form name="form1" method="post" action="runedit.php">
<input type=hidden name="confirmation" value="noconfirm" />
<center>
<table border="1">
<tr>
<td width="27%" align=right><b>Site:</b></td>
<td width="83%">
<input type=hidden name="sitenumber" value="<?php
echo $a["sitenumber"];
示例6: DBNewUser
function DBNewUser($param, $c = null)
{
if (isset($param['contestnumber']) && !isset($param['contest'])) {
$param['contest'] = $param['contestnumber'];
}
if (isset($param['sitenumber']) && !isset($param['site'])) {
$param['site'] = $param['sitenumber'];
}
if (isset($param['usernumber']) && !isset($param['user'])) {
$param['user'] = $param['usernumber'];
}
if (isset($param['number']) && !isset($param['user'])) {
$param['user'] = $param['number'];
}
$ac = array('contest', 'site', 'user');
$ac1 = array('updatetime', 'username', 'usericpcid', 'userfull', 'userdesc', 'type', 'enabled', 'multilogin', 'pass', 'permitip', 'changepass', 'userip', 'userlastlogin', 'userlastlogout', 'usersession', 'usersessionextra');
$typei['contest'] = 1;
$typei['updatetime'] = 1;
$typei['site'] = 1;
$typei['user'] = 1;
foreach ($ac as $key) {
if (!isset($param[$key]) || $param[$key] == "") {
MSGError("DBNewUser param error: {$key} not found");
return false;
}
if (isset($typei[$key]) && !is_numeric($param[$key])) {
MSGError("DBNewUser param error: {$key} is not numeric");
return false;
}
${$key} = sanitizeText($param[$key]);
}
$username = "team" . $user;
$updatetime = -1;
$pass = null;
$usericpcid = '';
$userfull = '';
$userdesc = '';
$type = 'team';
$enabled = 'f';
$changepass = 'f';
$multilogin = 'f';
$permitip = '';
$usersession = null;
$usersessionextra = null;
$userip = null;
$userlastlogin = null;
$userlastlogout = null;
foreach ($ac1 as $key) {
if (isset($param[$key])) {
${$key} = sanitizeText($param[$key]);
if (isset($typei[$key]) && !is_numeric($param[$key])) {
MSGError("DBNewUser param error: {$key} is not numeric");
return false;
}
}
}
$t = time();
if ($updatetime <= 0) {
$updatetime = $t;
}
if ($type != "chief" && $type != "judge" && $type != "admin" && $type != "score" && $type != "staff" && $type != "site") {
$type = "team";
}
if ($type == "admin") {
$changepass = "t";
}
if ($enabled != "f") {
$enabled = "t";
}
if ($multilogin != "t") {
$multilogin = "f";
}
if ($changepass != "t") {
$changepass = "f";
}
$cw = false;
if ($c == null) {
$cw = true;
$c = DBConnect();
DBExec($c, "begin work", "DBNewUser(begin)");
}
DBExec($c, "lock table usertable", "DBNewUser(lock)");
$r = DBExec($c, "select * from sitetable where sitenumber={$site} and contestnumber={$contest}", "DBNewUser(get site)");
$n = DBnlines($r);
if ($n == 0) {
DBExec($c, "rollback work", "DBNewUser(no-site)");
MSGError("DBNewUser param error: site {$site} does not exist");
return false;
}
if ($pass != myhash("") && $type != "admin" && $changepass != "t") {
$pass = '!' . $pass;
}
$r = DBExec($c, "select * from usertable where username='{$username}' and usernumber!={$user} and " . "usersitenumber={$site} and contestnumber={$contest}", "DBNewUser(get user)");
$n = DBnlines($r);
$ret = 1;
if ($n == 0) {
$sql = "select * from usertable where usernumber={$user} and usersitenumber={$site} and " . "contestnumber={$contest}";
$a = DBGetRow($sql, 0, $c);
if ($a == null) {
$ret = 2;
//.........這裏部分代碼省略.........
示例7: ForceLoad
//INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
//PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER
//OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR
//CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
//PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
//OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
///////////////////////////////////////////////////////////////////////////////////////////
// created 14/June/2011 by cassio@ime.usp.br
require 'header.php';
if (($ct = DBContestInfo($_SESSION["usertable"]["contestnumber"])) == null) {
ForceLoad("../index.php");
}
if (($st = DBSiteInfo($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"])) == null) {
ForceLoad("../index.php");
}
$fn = tempnam("/tmp", "bkp-");
$fout = fopen($fn, "wb");
echo $_POST;
echo $_POST['data'];
fwrite($fout, base64_decode($_POST['data']));
fclose($fout);
$size = filesize($fn);
$name = $_POST['name'];
if ($size > $ct["contestmaxfilesize"] || strlen($name) > 100 || strlen($name) < 1) {
LOGLevel("User {$_SESSION["usertable"]["username"]} tried to submit file " . ":{$name}: with {$size} bytes.", 1);
MSGError("File size exceeds the limit allowed or invalid name.");
} else {
DBNewBkp($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"], $_SESSION["usertable"]["usernumber"], $name, $fn, $size);
}
@unlink($fn);
ForceLoad("../index.php");
示例8: decryptData
break;
}
if (isset($param['unlockkey']) && $param['unlockkey'] != '') {
$pass = decryptData(substr($key, 15), $param['unlockkey'], 'includekeys');
if (substr($pass, 0, 5) != '#####') {
MSGError('Invalid key in the file -- not importing any keys');
$dd = 0;
break;
}
}
$ar[$val] = $key;
$dd++;
}
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>
示例9: DBNewTask
$param['site'] = $_SESSION["usertable"]["usersitenumber"];
$param['user'] = $_SESSION["usertable"]["usernumber"];
$param['desc'] = "Staff assistance";
DBNewTask($param);
}
ForceLoad("task.php");
}
if (isset($_FILES["filename"]) && isset($_POST["Submit"]) && $_FILES["filename"]["name"] != "") {
if ($_POST["confirmation"] == "confirm") {
$type = myhtmlspecialchars($_FILES["filename"]["type"]);
$size = myhtmlspecialchars($_FILES["filename"]["size"]);
$name = myhtmlspecialchars($_FILES["filename"]["name"]);
$temp = myhtmlspecialchars($_FILES["filename"]["tmp_name"]);
if ($size > $ct["contestmaxfilesize"]) {
LOGLevel("User {$_SESSION["usertable"]["username"]} tried to print file " . "{$name} with {$size} bytes ({$ct["contestmaxfilesize"]} max allowed).", 1);
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");
示例10: DBNewProblem
function DBNewProblem($contestnumber, $param, $c = null)
{
if (isset($param["action"]) && $param["action"] == "delete") {
return DBDeleteProblem($contestnumber, $param);
}
$ac = array('number', 'name');
$type['number'] = 1;
$type['updatetime'] = 1;
$ac1 = array('colorname', 'fake', 'color', 'updatetime', 'fullname', 'basename', 'inputfilename', 'inputfilepath');
$colorname = '';
$color = '';
$fake = 'f';
foreach ($ac as $key) {
if (!isset($param[$key])) {
MSGError("DBNewProblem param error: {$key} is not set");
return false;
}
if (isset($type[$key]) && !is_numeric($param[$key])) {
MSGError("DBNewProblem param error: {$key} is not numeric");
return false;
}
${$key} = sanitizeText($param[$key]);
}
$basename = '';
$inputfilename = '';
$inputfilepath = '';
$fullname = '';
$updatetime = -1;
foreach ($ac1 as $key) {
if (isset($param[$key])) {
if (isset($type[$key]) && !is_numeric($param[$key])) {
MSGError("DBNewProblem param error: {$key} is not numeric");
return false;
}
${$key} = sanitizeText($param[$key]);
}
}
$t = time();
if ($updatetime <= 0) {
$updatetime = $t;
}
$inputhash = '';
$sql2 = "select * from problemtable where contestnumber={$contestnumber} and problemnumber={$number} for update";
// "select * from problemtable where contestnumber=$contestnumber and problemnumber=$number " .
// "and probleminputfilename='$inputfilename'";
$cw = false;
if ($c == null) {
$cw = true;
$c = DBConnect();
DBExec($c, "begin work", "DBNewProblem(transaction)");
}
$r = DBExec($c, $sql2, "DBNewProblem(get problem for update)");
$n = DBnlines($r);
$ret = 1;
$oldfullname = '';
$deservesupdatetime = false;
if ($n == 0) {
DBExec($c, "insert into problemtable (contestnumber, problemnumber, problemname, problemcolor) values " . "({$contestnumber}, {$number}, '{$name}','-1')", "DBNewProblem(insert problem)");
$deservesupdatetime = true;
$s = "created";
} else {
$lr = DBRow($r, 0);
$t = $lr['updatetime'];
$oldfullname = $lr['problemfullname'];
$s = "updated";
$inputhash = $lr['probleminputfilehash'];
}
if ($s == "created" || $updatetime > $t) {
if (substr($inputfilepath, 0, 7) != "base64:") {
if ($inputfilepath != "") {
$hash = myshorthash(file_get_contents($inputfilepath));
if ($hash != $inputhash) {
$oldoid = '';
if (isset($lr)) {
$oldoid = $lr['probleminputfile'];
}
if (($oid1 = DB_lo_import($c, $inputfilepath)) === false) {
DBExec($c, "rollback work", "DBNewProblem(rollback-input)");
LOGError("Unable to create a large object for file {$inputfilename}.");
MSGError("problem importing file to database. See log for details!");
exit;
}
if ($oldoid != '') {
DB_lo_unlink($c, $oldoid);
}
$inputhash = DBcrc($contestnumber, $oid1, $c);
} else {
$oid1 = $lr['probleminputfile'];
}
}
} else {
$inputfilepath = base64_decode(substr($inputfilepath, 7));
$hash = myshorthash($inputfilepath);
if ($hash != $inputhash) {
$oldoid = '';
if (isset($lr)) {
$oldoid = $lr['probleminputfile'];
}
if (($oid1 = DB_lo_import_text($c, $inputfilepath)) == null) {
DBExec($c, "rollback work", "DBNewProblem(rollback-i-import)");
//.........這裏部分代碼省略.........
示例11: DBNewBkp
function DBNewBkp($contest, $site, $user, $filename, $filepath, $size)
{
$c = DBConnect();
DBExec($c, "begin work", "DBNewBkp(transaction)");
DBExec($c, "lock table bkptable");
$sql = "select count(*) as n from " . "bkptable where sitenumber={$site} and contestnumber={$contest} and usernumber={$user} and bkpstatus='active'";
$r = DBExec($c, $sql, "DBNewBkp(get bkp of user)");
if (DBnlines($r) != 1) {
DBExec($c, "rollback work", "DBNewBkp(rollback-toomanyerror)");
LOGError("Error in bkp table. SQL=(" . $sql . ")");
MSGError("Error in bkp table.");
exit;
}
$a = DBRow($r, 0);
if ($a['n'] > 100) {
DBExec($c, "rollback work", "DBNewBkp(rollback-toomany)");
LOGError("Too many bkps from user={$user}, site={$site}, contest={$contest}.", 2);
MSGError("Too many bkp files. Try remove some of them before uploading another.");
return false;
}
$sql = "select max(bkpnumber) as nextbkp from " . "bkptable where sitenumber={$site} and contestnumber={$contest}";
$r = DBExec($c, $sql, "DBNewBkp(get bkp for update)");
if (DBnlines($r) != 1) {
DBExec($c, "rollback work", "DBNewBkp(rollback-max)");
LOGError("Error in bkp table. SQL=(" . $sql . ")");
MSGError("Error in bkp table.");
exit;
}
$a = DBRow($r, 0);
$t = time();
$n = $a["nextbkp"] + 1;
if (($oid = DB_lo_import($c, $filepath)) === false) {
DBExec($c, "rollback work", "DBNewBkp(rollback-import)");
LOGError("Unable to create a large object for file {$filepath}.");
MSGError("problem importing bkp to database. Contact an admin now!");
exit;
}
DBExec($c, "INSERT INTO bkptable (contestnumber, sitenumber, bkpnumber, usernumber, bkpdate, bkpfilename, bkpdata, bkpstatus, bkpsize) " . "VALUES ({$contest}, {$site}, {$n}, {$user}, {$t}, '{$filename}', {$oid}, 'active', {$size})", "DBNewBkp(insert bkp)");
DBExec($c, "commit work", "DBNewBkp(commit)");
LOGLevel("User {$user} submitted a bkp (#{$n}) on site #{$site} " . "(filename={$filename}, contest={$contest}).", 2);
/* // isso gera problemas de portabilidade e de seguranca (quando outros usuarios tambem tem shell
// no servidor e podem construir paginas web. Eles podem usar essas paginas para acessar esses arquivos,
// pois os mesmos ficaram com dono apache/www-data/etc)
umask(0077);
@mkdir("/tmp/boca");
if (!move_uploaded_file ($filepath,
"/tmp/boca/contest${contest}.site${site}.run${n}.user${user}.problem${problem}.time${t}.${filename}"))
LOGLevel("Run not saved as file (run=$n,site=$site,contest=$contest", 1);
*/
}
示例12: header
@unlink($dir . '.zip');
@unlink($tfile);
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-transfer-encoding: binary\n");
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=" . basename($dir . '.zip'));
ob_end_flush();
echo $str;
exit;
} else {
@unlink($tfile);
ob_end_flush();
MSGError('Could not write to temporary directory');
}
}
ForceLoad('problem.php');
}
if (isset($_POST["Submit3"]) && isset($_POST["problemnumber"]) && is_numeric($_POST["problemnumber"]) && isset($_POST["problemname"]) && $_POST["problemname"] != "") {
if ($_POST["confirmation"] == "confirm") {
if ($_FILES["probleminput"]["name"] != "") {
$type = myhtmlspecialchars($_FILES["probleminput"]["type"]);
$size = myhtmlspecialchars($_FILES["probleminput"]["size"]);
$name = myhtmlspecialchars($_FILES["probleminput"]["name"]);
$temp = myhtmlspecialchars($_FILES["probleminput"]["tmp_name"]);
if (!is_uploaded_file($temp)) {
IntrusionNotify("file upload problem.");
ForceLoad("../index.php");
}
示例13: DBNewAnswer
function DBNewAnswer($contest, $param, $c = null)
{
if (isset($param["action"]) && $param["action"] == "delete") {
return DBDeleteAnswer($contestnumber, $param, $c);
}
$ac = array('number', 'name', 'yes');
$type['number'] = 1;
foreach ($ac as $key) {
if (!isset($param[$key])) {
MSGError("DBNewAnswer param error: {$key} is not set");
return false;
}
${$key} = sanitizeText($param[$key]);
if (isset($type[$key]) && !is_numeric($param[$key])) {
MSGError("DBNewAnswer param error: {$key} is not numeric");
return false;
}
}
$t = time();
$updatetime = $t;
if (isset($param['updatetime']) && is_numeric($param["updatetime"])) {
$updatetime = $param["updatetime"];
}
if ($yes != "t") {
$y = "f";
} else {
$y = "t";
}
$cw = false;
if ($c == null) {
$cw = true;
$c = DBConnect();
DBExec($c, "begin work", "DBNewAnswer(transaction)");
}
$r = DBExec($c, "select * from answertable as a where a.contestnumber={$contest} and a.answernumber={$number} for update", "DBNewAnswer(get answer)");
$n = DBnlines($r);
$ret = 1;
if ($n == 0) {
$ret = 2;
DBExec($c, "insert into answertable (contestnumber, answernumber, runanswer, yes, updatetime) values " . "({$contest}, {$number}, '{$name}', '{$y}', {$t})", "DBNewAnswer(insert answer)");
if ($cw) {
DBExec($c, "commit work", "DBNewAnswer(commit)");
}
LOGLevel("Answer {$number} inserted (contest={$contest},user=" . $_SESSION["usertable"]["username"] . "/" . $_SESSION["usertable"]["usersitenumber"] . ")", 2);
} else {
$lr = DBRow($r, 0);
if ($updatetime > $lr['updatetime']) {
$ret = 2;
DBExec($c, "update answertable set runanswer='{$name}', yes='{$y}', updatetime=" . $updatetime . " where " . "contestnumber={$contest} and answernumber={$number} and fake='f'", "DBNewAnswer(update answer)");
if ($cw) {
DBExec($c, "commit work", "DBNewAnswer(commit)");
}
LOGLevel("Answer {$number} updated (contest={$contest},user=" . $_SESSION["usertable"]["username"] . "/" . $_SESSION["usertable"]["usersitenumber"] . ")", 2);
} else {
if ($cw) {
DBExec($c, "commit work", "DBNewAnswer(commit)");
}
}
}
return $ret;
}
示例14: cleardir
}
cleardir($webcastdir);
@mkdir($webcastdir);
if (is_writable($webcastdir)) {
file_put_contents($webcastdir . $ds . 'runs', $runfile);
file_put_contents($webcastdir . $ds . 'contest', $contestfile);
file_put_contents($webcastdir . $ds . 'version', $versionfile);
file_put_contents($webcastdir . $ds . 'time', $timefile);
if (@create_zip($webcastparentdir, array('webcast'), $webcastdir . ".tmp") != 1) {
LOGError("Cannot create score webcast.tmp file");
MSGError("Cannot create score webcast.tmp file");
} else {
$cf = globalconf();
file_put_contents($webcastdir . ".tmp", encryptData(file_get_contents($webcastdir . ".tmp"), $cf["key"], false));
@rename($webcastdir . ".tmp", $webcastdir . '.zip');
}
echo "<br><br><br><center>";
echo "<a href=\"{$locr}/filedownload.php?" . filedownload(-1, $webcastdir . '.zip') . "\">CLICK TO DOWNLOAD</a>";
echo "</center>";
} else {
LOGError('Error creating the folder for the ZIP file: ' . $webcastdir);
MSGError('Error creating the folder for the ZIP file: ' . $webcastdir);
ForceLoad("../index.php");
}
echo "<br><br><br>\n";
echo "<br><br><br>\n";
echo "<br><br><br>\n";
echo "<br><br><br>\n";
echo "<br><br><br>\n";
echo "<br><br><br>\n";
include "{$locr}/footnote.php";
示例15: IntrusionNotify
function IntrusionNotify($where)
{
$msg = "Security Violation: {$where}";
if (isset($_SESSION["usertable"]["username"])) {
$msg .= " (" . $_SESSION["usertable"]["username"] . "/" . $_SESSION["usertable"]["usersitenumber"] . ")";
}
unset($_SESSION["usertable"]);
LOGLevel($msg, 1);
MSGError("Violation ({$where}). Admin warned.");
}