Exemplo n.º 1
0
    echo '<input type="hidden" name="userid" value="' . $userid . '">';
    //   		echo '<input type="hidden" name="userpwd" value="'.$_POST["userpwd"].'">';
    echo "<INPUT TYPE=\"SUBMIT\"  value=\"Expire It Now\"  id=\"ExpireItNowButton\">";
    echo '</FORM>';
    echo '</div>';
    //   		exit(-1);
} else {
    $filename = $dir . "analysis_result";
    if (file_exists($filename)) {
        echo "Analysis result generated at " . date("Y/n/j H:i:s.", filemtime($filename)) . "<br/><br/>";
    }
}
$filename = $dir . "time.report.final";
if (file_exists($filename)) {
    //$file = fopen($filename, "rt");
    $TR = LoadConfigFromFile($filename);
    $span = (int) $TR["time"][0];
    $timeout = (int) $TR["timeout"][0];
    $minute = (int) ($span / 60);
    $second = $span % 60;
    if ($timeout == 1) {
        echo "<font size=3 color=red>Analysis takes longer than expected. Process aborted !!!<br/><br/></font>";
    }
    echo "<font size=3 color=\"#9900CC\">time spent in analysis: {$minute} minutes {$second} seconds<br/><br/></font>";
    //fclose($file);
}
$filepath = $dir . "sha1.report.final";
if (file_exists($filepath)) {
    show_text_file($filepath);
}
echo "<br/>";
Exemplo n.º 2
0
    }
    return false;
}
////// Load config ////////////////
function LoadConfigFromFile($config_file)
{
    $CONFIG_SET = array();
    $file = fopen($config_file, "rt");
    if ($file != false) {
        while (!feof($file)) {
            $buf = fgets($file, 1024);
            if (strstr($buf, "=")) {
                $property = trim(strtok($buf, "="));
                $value_collection = strtok("=");
                $value = explode(",", $value_collection);
                for ($k = 0; $k < count($value); $k++) {
                    $value[$k] = trim($value[$k]);
                    $value[$k] = substr($value[$k], 1, strlen($value[$k]) - 2);
                }
                $CONFIG_SET[$property] = $value;
            }
        }
        fclose($file);
    }
    return $CONFIG_SET;
}
$CONFIG_SET = LoadConfigFromFile($config_file);
//var_dump($CONFIG_SET);
//var_dump(GetConfigValueList("deadline"));
//var_dump(GetConfigValueList("illegal_header"));
////////////////////////////