当前位置: 首页>>代码示例>>PHP>>正文


PHP senderror函数代码示例

本文整理汇总了PHP中senderror函数的典型用法代码示例。如果您正苦于以下问题:PHP senderror函数的具体用法?PHP senderror怎么用?PHP senderror使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了senderror函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: errorHandler

function errorHandler($errno, $errstr, $errfile, $errline)
{
    if (!(error_reporting() & $errno)) {
        // This error code is not included in error_reporting
        return;
    }
    switch ($errno) {
        case E_USER_ERROR:
            $error = "<b>My ERROR</b> [{$errno}] {$errstr}<br />\n\n                  Fatal error on line {$errline} in file {$errfile}\n                  , PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
            echo $error;
            senderror($error);
            echo 'Aborting...<br />\\n';
            exit(1);
            break;
        default:
            $error = "Unknown error type: [{$errno}] \"{$errstr}\" in file \"{$errfile}\" on line {$errline}<br />\n";
            senderror($error);
            Controller::render('500');
            Controller::finish();
            //echo 'Aborting...<br />\n';
            exit(1);
            break;
    }
    /* Don't execute PHP internal error handler */
    return true;
}
开发者ID:davidliuliuliu,项目名称:sublite,代码行数:26,代码来源:error.php

示例2: page

function page()
{
    $commonName = $_GET["CommonName"];
    $page = CurrentPageName();
    $q = new mysql();
    $tpl = new templates();
    $sql = "SELECT `privkey`,`Squidkey`,`UsePrivKeyCrt` FROM sslcertificates WHERE CommonName='{$commonName}'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    $keyfield = "privkey";
    if ($ligne["UsePrivKeyCrt"] == 0) {
        $keyfield = "Squidkey";
    }
    $upload_text = $tpl->_ENGINE_parse_body("{upload_content}");
    $t = $_GET["t"];
    if (!is_numeric($t)) {
        $t = time();
    }
    if (!$q->ok) {
        senderror($q->mysql_error);
    }
    $tt = time();
    $CommonNameURL = urlencode("{$commonName}");
    $button_upload = button("{$upload_text}", "Loadjs('certificates.center.upload.php?certificate-upload-js=yes&CommonName={$CommonNameURL}&type=privkey&t={$_GET["t"]}&textid=text{$t}&RunAfter=VerifyCertificate{$tt}',true)", 20);
    $button_extract = $tpl->_ENGINE_parse_body(button("{info}", "Loadjs('{$page}?certificate-info-privkey-js=yes&CommonName={$CommonNameURL}&type=crt&t={$_GET["t"]}&textid=crt{$tt}',true)", 20));
    $button_save = $tpl->_ENGINE_parse_body(button("{apply}", "Save{$tt}()", 20));
    if ($ligne["UsePrivKeyCrt"] == 0) {
        $button_upload = null;
        $button_save = null;
    }
    $ssl_explain = $tpl->_ENGINE_parse_body("{privkey_ssl_explain}");
    $html = "\n\t\n<div class=explain style='font-size:18px'>{$ssl_explain}</div>\n<center>{$button_upload}&nbsp;{$button_extract}</center>\n<div id='verify-{$tt}'></div>\n\t<center style='margin:10px'>\n\t\t<textarea id='text{$t}' style='font-family:Courier New;\n\t\tfont-weight:bold;width:100%;height:520px;border:5px solid #8E8E8E;\n\t\toverflow:auto;font-size:16px !important;width:99%;height:390px'>{$ligne[$keyfield]}</textarea>\n\t\t<br>{$button_save}\n\t\t</center>\n\t\t</div>\n\t\n<script>\nvar xSave{$tt}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;};\n\t\$('#TABLE_CERTIFICATE_CENTER_MAIN').flexReload();\n\tVerifyCertificate{$tt}();\n}\n\t\nfunction Save{$tt}(CommonName,md5){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('certificate_edit_privkey_save','{$commonName}');\n\tXHR.appendData('certificate_content',encodeURIComponent(document.getElementById('text{$t}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$tt});\n}\n\t\nfunction VerifyCertificate{$tt}(){\n\tLoadAjax('verify-{$tt}','{$page}?verify-privkey=yes&CommonName={$CommonNameURL}',true);\n}\nVerifyCertificate{$tt}();\n</script>\n\t";
    echo $html;
}
开发者ID:articatech,项目名称:artica,代码行数:33,代码来源:certificates.center.privkey.php

示例3: errorHandler

