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


PHP sockets::BuildTemplatesConfig方法代码示例

本文整理汇总了PHP中sockets::BuildTemplatesConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP sockets::BuildTemplatesConfig方法的具体用法?PHP sockets::BuildTemplatesConfig怎么用?PHP sockets::BuildTemplatesConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sockets的用法示例。


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

示例1: parseTemplate_ticket

function parseTemplate_ticket($error = null)
{
    include_once dirname(__FILE__) . "/ressources/class.sockets.inc";
    include_once dirname(__FILE__) . "/ressources/class.mysql.squid.builder.php";
    include_once dirname(__FILE__) . "/ressources/class.tcpip.inc";
    $sock = new sockets();
    $ARRAY = unserialize(base64_decode($_REQUEST["serialize"]));
    $sock->BuildTemplatesConfig($ARRAY);
    $SquidGuardIPWeb = null;
    $url = $_REQUEST["url"];
    $IPADDR = $_REQUEST["ipaddr"];
    if (isset($_GET["SquidGuardIPWeb"])) {
        $SquidGuardIPWeb = $_GET["SquidGuardIPWeb"];
    }
    if ($SquidGuardIPWeb == null) {
        $SquidGuardIPWeb = CurrentPageName();
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "<H1>SquidGuardIPWeb={$SquidGuardIPWeb}</H1>";
    }
    $UfdbGuardHTTPAllowNoCreds = intval($sock->GET_INFO("UfdbGuardHTTPAllowNoCreds"));
    $q = new mysql_squid_builder();
    $parse_url = parse_url($url);
    $host = $parse_url["host"];
    if (preg_match("#(.+?):[0-9]+#", $host, $re)) {
        $host = $re[1];
    }
    $FinalHost = $q->GetFamilySites($host);
    if (!isset($GLOBALS["UfdbGuardHTTP"]["FOOTER"])) {
        $GLOBALS["UfdbGuardHTTP"]["FOOTER"] = null;
    }
    $FOOTER = $GLOBALS["UfdbGuardHTTP"]["FOOTER"];
    $ticket_web_site_text = "{submit_a_ticket}";
    $UFDBGUARD_TICKET_LINK = $GLOBALS["UfdbGuardHTTP"]["UFDBGUARD_UNLOCK_LINK"];
    if ($UFDBGUARD_TICKET_LINK != null) {
        $ticket_web_site_text = $UFDBGUARD_TICKET_LINK;
    }
    $f[] = parseTemplate_headers("{$UFDBGUARD_TICKET_LINK}", null, $SquidGuardIPWeb);
    $f[] = $f[] = "<form id='unlockform' action=\"{$SquidGuardIPWeb}\" method=\"post\">\n\t<input type='hidden' id='unlock-ticket' name='unlock-ticket' value='yes'>\n\t<input type='hidden' id='finalhost' name='finalhost' value='{$FinalHost}'>\n\t<input type='hidden' id='ipaddr' name='ipaddr' value='{$IPADDR}'>\n\t<input type='hidden' id='SquidGuardIPWeb' name='SquidGuardIPWeb' value='{$SquidGuardIPWeb}'>\n\t<input type='hidden' id='serialize' name='serialize' value='{$_REQUEST["serialize"]}'>\n\t<input type='hidden' id='url' name='url' value='{$url}'>";
    $f[] = "<input type='hidden' id='username' name='username' value='{$_REQUEST["clientname"]}'>";
    $f[] = "<script>\t";
    $f[] = "function CheckTheForm(){\t";
    $f[] = "document.forms['unlockform'].submit();";
    $f[] = "}\t";
    $f[] = "CheckTheForm();";
    $f[] = "</script>\t";
    $f[] = "</body>";
    $f[] = "</html>";
    echo @implode("\n", $f);
}
开发者ID:articatech,项目名称:artica,代码行数:50,代码来源:ufdbguardd.php

示例2: parseTemplate_unlock

function parseTemplate_unlock($error = null)
{
    include_once dirname(__FILE__) . "/ressources/class.sockets.inc";
    include_once dirname(__FILE__) . "/ressources/class.mysql.squid.builder.php";
    include_once dirname(__FILE__) . "/ressources/class.tcpip.inc";
    $sock = new sockets();
    $ARRAY = unserialize(base64_decode($_REQUEST["serialize"]));
    $sock->BuildTemplatesConfig($ARRAY);
    $SquidGuardIPWeb = null;
    $url = $_REQUEST["url"];
    $IPADDR = $_REQUEST["ipaddr"];
    if (isset($_GET["SquidGuardIPWeb"])) {
        $SquidGuardIPWeb = $_GET["SquidGuardIPWeb"];
    }
    if ($SquidGuardIPWeb == null) {
        $SquidGuardIPWeb = CurrentPageName();
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "<H1>SquidGuardIPWeb={$SquidGuardIPWeb}</H1>";
    }
    $UfdbGuardHTTPAllowNoCreds = intval($sock->GET_INFO("UfdbGuardHTTPAllowNoCreds"));
    $q = new mysql_squid_builder();
    $parse_url = parse_url($url);
    $host = $parse_url["host"];
    if (preg_match("#(.+?):[0-9]+#", $host, $re)) {
        $host = $re[1];
    }
    $FinalHost = $q->GetFamilySites($host);
    if (!isset($GLOBALS["UfdbGuardHTTP"]["FOOTER"])) {
        $GLOBALS["UfdbGuardHTTP"]["FOOTER"] = null;
    }
    $FOOTER = $GLOBALS["UfdbGuardHTTP"]["FOOTER"];
    $MAX = $GLOBALS["UfdbGuardHTTP"]["UnbblockMaxTime"];
    $Timez[5] = "5 {minutes}";
    $Timez[10] = "10 {minutes}";
    $Timez[15] = "15 {minutes}";
    $Timez[30] = "30 {minutes}";
    $Timez[60] = "1 {hour}";
    $Timez[120] = "2 {hours}";
    $Timez[240] = "4 {hours}";
    $Timez[720] = "12 {hours}";
    $Timez[2880] = "2 {days}";
    $TEXT_TIME = $Timez[$MAX];
    $UnbblockText2 = $GLOBALS["UfdbGuardHTTP"]["UnbblockText2"];
    $page = CurrentPageName();
    $UnbblockText2 = str_replace("%WEBSITE%", $url, $UnbblockText2);
    $UnbblockText2 = str_replace("%TIME%", $TEXT_TIME, $UnbblockText2);
    $fontfamily = "font-family: {$GLOBALS["UfdbGuardHTTP"]["Family"]};";
    $fontfamily = str_replace('"', "", $fontfamily);
    $wifidog_build_uri = wifidog_build_uri();
    $uriext = $wifidog_build_uri[0];
    $HiddenFields = $wifidog_build_uri[1];
    $client_username = $ARRAY["clientname"];
    if ($client_username != null) {
        $_REQUEST["clientname"] = $client_username;
    }
    if ($q->COUNT_ROWS("ufdb_page_rules") > 0) {
        include_once dirname(__FILE__) . "/ressources/class.ufdb.parsetemplate.inc";
        $unlock = new parse_template_ufdb();
        $noauth = $unlock->parseTemplate_unlock_privs($ARRAY, $pattern = "noauth=1", 0, true);
        $UfdbGuardHTTPAllowNoCreds = $noauth;
    }
    $UFDBGUARD_UNLOCK_LINK = $GLOBALS["UfdbGuardHTTP"]["UFDBGUARD_UNLOCK_LINK"];
    $unlock_web_site_text = "{unlock_web_site}";
    if ($UFDBGUARD_UNLOCK_LINK != null) {
        $unlock_web_site_text = $UFDBGUARD_UNLOCK_LINK;
    }
    if ($noauth == 1) {
        $f[] = parseTemplate_headers("{$unlock_web_site_text}", null, $SquidGuardIPWeb);
        $f[] = $f[] = "<form id='unlockform' action=\"{$SquidGuardIPWeb}\" method=\"post\">\n\t\t<input type='hidden' id='unlock-www' name='unlock-www' value='yes'>\n\t\t<input type='hidden' id='finalhost' name='finalhost' value='{$FinalHost}'>\n\t\t<input type='hidden' id='ipaddr' name='ipaddr' value='{$IPADDR}'>\n\t\t<input type='hidden' id='SquidGuardIPWeb' name='SquidGuardIPWeb' value='{$SquidGuardIPWeb}'>\n\t\t<input type='hidden' id='serialize' name='serialize' value='{$_REQUEST["serialize"]}'>\n\t\t<input type='hidden' id='url' name='url' value='{$url}'>";
        $f[] = "<input type='hidden' id='username' name='username' value='{$_REQUEST["clientname"]}'>";
        $f[] = "<input type='hidden' id='nocreds' name='nocreds' value='1'>";
        $f[] = "<script>\t";
        $f[] = "function CheckTheForm(){\t";
        $f[] = "document.forms['unlockform'].submit();";
        $f[] = "}\t";
        $f[] = "CheckTheForm();";
        $f[] = "</script>\t";
        $f[] = "</body>";
        $f[] = "</html>";
        echo @implode("\n", $f);
        return;
    }
    $UFDBGUARD_UNLOCK_LINK = $GLOBALS["UfdbGuardHTTP"]["UFDBGUARD_UNLOCK_LINK"];
    $unlock_web_site_text = "{unlock_web_site}";
    if ($UFDBGUARD_UNLOCK_LINK != null) {
        $unlock_web_site_text = $UFDBGUARD_UNLOCK_LINK;
    }
    $f[] = parseTemplate_headers($unlock_web_site_text, null, $SquidGuardIPWeb);
    $f[] = "    <h2>{$unlock_web_site_text} {$FinalHost} {for} {$IPADDR} {$_REQUEST["clientname"]}</h2>";
    if ($error != null) {
        $f[] = "    <h2>{$error}</h2>";
    }
    $f[] = "    <div id=\"info\">";
    $f[] = "<p style='margin-bottom:30px'>{$UnbblockText2}</p>";
    $f[] = "<form id='unlockform' action=\"{$SquidGuardIPWeb}\" method=\"post\">\n\t<input type='hidden' id='unlock-www' name='unlock-www' value='yes'>\n\t<input type='hidden' id='finalhost' name='finalhost' value='{$FinalHost}'>\n\t<input type='hidden' id='ipaddr' name='ipaddr' value='{$IPADDR}'>\n\t<input type='hidden' id='serialize' name='serialize' value='{$_REQUEST["serialize"]}'>\n\t<input type='hidden' id='url' name='url' value='{$url}'>";
    $f[] = "<input type='hidden' id='username' name='username' value='{$_REQUEST["clientname"]}'>";
    if ($UfdbGuardHTTPAllowNoCreds == 1) {
        $f[] = "<input type='hidden' id='username' name='username' value='{$_REQUEST["clientname"]}'>";
        $f[] = "<input type='hidden' id='password' name='password' value='{$_REQUEST["password"]}'>";
//.........这里部分代码省略.........
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:101,代码来源:exec.squidguard.php

示例3: TemplatesDesign

function TemplatesDesign($title, $content)
{
    $title = utf8_decode($title);
    $content = utf8_decode($content);
    if (!isset($GLOBALS["CORP_LICENSE"])) {
        $users = new usersMenus();
        $GLOBALS["CORP_LICENSE"] = $users->CORP_LICENSE;
    }
    $sock = new sockets();
    $sock->BuildTemplatesConfig();
    $UfdbGuardHTTPEnablePostmaster = 1;
    $SquidHTTPTemplateSmiley = $sock->GET_INFO("SquidHTTPTemplateSmiley");
    if ($SquidHTTPTemplateSmiley == null) {
        $SquidHTTPTemplateSmiley = 2639;
    }
    if (!$GLOBALS["CORP_LICENSE"]) {
        $FOOTER = "\n\t\t<table style='width:75%;border-top:1px solid {$GLOBALS["UfdbGuardHTTP"]["FontColor"]};margin-top:15px'>\n\t\t<tr><td colspan=2>&nbsp;</td></tr>\n\t\t<tr>\n\t\t<td width=64px><img src='/squid-internal-static/icons/silk/logo-artica-64.png'></td>\n\t\t<td style='font-size:14px;padding-left:10px' width=99%>\n\t\tYou using Artica Proxy Appliance v{$GLOBALS["ARTICA_VERSION"]} in Community mode.<br>\n\t\t<i>Visit our  <a href=\"http://artica-proxy.com\">website</a> for technical informations or to purchase an Entreprise Edition License</i>\n\t\t</td>\n\t\t</tr>\n\t\t</table>\n\t\t</div>";
    }
    $f[] = "<!DOCTYPE HTML>";
    $f[] = "<html>";
    $f[] = "<head>";
    $f[] = "<title>{$title}</title>";
    $f[] = "<script type=\"text/javascript\">";
    $f[] = "    function checkIfTopMostWindow()";
    $f[] = "    {";
    $f[] = "        if (window.top != window.self) ";
    $f[] = "        {  ";
    $f[] = "            document.body.style.opacity    = \"0.0\";";
    $f[] = "            document.body.style.background = \"#FFFFFF\";";
    $f[] = "        }";
    $f[] = "        else";
    $f[] = "        {";
    $f[] = "            document.body.style.opacity    = \"1.0\";";
    $f[] = "            document.body.style.background = \"{$GLOBALS["UfdbGuardHTTP"]["BackgroundColor"]}\";";
    $f[] = "        } ";
    $f[] = "    }";
    $f[] = "</script>";
    $f[] = "<style type=\"text/css\">";
    $f[] = "    body {";
    $f[] = "        color:            {$GLOBALS["UfdbGuardHTTP"]["FontColor"]}; ";
    $f[] = "        background-color: #FFFFFF; ";
    $f[] = "        font-family:      {$GLOBALS["UfdbGuardHTTP"]["Family"]}; ";
    $f[] = "        font-weight:      lighter;";
    $f[] = "        font-size:        14pt; ";
    $f[] = "        ";
    $f[] = "        opacity:            0.0;";
    $f[] = "        transition:         opacity 2s;";
    $f[] = "        -webkit-transition: opacity 2s;";
    $f[] = "        -moz-transition:    opacity 2s;";
    $f[] = "        -o-transition:      opacity 2s;";
    $f[] = "        -ms-transition:     opacity 2s;    ";
    $f[] = "    }";
    $f[] = "    center {";
    $f[] = "        color:            {$GLOBALS["UfdbGuardHTTP"]["FontColor"]}; ";
    $f[] = "        font-family:      {$GLOBALS["UfdbGuardHTTP"]["Family"]}; ";
    $f[] = "        font-weight:      lighter;";
    $f[] = "        font-size:        12pt; ";
    $f[] = "}";
    $f[] = "    h1 {";
    $f[] = "        font-size: 72pt; ";
    $f[] = "        margin-bottom: 0; ";
    $f[] = "        font-family: {$GLOBALS["UfdbGuardHTTP"]["Family"]};";
    $f[] = "        margin-top: 0 ;";
    $f[] = "    }    ";
    $f[] = "    h2 {";
    $f[] = "        font-size: 22pt; ";
    $f[] = "        font-family: {$GLOBALS["UfdbGuardHTTP"]["Family"]}; ";
    $f[] = "        font-weight: lighter;";
    $f[] = "    }   ";
    $f[] = "    h3 {";
    $f[] = "        font-size: 18pt; ";
    $f[] = "        font-family: {$GLOBALS["UfdbGuardHTTP"]["Family"]}; ";
    $f[] = "        font-weight: lighter;";
    $f[] = "        margin-bottom: 0 ;";
    $f[] = "    }   ";
    $f[] = "    #wrapper {";
    $f[] = "        width: 700px ;";
    $f[] = "        margin-left: auto ;";
    $f[] = "        margin-right: auto ;";
    $f[] = "    }    ";
    $f[] = "    #info {";
    $f[] = "        width: 600px ;";
    $f[] = "        margin-left: auto ;";
    $f[] = "        margin-right: auto ;";
    $f[] = "    }    ";
    $f[] = "    #titles h1 {";
    $f[] = "        font-size: 72pt; ";
    $f[] = "        margin-bottom: 0; ";
    $f[] = "        font-family: {$GLOBALS["UfdbGuardHTTP"]["Family"]};";
    $f[] = "        margin-top: 0 ;";
    $f[] = "    }    ";
    $f[] = "hr {\n   border-top: 1px dotted #f00;\n  color: #fff;\n  background-color: #fff;\n  height: 1px;\n  width:50%;\n}\n";
    $f[] = "    #content p {";
    $f[] = "       font-size:  11pt;  ";
    $f[] = "        margin-bottom: 0; ";
    $f[] = "        font-family: {$GLOBALS["UfdbGuardHTTP"]["Family"]};";
    $f[] = "        margin-top: 0 ;";
    $f[] = "    }    ";
    $f[] = "    #footer p {";
    $f[] = "       font-size:  12pt;  ";
//.........这里部分代码省略.........
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:101,代码来源:exec.squid.php


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