Example #1
0
function http_get_async($domain, $path)
{
    dump_log("global_helper,http_get_async", $domain, $path);
    $fp = fsockopen($domain, 80, $errno, $errstr, 30);
    if (!$fp) {
        echo "{$errstr} ({$errno})<br />\n";
    } else {
        $out = "GET {$path} HTTP/1.1\r\n";
        $out .= "Host: " . $domain . "\r\n";
        $out .= "Connection: Close\r\n\r\n";
        fwrite($fp, $out);
        fclose($fp);
    }
}
Example #2
0
include 'diag_logs_tabs.inc';
?>
                <div class="tab-content content-box col-xs-12">
                    <div class="container-fluid">
                        <?php 
$tab_group = 'proxy';
include 'diag_logs_pills.inc';
?>
                        <p><?php 
printf(gettext("Last %s Proxy log entries"), $nentries);
?>
</p>
                        <div class="table-responsive">
                            <table class="table table-striped table-sort">
                                <?php 
dump_log($logfile, $nentries);
?>
                            </table>
                        </div>
                        <form method="get">
                            <input name="clear" type="submit" class="btn" value="<?php 
echo gettext("Clear log");
?>
" />
                            <input name="type" type="hidden" value="<?php 
echo $type;
?>
" />
                        </form>
                    </div>
                </div>
Example #3
0
echo "<div class='text-center'>";
$title = TITLE_STRING;
echo "<div>";
echo "<a class='text-shadow-large'\n\t\t\t\tstyle='text-decoration: none;'\n\t\t\t\thref='index.php'>";
echo "{$title}";
echo "</a>";
echo "</div>";
echo "</div>";
if (isset($_GET["delete_log"])) {
    $fifo = fopen(FIFO_FILE, "w");
    fwrite($fifo, "delete_log");
    fclose($fifo);
    sleep(1);
    //			www-data cannot delete a pi /tmp file even if group write permission!
    //			unlink("$log_file");
}
$div_style = "overflow-y: scroll; height:{$n_log_scroll_pixels}px; overflow-x: auto; border:4px groove silver";
echo "<div style=\"{$div_style}\">";
//		echo '<div id="" style="overflow-y: scroll; height:770px; overflow-x: auto; border:4px groove silver">';
dump_log();
echo "<a id='anchor'></a>";
echo "</div>";
echo "<div style='margin-top:16px;'>";
echo "<a href='index.php' class='btn-control'\n\t\t\tstyle='margin-left:8px;'>\n\t\t\t{$title}</a>";
echo "<input type='button' value='Delete Log'\n\t\t\tclass='btn-control alert-control'\n\t\t\tstyle='margin-left:32px;'\n\t\t\tonclick='if (confirm(\"Delete Log File?\"))\n\t\t\t {window.location=\"log.php?delete_log\";}'>";
echo "</div>";
?>
    </div>
  </body>
</html>
Example #4
0
function get_extension_by_mimetype($mimetype)
{
    switch ($mimetype) {
        case "audio/amr":
            return "amr";
        case "audio/mp3":
            return "mp3";
        case "audio/x-speex-with-header-byte":
            dump_log(__METHOD__, "Voice Format is speex.");
            return "speex";
        default:
            return false;
    }
}