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


PHP mysql_squid_builder类代码示例

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


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


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