function errorHandler($errno, $errstr, $errfile, $errline)
{
    if (!(error_reporting() & $errno)) {
        // This error code is not included in error_reporting
        return;
    }
    function senderror($error)
    {
        $session = $_SESSION;
        unset($session['pass']);
        $m = array2str(array('errormsg' => $error, 'session' => array2str($session, " &nbsp; &nbsp; %s = '%s'"), 'server' => array2str($_SERVER, " &nbsp; &nbsp; %s = '%s'"), 'request' => array2str($_REQUEST, " &nbsp; &nbsp; %s = '%s'")));
        sendgmail(array('tony.jiang@yale.edu', 'qingyang.chen@gmail.com'), "info@sublite.net", 'SubLite Error Report', $m);
        //echo "Error report sent!<br />\n";
    }
    switch ($errno) {
        case E_USER_ERROR:
            $error = "<b>My ERROR</b> [{$errno}] {$errstr}<br />\n\n                  Fatal error on line {$errline} in file {$errfile}\n                  , PHP " . PHP_VERSION . " (" . PHP_OS . ")<br />\n";
            echo $error;
            senderror($error);
            echo 'Aborting...<br />\\n';
            exit(1);
            break;
        default:
            $error = "Unknown error type: [{$errno}] \"{$errstr}\" in file \"{$errfile}\" on line {$errline}<br />\n";
            Controller::render('500');
            Controller::finish();
            senderror($error);
            //echo 'Aborting...<br />\n';
            exit(1);
            break;
    }
    /* Don't execute PHP internal error handler */
    return true;
}
开发者ID:edwardshe,项目名称:sublite-1,代码行数:34,代码来源:error.php

示例4: checkGPIOPin

function checkGPIOPin($gpio, $pin)
{
    if (!in_array($pin, $gpio->GPIO_AVAILABLE)) {
        senderror(403, "GPIO {$pin} Not Available");
    }
    if (in_array($pin, $gpio->getALTPins())) {
        senderror(403, "GPIO {$pin} Disabled");
    }
}
开发者ID:rogeros,项目名称:webiopi,代码行数:9,代码来源:webiopi.php

示例5: certificate_edit_csr_verify

function certificate_edit_csr_verify()
{
    $CommonName = $_GET["CommonName"];
    $q = new mysql();
    $sql = "SELECT `csr` FROM sslcertificates WHERE CommonName='{$CommonName}'";
    $t = $_GET["t"];
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    if (!$q->ok) {
        senderror($q->mysql_error);
        return;
    }
    $tt = time();
    if (strlen($ligne["csr"]) < 50) {
        $sock = new sockets();
        $CommonName = urlencode($CommonName);
        echo base64_decode($sock->getFrameWork("system.php?BuildCSR={$CommonName}"));
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    }
    $filepath = dirname(__FILE__) . "/ressources/conf/upload/Cert.csr";
    @file_put_contents($filepath, $ligne["csr"]);
    exec("/usr/bin/openssl req -text -noout -verify -verbose -in {$filepath} 2>&1", $results);
    $INFO = array();
    $class = "text-info";
    $f[] = "File: {$filepath} " . strlen($ligne["csr"]) . " bytes";
    while (list($num, $ligne) = each($results)) {
        if (preg_match("#[0-9]+:error:[0-9A-Z]+:PEM routines:#", $ligne)) {
            $class = "text-error";
        }
        if (preg_match("#unable to load#", $ligne)) {
            $class = "text-error";
        }
        if (preg_match("#Subject:(.*)#", $ligne)) {
            $INFO[] = $ligne;
        }
        if (preg_match("#verify OK#i", $ligne)) {
            $INFO[] = $ligne;
        }
        $ligne = str_replace($filepath, "Info", $ligne);
        $ligne = htmlentities($ligne);
        $f[] = "{$ligne}";
    }
    if ($class == "text-error") {
        echo "<p class='{$class}' style='font-size:18px'>" . @implode("<br>", $f) . "</p><script>UnlockPage();</script>";
    } else {
        echo "<p class='{$class}' style='font-size:18px'>" . @implode("<br>", $INFO) . "</p><script>UnlockPage();</script>";
    }
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:47,代码来源:certificates.center.csr.php

示例6: section_tab

function section_tab()
{
    $boot = new boostrap_form();
    $users = new usersMenus();
    $callback = urlencode($_GET["CallBack"]);
    if (!$users->AsAnAdministratorGeneric) {
        senderror("no privs");
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $array["{members} LDAP"] = "{$page}?section-search-ldap=yes&CallBack={$callback}";
    $ldap = new clladp();
    if ($ldap->IsKerbAuth()) {
        $array["{members} Active Directory"] = "{$page}?section-search-ad=yes&CallBack={$callback}";
    }
    echo $boot->build_tab($array);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:17,代码来源:miniadm.members.browse.php

示例7: search

function search()
{
    if (!CheckRights()) {
        senderror("{ERROR_NO_PRIVS}");
    }
    $boot = new boostrap_form();
    $sock = new sockets();
    $users = new usersMenus();
    $maillog_path = $users->maillog_path;
    $tpl = new templates();
    $t = time();
    $query = base64_encode($_GET["search"]);
    if (!is_numeric($_POST["rp"])) {
        $_POST["rp"] = 500;
    }
    $array = unserialize(base64_decode($sock->getFrameWork("postfix.php?query-maillog=yes&filter={$query}&maillog={$maillog_path}&rp={$_POST["rp"]}&zarafa-filter={$_GET["zarafa-filter"]}&mimedefang-filter={$_GET["mimedefang-filter"]}")));
    $array = explode("\n", @file_get_contents("/usr/share/artica-postfix/ressources/logs/web/query.mail.log"));
    krsort($array);
    $zDate = $tpl->_ENGINE_parse_body("{zDate}");
    $hostTXT = $tpl->_ENGINE_parse_body("{host}");
    $serviceTXT = $tpl->_ENGINE_parse_body("{servicew}");
    $eventsTXT = $tpl->_ENGINE_parse_body("{events}");
    while (list($index, $line) = each($array)) {
        $lineenc = base64_encode($line);
        if (preg_match("#^[a-zA-Z]+\\s+[0-9]+\\s+([0-9\\:]+)\\s+(.+?)\\s+(.+?)\\[([0-9]+)\\]:(.+)#", $line, $re)) {
            $date = "{$re[1]}";
            $host = $re[2];
            $service = $re[3];
            $pid = $re[4];
            $line = $re[5];
        }
        $class = LineToClass($line);
        $img = statusLogs($line);
        $loupejs = "ZoomEvents('{$lineenc}')";
        $trSwitch = $boot->trswitch("blur()");
        $tr[] = "\n\t\t<tr id='{$id}' class={$class} {$trSwitch}>\n\t\t<td style='font-size:12px' {$trSwitch} width=1% nowrap><i class='icon-time'></i>&nbsp;{$date}</td>\n\t\t<td style='font-size:12px' nowrap {$trSwitch} width=1% nowrap><i class='icon-arrow-right'></i>&nbsp;{$host}</td>\n\t\t<td style='font-size:12px' nowrap {$trSwitch} width=1% nowrap>{$service}</td>\n\t\t<td style='text-align:center;font-size:12px' width=1% nowrap>{$pid}</td>\n\t\t<td style='text-align:center;font-size:12px' width=1% nowrap><img src='{$img}'></td>\n\t\t<td style='font-size:12px' nowrap {$trSwitch} width=99% nowrap>{$line}</td>\n\t\t</tr>";
    }
    echo $tpl->_ENGINE_parse_body("\n\t\n\t\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{$zDate}</th>\n\t\t\t\t\t<th>{$hostTXT}</th>\n\t\t\t\t\t<th>{$serviceTXT}</th>\n\t\t\t\t\t<th>PID</th>\n\t\t\t\t\t<th colspan=2>{$eventsTXT}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t") . @implode("\n", $tr) . " </tbody>\n\t\t\t\t</table>\n\t\t\t\t<script>\n\n\t</script>\n\t";
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:39,代码来源:miniadmin.postfix.events.php

示例8: add_user_popup

function add_user_popup()
{
    $ldap = new clladp();
    if ($_GET["ou"] == null) {
        senderror("{ERROR_NO_ORGANISATION_SELECTED}");
    }
    $hash = $ldap->hash_groups($_GET["ou"], 1);
    $domains = $ldap->hash_get_domains_ou($_GET["ou"]);
    $boot = new boostrap_form();
    $boot->set_hidden("ou", $_GET["ou"]);
    $boot->set_hidden("encpass", 1);
    $boot->set_field("new_userid", "{name_the_new_account_title}", null, array("MANDATORY" => true));
    $boot->set_field("password", "{password}", null, array("MANDATORY" => true));
    $boot->set_field("email", "{email}", null, array("MANDATORY" => true));
    $boot->set_field("password", "{password}", null, array("MANDATORY" => true, "ENCODE" => true));
    $boot->set_list("group_id", "{group}", $hash);
    $boot->set_button("{add}");
    $boot->set_CloseYahoo("YahooWin2");
    $boot->set_RefreshSearchs();
    $boot->setAjaxPage("domains.edit.user.php");
    $boot->set_formtitle("{$_GET["ou"]}:: {new_member}");
    echo $boot->Compile();
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:23,代码来源:miniadmin.members.php

示例9: squid_cache_status

function squid_cache_status()
{
    $sock = new sockets();
    $DisableAnyCache = $sock->GET_INFO("DisableAnyCache");
    if (!is_numeric($DisableAnyCache)) {
        $DisableAnyCache = 0;
    }
    if ($DisableAnyCache == 1) {
        return;
    }
    $page = CurrentPageName();
    $squid = new squidbee();
    $tpl = new templates();
    $t = time();
    $q = new mysql_squid_builder();
    $exec_squid_rebuild_cache_mem = unserialize(base64_decode($sock->getFrameWork("squid.php?exec_squid_rebuild_cache_mem=yes")));
    if (isset($exec_squid_rebuild_cache_mem["PID"])) {
        if ($exec_squid_rebuild_cache_mem["PID"] > 0) {
            $datas = @file_get_contents("ressources/logs/web/rebuild-cache.txt");
            $tt = time();
            $html = "\n\t\t\t\t<div style='width:100%;text-align:right'>" . imgtootltip("refresh-32.png", "{refresh}", "LoadAjax('squid-caches-status','{$page}?squid-caches-status=yes&uuid={$_GET["uuid"]}');") . "</div>\n\t\t\t\t<table style='width:99%' class=form>\n\t\t\t\t<tr>\n\t\t\t\t\t<td width=1%><img src='img/wait_verybig_mini_red-48.gif'></td>\n\t\t\t\t\t<td style='font-size:16px'>{exec_squid_rebuild_cache_mem}</div>\n\t\t\t\t\t\t<div style='font-size:14px;font-weight:bold'>{pid}:{$exec_squid_rebuild_cache_mem["PID"]}, {since} {$exec_squid_rebuild_cache_mem["TIME"]}</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\t\n\t\t\t\t\t\n\t\t\t\t";
            $tb = array();
            $tb = explode("\n", $datas);
            krsort($tb);
            if (strlen($datas) > 100) {
                $html = $html . "<textarea style='margin-top:5px;font-family:Courier New;\n\tfont-weight:bold;width:100%;height:520px;border:5px solid #8E8E8E;overflow:auto;font-size:11.5px'\n\tid='textarea{$t}'>" . @implode("\n", $tb) . "</textarea>";
            }
            echo $tpl->_ENGINE_parse_body($html);
            return;
        }
    }
    $sql = "SELECT * FROM cachestatus WHERE uuid='{$_GET["uuid"]}'";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        senderror($q->mysql_error . "<br>{$sql}");
    }
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $strong = "<strong style='font-size:14px'>";
        if (basename($ligne["cachedir"]) == "cache_booster") {
            $strong = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.booster.php')\" style='font-size:14px;text-decoration:underline;font-weight:bold'>";
        }
        $delete = imgtootltip("disk-64-delete.png", "{delete_cache}", "squid32DeleteCache('" . base64_encode($ligne["cachedir"]) . "')");
        $NICKEL[$ligne["cachedir"]] = true;
        if ($ligne["cachedir"] == $squid->CACHE_PATH) {
            $cache_type = $squid->CACHE_TYPE;
            $delete = imgtootltip("disk-64-config.png", "{apply}", "Loadjs('{$page}?add-new-disk-js=yes&chdef=yes')");
        } else {
            $cache_type = $squid->cache_list[$ligne["cachedir"]]["cache_type"];
        }
        if ($ligne["cachedir"] != $squid->CACHE_PATH) {
            if (!isset($squid->cache_list[$ligne["cachedir"]])) {
                $delete = "<img src='img/disk-64-hide.png'>";
            }
        }
        $html = $html . "\n\t\t\t\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=1%>{$delete}</td>\n\t\t\t\t<td valign='top'>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=top>{$strong}" . basename($ligne["cachedir"]) . "&nbsp;({$cache_type})</strong></a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'><strong style='font-size:14px'>" . FormatBytes($ligne["currentsize"]) . "/" . FormatBytes($ligne["maxsize"]) . "</strong><div>{$ligne["cachedir"]}</div></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'>" . pourcentage($ligne["pourc"]) . "</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>";
    }
    while (list($path, $array) = each($squid->cache_list)) {
        if (isset($NICKEL[$path])) {
            continue;
        }
        $unit = "&nbsp;MB";
        $maxcachesize = null;
        if ($array["cache_type"] == "rock") {
            $maxcachesize = "&nbsp;({max_objects_size} {$array["cache_maxsize"]}{$unit})";
        }
        if (is_numeric($array["cache_size"])) {
            if ($array["cache_size"] > 1000) {
                $array["cache_size"] = $array["cache_size"] / 1000;
                $unit = "&nbsp;GB";
            }
        }
        if ($array["cache_type"] == "rock") {
            continue;
        }
        $html = $html . "\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/disk-64-hide.png'></td>\n\t\t\t\t<td valign='top'>\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign=top>{$strong}" . basename($path) . " ({$array["cache_type"]})</strong></a></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'><strong style='font-size:14px'>{$array["cache_size"]}{$unit}/{$maxcachesize}</strong><div>{$path}</div></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td valign='top'>&nbsp;</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t</tbody>\n\t\t\t</table>";
    }
    $html = $html . "\n\t<div style='width:100%;text-align:right'>" . imgtootltip("refresh-32.png", "{refresh}", "LoadAjax('squid-caches-status','{$page}?squid-caches-status=yes&uuid={$_GET["uuid"]}');") . "</div>\n\t\n\t<script>\n\t\tfunction Squid32RefreshCacheStatusAuto{$t}(){\n\t\t\tif(document.getElementById('squid-caches-status')){\n\t\t\t\tLoadAjax('squid-caches-status','{$page}?squid-caches-status=yes&uuid={$_GET["uuid"]}');\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\tsetTimeout('Squid32RefreshCacheStatusAuto{$t}',10000);\n\t\t\n\t</script>\n\t\n\n\t\t\n\t\n\t";
    $sock = new sockets();
    $sock->getFrameWork("squid.php?refresh-caches-infos=yes");
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:81,代码来源:squid.caches32.php

示例10: section_blocked_realtime_search

function section_blocked_realtime_search()
{
    $_GET["section-blocked-realtime-search"] = url_decode_special_tool($_GET["section-blocked-realtime-search"]);
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    if (!isset($_GET["rp"])) {
        $_GET["rp"] = 350;
    }
    if ($_GET["section-blocked-realtime-search"] != null) {
        $search = base64_encode($_GET["section-blocked-realtime-search"]);
        $datas = unserialize(base64_decode($sock->getFrameWork("squid.php?ufdbguard-logs={$search}&rp={$_GET["rp"]}")));
        if (count($datas) == 0) {
            senderror("no data");
        }
        $total = count($datas);
    } else {
        $datas = unserialize(base64_decode($sock->getFrameWork("squid.php?ufdbguard-logs=&rp={$_GET["rp"]}")));
        if (count($datas) == 0) {
            senderror("no data");
        }
        $total = count($datas);
    }
    $boot = new boostrap_form();
    $q2 = new mysql();
    $t = time();
    while (list($ID, $line) = each($datas)) {
        if (!preg_match('#(.+?)\\s+\\[(.+?)\\]\\s+(.+)#', $line, $re)) {
            continue;
        }
        $color = "black";
        $date = $re[1];
        $pid = $re[2];
        $event = $re[3];
        if (!preg_match("#^BLOCK\\s+(.*?)\\s+(.*?)\\s+(.*?)\\s+(.*?)\\s+(.*?)\\s+[A-Z]+#", $event, $re)) {
            continue;
        }
        $account = $re[1];
        $group = $re[2];
        $category = $re[4];
        $rule = $re[3];
        $uri = $re[5];
        $sitename = null;
        $js = null;
        $unblock = null;
        if (preg_match("#^art(.+)#", $category, $re)) {
            $category = CategoryCodeToCatName($category);
            $CATEGORY_PLUS_TXT = "Artica Database";
        }
        if (preg_match("#^tls(.+)#", $category, $re)) {
            $category = CategoryCodeToCatName($category);
            $CATEGORY_PLUS_TXT = "Toulouse University Database";
        }
        $URLAR = parse_url($uri);
        if (isset($URLAR["host"])) {
            $sitename = $URLAR["host"];
        }
        if (preg_match("#^(.*?):[0-9]+\$#", $sitename, $re)) {
            $sitename = $re[1];
        }
        if (preg_match("#^www\\.(.*?)\$#", $sitename, $re)) {
            $sitename = $re[1];
        }
        if ($sitename != null) {
            $js = "Loadjs('squid.categories.php?category={$category}&website={$sitename}',true)";
            $link = $boot->trswitch($js);
            $unblock = imgsimple("whitelist-24.png", null, "UnBlockWebSite{$t}('{$sitename}')");
            $ligne3 = mysql_fetch_array($q2->QUERY_SQL("SELECT items FROM urlrewriteaccessdeny WHERE items='{$sitename}'", "artica_backup"));
        }
        if (!$q2->ok) {
            $unblock = "<img src='img/icon_err.gif'><br>{$q2->mysql_error}";
        } else {
            if ($ligne3["items"] != null) {
                $unblock = imgsimple("20-check.png", null, null);
            }
        }
        $strlen = strlen($uri);
        $uriT = wordwrap($uri, 100, "\n", true);
        $uriT = htmlentities($uriT);
        $uriT = nl2br($uriT);
        $uriT = str_replace($sitename, "<a href=\"javascript:blur()\"\n\t\t\t\tOnClick=\"javascript:Loadjs('miniadm.webstats.familysite.all.php?familysite={$sitename}');\"\n\t\t\t\tstyle='text-decoration:underline;color:{$color}'>{$sitename}</a>", $uriT);
        $tr[] = "<tr>\n\t\t<td nowrap style='font-size:14px' width=1% nowrap>{$date}</td>\n\t\t<td style='font-size:14px' width=1% nowrap>{$pid}</td>\n\t\t<td style='font-size:14px' width=1% nowrap>{$category}<div style='font-size:11px'>{$CATEGORY_PLUS_TXT}</div></td>\n\t\t<td style='font-size:14px' width=1% nowrap>{$account}/{$group}</td>\n\t\t<td style='font-size:14px' width=1% nowrap>{$rule}</td>\n\t\t<td style='font-size:14px'>{$uriT}</td>\n\t\t<td style='font-size:14px' width=1% nowrap>{$unblock}</td>\n\t\t</tr>\n\t\t";
    }
    $tpl = new templates();
    $UnBlockWebSiteExplain = $tpl->javascript_parse_text("{UnBlockWebSiteExplain}");
    echo $tpl->_ENGINE_parse_body("<table class='table table-bordered'>\n\t\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t<th>{date}</th>\n\t\t\t<th>PID</th>\n\t\t\t<th>{category}</th>\n\t\t\t<th>{member}</th>\n\t\t\t<th nowrap>{rulename}</th>\n\t\t\t<th>{url}</th>\n\t\t\t<th>&nbsp;</th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t") . @implode("\n", $tr) . " </tbody></table>\t\t\n<script>\n\tvar x_UnBlockWebSite{$t}=function(obj){\n\t      var tempvalue=obj.responseText;\n\t      if(tempvalue.length>3){alert(tempvalue);}\n\t      \n\t}\t\n\nfunction UnBlockWebSite{$t}(domain){\n\tif(confirm('{$UnBlockWebSiteExplain}:'+domain+' ?')){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('unlock',domain);\n\t\tXHR.sendAndLoad('squid.blocked.events.php', 'POST',x_UnBlockWebSite{$t});\n\t}\n\n}\n</script>";
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:87,代码来源:miniadmin.proxy.access.php

示例11: graph0

function graph0()
{
    $q = new mysql_squid_builder();
    $page = CurrentPageName();
    $tpl = new templates();
    $t = $_GET["t"];
    $ff = time();
    $tablename = date("Ymd", $_GET["xtime"]) . "_blocked";
    $sql = "SELECT COUNT(ID) as thits,HOUR(zDate) as `thour` FROM {$tablename} GROUP BY `thour` ORDER BY `thour`";
    $c = 0;
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        senderror("{$q->mysql_error}<br>{$sql}");
    }
    if (mysql_num_rows($results) > 0) {
        $nb_events = mysql_num_rows($results);
        while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
            $xdata[] = $ligne["hour"];
            $ydata[] = $ligne["thits"];
            $c++;
        }
    }
    $highcharts = new highcharts();
    $highcharts->container = $_GET["container"];
    $highcharts->xAxis = $xdata;
    $highcharts->Title = "{display_blocked_events}: {hits}/{hour}";
    $highcharts->yAxisTtitle = "{hits}";
    $highcharts->xAxisTtitle = "{hours}";
    $highcharts->datas = array("{hits}" => $ydata);
    echo $highcharts->BuildChart();
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:31,代码来源:miniadm.webstats.websites.ByDayBlocked.php

示例12: replace_search

function replace_search()
{
    $prox = new squid_reverse();
    $searchstring = string_to_flexquery("replace-search");
    $q = new mysql_squid_builder();
    $sql = "SELECT * FROM nginx_replace WHERE groupid={$_GET["groupid"]} {$searchstring} ORDER BY rulename LIMIT 0,250";
    $results = $q->QUERY_SQL($sql, 'artica_backup');
    if (!$q->ok) {
        senderror($q->mysql_error);
    }
    $tpl = new templates();
    $boot = new boostrap_form();
    $page = CurrentPageName();
    $t = time();
    if ($GLOBALS["VERBOSE"]) {
        echo "<H1>{$sql}</H1><br>" . mysql_num_rows($results) . " Entries<hr>";
    }
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        $icon = "www-web-search-64.png";
        $icon2 = "folder-network-64.png";
        $color = "black";
        $md = md5(serialize($ligne));
        $stringtosearch = htmlentities($ligne["stringtosearch"]);
        $delete = imgsimple("delete-64.png", null, "Delete{$t}('{$ligne["ID"]}','{$md}')");
        $jsedit = $boot->trswitch("Loadjs('{$page}?js-replace=yes&ID={$ligne["ID"]}')");
        $tr[] = "\n\t\t<tr style='color:{$color}' id='{$md}'>\n\t\t<td width=1% nowrap {$jsedit} style='vertical-align:middle' nowrap><img src='img/{$icon}'></td>\n\t\t<td width=80% {$jsedit} style='vertical-align:middle'>\n\t\t\t<span style='font-size:18px;font-weight:bold'>{$ligne["rulename"]}</span>\n\t\t</td>\n\t\t\n\t\t<td width=1% nowrap {$jsedit} style='vertical-align:middle' nowrap>\n\t\t\t<span style='font-size:18px;font-weight:bold'>{$stringtosearch}</span>\n\t\t</td>\n\t\t<td width=1% nowrap style='vertical-align:middle'>{$delete}</td>\n\t\t</tr>\n\t\t";
    }
    echo $tpl->_ENGINE_parse_body("\n\t\n\t\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=2>{rule}</th>\n\t\t\t\t\t<th >{search}</th>\n\t\t\t\t\t<th>&nbsp;</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>") . @implode("", $tr) . "</tbody></table>\n<script>\n var FreeWebIDMEM{$t}='';\nvar xDelete{$t}=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>10){alert(results);return;}\n\t\$('#'+FreeWebIDMEM{$t}).remove();\n}\n\t\nfunction Delete{$t}(ID,md){\n\tFreeWebIDMEM{$t}=md;\n\tif(confirm('Remove '+ID+'?')){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('replace-delete',ID);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xDelete{$t});\n\t}\n}</script>\t\t\t \t\t\t\t\t \t\t\n";
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:29,代码来源:miniadmin.nginx.replace.php

示例13: graph1_1

function graph1_1()
{
    $q = new mysql_squid_builder();
    $page = CurrentPageName();
    $tpl = new templates();
    $t = $_GET["t"];
    $ff = time();
    $tablename = date("Ymd", $_GET["xtime"]) . "_hour";
    $category = mysql_escape_string2($_GET["category"]);
    if ($_GET["category"] == "unknown") {
        $_GET["category"] = null;
    }
    $sql = "SELECT SUM( hits ) AS size,zDate, category FROM generic_categories GROUP BY category,zDate\n\tHAVING category='{$_GET["category"]}' ORDER BY zDate";
    $results = $q->QUERY_SQL($sql);
    $c = 0;
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        senderror("{$q->mysql_error}<br>{$sql}");
    }
    if (mysql_num_rows($results) > 0) {
        $nb_events = mysql_num_rows($results);
        while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
            $xdata[] = $ligne["zDate"];
            $ydata[] = $ligne["size"];
            $c++;
        }
    }
    $highcharts = new highcharts();
    $highcharts->container = $_GET["container"];
    $highcharts->xAxis = $xdata;
    $highcharts->Title = "{$category}: {hits}/{day}";
    $highcharts->yAxisTtitle = "{hits}";
    $highcharts->xAxisTtitle = "{days}";
    $highcharts->datas = array("{hits}" => $ydata);
    echo $highcharts->BuildChart();
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:36,代码来源:miniadm.webstats.websites.ByCategory.php

示例14: section_webrules_search

function section_webrules_search()
{
    $q = new mysql_squid_builder();
    $database = "squidlogs";
    $sock = new sockets();
    $tpl = new templates();
    $search = '%';
    $table = "websites_caches_params";
    $searchstring = string_to_flexquery("search-webrules");
    $sql = "SELECT *  FROM `{$table}` WHERE 1 {$searchstring} ORDER BY sitename";
    $results = $q->QUERY_SQL($sql, $database);
    if (!$q->ok) {
        senderror($q->mysql_error);
    }
    $boot = new boostrap_form();
    $t = time();
    while ($ligne = mysql_fetch_assoc($results)) {
        $ID = md5($ligne["sitename"]);
        $delete = imgtootltip("delete-24.png", "{delete}", "DeleteWebsiteCached{$t}('{$ligne["sitename"]}','{$ID}')");
        $select = "Loadjs('squid.miniwebsite.tasks.php?cache-params-js=yes&sitename={$ligne["sitename"]}&table-t={$_GET["t"]}');";
        $ligne["MIN_AGE"] = $ligne["MIN_AGE"];
        $ligne["MIN_AGE"] = $tpl->javascript_parse_text(distanceOfTimeInWords(time(), mktime() + $ligne["MIN_AGE"] * 60, true));
        $ligne["MAX_AGE"] = $ligne["MAX_AGE"];
        $ligne["MAX_AGE"] = $tpl->javascript_parse_text(distanceOfTimeInWords(time(), mktime() + $ligne["MAX_AGE"] * 60, true));
        if (trim($ligne["sitename"]) == '.') {
            $ligne["sitename"] = $tpl->_ENGINE_parse_body("{all}");
        }
        $link = $boot->trswitch($select);
        $tr[] = "\n\t\t<tr id='{$ID}'>\n\t\t<td {$link}><i class='icon-globe'></i>&nbsp;{$ligne["sitename"]}</td>\n\t\t<td {$link} width=1% nowrap>{$ligne["MIN_AGE"]}</td>\n\t\t<td {$link} width=1% nowrap>{$ligne["PERCENT"]}%</td>\n\t\t<td {$link} width=1% nowrap>{$ligne["MAX_AGE"]}</td>\n\t\t<td width=1% nowrap>{$delete}</td>\n\t\t</tr>";
    }
    echo $tpl->_ENGINE_parse_body("\n\t\t\t<table class='table table-bordered table-hover'>\n\t\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t\t<th>{website}</th>\n\t\t\t<th>{expire_time}</th>\n\t\t\t<th>%</th>\n\t\t\t<th>{limit}</th>\n\t\t\t<th>&nbsp;</th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t") . @implode("", $tr) . "</tbody></table>\n<script>\nvar websiteMem{$t}='';\n\t\tvar x_DeleteWebsiteCached{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);return;}\n\t\t\t\$('#'+websiteMem{$t}).remove();\t\t\t\n\t\t\t\t\n\t\t}\t\n\n\t\tfunction DeleteWebsiteCached{$t}(domain,id){\n\t\t\twebsiteMem{$t}=id;\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('DELETE',domain);\n\t\t\tXHR.sendAndLoad('squid.caches32.caches-www.php', 'POST',x_DeleteWebsiteCached{$t});\n\t\t}\n</script>\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n";
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:32,代码来源:miniadmin.proxy.caches.php

示例15: today_search

function today_search()
{
    $now = date("Ymd");
    $tablename = "searchwordsD_{$now}";
    $q = new mysql_squid_builder();
    if (!$q->TABLE_EXISTS($tablename)) {
        senderror("{$tablename} no such table");
    }
    $tpl = new templates();
    $search = string_to_flexquery("search-today");
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $sql = "SELECT * FROM {$tablename} WHERE 1 {$search} ORDER BY `hour` DESC LIMIT 0,500";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        senderror($q->mysql_error);
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $ligne["words"] = utf8_decode($ligne["words"]);
        $time = strtotime($ligne["zDate"]);
        $ligne["zDate"] = date("H:i:s", $time);
        $tr[] = "\n\t\t<tr>\n\t\t<td nowrap><i class='icon-time' ></i>&nbsp;{$ligne["hour"]}h</a></td>\n\t\t<td nowrap><i class='icon-user'></i>&nbsp;{$ligne["uid"]}</a></td>\n\t\t<td>{$ligne["ipaddr"]}</a></td>\n\t\t<td>{$ligne["words"]}</td>\n\t\t<td><i class='icon-info-globe'></i>&nbsp;{$ligne["sitename"]}</td>\n\t\t<td nowrap><i class='icon-info-globe'></i>&nbsp;{$ligne["familysite"]}</td>\n\t\t</tr>";
    }
    echo $tpl->_ENGINE_parse_body("\n\n\t\t\t\t<table class='table table-bordered table-hover'>\n\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>{date}</th>\n\t\t\t\t\t<th>{member}</th>\n\t\t\t\t\t<th>{ipaddr}</th>\n\t\t\t\t\t<th>{words}</th>\n\t\t\t\t\t<th colspan=2>{sitename}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t\t") . @implode("", $tr) . "</tbody></table>";
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:miniadmin.proxy.keywords.php


注:本文中的senderror函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。