本文整理汇总了PHP中sockets::isFirehol方法的典型用法代码示例。如果您正苦于以下问题:PHP sockets::isFirehol方法的具体用法?PHP sockets::isFirehol怎么用?PHP sockets::isFirehol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sockets
的用法示例。
在下文中一共展示了sockets::isFirehol方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reconfigure_progress
function reconfigure_progress()
{
$sock = new sockets();
$unix = new unix();
$php = $unix->LOCATE_PHP5_BIN();
if (!$sock->isFirehol()) {
build_progress("{building_init_script}", 80);
build_init();
build_progress("{building_rules}", 80);
system("{$php} /usr/share/artica-postfix/exec.squid.transparent.php");
build_progress("FireWall service:{disabled}", 100);
return;
}
build_progress("{building_rules}", 10);
$fire = new firehol();
$fire->build();
build_progress("{stopping_firewall}", 50);
shell_exec("/usr/local/sbin/firehol stop");
build_progress("{starting_firewall}", 70);
shell_exec("/usr/local/sbin/firehol start");
build_progress("{building_init_script}", 80);
build_init();
build_progress("{done}", 100);
}
示例2: port_popup
function port_popup()
{
$ID = intval($_GET["ID"]);
$page = CurrentPageName();
$tpl = new templates();
if ($ID == 0) {
echo port_popup_main();
return;
}
$sock = new sockets();
PatchTable();
$q = new mysql_squid_builder();
$ligne = @mysql_fetch_array($q->QUERY_SQL("SELECT FTP,WANPROXY,MIKROTIK_PORT,transparent,TProxy,Parent,WCCP FROM proxy_ports WHERE ID={$ID}"));
$AS_TRANSPARENT = false;
$WCCP = intval($ligne["WCCP"]);
$Parent = intval($ligne["Parent"]);
$FTP = intval($ligne["FTP"]);
$WANPROXY = intval($ligne["WANPROXY"]);
$transparent = intval($ligne["transparent"]);
$MIKROTIK_PORT = intval($ligne["MIKROTIK_PORT"]);
$TProxy = intval($ligne["TProxy"]);
if ($WANPROXY == 1) {
$array["listen-port-popup"] = 'Wan Compressor Proxy';
$array["options"] = '{options}';
while (list($num, $ligne) = each($array)) {
if ($num == "options") {
$html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.ports.wanproxy.php?ID={$ID}\" style='font-size:18px'><span>{$ligne}</span></a></li>\n");
continue;
}
$html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes&ID={$ID}\" style='font-size:18px'><span>{$ligne}</span></a></li>\n");
}
echo build_artica_tabs($html, "main_proxy_listen_ports");
return;
}
if ($FTP == 1) {
$array["listen-port-popup"] = 'FTP Proxy';
$array["options"] = '{options}';
while (list($num, $ligne) = each($array)) {
if ($num == "options") {
$html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.ports.ftp.php?ID={$ID}\" style='font-size:18px'><span>{$ligne}</span></a></li>\n");
continue;
}
$html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes&ID={$ID}\" style='font-size:18px'><span>{$ligne}</span></a></li>\n");
}
echo build_artica_tabs($html, "main_proxy_listen_ports");
return;
}
if ($Parent == 1) {
$array["listen-port-popup"] = '{master_proxy}';
$array["options"] = '{options}';
$array["childs"] = '{childs_proxy}';
while (list($num, $ligne) = each($array)) {
if ($num == "options") {
$html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.ports.parent.php?ID={$ID}\" style='font-size:18px'><span>{$ligne}</span></a></li>\n");
continue;
}
if ($num == "childs") {
$html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.children.php?popup=yes&ID={$ID}\" style='font-size:18px'><span>{$ligne}</span></a></li>\n");
continue;
}
$html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes&ID={$ID}\" style='font-size:18px'><span>{$ligne}</span></a></li>\n");
}
echo build_artica_tabs($html, "main_proxy_listen_ports");
return;
}
if ($WCCP == 0) {
if ($transparent == 0) {
if ($MIKROTIK_PORT == 0) {
if (!$sock->isFirehol()) {
echo port_popup_main();
return;
}
}
}
}
if ($WCCP == 0) {
if (intval($ligne["transparent"]) == 1) {
$AS_TRANSPARENT = true;
}
if (intval($ligne["TProxy"]) == 1) {
$AS_TRANSPARENT = true;
}
if (!$AS_TRANSPARENT) {
echo port_popup_main();
return;
}
}
if ($WCCP == 1) {
$array["listen-port-popup"] = '{listen_port}';
$array["wccp-options"] = '{WCCP_NAME}';
}
if ($transparent == 1 or $TProxy == 1) {
$array["listen-port-popup"] = '{listen_port}';
$array["include"] = '{whitelisted_destination_networks}';
$array["exclude"] = "{whitelisted_src_networks}";
// 1 === Destination
// 0 === Source
}
while (list($num, $ligne) = each($array)) {
if ($num == "wccp-options") {
//.........这里部分代码省略.........