• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mysql_squid_builder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: TEMPLATE_SETTINGS

function TEMPLATE_SETTINGS()
{
    $page = CurrentPageName();
    $sock = new sockets();
    $tpl = new templates();
    $error = null;
    $t = time();
    $button = "<hr>" . button("{save}", "Save{$t}()", 40);
    $TEMPLATE_TITLE = $_GET["TEMPLATE_TITLE"];
    $EnableYoutubeLocker = intval($sock->GET_INFO("EnableYoutubeLocker"));
    $YoutubeLockerSize = intval($sock->GET_INFO("YoutubeLockerSize"));
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(*) AS tcount FROM proxy_ports WHERE UseSSL=1 AND enabled=1"));
    if ($ligne["tcount"] == 0) {
        $error = "<p class=text-error style='font-size:18px'>{feature_run_only_ssl}</p>";
    }
    $pp = Paragraphe_switch_img("{youtube_locker}", "{youtube_locker_explain}", "EnableYoutubeLocker-{$t}", $EnableYoutubeLocker, null, 1450);
    if ($YoutubeLockerSize == 0) {
        $YoutubeLockerSize = 144;
    }
    $RESOLUTIONS[144] = "144p";
    $RESOLUTIONS[240] = "240p";
    $RESOLUTIONS[360] = "360p";
    $RESOLUTIONS[480] = "480p";
    $RESOLUTIONS[720] = "720p";
    $html = "\n<div style='font-size:40px;margin-bottom:30px'>{youtube_locker}</div>\t\t\n{$error}\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t<tr>\n\t<td colspan=2>{$pp}</td>\n\t</tr>\n<tr>\n\t<td class=legend style='font-size:24px' width=1% nowrap>{video_quality}:</td>\n\t<td width=99%>" . Field_array_Hash($RESOLUTIONS, "YoutubeLockerSize-{$t}", $YoutubeLockerSize, "style:font-size:24px;width:240px") . "</td>\n</tr>\n\t<tr>\n\t<td colspan=2 align='right'>{$button}</td>\n\t</tr>\n<script>\n\tvar xSave{$t}=function(obj){\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue)};\n\tLoadjs('squid.ecap.progress.php');\n}\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('YoutubeLockerSize',document.getElementById('YoutubeLockerSize-{$t}').value);\n\tXHR.appendData('EnableYoutubeLocker',document.getElementById('EnableYoutubeLocker-{$t}').value);\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:articatech,项目名称:artica,代码行数:28,代码来源:squid.youtube.locker.php


示例2: popup

function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $html = "<div class=explain>{websites_to_export_explain}</div>\n\t<div style='margin:top:10px;width:100%;height:450px;overflow:auto'>\n\t<center>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n\t<thead class='thead'>\n\t\t\t<tr>\n\t\t\t\t<th width=1%>{date}</th>\n\t\t\t\t<th width=99%>{website}</th>\n\t\t\t\t<th width=99%>{category}</th>\n\t\t\t</tr>\n\t</thead>\n<tbody>";
    $sql = "SELECT * FROM categorize ORDER BY zDate DESC LIMIT 0,150";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo "<H2>{$q->mysql_error}</H2><center style='font-size:11px'><code>{$sql}</code></center>";
    }
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        if ($classtr == "oddRow") {
            $classtr = null;
        } else {
            $classtr = "oddRow";
        }
        $js = "Loadjs('{$page}?website-details=yes&familysite={$ligne["familysite"]}&day={$_GET["day"]}&user-field={$_GET["user-field"]}&user={$_GET["user"]}')";
        $categorize = "Loadjs('squid.categorize.php?www={$ligne["sitename"]}')";
        if (trim($ligne["category"]) == null) {
            $ligne["category"] = "<span style='color:#D70707'>{categorize_this_website}</span>";
        }
        $html = $html . "\n\t\t\t\t<tr class={$classtr}>\n\t\t\t\t\t<td width=1%  style='font-size:14px;'nowrap><strong>{$ligne["zDate"]}</strong></td>\n\t\t\t\t\t<td width=99%  style='font-size:14px;' nowrap><strong>{$ligne["pattern"]}</strong></td>\n\t\t\t\t\t<td width=1%  style='font-size:14px;' nowrap><strong>{$ligne["category"]}</strong></td>\n\t\t\t\t</tr>\n\t\t\t\t";
    }
    $html = $html . "</tbody></table></div>";
    echo $tpl->_ENGINE_parse_body($html);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:27,代码来源:squid.categories.toexport.php


