本文整理汇总了PHP中mysql_squid_builder::QUERY_SQL方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql_squid_builder::QUERY_SQL方法的具体用法?PHP mysql_squid_builder::QUERY_SQL怎么用?PHP mysql_squid_builder::QUERY_SQL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysql_squid_builder
的用法示例。
在下文中一共展示了mysql_squid_builder::QUERY_SQL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CategorizeAWebSite
function CategorizeAWebSite($www, $category)
{
$md5 = md5($www . $category);
$q = new mysql_squid_builder();
$q->CheckTables();
$uuid = $GLOBALS["UUID"];
$category_table = $q->category_transform_name($category);
$sql_add = "INSERT IGNORE INTO categorize (zmd5,zDate,category,pattern,uuid) VALUES('{$md5}',NOW(),'{$category}','{$www}','{$uuid}')";
$sql_add2 = "INSERT IGNORE INTO category_{$category_table} (zmd5,zDate,category,pattern,uuid) VALUES('{$md5}',NOW(),'{$category}','{$www}','{$uuid}')";
$q->QUERY_SQL($sql_add);
if (!$q->ok) {
echo $q->mysql_error . "\n{$sql_add}\n";
return false;
}
$q->QUERY_SQL($sql_add2);
if (!$q->ok) {
echo $q->mysql_error . "\n{$sql_add2}\n";
return false;
}
$categories = $q->GET_CATEGORIES($www, true);
if ($categories != null) {
$sql = "UPDATE visited_sites SET category='{$categories}' WHERE sitename='{$www}'";
$q->QUERY_SQL($sql);
if (!$q->ok) {
echo $q->mysql_error . "\n{$sql}\n";
return false;
}
}
}
示例2: 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);
}
示例3: 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");
}
示例4: 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);
}
示例5: 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);
}
示例6: page
function page()
{
$page = CurrentPageName();
$tpl = new templates();
$q = new mysql_squid_builder();
$t = time();
$sql = "SELECT zDate,not_categorized FROM tables_day ORDER BY zDate";
$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)) {
$xdata[] = $ligne["tdate"];
$ydata[] = $ligne["not_categorized"];
}
$targetedfile = "ressources/logs/" . basename(__FILE__) . "." . __FUNCTION__ . ".png";
$gp = new artica_graphs();
$gp->width = 880;
$gp->height = 350;
$gp->filename = "{$targetedfile}";
$gp->xdata = $xdata;
$gp->ydata = $ydata;
$gp->y_title = null;
$gp->x_title = $tpl->_ENGINE_parse_body("{days}");
$gp->title = null;
$gp->margin0 = true;
$gp->Fillcolor = "blue@0.9";
$gp->color = "146497";
$gp->line_green();
if (!is_file($targetedfile)) {
writelogs("Fatal \"{$targetedfile}\" no such file!", __FUNCTION__, __FILE__, __LINE__);
$targetedfile = "img/kas-graph-no-datas.png";
}
$sql = "SELECT zDate,not_categorized FROM tables_day WHERE not_categorized>0 ORDER BY zDate DESC";
$results = $q->QUERY_SQL($sql);
if (!$q->ok) {
echo "<H2>{$q->mysql_error}</H2><center style='font-size:11px'><code>{$sql}</code></center>";
}
$c = 0;
$table = null;
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$c++;
$table = $table . "<tr>\n\t\t\t<td style='font-size:14px' width=99%><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.visited.php?day={$ligne["zDate"]}&onlyNot=yes');\" style='font-size:14px;text-decoration:underline'>{$ligne["zDate"]}</a></td>\n\t\t\t<td style='font-size:14px' width=1%><strong>{$ligne["not_categorized"]}</strong></td>\n\t\t</tr>\n\t\t";
if ($c > 10) {
$c = 0;
$tr[] = "<table style='width:20%' class=form><tbody>{$table}</tbody></table>";
$table = null;
}
}
if ($c > 0) {
$tr[] = "<table style='width:20%' class=form><tbody>{$table}</tbody></table>";
}
$t = time();
echo $tpl->_ENGINE_parse_body("\n\t<div id='{$t}'>\n\t<div style='font-size:18px'>{not_categorized}/{days}</div>\n\t\n\t<center>\n\t<div style='margin:8px;float-right;width:100%'>" . button("{analyze}", "NoCategorizedAnalyze()") . "</div>\n\t<img src='{$targetedfile}?t=" . time() . "'>\n\t</center>\n\t" . CompileTrGen($tr, 6) . "\n\t</div>\n\t</div>\n\t<script>\n\t\t\n\tvar x_NoCategorizedAnalyze= function (obj) {\n\t\t\tvar tempvalue=obj.responseText;\n\t\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\t\tif(document.getElementById('squid_stats_consumption')){\n\t \t\tRefreshTab('squid_stats_consumption');\n\t\t\t}\n\t\t\t\n\t\t\tif(document.getElementById('squid_stats_central')){\n\t \t\tRefreshTab('squid_stats_central');\n\t\t\t}\t\t\t\n\t\t}\t\n\n\t\tfunction NoCategorizedAnalyze(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('NoCategorizedAnalyze','yes');\n\t\t\tAnimateDiv('{$t}');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_NoCategorizedAnalyze);\n\t\t}\n\t</script>\t\t\n\t\n\t");
}
示例7: page
function page()
{
$sock = new sockets();
$EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance");
$MalwarePatrolDatabasesCount = $sock->getFrameWork("cmd.php?MalwarePatrolDatabasesCount=yes");
if (GET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__)) {
return;
}
$page = CurrentPageName();
$tpl = new templates();
$q = new mysql_squid_builder();
$users = new usersMenus();
$websitesnums = $q->COUNT_ROWS("visited_sites");
$websitesnums = numberFormat($websitesnums, 0, "", " ");
$sql = "DELETE FROM categorize WHERE LENGTH(pattern)=0";
$q->QUERY_SQL($sql);
$export = $q->COUNT_ROWS("categorize");
$export = numberFormat($export, 0, "", " ");
$categories = $q->COUNT_CATEGORIES();
$categories = numberFormat($categories, 0, "", " ");
$tablescat = $q->LIST_TABLES_CATEGORIES();
$tablescatNUM = numberFormat(count($tablescat), 0, "", " ");
$q = new mysql_squid_builder();
$requests = $q->EVENTS_SUM();
$requests = numberFormat($requests, 0, "", " ");
$PhishingURIS = $q->COUNT_ROWS("uris_phishing");
$PhishingURIS = numberFormat($PhishingURIS, 0, "", " ");
$MalwaresURIS = $q->COUNT_ROWS("uris_malwares");
$MalwaresURIS = numberFormat($MalwaresURIS, 0, "", " ");
$Computers = $q->COUNT_ROWS("webfilters_nodes");
$Computers = numberFormat($Computers, 0, "", " ");
$DAYSNumbers = $q->COUNT_ROWS("tables_day");
$ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(totalsize) as tsize FROM tables_day"));
$totalsize = FormatBytes($ligne["tsize"] / 1024);
$ligne = mysql_fetch_array($q->QUERY_SQL("SELECT AVG(cache_perfs) as pourc FROM tables_day"));
$pref = round($ligne["pourc"]);
$ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM visited_sites WHERE LENGTH(category)=0"));
$websitesnumsNot = numberFormat($ligne["tcount"], 0, "", " ");
$CachePermformance = $q->CachePerfHour();
if ($CachePermformance > -1) {
$color = "#E01313";
if ($CachePermformance > 20) {
$color = "#6DBB6A";
}
$cachePerfText = "\n\t\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b style='color:{$color}'>{$CachePermformance}%</b> {cache_performance} ({now})</td>\n\t\t</tr>\n\t\t";
}
$mouse = "OnMouseOver=\";this.style.cursor='pointer';\" OnMouseOut=\";this.style.cursor='default';\"";
$submenu = "\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$totalsize}</b> {downloaded_flow}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$pref}%</b> {cache_performance}</td>\n\t</tr>\n\t";
$main_table = "\n\t<table style='width:98%' class=form>\n\t<tr><td style='font-size:16px'>{statistics}::{status}</td></tr>\n\t{$cachePerfText}\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;><b>{$DAYSNumbers}</b> {daysOfStatistics}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$requests}</b> {requests}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$Computers}</b> {computers}</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$websitesnums}</b> {visited_websites}</td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$categories}</b> {websites_categorized}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$PhishingURIS}</b> {phishing_uris}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$MalwaresURIS}</b> {viruses_uris}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$MalwarePatrolDatabasesCount}</b> Malware Patrol</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$websitesnumsNot}</b> {not_categorized}</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$tablescatNUM}</b> {categories}</td>\n\t</tr>\n\t</table>\t\n";
$main_table = $tpl->_ENGINE_parse_body($main_table);
SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $main_table);
echo $main_table;
}
示例8: CICAPEnableSquidGuardSave
function CICAPEnableSquidGuardSave()
{
$q = new mysql_squid_builder();
$sock = new sockets();
$q->CheckTablesICAP();
$sock->SET_INFO("CICAPEnableSquidGuard", $_POST["CICAPEnableSquidGuard"]);
if ($_POST["CICAPEnableSquidGuard"] == 1) {
$q->QUERY_SQL("UPDATE c_icap_services SET enabled=1,zOrder=3 WHERE ID=12");
} else {
$q->QUERY_SQL("UPDATE c_icap_services SET enabled=0 WHERE ID=12");
}
}
示例9: 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);
}
示例10: 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"]}");
}
示例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");
}
示例12: 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);
}
示例13: 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;
}
示例14: 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);
}
示例15: 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;
}