Exemple #1
0
<?php 
//error_reporting(0);
//include ("config.php");
include_once "account.php";
/*
if ( Authenticate($_POST["userid"], $_POST["userpwd"], $users)==FALSE && Authenticate("1000001", $_POST["userpwd"], $users)==FALSE) {
   echo "<font size=5 color=red>Account does not exist !</font></h1>";
   
   if (array_key_exists($_POST["userid"], $users) )
		mylog($_POST["userid"], "view result login faiulre");
   
	exit(-1);
}
*/
if (!CookieAuthenticate($userid, $user_name)) {
    echo "<h1><font size=5 color=red>You need to login first !</font></h1>";
    mylog($userid, "view result login faiulre");
    exit(-1);
}
$dir = $root_dir . $userid . "/current/";
//$user_name = $user;
echo "<font size=4 color=green>Submission Info for " . $userid . " {$user_name}<br/><br/></font></h1>";
// progress bar
echo '<iframe src="view_progress_bar/pg.php?id=' . $userid . '" width="100%" height=50 scrolling="no" frameborder="0" >		 </iframe>';
$queue_file = $queue_dir . "/" . $userid;
//	$timeout =  GetConfigValueList('child_process_timeout_seconds');
//	$timeout = (int)($timeout[0]);
if (file_exists($queue_file)) {
    echo '<div id="msg_still_running" style="display:block">';
    $st = filemtime($queue_file);
Exemple #2
0
    echo "Deadline is " . date('Y-n-j H:i:s', $tmDeadline) . "<br/><br/>";
    echo "Current time is " . date('Y-n-j H:i:s', $tmNow) . "<br/><br/>";
    echo "<br/><font color=red>Submission is now closed !</font><br/>";
    exit(-2);
}
//echo "檔案存放在Web伺服器上的位置 => ". $_FILES['userfile']['tmp_name'] ."<br/>";
echo "原始檔案名稱: " . $_FILES['userfile']['name'] . "<br/>";
echo "檔案大小 : " . $_FILES['userfile']['size'] . "<br/>";
echo "檔案型式 : " . $_FILES['userfile']['type'] . "<br/>";
echo "錯誤代碼 : " . $_FILES['userfile']['error'] . "<br/>";
?>
<hr>
<?php 
include_once "account.php";
//if ( Authenticate($_POST["userid"], $_POST["userpwd"], $users)==FALSE ) {
if (!CookieAuthenticate($id, $name)) {
    echo "<font size=5 color=red>Account does not exist !</font></h1>";
    mylog($id, "upload login faiulre");
    exit(-1);
}
///abort upload if something is still in queue
$queue_file = $queue_dir . "/" . $id;
if (isset($_POST["check_kill_job"])) {
    // kill existing job
    //		exec("$homework_inspector_executable  ". $id . "  ".$HW_NAME. "  kill", $dummy_output );
    proc_close(proc_open("{$homework_inspector_executable}  " . $id . "  " . $HW_NAME . "  kill", array(), $foo));
    //		sleep(3);
    unlink($queue_file);
}
if (file_exists($queue_file)) {
    $msg = sprintf("Error: a previous submission at %s is still running !", date("F j, Y H:i:s", filemtime($queue_file)));