本文整理汇总了PHP中sockets::EnableUfdbGuardArtica方法的典型用法代码示例。如果您正苦于以下问题:PHP sockets::EnableUfdbGuardArtica方法的具体用法?PHP sockets::EnableUfdbGuardArtica怎么用?PHP sockets::EnableUfdbGuardArtica使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sockets
的用法示例。
在下文中一共展示了sockets::EnableUfdbGuardArtica方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: xstart
function xstart()
{
$pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".pid";
$pidtime = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".time";
$dbfile = "/var/log/squid/ufdbgclient.unlock.db";
$pid = @file_get_contents($pidfile);
if ($GLOBALS["VERBOSE"]) {
echo "{$pidtime}\n";
}
$unix = new unix();
$squid = $unix->LOCATE_SQUID_BIN();
if (!$GLOBALS["FORCE"]) {
if ($unix->process_exists($pid, basename(__FILE__))) {
$time = $unix->PROCCESS_TIME_MIN($pid);
unlock_events("Already executed pid {$pid} since {$time}mn-> DIE");
if ($GLOBALS["VERBOSE"]) {
echo "Already executed pid {$pid} since {$time}mn\n";
}
die;
}
}
$mypid = getmypid();
@file_put_contents($pidfile, $mypid);
$timefile = $unix->file_time_min($pidtime);
if ($GLOBALS["VERBOSE"]) {
echo "Timelock:{$pidtime} {$timefile} Mn\n";
}
if (!$GLOBALS["FORCE"]) {
if ($timefile < 5) {
if ($GLOBALS["VERBOSE"]) {
echo "{$timefile}mn require 5mn\n";
}
unlock_events("{$timefile}mn require 5mn");
return;
}
}
@unlink($pidtime);
@file_put_contents($pidtime, time());
$q = new mysql_squid_builder();
$sock = new sockets();
$EnableUfdbGuardArtica = $sock->EnableUfdbGuardArtica();
unlock_events("EnableUfdbGuardArtica={$EnableUfdbGuardArtica}");
$Count = $q->COUNT_ROWS("ufdbunlock");
if ($Count == 0) {
if ($GLOBALS["VERBOSE"]) {
echo "ufdbunlock = 0 rows\n";
}
unlock_events("ufdbunlock = 0 rows");
if (is_file($dbfile)) {
@unlink($dbfile);
if ($EnableUfdbGuardArtica == 0) {
if ($GLOBALS["FORCE"]) {
squid_admin_mysql(2, "Reconfigure Proxy service in order to release blocked {$_GET["reconfigure-unlock"]} website(s)", null, __FILE__, __LINE__);
unlock_events("/etc/init.d/squid reload --script=exec.ufdb.queue.release.php");
system("/etc/init.d/squid reload --script=exec.ufdb.queue.release.php/" . __LINE__);
return;
}
}
unlock_ufdbguard_artica();
return;
}
die;
}
if ($EnableUfdbGuardArtica == 1) {
unlock_ufdbguard_artica();
return;
}
$q->QUERY_SQL("DELETE FROM ufdbunlock WHERE finaltime <" . time());
$Count2 = $q->COUNT_ROWS("ufdbunlock");
if ($Count == $Count2) {
if ($Count2 == 0) {
@unlink($dbfile);
}
if ($GLOBALS["VERBOSE"]) {
echo "***** NOTHING ******\n";
}
if ($GLOBALS["FORCE"]) {
squid_admin_mysql(2, "Reconfigure Proxy service in order to release blocked {$_GET["reconfigure-unlock"]} website(s)", null, __FILE__, __LINE__);
system("/etc/init.d/squid reload --script=exec.ufdb.queue.release.php/" . __LINE__);
}
return;
}
$count3 = $Count - $Count2;
$unix = new unix();
$squid = $unix->LOCATE_SQUID_BIN();
squid_admin_mysql(2, "Reconfigure Proxy service in order to re-block blocked {$count3} websites", null, __FILE__, __LINE__);
system("/etc/init.d/squid reload --script=exec.ufdb.queue.release.php/" . __LINE__);
$sock = new sockets();
$EnableTransparent27 = intval($sock->GET_INFO("EnableTransparent27"));
if ($EnableTransparent27 == 1) {
system("/etc/init.d/squid-nat reload --script=" . basename(__FILE__));
}
}
示例2: build
//.........这里部分代码省略.........
}
if (count($k == 0)) {
$f[] = "acl localnet src all";
}
if (count($k > 0)) {
while (list($m, $l) = each($k)) {
$s[] = $l;
}
$f[] = "acl localnet src " . implode(" ", $s);
}
}
if ($ssl) {
}
$f[] = "acl all src all";
$f[] = "acl manager proto cache_object";
$f[] = "acl localhost src 127.0.0.1/32";
$f[] = "acl to_localhost dst 127.0.0.0/8 0.0.0.0/32";
$f[] = "acl SSL_ports port \"/etc/squid3/acls/SSLPorts\"";
$f[] = "acl Safe_ports port 80\t\t# http";
$f[] = "acl Safe_ports port 21\t\t# ftp";
$f[] = "acl Safe_ports port 443\t\t# https";
$f[] = "acl Safe_ports port 70\t\t# gopher";
$f[] = "acl Safe_ports port 210\t\t# wais";
$f[] = "acl Safe_ports port 1025-65535\t# unregistered ports";
$f[] = "acl Safe_ports port 280\t\t# http-mgmt";
$f[] = "acl Safe_ports port 488\t\t# gss-http";
$f[] = "acl Safe_ports port 591\t\t# filemaker";
$f[] = "acl Safe_ports port 777\t\t# multiling http";
$f[] = "acl CONNECT method CONNECT";
$f[] = "";
$f[] = "";
if ($sock->EnableUfdbGuard() == 1) {
$f[] = ufdbguard27();
$EnableUfdbGuardArtica = $sock->EnableUfdbGuardArtica();
if (!is_file("/etc/squid3/acls/office365-nets.acl")) {
@touch("/etc/squid3/acls/office365-nets.acl");
}
if (!is_file("/etc/squid3/acls/office365-domains.acl")) {
@touch("/etc/squid3/acls/office365-domains.acl");
}
if (!is_file("/etc/squid3/acls/skype-nets.acl")) {
@touch("/etc/squid3/acls/skype-nets.acl");
}
if (!is_file("/etc/squid3/acls/dropbox-nets.acl")) {
@touch("/etc/squid3/acls/dropbox-nets.acl");
}
$f[] = "acl squidclient proto cache_object";
$f[] = "acl MgRDest dst 127.0.0.1";
$f[] = "acl MgRPort dst 127.0.0.1";
$f[] = "acl MyTestPort src 127.0.0.1";
$f[] = "acl MyLocalIpsDest dst 127.0.0.1";
$f[] = "acl ToArticaWWW dstdomain .artica.fr .articatech.net .articatech.com";
if ($EnableUfdbGuardArtica == 0) {
$f[] = "acl UrlRewriteDenyList dstdomain \"/etc/squid3/url_rewrite_program.deny.db\"";
}
$f[] = "acl ArticaMetaWhiteDoms dstdomain \"/etc/squid3/artica-meta/whitelist-domains.db\"";
$f[] = "acl ArticaMetaWhiteIPs dst \"/etc/squid3/artica-meta/whitelist-nets.db\"";
$f[] = "acl BrowsersNoWebF browser -i \"/etc/squid3/acls/Browsers-nofilter.acl\"";
$f[] = "acl whitelisted_mac_computers arp \"/etc/squid3/whitelisted-computers-by-mac.acl\"";
$f[] = "acl office365_ips dst \"/etc/squid3/acls/office365-nets.acl\"";
$f[] = "acl office365_www dstdomain \"/etc/squid3/acls/office365-domains.acl\"";
$f[] = "acl skype_www dstdomain .live.com .skypeassets.com";
$f[] = "acl skype_ips dst \"/etc/squid3/acls/skype-nets.acl\"";
$f[] = "acl dropbox_ips dst \"/etc/squid3/acls/dropbox-nets.acl\"";
$f[] = "acl dropbox_www dstdomain .dropbox.com";
$f[] = @file_get_contents("/etc/squid3/url_rewrite_access.conf");