示例3: build_rules

function build_rules()
{
    $q = new mysql_squid_builder();
    $unix = new unix();
    $SQUID_BIN = $unix->LOCATE_SQUID_BIN();
    build_progress("{IT_charter}", 25);
    $sql = "SELECT ID,title FROM itcharters WHERE enabled=1";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        build_progress("{IT_charter} {mysql_error}", 110);
        echo $q->mysql_error;
        return;
    }
    if (mysql_num_rows($results) == 0) {
        @unlink("/etc/squid3/itCharts.enabled.db");
        squid_admin_mysql(1, "Reloading Proxy service (itCharts)", null, __FILE__, __LINE__);
        build_progress("{IT_charter} {reload_proxy_service}", 90);
        system("{$SQUID_BIN} -f /etc/squid3/squid.conf -k reconfigure");
        build_progress("{IT_charter} {done} 0 {item}", 100);
        return;
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        build_progress("{$ligne["title"]}", 50);
        echo "{$ligne["ID"]}: {$ligne["title"]}\n";
        $MAIN[$ligne["ID"]] = $ligne["title"];
    }
    @file_put_contents("/etc/squid3/itCharts.enabled.db", serialize($MAIN));
    squid_admin_mysql(1, "Reloading Proxy service (itCharts)", null, __FILE__, __LINE__);
    build_progress("{IT_charter} {reload_proxy_service}", 90);
    system("{$SQUID_BIN} -f /etc/squid3/squid.conf -k reconfigure");
    build_progress("{IT_charter} {done} " . count($MAIN) . " {items}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:32,代码来源:exec.itchart.php


示例4: xstart

function xstart()
{
    $sock = new sockets();
    $unix = new unix();
    $php = $unix->LOCATE_PHP5_BIN();
    $SquidAllow80Port = intval($sock->GET_INFO("SquidAllow80Port"));
    build_progress("{starting} {allow_80443_port}", 15);
    if ($SquidAllow80Port == 1) {
        build_progress("{stopping} {web_service}", 20);
        system("/etc/init.d/apache2 stop");
        build_progress("{stopping} Reverse Proxy", 30);
        system("/etc/init.d/nginx stop");
    } else {
        build_progress("{remove} 80/443 ports", 20);
        $q = new mysql_squid_builder();
        $q->QUERY_SQL("DELETE FROM proxy_ports WHERE `port`='80'");
        build_progress("{remove} 80/443 ports", 25);
        $q->QUERY_SQL("DELETE FROM proxy_ports WHERE `port`='443'");
        build_progress("{reconfigure_proxy_service}", 30);
        $php = $unix->LOCATE_PHP5_BIN();
        shell_exec("{$php} /usr/share/artica-postfix/exec.squid.php --build --force");
    }
    build_progress("{restarting_artica_status}", 80);
    system("/etc/init.d/artica-status restart --force");
    build_progress("{done}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:exec.squid80443.php


示例5: title

function title()
{
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT servername, ipaddr FROM reverse_sources WHERE ID='{$_GET["cacheid"]}'"));
    return $tpl->javascript_parse_text("{compile2} {destination} {$ligne["servername"]}/{$ligne["ipaddr"]}");
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:7,代码来源:nginx.destination.progress.php


示例6: js

function js()
{
    $page = CurrentPageName();
    $tpl = new templates();
    if (!is_numeric($_GET["taskid"])) {
        $_GET["taskid"] = 0;
    }
    if ($_GET["table"] == null) {
        $all_events = $tpl->_ENGINE_parse_body("{all_events}");
        $title = $all_events;
    } else {
        $title = $tpl->_ENGINE_parse_body("{events}") . "::{$_GET["category"]}";
    }
    if ($_GET["taskid"] > 0) {
        if ($_GET["table"] == null or preg_match("#TaskSq[0-9]+#", $_GET["table"])) {
            $q = new mysql_squid_builder();
            $ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT TaskType,TimeDescription FROM webfilters_schedules WHERE ID={$_GET["taskid"]}", "artica_events"));
        } else {
            $q = new mysql();
            $ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT TaskType,TimeDescription FROM system_schedules WHERE ID={$_GET["taskid"]}", "artica_backup"));
        }
        $title = "{$_GET["taskid"]}::Type:{$ligne2["TaskType"]}::{$ligne2["TimeDescription"]}";
    }
    $html = "YahooWin5('690','{$page}?popup=yes&filename={$_GET["filename"]}&taskid={$_GET["taskid"]}&category={$_GET["category"]}&tablesize={$_GET["tablesize"]}&descriptionsize={$_GET["descriptionsize"]}&table={$_GET["table"]}','{$title}')";
    echo $html;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:squid.update.events.php


示例7: save

function save()
{
    $sock = new sockets();
    if ($_POST["ID"] == 0) {
        $ligne = unserialize(base64_decode($sock->GET_INFO("DansGuardianDefaultMainRule")));
        $ligne["bypass"] = $_POST["bypass"];
        $ligne["BypassSecretKey"] = $_POST["BypassSecretKey"];
        writelogs("Default rule, saving DansGuardianDefaultMainRule", __FUNCTION__, __FILE__, __LINE__);
        $sock->SaveConfigFile(base64_encode(serialize($ligne)), "DansGuardianDefaultMainRule");
        writelogs("Ask to compile rule...", __FUNCTION__, __FILE__, __LINE__);
        $sock->getFrameWork("webfilter.php?compile-rules=yes");
        return;
    }
    $q = new mysql_squid_builder();
    $sql = "UPDATE webfilter_rules SET bypass='{$_POST["bypass"]}',BypassSecretKey='{$_POST["bypass"]}' WHERE ID='{$_POST["ID"]}'";
    $q->QUERY_SQL($sql);
    if (!$q->ok) {
        if (strpos($q->mysql_error, "Unknown column") > 0) {
            $q->CheckTables();
            $q->QUERY_SQL($sql);
        }
    }
    if (!$q->ok) {
        echo $q->mysql_error;
        return;
    }
    $sock->getFrameWork("webfilter.php?compile-rules=yes");
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:28,代码来源:dansguardian2.bypass.php


示例8: delete_link

function delete_link($aclid)
{
    $q = new mysql_squid_builder();
    $sql = "SELECT zmd5,gpid FROM webfilters_sqacllinks WHERE aclid='{$aclid}'";
    $results = $q->QUERY_SQL($sql);
    echo "ACL {$aclid} " . mysql_num_rows($results) . " links\n";
    while ($ligne = mysql_fetch_assoc($results)) {
        $gpid = $ligne["gpid"];
        $zmd5 = $ligne["zmd5"];
        if ($_POST["DeleteGroups"] == 1) {
            echo "ACL {$aclid} Delete group id {$gpid}\n";
            $q->QUERY_SQL("DELETE FROM webfilters_sqgroups WHERE ID={$gpid}");
            if (!$q->ok) {
                echo $q->mysql_error . "\n";
                return;
            }
        }
        echo "ACL {$aclid} Delete link id {$zmd5}\n";
        $q->QUERY_SQL("DELETE FROM webfilters_sqacllinks WHERE zmd5='{$zmd5}'");
        if (!$q->ok) {
            echo $q->mysql_error . "\n";
            return;
        }
    }
    return true;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:26,代码来源:squid.acls.delete.php


示例9: reset2

function reset2()
{
    system("clear");
    echo "Remove databases\n";
    $q = new mysql();
    echo "Remove database settings\n";
    $q->DELETE_DATABASE("artica_backup");
    echo "Remove database events\n";
    $q->DELETE_DATABASE("artica_events");
    echo "Remove database Proxy\n";
    $q = new mysql_squid_builder();
    $q->QUERY_SQL("DROP DATABASE `squidlogs`");
    echo "Remove Artica settings Proxy\n";
    $unix = new unix();
    $files = $unix->DirFiles("/etc/artica-postfix/settings/Daemons");
    while (list($filename, $value) = each($files)) {
        $fulename = "/etc/artica-postfix/settings/Daemons/{$filename}";
        echo "Removing {$filename}\n";
        @unlink($fulename);
    }
    @file_put_contents("/root/build/etc/artica-postfix/settings/Daemons/ProxyUseArticaDB", 1);
    @file_put_contents("/root/build/etc/artica-postfix/settings/Daemons/StatsPerfsSquidAnswered", 1);
    @file_put_contents("/root/build/etc/artica-postfix/settings/Daemons/CacheManagement2", 1);
    @file_put_contents("/root/build/etc/artica-postfix/settings/Daemons/EnablePHPFPM", 0);
    @file_put_contents("/root/build/etc/artica-postfix/settings/Daemons/EnableArticaFrontEndToNGninx", 0);
    @file_put_contents("/root/build/etc/artica-postfix/settings/Daemons/EnableArticaFrontEndToApache", 1);
    @file_put_contents("/root/build/etc/artica-postfix/settings/Daemons/EnableNginx", 0);
    echo "Restarting Web Console...\n";
    system('/etc/init.d/artica-webconsole restart');
    system("clear");
    echo "All data has been erased..\n";
    echo "Type Enter key to exit\n";
    $answer = trim(strtolower(fgets(STDIN)));
    die;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:35,代码来源:exec.users.reset.php


示例10: section_websites_search

function section_websites_search()
{
    $boot = new boostrap_form();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $page = CurrentPageName();
    $table = "visited_sites_tot";
    $searchstring = string_to_flexquery("sites-search");
    $ORDER = $boot->TableOrder(array("size" => "ASC"));
    if ($q->COUNT_ROWS($table) == 0) {
        senderrors("no data");
    }
    $sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} ORDER BY {$ORDER} LIMIT 0,250";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        senderrors($q->mysql_error . "<br>{$sql}");
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $md = md5(serialize($ligne));
        $ligne["size"] = FormatBytes($ligne["size"] / 1024);
        $sitenameenc = urlencode($ligne["familysite"]);
        $js = "Loadjs('miniadm.webstats.familysite.all.php?familysite={$sitenameenc}')";
        $link = $boot->trswitch($js);
        $tr[] = "\n\t\t<tr id='{$md}'>\n\t\t\t<td style='font-size:16px' width=10% nowrap {$link}>{$ligne["familysite"]}</td>\n\t\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["hits"]}</td>\n\t\t\t<td style='font-size:16px' width=1% nowrap {$link}>{$ligne["size"]}</td>\n\t\t</tr>\n\t\t";
    }
    echo $boot->TableCompile(array("familysite" => "{familysite}", "hits" => "{hits}", "size" => "{size}"), $tr);
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:27,代码来源:miniadm.webstats.bywebsites.php


示例11: export_category

function export_category($category)
{
    $q = new mysql_squid_builder();
    echo "Exporting {$category}\n";
    if (!preg_match("#^category_.+?#", $category)) {
        $table = "category_" . $q->category_transform_name($category);
    } else {
        $table = $category;
    }
    $t = time();
    $dirtmp = "/tmp/categories_{$t}";
    $Finaldir = "/root/categories";
    @mkdir($dirtmp);
    @mkdir($Finaldir);
    shell_exec("/bin/chmod 777 -R {$dirtmp}");
    $sql = "SELECT zmd5,zDate,category,pattern,uuid FROM {$table} WHERE enabled=1 ORDER BY pattern\n\tINTO OUTFILE '{$dirtmp}/{$table}.csv'\n\tFIELDS TERMINATED BY ','\n\tENCLOSED BY '\"'\n\tLINES TERMINATED BY '\\n'";
    $q->QUERY_SQL($sql);
    if (!$q->ok) {
        echo $q->mysql_error . "\n";
    }
    if (!is_file("{$dirtmp}/{$table}.csv")) {
        echo "{$dirtmp}/{$table}.csv no such file\n";
        return;
    }
    echo "{$dirtmp}/{$table}.csv success\n";
    compress("{$dirtmp}/{$table}.csv", "{$dirtmp}/{$table}.csv.gz");
    if (!is_file("{$dirtmp}/{$table}.csv.gz")) {
        echo "Failed {$dirtmp}/{$table}.csv.gz no such file\n";
        return;
    }
    @unlink("{$dirtmp}/{$table}.csv");
    echo "Success {$dirtmp}/{$table}.csv.gz\n";
    copy("{$dirtmp}/{$table}.csv.gz", "{$Finaldir}/{$table}.csv.gz");
    @unlink("{$dirtmp}/{$table}.csv.gz");
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:35,代码来源:exec.squid.exportcatz.php


示例12: doexport

function doexport()
{
    $q = new mysql_squid_builder();
    $q->BD_CONNECT();
    $t = $_GET["t"];
    $squidlogs["webfilters_sqacls"] = true;
    $squidlogs["webfilters_sqaclaccess"] = true;
    $squidlogs["webfilters_sqgroups"] = true;
    $squidlogs["webfilters_sqacllinks"] = true;
    $squidlogs["webfilters_sqitems"] = true;
    $squidlogs["webfilters_sqtimes_rules"] = true;
    $squidlogs["webfilters_blkwhlts"] = true;
    $squidlogs["webfilters_usersasks"] = true;
    $squidlogs["webfilters_quotas"] = true;
    $squidlogs["webfilter_avwhitedoms"] = true;
    $squidlogs["webfilter_aclsdynamic"] = true;
    $squidlogs["squidtpls"] = true;
    $dir = dirname(__FILE__) . "/ressources/logs/web/acls.gz";
    $databases["squidlogs"] = $squidlogs;
    if (is_file($dir)) {
        @unlink($dir);
    }
    $dump = new phpMyDumper("squidlogs", $q->mysql_connection, "{$dir}", true, $squidlogs);
    $dump->doDump();
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:25,代码来源:exec.squid.migration.tables.php


示例13: duplicate

function duplicate()
{
    $ID = $_POST["rule-dup"];
    $rulename = url_decode_special_tool($_POST["rulename"]);
    $sql = "INSERT IGNORE INTO iptables_main (`rulename`,`eth`,`accepttype`,`enabled`)\n\tVALUES ('{$rulename}','{$eth}','ACCEPT','1')";
    $q = new mysql();
    if (!$q->FIELD_EXISTS("iptables_main", "service", "artica_backup")) {
        $q->QUERY_SQL("ALTER TABLE `iptables_main` ADD `service` varchar(50) NULL ,ADD INDEX ( service );", "artica_backup");
    }
    $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo $q->mysql_error;
        return;
    }
    $NEW_RULE_ID = $q->last_id;
    if (!is_numeric($NEW_RULE_ID)) {
        echo "Failed\n";
        return;
    }
    if ($NEW_RULE_ID == 0) {
        echo "Failed\n";
        return;
    }
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM iptables_main WHERE ID='{$ID}'", "artica_backup"));
    unset($ligne["ID"]);
    unset($ligne["rulename"]);
    while (list($key, $value) = each($ligne)) {
        if (is_numeric($key)) {
            continue;
        }
        $f[] = "`{$key}`='" . mysql_escape_string2($value) . "'";
    }
    $sql = "UPDATE `iptables_main` SET " . @implode(",", $f) . " WHERE ID='{$NEW_RULE_ID}'";
    $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        echo $q->mysql_error;
        return;
    }
    $q = new mysql_squid_builder();
    $results = $q->QUERY_SQL("SELECT * FROM firewallfilter_sqacllinks WHERE aclid='{$ID}'");
    $prefix = "INSERT IGNORE INTO firewallfilter_sqacllinks (zmd5,aclid,gpid,zOrder,direction,negation) VALUES ";
    $f = array();
    while ($ligne = mysql_fetch_assoc($results)) {
        $direction = $ligne["direction"];
        $gpid = $ligne["gpid"];
        $zOrder = $ligne["zOrder"];
        $negation = $ligne["negation"];
        $aclid = $NEW_RULE_ID;
        $md5 = md5($aclid . $gpid . $direction);
        $f[] = "('{$md5}','{$aclid}','{$gpid}',{$zOrder},{$direction},{$negation})";
    }
    if (count($f) > 0) {
        $q->QUERY_SQL("{$prefix}" . @implode(",", $f));
        if (!$q->ok) {
            echo $q->mysql_error;
            return;
        }
    }
}
开发者ID:articatech,项目名称:artica,代码行数:59,代码来源:firehol.nic.rules.popup.php


示例14: start_parse

function start_parse()
{
    if ($GLOBALS["VERBOSE"]) {
        "echo Loading...\n";
    }
    $unix = new unix();
    if ($GLOBALS["VERBOSE"]) {
        "echo Loading done...\n";
    }
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid";
    $timefile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".time";
    $pid = @file_get_contents($pidfile);
    if (!$GLOBALS["FORCE"]) {
        if ($pid < 100) {
            $pid = null;
        }
        $unix = new unix();
        if ($unix->process_exists($pid, basename(__FILE__))) {
            if ($GLOBALS["VERBOSE"]) {
                echo "Already executed pid {$pid}\n";
            }
            return;
        }
        $timeexec = $unix->file_time_min($timefile);
        if ($timeexec < 10) {
            return;
        }
        $mypid = getmypid();
        @file_put_contents($pidfile, $mypid);
    }
    @unlink($timefile);
    @file_put_contents($timefile, time());
    $ldap = new clladp();
    if (!$ldap->IsKerbAuth()) {
        return;
    }
    $q = new mysql_squid_builder();
    $sql = "SELECT ID,GroupName FROM webfilters_sqgroups WHERE `enabled`=1 AND `GroupType`='proxy_auth_statad'";
    $results = $q->QUERY_SQL($sql);
    $REFRESH = false;
    $Count = mysql_num_rows($results);
    $UPDATED = array();
    while ($ligne = mysql_fetch_assoc($results)) {
        if (parse_object($ligne["ID"], $ligne["GroupName"])) {
            $UPDATED[] = $ligne["GroupName"];
            $REFRESH = true;
        }
    }
    if ($REFRESH) {
        squid_admin_mysql(1, "Reloading proxy service after updating " . count($UPDATED) . " Active Directory group(s)", @implode("\n", $UPDATED), __FILE__, __LINE__);
        $squid = $unix->LOCATE_SQUID_BIN();
        system("/etc/init.d/squid reload --force --script=exec.squid.static.ad.groups.php/" . __LINE__);
        $sock = new sockets();
        $EnableTransparent27 = intval($sock->GET_INFO("EnableTransparent27"));
        if ($EnableTransparent27 == 1) {
            system("/etc/init.d/squid-nat reload --script=" . basename(__FILE__));
        }
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:59,代码来源:exec.squid.static.ad.groups.php


示例15: showlist

function showlist()
{
    $page = 1;
    $q = new mysql_squid_builder();
    $tablesrc = "quotatemp_" . date("YmdH");
    $table = "(SELECT SUM(size) as size,ipaddr,familysite,uid,MAC FROM `{$tablesrc}` GROUP BY ipaddr,familysite,uid,MAC) as t";
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    $q = new mysql_squid_builder();
    $searchstring = string_to_flexquery();
    if ($searchstring != null) {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_events"));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_events"));
        $total = $ligne["TCOUNT"];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    if (!is_numeric($rp)) {
        $rp = 50;
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT *  FROM {$table} WHERE 1 {$searchstring} {$ORDER} {$limitSql}";
    if (isset($_GET["verbose"])) {
        echo "<hr><code>{$sql}</code></hr>";
    }
    $results = $q->QUERY_SQL($sql, "artica_events");
    if (!$q->ok) {
        json_error_show($q->mysql_error, 1);
    }
    if (mysql_num_rows($results) == 0) {
        json_error_show("{$table} no data", 1);
    }
    $data = array();
    $data['page'] = 1;
    $data['total'] = $total;
    $data['rows'] = array();
    //if(mysql_num_rows($results)==0){$data['rows'][] = array('id' => $ligne[time()],'cell' => array($sql,"", "",""));}
    while ($ligne = mysql_fetch_assoc($results)) {
        $ipaddr = $ligne["ipaddr"];
        $mac = $ligne["MAC"];
        $familysite = $ligne["familysite"];
        $uid = $ligne["uid"];
        $size = FormatBytes($ligne["size"] / 1024);
        $data['rows'][] = array('id' => md5(serialize($ligne)), 'cell' => array("<span style='font-size:14px'>{$uid}</span>", "<span style='font-size:14px'>{$ipaddr}</span>", "<span style='font-size:14px'>{$mac}</span>", "<span style='font-size:14px'>{$familysite}</span>", "<span style='font-size:14px'>{$size}</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:59,代码来源:squid.users-size-hour.php


示例16: save

function save()
{
    $q = new mysql_squid_builder();
    $q->QUERY_SQL("UPDATE webfilters_sqaclaccess SET httpaccess_data='{$_POST["parentid"]}' WHERE aclid='{$_POST["aclid"]}' AND httpaccess='cache_parent'");
    if (!$q->ok) {
        echo $q->mysql_error;
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:8,代码来源:squid.acls.proxy.parent.php


示例17: SquidAsMasterLogChilds

function SquidAsMasterLogChilds()
{
    $q = new mysql_squid_builder();
    $q->QUERY_SQL("UPDATE proxy_ports SET\n\tSquidAsMasterLogChilds={$_POST["SquidAsMasterLogChilds"]},\n\tSquidAsMasterCacheChilds={$_POST["SquidAsMasterCacheChilds"]},\n\tSquidAsMasterFollowxForward={$_POST["SquidAsMasterFollowxForward"]}\n\tWHERE ID='{$_POST["ID"]}'");
    if (!$q->ok) {
        echo $q->mysql_error;
    }
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:8,代码来源:squid.ports.parent.php


示例18: compile_destination

function compile_destination($cacheid)
{
    $unix = new unix();
    $sock = new sockets();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".compile_destination." . __FUNCTION__ . ".pid";
    $pid = $unix->get_pid_from_file($pidfile);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        $time = $unix->PROCCESS_TIME_MIN($pid);
        if ($GLOBALS["OUTPUT"]) {
            echo "Starting......: " . date("H:i:s") . " [INIT]: Nginx Already Artica task running PID {$pid} since {$time}mn\n";
        }
        return;
    }
    @file_put_contents($pidfile, getmypid());
    if (!is_numeric($cacheid)) {
        build_progress("Error Destination ID is not set", 110);
        return;
    }
    if ($cacheid == 0) {
        build_progress("Error Destination ID is Zero", 110);
        return;
    }
    $q = new mysql_squid_builder();
    $sql = "SELECT servername FROM reverse_www WHERE cache_peer_id={$cacheid}";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        build_progress("Error MySQL error", 110);
        echo $q->mysql_error;
        return;
    }
    $count = mysql_num_rows($results);
    if ($count == 0) {
        echo "{$sql}\n";
        build_progress("Error no destination for ID {$cacheid}", 110);
        return;
    }
    build_progress("{$count} Destination(s)", 5);
    $c = 0;
    $php = $unix->LOCATE_PHP5_BIN();
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $c++;
        $prc = $c / $count;
        $prc = $prc * 100;
        if ($prc > 90) {
            $prc = 90;
        }
        $servername = $ligne["servername"];
        build_progress("{reconfigure} {$servername}", $prc);
        system("{$php} /usr/share/artica-postfix/exec.nginx.single.php {$servername} --no-reload --output --no-buildmain");
    }
    build_progress("{cleaning_old_configs}...", 91);
    system("{$php} /usr/share/artica-postfix/exec.nginx.wizard.php --check-http");
    build_progress("{building_main_settings}", 95);
    system("{$php} /usr/share/artica-postfix/exec.nginx.php --main");
    build_progress("{$ligne["servername"]}: {reloading_reverse_proxy} ", 96);
    system("/etc/init.d/nginx reload --force");
    build_progress("{$ligne["servername"]}: {reloading_reverse_proxy}  {done}", 100);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:58,代码来源:exec.nginx.destinations.php


示例19: members_search

function members_search()
{
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql_squid_builder();
    $search = '%';
    $table = "usersisp";
    $page = 1;
    $FORCE_FILTER = null;
    if ($q->COUNT_ROWS($table) == 0) {
        json_error_show("Empty table");
    }
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    if ($_POST["query"] != null) {
        $_POST["query"] = "*" . $_POST["query"] . "*";
        $_POST["query"] = str_replace("**", "*", $_POST["query"]);
        $_POST["query"] = str_replace("**", "*", $_POST["query"]);
        $_POST["query"] = str_replace("*", "%", $_POST["query"]);
        $search = $_POST["query"];
        $searchstring = "AND (`{$_POST["qtype"]}` LIKE '{$search}')";
        $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE 1 {$FORCE_FILTER} {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE 1 {$FORCE_FILTER}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT *  FROM `{$table}` WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
    writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
    $results = $q->QUERY_SQL($sql);
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    if (!$q->ok) {
        json_error_show($q->mysql_error);
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $id = md5(serialize($ligne));
        $delete = "<a href=\"javascript:blur()\" OnClick=\"javascript:DeleteISPMEmber('{$ligne["userid"]}','{$id}','{$ligne["email"]}');\"><img src='img/delete-24.png'></a>";
        $enable = Field_checkbox("check-{$id}", 1, $ligne["enabled"], "ISPMemberEnable('{$ligne["userid"]}','check-{$id}')");
        $data['rows'][] = array('id' => $id, 'cell' => array("<span style='font-size:14px'>{$ligne["userid"]}</span>", "<span style='font-size:14px'>{$ligne["publicip"]}</span>", "<span style='font-size:14px'>{$ligne["email"]}</span>", $enable, $delete));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:58,代码来源:squid.isp.members.php


示例20: items_list

function items_list()
{
    //ini_set('html_errors',0);ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string','');ini_set('error_append_string','');
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql_squid_builder();
    $currentWeek = date("YW");
    $table = "{$currentWeek}_not_cached";
    $search = '%';
    $page = 1;
    if ($q->COUNT_ROWS("{$table}") == 0) {
        json_error_show("No datas");
    }
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    $searchstring = string_to_flexquery();
    if ($searchstring != null) {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER} {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        $total = $ligne["TCOUNT"];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT *  FROM {$table} WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        json_error_show($q->mysql_error . "\n{$sql}");
    }
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    if (mysql_num_rows($results) == 0) {
        json_error_show($q->mysql_error);
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $val = 0;
        $familysite = $ligne["familysite"];
        $size = FormatBytes($ligne["size"] / 1024);
        $hits = FormatNumber($ligne["hits"]);
        $data['rows'][] = array('id' => "{$familysite}", 'cell' => array("<span style='font-size:16px;'>{$familysite}</span>", "<span style='font-size:16px;font-weight:bold'>{$size}</span>", "<span style='font-size:16px;font-weight:bold'>{$hits}</span>"));
    }
    echo json_encode($data);
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:57,代码来源:admin.index.loadvg.squid.notcached-week.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mysqli类代码示例发布时间:2022-05-23
下一篇:
PHP mysql_class类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap