コード例 #1
0
ファイル: squid.browsers.php プロジェクト: BillTheBest/1.6.x
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
    if ($SquidPerformance > 1) {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{artica_statistics_disabled}"));
        return;
    }
    $q = new mysql_squid_builder();
    $q->CheckTables();
    $type = $tpl->_ENGINE_parse_body("{type}");
    $browsers = $tpl->_ENGINE_parse_body("{browsers}");
    $items = $tpl->_ENGINE_parse_body("{items}");
    $add = $tpl->_ENGINE_parse_body("{add}");
    $delete_group_ask = $tpl->javascript_parse_text("{inputbox delete group}");
    $title = $tpl->javascript_parse_text("{browsers}");
    $t = time();
    $table_width = 630;
    $table_height = 450;
    $buttons = "buttons : [\n\t{name: '{$new_group}', bclass: 'add', onpress : AddGroup},\n\t\t],\t";
    $buttons = null;
    $html = $tpl->_ENGINE_parse_body("") . "\n\t<table class='table-{$t}' style='display: none' id='table-{$t}' style='width:99%'></table>\n<script>\n\$(document).ready(function(){\n\$('#table-{$t}').flexigrid({\n\turl: '{$page}?list=yes',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$browsers}', name : 'pattern', width : 904, sortable : true, align: 'left'},\n\t\t{display: '{$add}', name : 'pattern', width : 81, sortable : false, align: 'center'},\n\t\t\n\t\t\n\t],\n\n\tsearchitems : [\n\t\t{display: '{$browsers}', name : 'pattern'},\n\t\t],\n\tsortname: 'pattern',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '<span style=font-size:18px>{$title}</span>',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: {$table_height},\n\tsingleSelect: true\n\t\n\t});   \n});\n</script>\n\t";
    echo $html;
}
コード例 #2
0
function smtp_tls_policy_maps_table()
{
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $sock = new sockets();
    $q = new mysql();
    if (!$q->TABLE_EXISTS("smtp_tls_policy_maps", "artica_backup")) {
        $q = new mysql_builder();
        if (!$q->CheckTablePostfixTls()) {
            echo FATAL_ERROR_SHOW_128($q->mysql_error_html());
            return;
        }
    }
    $t = time();
    $hostname = $_GET["hostname"];
    $hostname_enc = urlencode($hostname);
    $title = $tpl->javascript_parse_text("{tls_table_explain}");
    $about = $tpl->javascript_parse_text("{about2}");
    $about_text = $tpl->javascript_parse_text("{tls_table_explain}");
    $add_tls_smtp_server = $tpl->javascript_parse_text("{add_tls_smtp_server}");
    $servername = $tpl->javascript_parse_text("{servername2}");
    $option = $tpl->javascript_parse_text("{option}");
    $delete = $tpl->javascript_parse_text("{delete}");
    $add = "{name: '{$add_tls_smtp_server}', bclass: 'add', onpress : add_tls_smtp_server{$t}},";
    $aboutButton = "{name: '{$about}', bclass: 'Help', onpress : About{$t}},";
    $buttons = "\n\t\tbuttons : [\n\t\t{$add}\n\t\t{$aboutButton}\n\t\t],";
    $explain = $tpl->javascript_parse_text("{postfix_transport_table_explain}");
    $html = "\n<table class='POSTFIX_TLS_TABLE' style='display: none' id='POSTFIX_TLS_TABLE' style='width:100%'></table>\n<script>\n\$(document).ready(function(){\n\t\t\$('#POSTFIX_TLS_TABLE').flexigrid({\n\t\turl: '{$page}?list=yes&hostname={$hostname_enc}&t={$t}',\n\t\tdataType: 'json',\n\t\tcolModel : [\n\t\t{display: '{$servername}', name : 'servername', width : 546, sortable : true, align: 'left'},\n\t\t{display: '{$option}', name : 'tls_option', width :309, sortable : true, align: 'left'},\n\t\t{display: '{$delete}', name : 'delete', width : 77, sortable : false, align: 'center'},\n\t\t],\n\t\t{$buttons}\n\t\tsearchitems : [\n\t\t{display: '{$servername}', name : 'servername'},\n\t\t],\n\t\tsortname: 'servername',\n\t\tsortorder: 'asc',\n\t\tusepager: true,\n\t\ttitle: '<span style=font-size:18px>{$title}</span>',\n\t\tuseRp: true,\n\t\trp: 50,\n\t\tshowTableToggleBtn: false,\n\t\twidth: '99%',\n\t\theight: 450,\n\t\tsingleSelect: true,\n\t\trpOptions: [10, 20, 30, 50,100,200]\n\t\n\t});\n});\n\t\nfunction About{$t}(){\n\talert('{$about_text}');\n}\n\t\nfunction add_tls_smtp_server{$t}(){\n\tLoadjs('{$page}?tls-js=yes&ID=0&t={$t}&hostname={$hostname_enc}');\n}\n\t\n</script>\n\t";
    echo $html;
}
コード例 #3
0
function tabs()
{
    $fontsize = 18;
    $tpl = new templates();
    $page = CurrentPageName();
    $users = new usersMenus();
    $sock = new sockets();
    $SquidUrgency = intval($sock->GET_INFO("SquidUrgency"));
    if ($SquidUrgency == 1) {
        echo FATAL_ERROR_SHOW_128("<div style='font-size:22px'>{proxy_in_emergency_mode}</div>\n\t\t\t<div style='font-size:18px'>{proxy_in_emergency_mode_explain}</div>\n\t\t\t<div style='text-align:right'><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.urgency.php?justbutton=yes');\"\n\t\t\tstyle='text-decoration:underline'>{disable_emergency_mode}</a></div>\t\n\t\t\t");
        return;
    }
    $array["thishour"] = '{this_hour}';
    $array["thishour2"] = '{this_hour} ({compressed})';
    while (list($num, $ligne) = each($array)) {
        if ($num == "thishour") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.accesslogs.php\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "thishour2") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.accesslogs.compressed.php\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "thishour3") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.accesslogs.day.compressed.php\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}={$time}\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n");
    }
    echo build_artica_tabs($html, "main_squid_logs_subtabs");
}
コード例 #4
0
function popup()
{
    $tpl = new templates();
    $users = new usersMenus();
    $checks = true;
    if (!$users->LDAP_BACKLDAP) {
        $checks = false;
    }
    if (!$users->LDAP_BACKMETA) {
        $checks = false;
    }
    if (!$checks) {
        FATAL_ERROR_SHOW_128("{ldap_doesnt_support_proxy}");
        return;
    }
    $ID = $_GET["ID"];
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $TB_HEIGHT = 300;
    $TB_WIDTH = 630;
    $t = time();
    $new_entry = $tpl->_ENGINE_parse_body("{new_rewrite_rule}");
    $attribute = $tpl->_ENGINE_parse_body("{attribute}");
    $type = $tpl->_ENGINE_parse_body("{type}");
    $match = $tpl->_ENGINE_parse_body("{match}");
    $ask_delete_rule = $tpl->javascript_parse_text("{ask_delete_rule}");
    $buttons = "\n\tbuttons : [\n\t{name: '{$new_entry}', bclass: 'Add', onpress : NewGItem{$t}},\n\t{name: 'Active Directory', bclass: 'Add', onpress : NewADItems{$t}},\n\t{name: 'OpenLDAP', bclass: 'Add', onpress : NewOLDItems{$t}},\n\t\n\t],\t";
    $html = "\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:99%'></table>\n<script>\nvar mem{$t}='';\n\$(document).ready(function(){\n\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?items-rules=yes&t={$t}&ID={$ID}',\n\tdataType: 'json',\n\tcolModel : [\t\n\t\t{display: '{$attribute}', name : 'attribute', width :200, sortable : true, align: 'left'},\n\t\t{display: '{$type}', name : 'type', width :128, sortable : false, align: 'left'},\n\t\t{display: '{$match}', name : 'match', width :200, sortable : true, align: 'left'},\n\t\t{display: '&nbsp;', name : 'action', width :31, sortable : false, align: 'center'},\n\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t\t{display: '{$attribute}', name : 'attribute'},\n\t\t{display: '{$type}', name : 'type'},\n\t\t{display: '{$match}', name : 'match'},\n\t\t\n\t\t\n\n\t],\n\tsortname: 'attribute',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '{$title}',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: {$TB_WIDTH},\n\theight: {$TB_HEIGHT},\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500]\n\t\n\t});   \n});\n\nfunction ItemHelp{$t}(){\n\ts_PopUpFull('http://www.mail-appliance.org/index.php?cID=305','1024','900');\n}\n\n\n\n\nvar x_NewGItem{$t}=function(obj){\n\tvar tempvalue=obj.responseText;\n    if(tempvalue.length>3){alert(tempvalue);}\n    \$('#flexRT{$t}').flexReload();\n}\n\nfunction NewADItems{$t}(){\n \t\tvar XHR = new XHRConnection();\n      \tXHR.appendData('ADADD',{$ID});\n      \tXHR.sendAndLoad('{$page}', 'POST', x_NewGItem{$t});\n\n}\nfunction NewOLDItems{$t}(){\n\t\tvar XHR = new XHRConnection();\n      \tXHR.appendData('ADLDAP',{$ID});\n      \tXHR.sendAndLoad('{$page}', 'POST', x_NewGItem{$t});\n}\nfunction NewGItem{$t}(){\n\tYahooWin5('550','{$page}?ID=&t={$t}&proxyid={$ID}','{$new_entry}');\n\t\n}\nfunction GItem{$t}(ID,title){\n\tYahooWin5('550','{$page}?ID='+ID+'&t={$t}&proxyid={$ID}',title);\n\t\n}\n\nvar x_DeleteAttribute{$t}=function(obj){\n\tvar tempvalue=obj.responseText;\n    if(tempvalue.length>3){alert(tempvalue);return;}\n    \$('#row'+mem{$t}).remove();\n}\n\nfunction DeleteAttribute{$t}(ID){\n\t\tmem{$t}=ID;\n \t\tvar XHR = new XHRConnection();\n      \tXHR.appendData('del-ID',ID);\n      \tXHR.sendAndLoad('{$page}', 'POST',x_DeleteAttribute{$t});\t\t\n\t}\n\n</script>";
    echo $html;
    //openldap_proxy
}
コード例 #5
0
function tabs()
{
    $sock = new sockets();
    $fontsize = 16;
    $tpl = new templates();
    $page = CurrentPageName();
    $date = date("Ym");
    $table = "{$date}_maccess";
    $q = new mysql_squid_builder();
    if (!$q->TABLE_EXISTS($table)) {
        echo FATAL_ERROR_SHOW_128("{no_table_see_support}");
        return;
    }
    $array["popup"] = '{members_this_month}';
    while (list($num, $ligne) = each($array)) {
        if ($num == "parameters") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.accesslogs.params.php?parameters=yes\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "schedule") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.databases.schedules.php?TaskType=54\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n");
    }
    echo build_artica_tabs($html, "squid_users_profiling", 1100) . "<script>LeftDesign('user-stats-256.png');</script>";
}
コード例 #6
0
ファイル: system.snmp.php プロジェクト: articatech/artica
function popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $squid = new squidbee();
    $sock = new sockets();
    $users = new usersMenus();
    $installed = $sock->getFrameWork("snmpd.php?installed=yes");
    if ($installed != "TRUE") {
        $button = button("{manual_install}", "Loadjs('system.snmpd.install.php');", 22);
        $data = FATAL_ERROR_SHOW_128("{SNMPD_NOT_INSTALLED}<center style='margin:10px'>{$button}</center>");
        echo $tpl->_ENGINE_parse_body($data);
        return;
    }
    $EnableSNMPD = $sock->GET_INFO("EnableSNMPD");
    if (!is_numeric($EnableSNMPD)) {
        $EnableSNMPD = 0;
    }
    $SNMPDCommunity = $sock->GET_INFO("SNMPDCommunity");
    if ($SNMPDCommunity == null) {
        $SNMPDCommunity = "public";
    }
    $t = time();
    $SNMPDNetwork = $sock->GET_INFO("SNMPDNetwork");
    if ($SNMPDNetwork == null) {
        $SNMPDNetwork = "default";
    }
    $js2 = null;
    if ($users->SQUID_INSTALLED) {
        $js2 = "LoadAjax('squid-snmp','squid.snmp.php?popup=yes');";
    }
    $html = "\n\t<div id='{$t}' style='width:100%'>\n\t<table style=width:100%>\n\t<tr>\n\t<td style='width:350px;vertical-align:top'><span id='snmpd-service'></span></td>\n\t<td valign='top'>\n\t<div style='width:98%' class=form>\n\t<table >\n\t\t\t\t<tr>\n\t\t\t<td colspan=2 style='font-size:30px;'><strong>{monitor_your_system} (SNMP)</strong><p>&nbsp</p></td>\n\t\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t\n\t\t\t<td colspan=2>" . Paragraphe_switch_img("{enable_snmp} - {system}", "{enable_snmp_system}", "EnableSNMPD", $EnableSNMPD, null, 1140) . "</td>\n\t\t</tr>\n\t\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:30px'>{snmp_community}:</td>\n\t\t\t<td style='font-size:16px'>" . Field_text("SNMPDCommunity", $SNMPDCommunity, "font-size:30px;width:300px") . " SNMPv2c</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:30px'>{allowed_network}:</td>\n\t\t\t<td style='font-size:16px'>" . Field_text("SNMPDNetwork", $SNMPDNetwork, "font-size:30px;width:300px") . " SNMPv2c</td>\n\t\t</tr>\t\t\t\t\t\n\t\t<tr>\n\t\t<td align='right' colspan=2><hr>" . button("{apply}", "SaveSNMP{$t}()", "40px") . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t<div id='squid-snmp'></div>\n\t\n\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t<script>\n\tvar x_SaveSNMP{$t}=function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);return;}\n\t\tCacheOff();\n\t\tLoadAjaxRound('system-snmp','system.snmp.php');\n\t}\t\n\t\n\tfunction SaveSNMP{$t}(){\n\t\t\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('EnableSNMPD',document.getElementById('EnableSNMPD').value);\n\t\tXHR.appendData('SNMPDCommunity',encodeURIComponent(document.getElementById('SNMPDCommunity').value));\n\t\tXHR.appendData('SNMPDNetwork',document.getElementById('SNMPDNetwork').value);\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveSNMP{$t});\t\n\t\t\n\t}\t\n\t\n\tLoadAjax('snmpd-service','{$page}?snmpd-service=yes');\n\t{$js2}\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #7
0
function tabs(){

	$tpl=new templates();
	$users=new usersMenus();
	$page=CurrentPageName();
	$squid=new squidbee();
	
	$fontsize=20;
	
	$sock=new sockets();
	$compilefile="ressources/logs/squid.compilation.params";
	if(!is_file($compilefile)){$sock->getFrameWork("squid.php?compil-params=yes");}
	$COMPILATION_PARAMS=unserialize(base64_decode(file_get_contents($compilefile)));
	
	$DisableSSLStandardPort=$sock->GET_INFO("DisableSSLStandardPort");
	if(!is_numeric($DisableSSLStandardPort)){$DisableSSLStandardPort=1;}
	
	if($DisableSSLStandardPort==0){$StandardPortSSL=1;}else{$StandardPortSSL=0;}
	
	if(!isset($COMPILATION_PARAMS["enable-ssl"])){
		echo FATAL_ERROR_SHOW_128("{error_squid_ssl_not_compiled}");
		return;
	
	}
	
	$array["popup"]="{status}";
	if($StandardPortSSL==1){
		if($squid->SSL_BUMP_WHITE_LIST==1){
			$array["ssl-decrypt"]="{decrypted_ssl_websites}";
		}else{
			$array["ssl-whitelist"]="{whitelist}";
		}
	}
	
	$t=time();
	while (list ($num, $ligne) = each ($array) ){
		
		if($num=="ssl-decrypt"){
			$html[]= $tpl->_ENGINE_parse_body("<li><a href=\"squid.ssl.encrypt.php\" style='font-size:$fontsize;font-weight:normal'><span>$ligne</span></a></li>\n");
			continue;
		}
		
		if($num=="ssl-whitelist"){
			$html[]= $tpl->_ENGINE_parse_body("<li><a href=\"squid.sslbump.php?whitelist=yes\" style='font-size:$fontsize;font-weight:normal'><span>$ligne</span></a></li>\n");
			continue;
		}		
	
		$html[]= $tpl->_ENGINE_parse_body("<li><a href=\"$page?$num=$t\" style='font-size:$fontsize;font-weight:normal'><span>$ligne</span></a></li>\n");
	
	}
	
	
	
	$html=build_artica_tabs($html,'main_ssl_center_tabs',975)."<script>LeftDesign('ssl-256-white-opac20.png');</script>";
	
	echo $html;



}
コード例 #8
0
ファイル: pdns.restricts.php プロジェクト: brucewu16899/1.6.x
function table()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $q = new mysql();
    $TB_HEIGHT = 500;
    $TB_WIDTH = 880;
    $domains = $tpl->_ENGINE_parse_body("{domains}");
    $new_domain_controller = $tpl->_ENGINE_parse_body("{new_domain_controller}");
    $table = "records";
    $database = 'powerdns';
    $t = time();
    if (!$q->TABLE_EXISTS("records", "powerdns")) {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{error_missing_tables_click_to_repair}") . "\n\t\t<hr>\n\t\t<center id='{$t}'>" . button("{repair}", "RepairPDNSTables()", "22px") . "</center>\n\t\t<script>\n\t\t\tvar x_RepairPDNSTables=function (obj) {\n\t\t\t\t\tvar results=obj.responseText;\n\t\t\t\t\tif(results.length>0){alert(results);}\t\n\t\t\t\n\t\t\t\t\tRefreshTab('main_config_pdns');\n\t\t\t\t}\n\t\t\tfunction RepairPDNSTables(){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tXHR.appendData('RepairPDNSTables','yes');\n\t\t\t\tAnimateDiv('{$t}');\n\t\t\t    XHR.sendAndLoad('{$page}', 'POST',x_RepairPDNSTables);\t\n\t\t\t}\n\t\t\t</script>\t\t\n\t\t\n\t\t");
        return;
    }
    $new_entry = $tpl->_ENGINE_parse_body("{new_allowed_address}");
    $t = time();
    $address = $tpl->_ENGINE_parse_body("{address}");
    $restriction = $tpl->javascript_parse_text("{restriction}");
    $addText = $tpl->javascript_parse_text("{pdns_restrict_explain}");
    $buttons = "\n\tbuttons : [\n\t{name: '{$new_entry}', bclass: 'Add', onpress : NewPDNSEntry2{$t}},\n\t{name: '{$restriction}', bclass: 'Settings', onpress : Restrictions{$t}},\n\t\n\t],\t";
    //$('#flexRT$t').flexReload();
    $html = "\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:99%'></table>\n<script>\nvar mem{$t}='';\n\$(document).ready(function(){\n\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?items=yes&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$address}', name : 'address', width :765, sortable : true, align: 'left'},\n\t\t{display: '&nbsp;', name : 'delete', width :31, sortable : false, align: 'center'},\n\t\t\n\t\t \t\n\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t\t{display: '{$address}', name : 'address'},\n\t],\n\tsortname: 'address',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: 845,\n\theight: {$TB_HEIGHT},\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500]\n\t\n\t});   \n});\n\n\tvar x_PdnsZoneDelete{$t}=function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);return;}\t\n\t\t\$('#row'+mem{$t}).remove();\n\t}\n\nfunction PdnsAddressDelete{$t}(addr,id){\n\tmem{$t}=id;\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('delete-item',addr);\n    XHR.sendAndLoad('{$page}', 'POST',x_PdnsZoneDelete{$t});\t\n\t}\n\t\nfunction Restrictions{$t}(){\n\tYahooWin2('600','{$page}?restrictions=yes&t={$t}','{$restriction}');\n}\n\t\n\tvar x_SaveDNSEntry{$t}=function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif (results.length>0){alert(results);return;}\n\t\t\$('#flexRT{$t}').flexReload();\n\t}\t\t\n\n\tfunction NewPDNSEntry2{$t}(id){\n\t\tvar addr=prompt('{$addText}');\n\t\tif(addr){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('addr',addr);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveDNSEntry{$t});\t\t\t\n\t\t\n\t\t}\n\t}\n\n\n\t\n</script>";
    echo $html;
}
コード例 #9
0
function popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $ArticaHotSpotEmergency = intval($sock->GET_INFO("ArticaHotSpotEmergency"));
    $ArticaHotSpotPort = $sock->GET_INFO("ArticaHotSpotPort");
    $ArticaSSLHotSpotPort = $sock->GET_INFO("ArticaSSLHotSpotPort");
    $ArticaSplashHotSpotPort = $sock->GET_INFO("ArticaSplashHotSpotPort");
    $ArticaSplashHotSpotPortSSL = $sock->GET_INFO("ArticaSplashHotSpotPortSSL");
    if (!is_numeric($ArticaHotSpotPort)) {
        $ArticaHotSpotPort = 0;
    }
    if (!is_numeric($ArticaSplashHotSpotPort)) {
        $ArticaSplashHotSpotPort = 16080;
    }
    if (!is_numeric($ArticaSplashHotSpotPortSSL)) {
        $ArticaSplashHotSpotPortSSL = 16443;
    }
    $HotSpotGatewayAddr = $sock->GET_INFO("HotSpotGatewayAddr");
    $HotSpotGatewayAddr_org = $HotSpotGatewayAddr;
    $HotSpotGatewayAddrZ = explode(".", $HotSpotGatewayAddr);
    $HotSpotGatewayAddrz[3] = rand(1, 254);
    $HotSpotGatewayAddr = @implode(".", $HotSpotGatewayAddrz);
    $t = time();
    $ipaddr = $tpl->javascript_parse_text("{ipaddr}");
    $emergency_bt = "<center style='margin:30px'>" . button("{global_urgency_mode}", "Loadjs('squid.hostspot.emergency.enable.progress.php')", 40) . "</center>";
    if ($ArticaHotSpotEmergency == 1) {
        $emergency_bt = "<center style='margin:30px'>" . button("{disable_emergency_mode}", "Loadjs('squid.hostspot.emergency.disable.progress.php')", 40) . "</center>";
        $error = FATAL_ERROR_SHOW_128("{hotspot_in_emergency_mode_explain}");
    }
    $html = "\n\t<inpuyt type='hidden' id='layer-hotspot-maintenance' value='1'>\n\t{$error}\n\t<div style='width:98%' class=form>\n\t<center style='margin:30px'>" . button("{restart_web_service}", "Loadjs('squid.hostspot.restart.web.progress.php')", 40) . "</center>\n\t{$emergency_bt}\n\t\n\t\t\t\n\t\t\t\n\t</div>\n\t<script>\n\n\t</script>\t\t\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #10
0
function page()
{
    $ID = intval($_GET["ID"]);
    $tpl = new templates();
    $page = CurrentPageName();
    $fields_size = 22;
    $rv = new squid_reverse();
    $q = new mysql_squid_builder();
    $sock = new sockets();
    $t = time();
    $servername = $_GET["servername"];
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM reverse_www WHERE servername='{$servername}'"));
    $cache_peer_id = $ligne["cache_peer_id"];
    $ligne2 = mysql_fetch_array($q->QUERY_SQL("SELECT cacheid FROM reverse_sources WHERE ID='{$cache_peer_id}'"));
    if (intval($ligne2) == 0) {
        echo FATAL_ERROR_SHOW_128("{nginx_error_no_cache_defined}");
        return;
    }
    $html[] = "<div style='width:98%' class=form>";
    $html[] = "<table style='width:100%'>";
    $html[] = "<tr><td colspan=2 style='font-size:40px;padding-bottom:20px'>{caching}</td></tr>";
    $html[] = Field_checkbox_table("proxy_buffering-{$t}", "{proxy_buffering}", $ligne["proxy_buffering"], $fields_size, "{proxy_buffering_text}");
    $html[] = Field_text_table("proxy_cache_min_uses-{$t}", "{proxy_cache_min_uses}", $ligne["proxy_cache_min_uses"], $fields_size, "{proxy_cache_min_uses_text}", 120);
    $html[] = Field_text_table("proxy_cache_valid-{$t}", "{proxy_cache_valid} ({minutes})", $ligne["proxy_cache_valid"], $fields_size, "{proxy_cache_valid_text}", 120);
    $html[] = Field_ipv4_table("proxy_buffers-{$t}", "{proxy_buffers}", $ligne["proxy_buffers"], $fields_size, "{proxy_buffers_text}", 120);
    $html[] = Field_text_table("proxy_buffer_size-{$t}", "{proxy_buffer_size} (k)", $ligne["proxy_buffer_size"], $fields_size, "{proxy_buffer_size_text}", 110);
    $html[] = Field_text_table("proxy_temp_file_write_size-{$t}", "{proxy_temp_file_write_size} (k)", $ligne["proxy_temp_file_write_size"], $fields_size, "{proxy_temp_file_write_size_text}", 110);
    $html[] = Field_text_table("proxy_max_temp_file_size-{$t}", "{proxy_max_temp_file_size} (MB)", $ligne["proxy_max_temp_file_size"], $fields_size, "{proxy_max_temp_file_size_text}", 110);
    $html[] = Field_button_table_autonome("{apply}", "Submit{$t}", 40);
    $html[] = "</table>";
    $html[] = "</div>\n\t<script>\n\tvar xSubmit{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\tRefreshTab('main_nginx_server');\n\t\t\$('#NGINX_MAIN_TABLE').flexReload();\n\t\t\$('#NGINX_DESTINATION_MAIN_TABLE').flexReload();\n\t\tvar ID={$ID}\n\t\tif(ID==0){ YahooWin2Hide();}\n\t\n\t}\n\t\n\t\n\tfunction Submit{$t}(){\n\t\tvar proxy_buffering=0\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('general-settings','{$servername}');\n\t\tif(document.getElementById('proxy_buffering-{$t}').checked){proxy_buffering=1;}\n\t\tXHR.appendData('proxy_cache_min_uses',document.getElementById('proxy_cache_min_uses-{$t}').value);\n\t\tXHR.appendData('proxy_buffering',proxy_buffering);\n\t\tXHR.appendData('proxy_cache_valid',document.getElementById('proxy_cache_valid-{$t}').value);\n\t\tXHR.appendData('proxy_buffers',document.getElementById('proxy_buffers-{$t}').value);\n\t\tXHR.appendData('proxy_buffer_size',document.getElementById('proxy_buffer_size-{$t}').value);\n\t\t\n\t\tXHR.appendData('proxy_max_temp_file_size',document.getElementById('proxy_max_temp_file_size-{$t}').value);\n\t\tXHR.appendData('proxy_temp_file_write_size',document.getElementById('proxy_temp_file_write_size-{$t}').value);\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t}\n\t</script>\n\t\t\n\t";
    echo $tpl->_ENGINE_parse_body(@implode("\n", $html));
}
コード例 #11
0
function tabs(){
	$page=CurrentPageName();
	$tpl=new templates();
	$users=new usersMenus();

	if(!$users->WIFIDOG_INSTALLED){
		echo FATAL_ERROR_SHOW_128("{ERROR_SERVICE_NOT_INSTALLED} <hr><center>".button("{manual_update}", "Loadjs('update.upload.php')",32)."</center>");
		return;
	}

	$array["popup"]='{self_register}';
	$array["smtp-params"]='{smtp_parameters}';
	$fontsize=18;
	
	$t=time();
	while (list ($num, $ligne) = each ($array) ){
		if($num=="members"){
			$html[]= $tpl->_ENGINE_parse_body("<li><a href=\"squid.webauth.members.php?members=yes\" style='font-size:$fontsize'><span>$ligne</span></a></li>\n");
			continue;
		}

		$html[]= $tpl->_ENGINE_parse_body("<li><a href=\"$page?$num=$t$YahooWinUri\" style='font-size:$fontsize'><span>$ligne</span></a></li>\n");
	}

	echo build_artica_tabs($html, "squid_hotspot_smtp")."<script>LeftDesign('wifi-white-256-opac20.png');</script>";


	
}
コード例 #12
0
ファイル: system.sensors.php プロジェクト: brucewu16899/1.6.x
function tabs(){
	
	$page=CurrentPageName();
	$tpl=new templates();
	$users=new usersMenus();
	$array["parameters"]='{parameters}';
	
	$usersmenus=new usersMenus();
	if(!$usersmenus->SENSORS_INSTALLED){
		echo FATAL_ERROR_SHOW_128("{MODULES_NOT_INSTALLED}");
		die();
	}
	$tabsize="style='font-size:24px'";
	
	while (list ($num, $ligne) = each ($array) ){
		if($num=="greensql"){
			$html[]= $tpl->_ENGINE_parse_body("<li><a href=\"greensql.php\"><span $tabsize>$ligne</span></a></li>\n");
			continue;
		}
	
		$html[]= $tpl->_ENGINE_parse_body("<li><a href=\"$page?$num=yes\"><span $tabsize>$ligne</span></a></li>\n");
	}
	
	
	echo build_artica_tabs($html, "main_config_sensors",1050)."<script>LeftDesign('temperature-256-white.png');</script>";	
	
}
コード例 #13
0
function tabs()
{
    $page = CurrentPageName();
    $users = new usersMenus();
    if (!$users->stunnel4_installed) {
        echo FATAL_ERROR_SHOW_128("{stunnel_not_installed}");
        die;
    }
    $tpl = new templates();
    $sock = new sockets();
    $page = CurrentPageName();
    $height = "850px";
    $array["status"] = '{status}';
    $array["rules"] = '{rules}';
    $style = "style='font-size:20px'";
    if (isset($_GET["font-size"])) {
        $style = "style='font-size:22px'";
    }
    while (list($num, $ligne) = each($array)) {
        if ($num == "rules") {
            $html[] = $tpl->_ENGINE_parse_body("<li {$style}>\n\t\t\t\t\t<a href=\\system.network.stunnel4.rules.php\">\n\t\t\t\t\t<span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "authentication") {
            $html[] = "<li {$style}><a href=\"postfix.index.php?popup-auth=yes&hostname={$hostname}\"><span>{$ligne}</span></a></li>\n";
            continue;
        }
        $html[] = "<li {$style}><a href=\"{$page}?{$num}=yes\"><span>{$ligne}</span></a></li>\n";
    }
    echo build_artica_tabs($html, "main_tabs_stunnel4", 1200) . "<script>LeftDesign('ssl-256-white.png');</script>";
}
コード例 #14
0
function table()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
    if ($SquidPerformance > 1) {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{artica_statistics_disabled}"));
        return;
    }
    $tt = time();
    $t = $_GET["t"];
    $ipaddr = $tpl->javascript_parse_text("{ipaddr}");
    $hostname = $tpl->_ENGINE_parse_body("{hostname}");
    $uid = $tpl->javascript_parse_text("{uid}");
    $MAC = $tpl->javascript_parse_text("{MAC}");
    $QuerySize = $tpl->javascript_parse_text("{size}");
    $hits = $tpl->javascript_parse_text("{hits}");
    $maintitle = $tpl->_ENGINE_parse_body("{members}");
    //ipaddr          | hostname      | uid               | MAC               | account | QuerySize    | hits
    $buttons = "\n\tbuttons : [\n\t{name: '{$new_text}', bclass: 'add', onpress : NewRule{$tt}},\n\t{name: '{$apply}', bclass: 'Reconf', onpress : Apply{$tt}},\n\t],";
    $buttons = null;
    $html = "\n<table class='flexRT{$tt}' style='display: none' id='flexRT{$tt}' style='width:100%'></table>\n<script>\nfunction Start{$tt}(){\n\t\$('#flexRT{$tt}').flexigrid({\n\turl: '{$page}?items=yes&t={$tt}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$ipaddr}', name : 'ipaddr', width : 124, sortable : false, align: 'left'},\n\t{display: '{$hostname}', name : 'hostname', width :330, sortable : true, align: 'left'},\n\t{display: '{$uid}', name : 'uid', width : 226, sortable : true, align: 'left'},\n\t{display: '{$MAC}', name : 'MAC', width : 129, sortable : false, align: 'left'},\n\t{display: '{$QuerySize}', name : 'size', width : 107, sortable : false, align: 'left'},\n\t{display: '{$hits}', name : 'hits', width : 100, sortable : true, align: 'left'},\n\t],\n\t{$buttons}\n\tsearchitems : [\n\t{display: '{$ipaddr}', name : 'ipaddr'},\n\t{display: '{$hostname}', name : 'hostname'},\n\t{display: '{$uid}', name : 'uid'},\n\t{display: '{$MAC}', name : 'MAC'},\n\t\n\t\n\t],\n\tsortname: 'QuerySize',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span style=font-size:22px>{$maintitle}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 450,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\t\n\t});\n}\n\nStart{$tt}();\n</script>\n";
    echo $html;
}
コード例 #15
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    if (!$users->CORP_LICENSE) {
        $html = FATAL_ERROR_SHOW_128("{this_feature_is_disabled_corp_license}");
        echo $tpl->_ENGINE_parse_body($html);
        return;
    }
    $tablename = $tpl->_ENGINE_parse_body("{tablename}");
    $filepath = $tpl->javascript_parse_text("{filepath}");
    $filesize = $tpl->_ENGINE_parse_body("{filesize}");
    $parameters = $tpl->_ENGINE_parse_body("{parameters}");
    $t = time();
    $tablesize = 830;
    $online_help = $tpl->_ENGINE_parse_body("{online_help}");
    $bts = array();
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(*) as tcount, SUM(filesize) as tsize FROM webstats_backup", "artica_events"));
    $title = $tpl->_ENGINE_parse_body("{backup}:: {$ligne["tcount"]} {containers} (") . FormatBytes($ligne["tsize"] / 1024) . ")";
    $bts[] = "{name: '{$parameters}', bclass: 'Settings', onpress : Settings{$t}},";
    $bts[] = "{name: '{$parameters}', bclass: 'Help', onpress : help{$t}},";
    $buttons = "buttons : [" . @implode("\n", $bts) . " ],";
    $html = "\n\t<div style='margin-left:5px'>\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:99%'></table>\n\t</div>\n<script>\n\$(document).ready(function(){\n\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?search=yes',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$tablename}', name : 'tablename', width : 235, sortable : true, align: 'left'},\n\t\t{display: '{$filesize}', name : 'filesize', width : 120, sortable : true, align: 'left'},\n\t\t{display: '{$filepath}', name : 'filepath', width : 418, sortable : true, align: 'left'},\n\t],{$buttons}\n\tsearchitems : [\n\t\t{display: '{$tablename}', name : 'tablename'},\n\t\t{display: '{$filesize}', name : 'filesize'},\n\t\t{display: '{$filepath}', name : 'filepath'},\n\t\t],\n\tsortname: 'tablename',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '{$title}',\n\tuseRp: true,\n\trp: 25,\n\tshowTableToggleBtn: false,\n\twidth: {$tablesize},\n\theight: 500,\n\tsingleSelect: true\n\t\n\t});   \n});\n\nfunction Settings{$t}(){\n\tYahooWin2('714','{$page}?Settings=yes','{$parameters}');\n\n}\nfunction help{$t}(){\n\ts_PopUpFull('http://www.proxy-appliance.org/index.php?cID=249','1024','900');\n}\n\tvar x_EmptyTask{$t}=function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);return;}\n\t\t\$('#ufdbguard-events-{$t}').flexReload();\t\t\n\t}\n\nfunction EmptyTask{$t}(){\n\tif(confirm('{$empty}::{$_GET["taskid"]}')){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('EmptyTask','{$_GET["taskid"]}');\n\t\tXHR.appendData('Table','{$_GET["table"]}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_EmptyTask{$t});\t\t\t\n    }\n}\n\n</script>\n\n";
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #16
0
ファイル: freeweb.edit.bw.php プロジェクト: BillTheBest/1.6.x
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    if (!$users->APACHE_MOD_BW) {
        echo FATAL_ERROR_SHOW_128("{the_specified_module_is_not_installed}");
        return;
    }
    $servername_enc = urlencode($_GET["servername"]);
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql();
    $sock = new sockets();
    $free = new freeweb($_GET["servername"]);
    $Params = $free->Params;
    $t = time();
    $ForceBandWidthModule = intval($Params["ModeBw"]["ForceBandWidthModule"]);
    $BandwidthAll = intval($Params["ModeBw"]["BandwidthAll"]);
    if ($BandwidthAll == 0) {
        $BandwidthAll = 1536000;
    }
    $BandwidthAll = $BandwidthAll / 1024;
    $html = "\n\n\t<div style='width:98%' class=form>\n\t" . Paragraphe_switch_img("{apache_Bandwidth_enable}", "{apache_Bandwidth_explain}", "bandlimit", "{$free->bandlimit}", null, 650) . "\n\t<table style='width:100%'>\n\t<td colspan=3 align=right>" . button("{rules}", "Loadjs('freeweb.mod.bw.php?servername={$servername_enc}')", 24) . "</td>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{limit_all_requests}:</td>\n\t\t<td>" . Field_checkbox("ForceBandWidthModule", 1, $ForceBandWidthModule) . "</td>\n\t\t<td></td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:18px'>{default_limit}:</td>\n\t\t<td style='font-size:18px'>" . Field_text("BandwidthAll", $BandwidthAll, "font-size:18px;width:90px") . "&nbsp;KB/s</td>\n\t\t<td></td>\n\t</tr>\n\n\t<tr>\n\t\t<td colspan=3 align=right><hr>" . button("{apply}", "Save{$t}()", 24) . "</td>\n\t</tr>\n\t</table>\n\t<p>&nbsp;</p>\n\t</div>\n<script>\n\tvar xSave{$t}=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t\t\tRefreshTab('main_freeweb_qos');\n\t}\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('bandlimit',document.getElementById('bandlimit').value);\n\tif(document.getElementById('ForceBandWidthModule').checked){\n\t\tXHR.appendData('ForceBandWidthModule',1);\n\t}else{\n\t\tXHR.appendData('ForceBandWidthModule',0);\n\t}\n\t\n\t\n\tXHR.appendData('BandwidthAll',document.getElementById('BandwidthAll').value);\n\tXHR.appendData('servername','{$_GET["servername"]}');\n\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n}\n</script>";
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #17
0
ファイル: squid.ecap.gzip.php プロジェクト: BillTheBest/1.6.x
function tabs()
{
    $page = CurrentPageName();
    $tpl = new templates();
    if (!is_file("/usr/lib/ecap_adapter_gzip.so")) {
        echo FATAL_ERROR_SHOW_128("<div style='font-size:26px'>{ERROR_MISSING_MODULE_UPDATE_PROXY}</div>\n\t\t\t\t<center style='font-size:22px;margin:30px;font-weight:bold'>3.5.8-20150910-r13912 {or_above}</div>\n\t\t\t\t<p style='font-size:42px;text-align:right;margin-top:30px'>" . texttooltip("{update_proxy_engine}", "position:top:{proxy_engine_available_explain}", "javascript:LoadProxyUpdate();") . "</p>");
        die;
    }
    $tpl = new templates();
    $array["status"] = '{status}';
    $fontsize = "22";
    while (list($num, $ligne) = each($array)) {
        if ($num == "exclude") {
            $html[] = $tpl->_ENGINE_parse_body("<li>\n\t\t\t\t\t<a href=\"squid.hosts.blks.php?popup=yes&blk=6\" style='font-size:{$fontsize}'>\n\t\t\t\t\t<span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "exclude-www") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"c-icap.wwwex.php\" style='font-size:{$fontsize}'>\n\t\t\t\t\t\t\t<span style='font-size:{$fontsize}'>{$ligne}</span></a></li>\n");
            continue;
        }
        $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\" style='font-size:{$fontsize}px;'>\n\t\t\t\t<span style='font-size:{$fontsize}px;'>{$ligne}</span></a></li>\n");
    }
    $html = build_artica_tabs($html, 'main_ecapGzip_tabs', 1490) . "<script>LeftDesign('webfiltering-white-256-opac20.png');</script>";
    echo $html;
}
コード例 #18
0
ファイル: squid.identd.php プロジェクト: BillTheBest/1.6.x
function tabs()
{
    $sock = new sockets();
    $compilefile = "ressources/logs/squid.compilation.params";
    if (!is_file($compilefile)) {
        $sock->getFrameWork("squid.php?compil-params=yes");
    }
    $COMPILATION_PARAMS = unserialize(base64_decode(file_get_contents($compilefile)));
    if (!isset($COMPILATION_PARAMS["enable-ident-lookups"])) {
        echo "<div id='squid-identd-upd-error'></div>" . FATAL_ERROR_SHOW_128("{error_squid_ident_not_compiled}<center>\n\t\t\t\t" . button("{update2}", "Loadjs('squid.compilation.status.php');", 32) . "</center>");
        return;
    }
    $page = CurrentPageName();
    $users = new usersMenus();
    $array["status"] = '{status}';
    $array["networks"] = '{networks}';
    $sock = new sockets();
    $tpl = new templates();
    while (list($num, $ligne) = each($array)) {
        if ($num == "networks") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.identd.network.php\" style='font-size:20px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\" style='font-size:20px'><span>{$ligne}</span></a></li>\n");
        //$html=$html . "<li><a href=\"javascript:LoadAjax('squid_main_config','$page?main=$num&hostname={$_GET["hostname"]}')\" $class>$ligne</a></li>\n";
    }
    echo build_artica_tabs($html, "debug_identd_config", 1024) . "<script>LeftDesign('users-white-256.png');</script>";
}
コード例 #19
0
function tabs()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $SQUIDEnable = trim($sock->GET_INFO("SQUIDEnable"));
    if (!is_numeric($SQUIDEnable)) {
        $SQUIDEnable = 1;
    }
    if ($SQUIDEnable == 0) {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{proxy_service_is_disabled}<hr>\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.newbee.php?js_enable_disable_squid=yes')\" style='font-size:22px;text-decoration:underline'>\n\t\t{enable_squid_service}</a>"));
        return;
    }
    $q = new mysql_squid_builder();
    $t = time();
    $boot = new boostrap_form();
    $array["{ACLS}"] = "miniadmin.access.rules.php?tabs=yes&title=yes";
    $users = new usersMenus();
    if ($users->APP_UFDBGUARD_INSTALLED) {
        $array["{categories_filtering}"] = "{$page}?webfiltering-tabs=yes";
    }
    if ($users->APP_CHILLI_INSTALLED) {
        if ($users->AsHotSpotManager) {
            $array["HotSpot"] = "miniadmin.webfiltering.coova.php?tabs=yes";
        }
    }
    if ($users->C_ICAP_INSTALLED) {
        $array["Antivirus"] = "miniadmin.proxy.cicap.php?tabs=yes";
    }
    echo $boot->build_tab($array);
}
コード例 #20
0
function tabs()
{
    $sock = new sockets();
    $tpl = new templates();
    $INSTALLED = trim($sock->getFrameWork("squid.php?kaspersky-is-installed=yes"));
    if ($INSTALLED != "TRUE") {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{not_installed}"));
        return;
    }
    $font_size = $_GET["font-size"];
    if ($font_size == null) {
        $font_size = "100%";
    }
    $tpl = new templates();
    $page = CurrentPageName();
    $users = new usersMenus();
    $array["service"] = "{service_events}";
    $array["update"] = "{update_events}";
    $font_size = "16px";
    https:
    //192.168.1.205:9000/
    while (list($num, $ligne) = each($array)) {
        if ($num == "update") {
            $tab[] = "<li><a href=\"Kav4Proxy.Update.Events.php?popup=yes\"><span style='font-size:{$font_size}'>{$ligne}</span></a></li>\n";
            continue;
        }
        $tab[] = "<li><a href=\"{$page}?{$num}=yes\"><span style='font-size:{$font_size}'>{$ligne}</span></a></li>\n";
    }
    echo build_artica_tabs($tab, "main_kav4proxyevents");
}
コード例 #21
0
function table()
{
    $q = new mysql_squid_builder();
    $tpl = new templates();
    $page = CurrentPageName();
    $page = CurrentPageName();
    $sock = new sockets();
    $t = time();
    if (!$q->TABLE_EXISTS("ufdbunlock")) {
        $sql = "CREATE TABLE IF NOT EXISTS `squidlogs`.`ufdbunlock` (\n\t\t\t`md5` VARCHAR( 90 ) NOT NULL ,\n\t\t\t`logintime` BIGINT UNSIGNED ,\n\t\t\t`finaltime` INT UNSIGNED ,\n\t\t\t`uid` VARCHAR(128) NOT NULL,\n\t\t\t`MAC` VARCHAR( 90 ) NULL,\n\t\t\t`www` VARCHAR( 128 ) NOT NULL ,\n\t\t\t`ipaddr` VARCHAR( 128 ) ,\n\t\t\tPRIMARY KEY ( `md5` ) ,\n\t\t\tKEY `MAC` (`MAC`),\n\t\t\tKEY `logintime` (`logintime`),\n\t\t\tKEY `finaltime` (`finaltime`),\n\t\t\tKEY `uid` (`uid`),\n\t\t\tKEY `www` (`www`),\n\t\t\tKEY `ipaddr` (`ipaddr`)\n\t\t\t)  ENGINE = MEMORY;";
        $q->QUERY_SQL($sql);
        if (!$q->ok) {
            echo FATAL_ERROR_SHOW_128($q->mysql_error_html());
            return;
        }
    }
    //
    $ipaddr = $tpl->_ENGINE_parse_body("{ipaddr}");
    $uid = $tpl->_ENGINE_parse_body("{uid}");
    $sitename = $tpl->_ENGINE_parse_body("{sitename}");
    $date = $tpl->_ENGINE_parse_body("{created}");
    $finish = $tpl->_ENGINE_parse_body("{finish}");
    $delete = $tpl->_ENGINE_parse_body("{delete}");
    $member = $tpl->javascript_parse_text("{members}");
    $parameters = $tpl->javascript_parse_text("{settings}");
    $title = $tpl->_ENGINE_parse_body("{unblock_queue}");
    $buttons = "\n\tbuttons : [\n\t\t{name: '{$parameters}', bclass: 'Reconf', onpress : unblock_parms},\n\t\n\t],";
    $buttons = null;
    $html = "\n\n<table class='UFDBGUARD_QUEUE_RELEASE' style='display: none' id='UFDBGUARD_QUEUE_RELEASE' style='width:100%'></table>\n<script>\nvar rowid{$t}='';\n\$(document).ready(function(){\n\$('#UFDBGUARD_QUEUE_RELEASE').flexigrid({\n\turl: '{$page}?rules-table-list=yes&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$date}', name : 'logintime', width : 180, sortable : true, align: 'left'},\t\n\t\t{display: '{$ipaddr}', name : 'ipaddr', width : 160, sortable : true, align: 'left'},\n\t\t{display: '{$uid}', name : 'uid', width : 160, sortable : true, align: 'left'},\t\t\n\t\t{display: '{$sitename}', name : 'www', width : 299, sortable : true, align: 'left'},\n\t\t{display: '{$finish}', finaltime : 'uid', width :180, sortable : true, align: 'left'},\n\t\t{display: '{$delete}', name : 'delete', width : 70, sortable : false, align: 'center'},\n\t\t],\n\t{$buttons}\n\tsearchitems : [\n\t\t{display: '{$ipaddr}', name : 'ipaddr'},\n\t\t{display: '{$member}', name : 'uid'},\n\t\t{display: '{$sitename}', name : 'www'},\n\t\t],\n\tsortname: 'logintime',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<strong style=font-size:22px>{$title}</strong>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 400,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\t\n\t});   \n});\n\n\tfunction unblock_parms(){\n\t\tLoadjs('squidguardweb.unblock.php')\n\t}\n\n\tvar xBannedDeleteQueueUFDB= function (obj) {\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){alert(res);return;}\n\t\t\$('#row'+rowid{$t}).remove();\n\t\t\$('#UFDBGUARD_QUEUE_RELEASE').flexReload();\n\t}\t\t\n\t\t\n\tfunction BannedDeleteQueueUFDB(md5){\n\t\trowid{$t}=md5;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('DeleteWhiteListed', md5);\n\t\tXHR.sendAndLoad('{$page}', 'POST',xBannedDeleteQueueUFDB);  \n\t}\n\n</script>\n";
    echo $html;
}
コード例 #22
0
ファイル: nginx.backup.php プロジェクト: BillTheBest/1.6.x
function download_popup()
{
    if (!is_file("/usr/share/artica-postfix/ressources/logs/web/nginx.dump.gz")) {
        echo FATAL_ERROR_SHOW_128("nginx.dump.gz no such file!");
        return;
    }
    $size = @filesize("ressources/logs/web/nginx.dump.gz");
    $size = FormatBytes($size / 1024);
    echo "<center style='margin:30px'><a href='ressources/logs/web/nginx.dump.gz'><img src='img/download-64.png'></a>\n\t<center style='margin:30px'>\n\t\t<a href='ressources/logs/web/nginx.dump.gz' style='font-size:18px;text-decoration:underline'>nginx.dump.gz ({$size})</a>\n\t</center>";
}
コード例 #23
0
function etch(){
	$sock=new sockets();
	$tpl=new templates();
	$page=CurrentPageName();
	$EnableVnStat=$sock->GET_INFO("EnableVnStat");
	if(!is_numeric($EnableVnStat)){$EnableVnStat=0;}
	$t=time();
	if($EnableVnStat==0){
		$html=FATAL_ERROR_SHOW_128("{APP_VNSTAT_DISABLED_EXPLAIN}")." <center style='margin:30px' id='$t'>".button("{activate}","EnableVnStat()","22px")."</center>
		<script>
		
		var x_EnableVnStat= function (obj) {
			var tempvalue=obj.responseText;
			if(tempvalue.length>3){alert(tempvalue)}
		    RefreshTab('main_config_vnstat');
			}
		
		
		function EnableVnStat(){
			var XHR = new XHRConnection();
			XHR.appendData('EnableVnStat',1);
		    XHR.sendAndLoad('$page', 'POST',x_EnableVnStat);
		}</script>
		";
		echo $tpl->_ENGINE_parse_body($html);
		return;
		
	}
	
	
	
	
		$interface=$_GET["etch"];
		$cmdr[]="ressources/logs/vnstat-$interface-resume.png";
		$cmdr[]="ressources/logs/vnstat-$interface-hourly.png";
		$cmdr[]="ressources/logs/vnstat-$interface-daily.png";
		$cmdr[]="ressources/logs/vnstat-$interface-monthly.png";
		$cmdr[]="ressources/logs/vnstat-$interface-top.png";
		$imgs=array();
		
		
		$error="<center style='font-size:18px;color:red;margin:5px;font-weight:bolder'>{NO_DATA_COME_BACK_LATER}</center><center><img src='img/report-warning-256.png'></center>";		
		
		while (list ($num, $filename) = each ($cmdr) ){
			if(!is_file($filename)){continue;}
			$t=time();
			$imgs[]="<center style='margin:10px'><img src='$filename?$t'></center>";
			
		}
		
		
		if(count($imgs)==0){echo $tpl->_ENGINE_parse_body("$error");return;}
		echo $tpl->_ENGINE_parse_body(@implode("\n",$imgs));
	
}
コード例 #24
0
function step0()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $array = $q->WebFilteringAllSystems();
    if (count($array) > 0) {
        echo FATAL_ERROR_SHOW_128("{webfiltering_all_system_warning}<br>" . @implode("\n", $array));
        return;
    }
    $t = time();
    echo "<div id='main-{$t}'></div>\n\t<script>\n\t\tLoadAjax('main-{$t}','{$page}?step1=yes&t={$t}',false);\n\t</script>\n\t";
}
コード例 #25
0
function justbutton()
{
    $user = new usersMenus();
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $t = time();
    if (!$user->AsSquidAdministrator) {
        echo FATAL_ERROR_SHOW_128('{ERROR_NO_PRIVS}');
        return;
    }
    echo $tpl->_ENGINE_parse_body("\n\t\t<center style='margin:20px' id='SQUID_URGENCY_FORM_ADM'>\n\t\t\t" . button("{enable_emergency_mode}", "Save{$t}()", 32) . "\n\t\t</center>\n<script>\n\tvar xSave{$t}=function (obj) {\n\t\tvar ID='{$_GET["ID"]}';\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);}\t\t\n\t\t\$('#ARTICA_META_MAIN_TABLE').flexReload();\n\t\tYahooWin6Hide();\n\t}\t\n\n\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t  \tXHR.appendData('Disable','yes');\n\t  \tXHR.appendData('uuid','{$_GET["uuid"]}');\n\t  \tXHR.appendData('gpid','{$_GET["gpid"]}');\n\t  \tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\n\t}\n</script>\t\t\t\n\t\t\t\n\t\t\t\n");
}
コード例 #26
0
function justbutton()
{
    $user = new usersMenus();
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $t = time();
    if (!$user->AsSquidAdministrator) {
        echo FATAL_ERROR_SHOW_128('{ERROR_NO_PRIVS}');
        return;
    }
    echo $tpl->_ENGINE_parse_body("\n\t\t\t<center style='margin:20px' id='SQUID_URGENCY_FORM_ADM'>\n\t\t\t" . button("{disable_emergency_mode}", "Loadjs('squid.urgency.hypercache.progress.php')", 32) . "\n\t\t\t</center>");
}
コード例 #27
0
function page()
{
    $sock = new sockets();
    $tpl = new templates();
    $IsInstalled = trim($sock->getFrameWork("system.php?phpmyadmin-installed=yes"));
    if ($IsInstalled != "TRUE") {
        $button = button("{reinstall_software}", "Loadjs('system.mysql.phpmyadmin.install.php')", 36);
        echo FATAL_ERROR_SHOW_128("<span style='font-size:26px'>{ERROR_SERVICE_NOT_INSTALLED}</span><center style='margin:20px'>{$button}</center>");
    }
    $version = trim($sock->getFrameWork("system.php?phpmyadpmin-version=yes"));
    $html = "\n\t<div style='width:100%;text-align:center'>\n\t<center>\n\t<center style='width:70%;margin:30px' class=form>\n\t<div style='font-size:26px'>PHPMyAdmin v.{$version}</div>\n\t<p>&nbsp;</p>\n\t" . button("PHPMyAdmin Front-end", "PopUpFull('/mysql',2048,1024);", 40) . "<p>&nbsp;</p></center></center></div>";
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #28
0
function action()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $sock->getFrameWork("fetchmail.php?export-table=yes");
    $target_file = "/usr/share/artica-postfix/ressources/logs/fetchmail-export.gz";
    if (!is_file($target_file)) {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{failed}", "fetchmail-export.gz"));
        return;
    }
    $size = FormatBytes(@filesize($target_file) / 1024);
    echo "<center style='margin:10px;padding:10px'>\n\t\t\t<a href='ressources/logs/fetchmail-export.gz'><img src='img/128-import.png'><p>&nbsp;</p>\n\t\t\t<span style='font-size:22px;text-decoration:underline'>" . basename($target_file) . " - {$size}</span></a>\n\t\t\t</center>\n\t\t\t";
}
コード例 #29
0
function params()
{
    $t = time();
    $sock = new sockets();
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
    if ($SquidPerformance > 1) {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{artica_statistics_disabled_see_performance}"));
        return;
    }
    $DisableArticaProxyStatistics = $sock->GET_INFO("DisableArticaProxyStatistics");
    $EnableSquidRemoteMySQL = $sock->GET_INFO("EnableSquidRemoteMySQL");
    $CleanArticaSquidDatabases = $sock->GET_INFO("CleanArticaSquidDatabases");
    $EnableProxyLogHostnames = $sock->GET_INFO("EnableProxyLogHostnames");
    $MacResolvInterface = $sock->GET_INFO("MacResolvInterface");
    if (!is_numeric($EnableSquidRemoteMySQL)) {
        $EnableSquidRemoteMySQL = 0;
    }
    if (!is_numeric($DisableArticaProxyStatistics)) {
        $DisableArticaProxyStatistics = 0;
    }
    if (!is_numeric($CleanArticaSquidDatabases)) {
        $CleanArticaSquidDatabases = 0;
    }
    if (!is_numeric($EnableProxyLogHostnames)) {
        $EnableProxyLogHostnames = 0;
    }
    $net = new networking();
    $interfaces = $net->Local_interfaces();
    $array[null] = "{none}";
    while (list($eth, $line) = each($interfaces)) {
        if ($eth == "lo") {
            continue;
        }
        $ip = new system_nic($eth);
        $array[$eth] = $ip->IPADDR . " (" . $ip->NICNAME . ")";
    }
    $p = Paragraphe_switch_img("{DisableArticaProxyStatistics}", "{DisableArticaProxyStatistics_explain}", "DisableArticaProxyStatistics", $DisableArticaProxyStatistics, null, 600);
    $p1 = Paragraphe_switch_img("{CleanArticaSquidDatabases}", "{CleanArticaSquidDatabases_explain}", "CleanArticaSquidDatabases", $CleanArticaSquidDatabases, null, 600);
    $p2 = Paragraphe_switch_img("{EnableProxyLogHostnames}", "{EnableProxyLogHostnames_explain}", "EnableProxyLogHostnames", $EnableProxyLogHostnames, null, 600);
    if ($EnableSquidRemoteMySQL == 1) {
        $TuningParameters = unserialize(base64_decode($sock->GET_INFO("MySQLSyslogParams")));
        $error = "<div style='font-size:16px' class=explain>{remote_mysqlsquidserver_text}<br><strong>mysql://{$TuningParameters["mysqlserver"]}:{$TuningParameters["RemotePort"]}</strong></div>";
        $p = Paragraphe_switch_disable("{DisableArticaProxyStatistics}", "{DisableArticaProxyStatistics_explain}", null, 600) . "" . Field_hidden("DisableArticaProxyStatistics", 0);
    }
    $html = "\n\t<div id={$t}></div>\n\t<div style='width:98%' class=form>\n\t{$error}\n\t<table>\n\t<tr>\n\t\t<td colspan=3>{$p}</td>\n\t</tr>\n\t<tr><td colspan=3><hr></td></tr>\n\t<tr>\n\t\t<td colspan=3>{$p1}</td>\n\t</tr>\n\n\t\n\t<tr>\n\t\t<td colspan=3 align='right'>" . button("{apply}", "SaveStopArticaStats()", 16) . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t\n\t<div style='width:98%' class=form>\n\t<table>\n\t<tr>\n\t\t<td colspan=3>{$p2}</td>\n\t</tr>\n\t\t<tr>\n\t\t<td class=legend style='font-size:16px'>{mac_resolv_interface}:</td>\n\t\t<td>" . Field_array_Hash($array, "MacResolvInterface", $MacResolvInterface, null, null, 0, "font-size:16px") . "</td>\n\t\t<td width=1%>" . help_icon("{mac_resolv_interface_help}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td  align='right' colspan=3>" . button("{apply}", "SaveOptions{$t}()", 16) . "</td>\n\t</tr>\t\n\t</table>\n\t</div>\n\t<script>\n\tvar x_SaveStopArticaStats= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\tRefreshTab('artica_stats_tabs');\n\t\tCacheOff();\n\t\tConfigureYourserver();\n\t}\n\n\t\t\n\t\t\n\tfunction SaveStopArticaStats(){\n\t\t\tvar XHR = new XHRConnection();\t\n\t\t\tXHR.appendData('DisableArticaProxyStatistics',document.getElementById('DisableArticaProxyStatistics').value);\n\t\t\tXHR.appendData('CleanArticaSquidDatabases',document.getElementById('CleanArticaSquidDatabases').value);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveStopArticaStats);\n\t\t\t}\n\t\t\t\n\tvar xSaveOptions{$t}= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue)};\n\n\t}\t\t\t\n\t\t\t\n\tfunction SaveOptions{$t}(){\n\t\t\tvar XHR = new XHRConnection();\t\n\t\t\tXHR.appendData('EnableProxyLogHostnames',document.getElementById('EnableProxyLogHostnames').value);\n\t\t\tXHR.appendData('MacResolvInterface',document.getElementById('MacResolvInterface').value);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',xSaveOptions{$t});\n\t\t\t}\t\t\t\n\t\t\t\n\t</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
コード例 #30
0
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $SquidPerformance = intval($sock->GET_INFO("SquidPerformance"));
    if ($SquidPerformance > 1) {
        echo $tpl->_ENGINE_parse_body(FATAL_ERROR_SHOW_128("{artica_statistics_disabled}"));
        return;
    }
    $t = time();
    $html = "<div style='font-size:26px;margin-bottom:20px'>{APP_LOGGERS}</div>\n\t<div style='font-size:16px' class=explain>{APP_LOGGERS_SQUID_EXPLAIN}</div>\n\t<div id='logger-status'></div>\n\t\n\t\t\t\n\t<script>\n\t\tfunction LoggerStatus{$t}(){\n\t\t\tLoadAjax('logger-status','{$page}?logger-status=yes',false);\n\t\t\n\t\t}\n\t\tLoggerStatus{$t}();\n\t</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}