Example #1
0
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $description = $tpl->_ENGINE_parse_body("{description}");
    $select = $tpl->javascript_parse_text("{select}");
    $date = $tpl->_ENGINE_parse_body("{date}");
    $empty = $tpl->javascript_parse_text("{empty}");
    $t = time();
    $tablesize = 868;
    $descriptionsize = 705;
    $bts = array();
    if (is_numeric($_GET["tablesize"])) {
        $tablesize = $_GET["tablesize"];
    }
    if (is_numeric($_GET["descriptionsize"])) {
        $descriptionsize = $_GET["descriptionsize"];
    }
    $bts[] = "{name: '{$select}', bclass: 'Search', onpress : SelectFields{$t}},";
    $tablejs = "ufdbguard_admin_events";
    if ($_GET["table"] != null) {
        $tablejs = $_GET["table"];
    }
    if ($_GET["taskid"] > 0) {
        $bts[] = "{name: '{$empty}', bclass: 'Delz', onpress : EmptyTask{$t}},";
    }
    if (count($bts) > 0) {
        $buttons = "buttons : [" . @implode("\n", $bts) . " ],";
    }
    $html = "\n\t<div style='margin-left:5px'>\n\t<table class='ufdbguard-events-{$t}' style='display: none' id='ufdbguard-events-{$t}' style='width:99%'></table>\n\t</div>\n<script>\n\$(document).ready(function(){\n\$('#ufdbguard-events-{$t}').flexigrid({\n\turl: '{$page}?search=yes&filename={$_GET["filename"]}&taskid={$_GET["taskid"]}&category=stats&table={$_GET["table"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$date}', name : 'zDate', width : 120, sortable : true, align: 'left'},\n\t\t{display: '{$description}', name : 'description', width : {$descriptionsize}, sortable : false, align: 'left'},\n\t],{$buttons}\n\tsearchitems : [\n\t\t{display: '{$description}', name : 'description'},\n\t\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '',\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 SelectFields{$t}(){\n\tYahooWin2('550','{$page}?Select-fields=yes&table=ufdbguard_admin_events&t={$t}&taskid={$_GET["taskid"]}','{$select}');\n\n}\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);
}
Example #2
0
function table()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $dnsmasq_address_text = $tpl->_ENGINE_parse_body("{dnsmasq_address_text}");
    $hosts = $tpl->_ENGINE_parse_body("{hosts}");
    $addr = $tpl->_ENGINE_parse_body("{addr}");
    $new_interface = $tpl->_ENGINE_parse_body("{new_interface}");
    $rulename = $tpl->_ENGINE_parse_body("{rulename}");
    $explain = $tpl->javascript_parse_text("{explain}");
    $title = $tpl->_ENGINE_parse_body("{rules}");
    $category = $tpl->_ENGINE_parse_body("{category}");
    $enabled = $tpl->_ENGINE_parse_body("{enabled}");
    $q = new mysql();
    if (!$q->TABLE_EXISTS("suricata_rules_packages", "artica_backup")) {
        $sql = "CREATE TABLE IF NOT EXISTS `artica_backup`.`suricata_rules_packages` (\n\t\t`rulefile` VARCHAR(128) NOT NULL PRIMARY KEY ,\n\t\t`category` VARCHAR(40) NOT NULL,\n\t\t`enabled` smallint(1) NOT NULL DEFAULT 0,\n\t\tINDEX ( `category`),\n\t\tINDEX ( `enabled`)\n\t\t)";
        $q->QUERY_SQL($sql, 'artica_backup');
        if (!$q->ok) {
            echo $q->mysql_error . "\n";
        }
    }
    if ($q->COUNT_ROWS("suricata_rules_packages", "artica_backup") == 0) {
        $sql = "INSERT IGNORE INTO suricata_rules_packages (rulefile,enabled,category) VALUES \n\t\t\t\t('botcc.rules',0,'DMZ'),('ciarmy.rules',0,'DMZ'),('compromised.rules','0','DMZ'),\n\t\t\t\t('drop.rules',1,'DMZ'),\n\t\t\t\t('dshield.rules',1,'DMZ'),('snort.rules',1,'ALL'),\n\t\t\t\t('emerging-activex.rules',1,'WEB'),\n\t\t\t\t('emerging-attack_response.rules',1,'ALL'),\n\t\t\t\t('emerging-chat.rules',0,'WEB'),\n\t\t\t\t('emerging-current_events.rules',0,'ALL'),\n\t\t\t\t('emerging-dns.rules',0,'DMZ'),\n\t\t\t\t('emerging-dos.rules',0,'DMZ'),\n\t\t\t\t('emerging-exploit.rules',0,'DMZ'),\n\t\t\t\t('emerging-ftp.rules',0,'DMZ'),\n\t\t\t\t('emerging-games.rules',0,'ALL'),\n\t\t\t\t('emerging-icmp_info.rules',0,'ALL'),\n\t\t\t\t('emerging-icmp.rules',0,'ALL'),\n\t\t\t\t('emerging-imap.rules',0,'DMZ'),\n\t\t\t\t('emerging-inappropriate.rules',0,'WEB'),\n\t\t\t\t('emerging-malware.rules',1,'WEB'),\n\t\t\t\t('emerging-mobile_malware.rules',0,'WEB'),\n\t\t\t\t('emerging-netbios.rules',0,'ALL'),\n\t\t\t\t('emerging-p2p.rules',0,'WEB'),\n\t\t\t\t('emerging-policy.rules',1,'WEB'),\n\t\t\t\t('emerging-pop3.rules',0,'DMZ'),\n\t\t\t\t('emerging-rpc.rules',0,'ALL'),\n\t\t\t\t('emerging-scada.rules',0,'ALL'),\n\t\t\t\t('emerging-scan.rules',1,'ALL'),\n\t\t\t\t('emerging-shellcode.rules',1,'ALL'),\n\t\t\t\t('emerging-smtp.rules',0,'DMZ'),\n\t\t\t\t('emerging-snmp.rules',0,'ALL'),\n\t\t\t\t('emerging-sql.rules',0,'ALL'),\n\t\t\t\t('emerging-telnet.rules',0,'ALL'),\n\t\t\t\t('emerging-tftp.rules',0,'ALL'),\n\t\t\t\t('emerging-trojan.rules',1,'ALL'),\n\t\t\t\t('emerging-user_agents.rules',0,'ALL'),\n\t\t\t\t('emerging-voip.rules',0,'ALL'),\n\t\t\t\t('emerging-web_client.rules',1,'HTTP'),\n\t\t\t\t('emerging-web_server.rules',0,'HTTP'),\n\t\t\t\t('emerging-web_specific_apps.rules',0,'HTTP'),\n\t\t\t\t('emerging-worm.rules',1,'ALL'),\n\t\t\t\t('tor.rules',0,'ALL'),\n\t\t\t\t('decoder-events.rules',0,'ALL'),\n\t\t\t\t('stream-events.rules',0,'ALL'),\n\t\t\t\t('http-events.rules',0,'HTTP'),\n\t\t\t\t('smtp-events.rules',0,'DMZ'),\n\t\t\t\t('dns-events.rules',0,'DMZ'),\n\t\t\t\t('tls-events.rules',0,'DMZ')";
        $q->QUERY_SQL($sql, 'artica_backup');
    }
    $apply = $tpl->javascript_parse_text("{apply}");
    $buttons = "\n\tbuttons : [\n\t\n\t{name: '<strong style=font-size:18px>{$apply}</strong>', bclass: 'Apply', onpress : Apply{$t}},\n\t],";
    $html = "\n\t\n\t\n\t<table class='TABLE_SURICATA_MAIN_RULES' style='display: none' id='TABLE_SURICATA_MAIN_RULES'\n\tstyle='width:100%'></table>\n\t<script>\n\t\$(document).ready(function(){\n\tvar md5H='';\n\t\$('#TABLE_SURICATA_MAIN_RULES').flexigrid({\n\turl: '{$page}?list=yes',\n\tdataType: 'json',\n\tcolModel : [\n\t\n\t{display: '<span style=font-size:22px>{$rulename}</span>', name : 'rulefile', width : 300, sortable : true, align: 'left'},\n\t{display: '<span style=font-size:22px>{$category}</span>', name : 'category', width : 156, sortable : true, align: 'center'},\n\t{display: '<span style=font-size:22px>{$explain}</span>', name : 'none', width : 833, sortable : false, align: 'left'},\n\t{display: '<span style=font-size:22px>{$enabled}</span>', name : 'enabled', width : 105, sortable : true, align: 'center'},\n\n\t],\n\t{$buttons}\nsearchitems : [\n\t\t{display: '{$rulename}', name : 'rulefile'},\n\t\t{display: '{$category}', name : 'category'},\n\t\t\n\n\t],\t\n\tsortname: 'rulefile',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '<span style=font-size:30px>{$title}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 550,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\t\n\t});\n\t});\n\t\n\t\nfunction Add{$t}(){\n\tLoadjs('{$page}?add-interface-js=yes&t={$t}');\n}\nvar xSuricataRuleEnabled= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);return;}\n\t\$('#TABLE_SURICATA_MAIN_RULES').flexReload();\n}\n\t\nfunction SuricataRuleEnabled(filename){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('filename',filename);\n\tXHR.sendAndLoad('{$page}', 'POST',xSuricataRuleEnabled);\n}\nfunction Apply{$t}(){\n\tLoadjs('suricata.progress.php');\n}\n</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #3
0
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;
}
Example #4
0
function page()
{
    $tpl = new templates();
    $ID = $_GET["ID"];
    if (!is_numeric($ID)) {
        $ID = 0;
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $TB_HEIGHT = 515;
    $TB_WIDTH = 875;
    $path = base64_decode($_GET["path"]);
    $md5path = md5($path);
    $veto_files_explain = $tpl->_ENGINE_parse_body("{veto_files_explain}");
    $veto_files_add_explain = $tpl->javascript_parse_text("{veto_files_add_explain}");
    $t = time();
    $event = $tpl->_ENGINE_parse_body("{events}");
    $zDate = $tpl->_ENGINE_parse_body("{zDate}");
    $ask_delete_rule = $tpl->javascript_parse_text("{ask_delete_rule}");
    $help = $tpl->_ENGINE_parse_body("{online_help}");
    $buttons = "\n\tbuttons : [\n\t{name: '{$new_entry}', bclass: 'Add', onpress : NewGItem{$t}},\n\t{name: '{$help}', bclass: 'Help', onpress : ItemHelp{$t}},\n\t],\t";
    $buttons = null;
    $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-list=yes&t={$t}&md5path={$md5path}',\n\tdataType: 'json',\n\tcolModel : [\t\n\t\t{display: '{$zDate}', name : 'zDate', width :146, sortable : true, align: 'left'},\n\t\t{display: '{$event}', name : 'description', width :961, sortable : true, align: 'left'},\n\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t\t{display: '{$event}', name : 'description'},\n\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '{$path}',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: {$TB_HEIGHT},\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500]\n\t\n\t});   \n});\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #5
0
function table()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $purge_catagories_database_explain = $tpl->javascript_parse_text("{purge_catagories_database_explain}");
    $purge_catagories_table_explain = $tpl->javascript_parse_text("{purge_catagories_table_explain}");
    $items = $tpl->_ENGINE_parse_body("{items}");
    $size = $tpl->_ENGINE_parse_body("{size}");
    $SaveToDisk = $tpl->_ENGINE_parse_body("{SaveToDisk}");
    $addCat = $tpl->_ENGINE_parse_body("{add} {category}");
    $description = $tpl->_ENGINE_parse_body("{description}");
    $task = $tpl->_ENGINE_parse_body("{task}");
    $new_schedule = $tpl->_ENGINE_parse_body("{new_schedule}");
    $DisableSquidDefaultSchedule = $sock->GET_INFO("DisableSquidDefaultSchedule");
    if (!is_numeric($DisableSquidDefaultSchedule)) {
        $DisableSquidDefaultSchedule = 0;
    }
    $explain = $tpl->_ENGINE_parse_body("{explain_squid_tasks}");
    $run = $tpl->_ENGINE_parse_body("{run}");
    $events = $tpl->_ENGINE_parse_body("{events}");
    $run_this_task_now = $tpl->javascript_parse_text("{run_this_task_now} ?");
    $zDate = $tpl->_ENGINE_parse_body("{zDate}");
    $task = $tpl->_ENGINE_parse_body("{task}");
    $file = $tpl->_ENGINE_parse_body("{file}");
    $function = $tpl->_ENGINE_parse_body("{function}");
    $t = time();
    $html = "\n\t<div class=explain>{$explain}</div>\n\n\n\t<div style='margin-left:-15px'>\n\t<table class='{$t}' style='display: none' id='{$t}' style='width:99%'></table>\n\t</div>\n<script>\nvar rowSquidTask='';\n\$(document).ready(function(){\n\$('#{$t}').flexigrid({\n\turl: '{$page}?search=yes',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$zDate}', name : 'zDate', width : 132, sortable : true, align: 'left'},\n\t\t{display: '{$task}', name : 'TASKID', width : 121, sortable : false, align: 'left'},\n\t\t{display: '{$description}', name : 'description', width : 587, sortable : false, align: 'left'},\n\n\t],\nbuttons : [\n\t{name: '{$task}', bclass: 'Search', onpress : SelectTasks},\n\t{name: '{$file}', bclass: 'Search', onpress : SelectScript},\n\t{name: '{$function}', bclass: 'Search', onpress : SelectFunction},\n\t\n\t\t],\t\n\tsearchitems : [\n\t\t{display: '{$description}', name : 'TimeDescription'},\n\t\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: 897,\n\theight: 350,\n\tsingleSelect: true\n\t\n\t});   \n});\t\n\n\tfunction AddNewSchedule(category){\n\t\t\tLoadjs('{$page}?AddNewSchedule-js=yes&ID=0');\n\t}\n\t\n\tfunction SquidCrontaskUpdateTable(){\n\t\t\$('#{$t}').flexReload();\n\t }\n\t\n\tvar x_SquidTaskEnable=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}\n\n\tvar x_DisableSquidDefaultScheduleCheck=function (obj) {\n\t\tvar ID='{$_GET["ID"]}';\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);}\n\t\t\$('#{$t}').flexReload();\t\t\n\t}\t\t\n\n\n\tfunction SelectTasks(){\n\t\tYahooWin4('500','{$page}?select-tasks=yes&t={$t}','{$task}?');\n\t}\n\t\n\tfunction SelectFunction(){\n\t\tYahooWin4('550','{$page}?select-function=yes&t={$t}','{$task}?');\n\t}\n\t\n\tfunction SelectScript(){\n\t\tYahooWin4('550','{$page}?select-script=yes&t={$t}','{$file}?');\n\t}\t\n\n\tfunction DisableSquidDefaultScheduleCheck(){\n\t  \tvar XHR = new XHRConnection();\n\t  \tif(document.getElementById('DisableSquidDefaultSchedule').checked){XHR.appendData('DisableSquidDefaultSchedule',1);}\n\t  \telse{XHR.appendData('DisableSquidDefaultSchedule',0);}\n\t  \tXHR.sendAndLoad('{$page}', 'POST',x_DisableSquidDefaultScheduleCheck);\t\n\t}\n\t\n\t\n\tfunction SquidTaskRun(ID,explain){\n\t\tif(confirm('{$run_this_task_now} `'+explain+'`')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('ID',ID);\n\t  \t\tXHR.appendData('schedule-run','yes');\n\t  \t\tXHR.sendAndLoad('{$page}', 'POST',x_SquidTaskEnable);\t\t\n\t\t}\n\t\n\t}\n\t\n\t\n\tvar x_SquidTaskDelete=function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>0){alert(results);return;}\n\t\t\$('#rowSquidTask'+rowSquidTask).remove();\n\t}\t\n\t\n\tfunction SquidTaskDelete(ID){\n\t\trowSquidTask=ID;\n\t  \tvar XHR = new XHRConnection();\n\t\tXHR.appendData('ID',ID);\n\t  \tXHR.appendData('schedule-delete','yes');\n\t  \tXHR.sendAndLoad('{$page}', 'POST',x_SquidTaskDelete);\t\n\t}\n\t\n\t\n\t\n</script>";
    echo $html;
}
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    if ($_GET["prepend"] == null) {
        $_GET["prepend"] = 0;
    }
    if ($_GET["prepend-guid"] == null) {
        $_GET["prepend-guid"] = 0;
    }
    $OnlyGUID = $_GET["OnlyGUID"];
    $OnlyAD = $_GET["OnlyAD"];
    if (!is_numeric($OnlyGUID)) {
        $OnlyGUID = 0;
    }
    if (!is_numeric($OnlyAD)) {
        $OnlyAD = 0;
    }
    if ($_GET["callback"] != null) {
        $callback = "{$_GET["callback"]}(id,prependText,guid);WinORGHide();return;";
    }
    $GroupName = $tpl->_ENGINE_parse_body("{groupname}");
    $Members = $tpl->_ENGINE_parse_body("{members}");
    $item_add = $tpl->javascript_parse_text("{item_added}");
    $Select = $tpl->javascript_parse_text("{select}");
    $title = $tpl->javascript_parse_text("{browse_remote_ldap_server}");
    $t = time();
    $CallBack2 = null;
    if ($_GET["CallBack2"] != null) {
        $CallBack2 = "{$_GET["CallBack2"]}(base64,Name);";
    }
    $html = "\n\t<table class='table{$t}' style='display: none' id='table{$t}' style='width:99%'></table>\n\t<script>\n\t\$(document).ready(function(){\n\t\$('#table{$t}').flexigrid({\n\turl: '{$page}?search-groups=yes&t={$t}&ADID={$_GET["ADID"]}&MainFunction={$_GET["MainFunction"]}&field-user={$_GET["field-user"]}&field-type={$_GET["field-type"]}&function={$_GET["function"]}&t={$t}&CallBack2={$_GET["CallBack2"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '&nbsp;', name : 'select', width : 42, sortable : false, align: 'center'},\n\t{display: '{$GroupName}', name : 'groupname', width : 372, sortable : true, align: 'left'},\n\t{display: '{$Members}', name : 'none', width : 67, sortable : false, align: 'center'},\n\t{display: '{$Select}', name : 'none', width : 79, sortable : false, align: 'center'},\n\t],\n\n\tsearchitems : [\n\t{display: '{$GroupName}', name : 'groupname'},\n\t],\n\tsortname: 'groupname',\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: 400,\n\tsingleSelect: true\n\n});\n});\nfunction BrowseFindUserGroupClick(e){\nif(checkEnter(e)){BrowseFindUserGroup();}\n}\n\nvar x_BrowseFindUserGroup=function (obj) {\ntempvalue=obj.responseText;\ndocument.getElementById('finduserandgroupsidBrwse').innerHTML=tempvalue;\n}\n\n\nfunction BrowseFindUserGroup(){\nLoadAjax('finduserandgroupsidBrwse','{$page}?query='+escape(document.getElementById('BrowseUserQuery').value)+'&prepend={$_GET["prepend"]}&field-user={$_GET["field-user"]}&prepend-guid={$_GET["prepend-guid"]}&OnlyUsers={$_GET["OnlyUsers"]}&OnlyGUID={$_GET["OnlyGUID"]}&organization={$_GET["organization"]}&OnlyGroups={$_GET["OnlyGroups"]}&callback={$_GET["callback"]}&NOComputers={$_GET["NOComputers"]}&Zarafa={$_GET["Zarafa"]}&OnlyAD={$OnlyAD}');\n\n}\n\n\nfunction BrowseSelect{$t}(id,prependText,guid){\n{$callback}\n\tvar prepend={$_GET["prepend"]};\n\tvar prepend_gid={$_GET["prepend-guid"]};\n\tvar OnlyGUID={$OnlyGUID};\n\tif(document.getElementById('{$_GET["field-user"]}')){\n\tvar selected=id;\n\tif(OnlyGUID==1){\n\tdocument.getElementById('{$_GET["field-user"]}').value=guid;\n\tWinORGHide();\n\treturn;\n}\n\nif(prepend==1){selected=prependText+id;}\nif(prepend_gid==1){\nif(guid>1){\nselected=prependText+id+':'+guid;\n}\n}\ndocument.getElementById('{$_GET["field-user"]}').value=selected;\nWinORGHide();\n\t}\n}\n\nfunction EditField{$t}(base64,Name){\n\tvar fieldtype='{$_GET["field-type"]}';\n\tvar ADID='{$_GET["ADID"]}';\n\tif(document.getElementById('{$_GET["field-user"]}')){\n\t\tif(fieldtype==2){\n\t\t\tdocument.getElementById('{$_GET["field-user"]}').value='AD:'+ADID+':'+base64;\n\t\t\talert('{$item_add} mode:'+fieldtype+' - '+'`'+Name+'`');\n\t\t\t{$CallBack2}\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(fieldtype==3){\n\t\t\tdocument.getElementById('{$_GET["field-user"]}').value=Name;\n\t\t\talert('{$item_add} `'+Name+' - '+'`'+Name+'`');\n\t\t\t{$CallBack2}\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(fieldtype==4){\n\t\t\tdocument.getElementById('{$_GET["field-user"]}').value='ExtLDAP:'+Name+':'+base64;\n\t\t\tdocument.getElementById('{$_GET["field-user"]}').disabled=true;\n\t\t\talert('{$item_add} `'+Name+' - '+'`'+Name+'`');\n\t\t\t{$CallBack2}\n\t\t\treturn;\n\t\t}\t\t\n\t\t\n\t\tdocument.getElementById('{$_GET["field-user"]}').value=base64;\n\t\talert('{$item_add} mode:'+fieldtype+' - '+'`'+Name+'`');\n\t\t{$CallBack2}\n\t}\n}\n</script>\n";
    echo $html;
}
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $t = time();
    $explain = $tpl->_ENGINE_parse_body("{MILTERGREYLIST_STATUSDUMP_TEXT}");
    $time = $tpl->_ENGINE_parse_body("{time}");
    $ipaddr = $tpl->_ENGINE_parse_body("{ipaddr}");
    $from = $tpl->_ENGINE_parse_body("{from}");
    $to = $tpl->_ENGINE_parse_body("{to}");
    $whitelisted = $tpl->_ENGINE_parse_body("{whitelisted}");
    if (!isset($_GET["hostname"])) {
        $_GET["hostname"] = "master";
    }
    if ($_GET["hostname"] == null) {
        $_GET["hostname"] = "master";
    }
    $empty = $tpl->javascript_parse_text("{empty}");
    $mgreylist_empty_db_warn = $tpl->javascript_parse_text("{mgreylist_empty_db_warn}");
    $buttons = "buttons : [\n\t{name: '{$empty}', bclass: 'Delz', onpress : EmptyDB{$t}},\n\t{separator: true},\n\t],\t";
    if ($explain != null) {
        $explain = "<div class=explain style='font-size:13px'>{$explain}</div>";
    }
    $html = "\n{$explain}\n<center>\n<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:100%'></table>\n</center>\t\n<script>\n\$(document).ready(function(){\n\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?search=yes&hostname={$_GET["hostname"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$time}', name : 'stime', width : 122, sortable : false, align: 'left'},\t\n\t\t{display: '{$ipaddr}', name : 'ip_addr', width :108, sortable : true, align: 'left'},\n\t\t{display: '{$from}', name : 'mailfrom', width :225, sortable : true, align: 'left'},\n\t\t{display: '{$to}', name : 'mailto', width : 220, sortable : true, align: 'left'},\n\t\t{display: '{$whitelisted}', name : 'whitelisted', width : 25, sortable : true, align: 'center'},\n\t\t],\n\t{$buttons}\n\tsearchitems : [\n\t\t{display: '{$ipaddr}', name : 'ip_addr'},\n\t\t{display: '{$from}', name : 'mailfrom'},\n\t\t{display: '{$to}', name : 'mailto'},\n\t\t],\n\tsortname: 'stime',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: 780,\n\theight: 350,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\t\n\t});   \n});\n\n\t\tvar x_EmptyDB{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>5){alert(results);}\n\t\t\tRefreshTab('main_config_mgreylist');\n\t\t}\n\nfunction EmptyDB{$t}(){\n\tif(confirm('{$mgreylist_empty_db_warn}')){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('empty-db','yes');\n\t\tXHR.appendData('hostname','{$_GET["hostname"]}');\n\t\tAnimateDiv('flexRT{$t}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_EmptyDB{$t});\t\t\n\t\n\t}\n\n}\n\n</script>\n\n";
    echo $html;
}
function tabs()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $ID = $_GET["ID"];
    $t = $_GET["t"];
    $q = new mysql();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT groupname FROM haproxy_acls_groups WHERE ID='{$_GET["gpid"]}'", "artica_backup"));
    $title = $tpl->javascript_parse_text($ligne["groupname"]);
    if ($title == null) {
        $title = $tpl->javascript_parse_text("{group} {$ID}");
    }
    $array["popup"] = $title;
    $array["items"] = "{items}";
    while (list($num, $ligne) = each($array)) {
        if ($num == "popup") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?popup=yes&gpid={$_GET["gpid"]}\" style='font-size:18px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
        if ($num == "items") {
            $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"haproxy.acls.items.php?gpid={$_GET["gpid"]}\" style='font-size:18px'><span>{$ligne}</span></a></li>\n");
            continue;
        }
    }
    echo build_artica_tabs($html, "haproxy_groups_{$_GET["gpid"]}");
}
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $TB_HEIGHT = 300;
    $TB_WIDTH = 880;
    $t = time();
    $new_entry = $tpl->_ENGINE_parse_body("{new_rule}");
    $from = $tpl->_ENGINE_parse_body("{sender}");
    $to = $tpl->_ENGINE_parse_body("{recipients}");
    $title = $tpl->_ENGINE_parse_body("&laquo;{attachments}&raquo;");
    $rules = $tpl->_ENGINE_parse_body("{rules}");
    $ask_delete_rule = $tpl->javascript_parse_text("{delete_this_rule}");
    $enable = $tpl->_ENGINE_parse_body("{enable}");
    $compile_rules = $tpl->_ENGINE_parse_body("{compile_rules}");
    $filename = $tpl->_ENGINE_parse_body("{filename}");
    $content_type = $tpl->_ENGINE_parse_body("{content_type}");
    $zdate = $tpl->javascript_parse_text("{date}");
    $size = $tpl->javascript_parse_text("{size}");
    $buttons = "\n\tbuttons : [\n\t{name: '<strong style=font-size:18px>{$new_entry}</strong>', bclass: 'Add', onpress : NewGItem{$t}},\n\t\n\t\n\t],\t";
    $buttons = null;
    $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}',\n\tdataType: 'json',\n\tcolModel : [\t\n\t\n\t\t{display: '<span style=font-size:18px>{$zdate}</span>', name : 'zdate', width :158, sortable : true, align: 'left'},\n\t\t{display: '<span style=font-size:18px>{$from}</span>', name : 'mailfrom', width :224, sortable : true, align: 'left'},\n\t\t{display: '<span style=font-size:18px>{$to}</span>', name : 'mailto', width :224, sortable : true, align: 'left'},\n\t\t{display: '<span style=font-size:18px>{$filename}</span>', name : 'fname', width :403, sortable : true, align: 'left'},\n\t\t{display: '<span style=font-size:18px>{$content_type}</span>', name : 'contenttype', width :246, sortable : true, align: 'left'},\n\t\t{display: '<span style=font-size:18px>{$size}</span>', name : 'size', width :120, sortable : true, align: 'right'},\n\t\t\n\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t\t{display: '{$from}', name : 'mailfrom'},\n\t\t{display: '{$to}', name : 'mailto'},\n\t\t{display: '{$filename}', name : 'fname'},\n\t\t{display: '{$content_type}', name : 'contenttype'},\n\t],\n\tsortname: 'zdate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span style=font-size:30px>{$title}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 550,\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\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 NewGItem{$t}(){\n\tYahooWin('650','{$page}?rulemd5=&t={$t}','{$new_entry}');\n\t\n}\nfunction GItem{$t}(zmd5,ttile){\n\tYahooWin('650','{$page}?rulemd5='+zmd5+'&t={$t}',ttile);\n\t\n}\n\nvar x_DeleteAutCompress{$t}=function(obj){\n\tvar tempvalue=obj.responseText;\n    if(tempvalue.length>3){alert(tempvalue);return;}\n    \$('#rowC'+mem{$t}).remove();\n}\n\nfunction GroupAmavisExtEnable(id){\n\tvar value=0;\n\tif(document.getElementById('gp'+id).checked){value=1;}\n \tvar XHR = new XHRConnection();\n    XHR.appendData('enable-gp',id);\n    XHR.appendData('value',value);\n    XHR.sendAndLoad('{$page}', 'POST',x_NewGItem{$t});\t\t\n}\n\n\nfunction DeleteAutCompress{$t}(md5){\n\tif(confirm('{$ask_delete_rule}')){\n\t\tmem{$t}=md5;\n \t\tvar XHR = new XHRConnection();\n      \tXHR.appendData('del-zmd5',md5);\n      \tXHR.sendAndLoad('{$page}', 'POST',x_DeleteAutCompress{$t});\t\t\n\t\n\t}\n\n}\n\n</script>";
    echo $html;
}
function master_content()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $TB_HEIGHT = 500;
    $TB_WIDTH = 910;
    $uid = $_GET["uid"];
    $t = time();
    $ipaddr = $tpl->javascript_parse_text("{ipaddr}");
    $hostname = $tpl->_ENGINE_parse_body("{hostname}");
    $uid = $tpl->_ENGINE_parse_body("{uid}");
    //	$title=$tpl->_ENGINE_parse_body("$attachments_storage {items}:&nbsp;&laquo;$size&raquo;");
    $MAC = $tpl->_ENGINE_parse_body("{MAC}");
    $QuerySize = $tpl->javascript_parse_text("{QuerySize}");
    $hits = $tpl->_ENGINE_parse_body("{hits}");
    $MAC = $tpl->_ENGINE_parse_body("{MAC}");
    $all = $tpl->_ENGINE_parse_body("{all}");
    $rebuild = $tpl->_ENGINE_parse_body("{rebuild}");
    $error_want_operation = $tpl->javascript_parse_text("{error_want_operation}");
    $buttons = "\n\tbuttons : [\n\t{name: '{$all}', bclass: 'Search', onpress : CompressAll{$t}},\n\t{name: '{$uid}', bclass: 'Search', onpress : CompressUid{$t}},\n\t{name: '{$MAC}', bclass: 'Search', onpress : CompressMAC{$t}},\n\t{name: '{$rebuild}', bclass: 'Reload', onpress : Rebuild{$t}},\n\t\n\t],\t";
    //youtubeid 	 	title 	content 	 	hits 	 	thumbnail
    $html = "\n\t<div class=BodyContent>\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:99%'></table>\n\t</div>\n<script>\nvar mem{$t}='';\n\$(document).ready(function(){\n\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?items=yes&t={$t}&uid={$uid}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$ipaddr}', name : 'ipaddr', width :108, sortable : false, align: 'left'},\n\t\t{display: '{$MAC}', name : 'MAC', width :114, sortable : false, align: 'left'},\n\t\t{display: '{$hostname}', name : 'hostname', width :202, sortable : true, align: 'left'},\n\t\t{display: '{$uid}', name : 'uid', width :180, sortable : true, align: 'left'},\t\n\t\t{display: '{$QuerySize}', name : 'QuerySize', width :107, sortable : true, align: 'left'},\n\t\t{display: '{$hits}', name : 'hits', width :107, sortable : true, align: 'left'},\n\n\t\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t\t{display: '{$ipaddr}', name : 'ipaddr'},\n\t\t{display: '{$hostname}', name : 'hostname'},\n\t\t{display: '{$MAC}', name : 'MAC'},\n\t\t{display: '{$uid}', name : 'uid'},\n\n\t],\n\tsortname: 'QuerySize',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span id=\"title-{$t}\"></span>',\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=339','1024','900');\n}\n\nfunction CompressAll{$t}(){\n\t\$('#flexRT{$t}').flexOptions({url: '{$page}?items=yes'}).flexReload();\t\n}\nfunction CompressUid{$t}(){\n\t\$('#flexRT{$t}').flexOptions({url: '{$page}?items=yes&ByUid=yes'}).flexReload();\t\n}\nfunction CompressMAC{$t}(){\n\t\$('#flexRT{$t}').flexOptions({url: '{$page}?items=yes&ByMAC=yes'}).flexReload();\t\n}\n\nvar x_Enable{$t}=function(obj){\n\tvar tempvalue=obj.responseText;\n    if(tempvalue.length>3){alert(tempvalue);return;}\n    \$('#flexRT{$t}').flexReload();\n}\n\nfunction Rebuild{$t}(){\n\tif(confirm('{$error_want_operation}')){\n \t\tvar XHR = new XHRConnection();\n   \t \tXHR.appendData('rebuild','yes');\n   \t \tXHR.sendAndLoad('{$page}', 'POST',x_Enable{$t});\t\t\n\t}\t\n\n}\n\nvar x_Delete{$t}=function(obj){\n\tvar tempvalue=obj.responseText;\n    if(tempvalue.length>3){alert(tempvalue);return;}\n    \$('#row'+mem{$t}).remove();\n}\n\n\nfunction Enable{$t}(md){\n\tmem{$t}=md;\n\tvar enable=0;\n\tif(document.getElementById('enable_'+md).checked){enable=1;}\n \tvar XHR = new XHRConnection();\n    XHR.appendData('enable-item',md);\n    XHR.appendData('value',enable);\n    XHR.sendAndLoad('{$page}', 'POST',x_Enable{$t});\t\t\n   \n\t}\n\nfunction Delete{$t}(md){\n\tmem{$t}=md;\n\tif(confirm('{$action_delete_rule}')){\n \t\tvar XHR = new XHRConnection();\n   \t \tXHR.appendData('delete-item',md);\n   \t \tXHR.sendAndLoad('{$page}', 'POST',x_Delete{$t});\t\t\n\t}\n}\n\nfunction Run{$t}(md){\n\tmem{$t}=md;\n\tif(confirm('{$error_want_operation}')){\n \t\tvar XHR = new XHRConnection();\n   \t \tXHR.appendData('run-item',md);\n   \t \tXHR.sendAndLoad('{$page}', 'POST',x_Enable{$t});\t\t\n\t}\n\n}\n\nfunction Events{$t}(md){\n\tYahooWin5('505','{$page}?events-table=yes&zmd5='+md+'&t={$t}','{$events}');\n}\n\nfunction NewGItem{$t}(){\n\tYahooWin5('600','{$page}?backup-rule=&uid={$uid}&t={$t}','{$new_entry}');\n\n}\nfunction GItem{$t}(md,title){\n\tYahooWin5('600','{$page}?backup-rule='+md+'&uid={$uid}&t={$t}',title);\n\n}\n\n\n</script>";
    echo $html;
}
Example #11
0
function popup()
{
    $tt = $_GET["tt"];
    $page = CurrentPageName();
    $tpl = new templates();
    $webservers = $tpl->_ENGINE_parse_body("{webservers}");
    $hits = $tpl->_ENGINE_parse_body("{hits}");
    $size = $tpl->_ENGINE_parse_body("{size}");
    $time = $tpl->_ENGINE_parse_body("{time}");
    $member = $tpl->_ENGINE_parse_body("{member}");
    $country = $tpl->_ENGINE_parse_body("{country}");
    $url = $tpl->_ENGINE_parse_body("{url}");
    $delete = $tpl->_ENGINE_parse_body("{delete}");
    $new = $tpl->_ENGINE_parse_body("{new}");
    $rule = $tpl->_ENGINE_parse_body("{rule}");
    $title = $tpl->_ENGINE_parse_body(date("{l} d {F}") . " {blocked_requests}");
    $unblock = $tpl->javascript_parse_text("{unblock}");
    $UnBlockWebSiteExplain = $tpl->javascript_parse_text("{UnBlockWebSiteExplain}");
    $title = $tpl->javascript_parse_text("{blacklist}");
    $squid_ask_domain = $tpl->javascript_parse_text("{squid_ask_domain}");
    $apply = $tpl->javascript_parse_text("{apply}");
    $t = time();
    $html = "\n\t\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:100%'></table>\n\t\n<script>\nvar mem{$t}='';\n\$(document).ready(function(){\n\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?events=yes&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$webservers}', name : 'items', width : 461, sortable : true, align: 'left'},\n\t\t{display: '{$delete}', name : 'delete', width : 31, sortable : false, align: 'center'},\n\t\t\n\t\t],\nbuttons : [\n\t{name: '{$new}', bclass: 'add', onpress : NewWebServer{$t}},\n\t{name: '{$apply}', bclass: 'Reconf', onpress : Apply{$t}},\n\n\t\t],\t\t\t\n\tsearchitems : [\n\t\t{display: '{$webservers}', name : 'items'},\n\t\t\n\t\t],\t\t\t\n\t\t\n\tsortname: 'items',\n\tsortorder: 'asc',\n\tusepager: true,\n\tuseRp: true,\n\ttitle: '<span style=\"font-size:14px\">{$title}</span>',\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 400,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500,1000,1500]\n\t\n\t});   \n});\n\n\tvar x_Delete{$t}=function(obj){\n\t      var tempvalue=obj.responseText;\n\t      if(tempvalue.length>3){alert(tempvalue);}\n\t      \$('#row'+mem{$t}).remove();\n\t}\t\n\t\n\tvar x_reload{$t}=function(obj){\n\t\tvar tempvalue=obj.responseText;\n\t     if(tempvalue.length>3){alert(tempvalue);return;}\n\t\t \$('#flexRT{$t}').flexReload();\n\t\t \$('#flexRT{$tt}').flexReload();\n\t}\n\nfunction Delete{$t}(domain,id){\n\tmem{$t}=id;\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('delete',domain);\n\tXHR.sendAndLoad('{$page}', 'POST',x_Delete{$t});\n}\n\nfunction Apply{$t}(){\n\tLoadjs('squid.compile.progress.php?onlywhitelist=yes');\n}\n\nfunction NewWebServer{$t}(){\n\tLoadjs('{$page}?add-black-js=yes&t={$t}&tt={$tt}',true);\n}\n\n</script>\n\t\n\t\n\t";
    echo $html;
}
Example #12
0
function js(){
	$sock=new sockets();
	$page=CurrentPageName();
	$tpl=new templates();
	$datasUFDB=unserialize(base64_decode($sock->GET_INFO("ufdbguardConfig")));
	if(!is_numeric($datasUFDB["DebugAll"])){$datasUFDB["DebugAll"]=0;}
	$watn=$tpl->javascript_parse_text("{ufdbguard_debug_off}");
	if($datasUFDB["DebugAll"]==0){
		$watn=$tpl->javascript_parse_text("{ufdbguard_debug_on}");
		
		
	}
	$t=time();
	$html="
			
	var xttask$t=function (obj) {
		if(document.getElementById('rules-toolbox-left')){
			RefreshTab('main_dansguardian_mainrules');
		}
	}
	
		function ttask$t(){
			if(!confirm('$watn')){return;}
			var XHR = new XHRConnection();
			XHR.appendData('debug','yes');
			XHR.sendAndLoad('$page', 'POST',xttask$t);
		}
			
ttask$t();	";
	
	echo $html;
}
function page()
{
    $tpl = new templates();
    $ID = $_GET["ID"];
    if (!is_numeric($ID)) {
        $ID = 0;
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $t = time();
    $path = base64_decode($_GET["path"]);
    $md5path = md5($path);
    $veto_files_explain = $tpl->_ENGINE_parse_body("{veto_files_explain}");
    $veto_files_add_explain = $tpl->javascript_parse_text("{veto_files_add_explain}");
    $t = time();
    $from = $tpl->_ENGINE_parse_body("{from}");
    $zDate = $tpl->_ENGINE_parse_body("{zDate}");
    $mailto = $tpl->javascript_parse_text("{recipient}");
    $subject = $tpl->javascript_parse_text("{subject}");
    $help = $tpl->_ENGINE_parse_body("{online_help}");
    $title = $tpl->_ENGINE_parse_body(date("{l} d {F} Y"));
    $buttons = "\n\tbuttons : [\n\t{name: '{$new_entry}', bclass: 'Add', onpress : NewGItem{$t}},\n\t{name: '{$help}', bclass: 'Help', onpress : ItemHelp{$t}},\n\t],\t";
    $buttons = null;
    $html = "\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:99%'></table>\n\t<script>\n\tvar mem{$t}='';\n\t\$(document).ready(function(){\n\t\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?items-list=yes&t={$t}&md5path={$md5path}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$zDate}', name : 'zDate', width :146, sortable : true, align: 'left'},\n\t{display: '{$from}', name : 'mailfrom', width :149, sortable : true, align: 'left'},\n\t{display: '{$mailto}', name : 'mailto', width :149, sortable : true, align: 'left'},\n\t{display: '{$subject}', name : 'subject', width :430, sortable : true, align: 'left'},\n\t\n\t\n\t\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t{display: '{$from}', name : 'mailfrom'},\n\t{display: '{$mailto}', name : 'mailto'},\n\t{display: '{$subject}', name : 'subject'},\n\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span style=font-size:18px>{$title}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 550,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200,500]\n\n});\n});\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
Example #14
0
function containers_table()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $TB_HEIGHT = 450;
    $TB_WIDTH = 600;
    $uid = $_GET["uid"];
    $t = time();
    $filename = $tpl->javascript_parse_text("{filename}");
    $date = $tpl->_ENGINE_parse_body("{date}");
    $account = $tpl->_ENGINE_parse_body("{account}");
    //	$title=$tpl->_ENGINE_parse_body("$attachments_storage {items}:&nbsp;&laquo;$size&raquo;");
    $filessize = $tpl->_ENGINE_parse_body("{filesize}");
    $action_delete_rule = $tpl->javascript_parse_text("{action_delete_rule}");
    $enable = $tpl->_ENGINE_parse_body("{enable}");
    $compile_rules = $tpl->_ENGINE_parse_body("{compile_rules}");
    $online_help = $tpl->_ENGINE_parse_body("{online_help}");
    $enabled = $tpl->_ENGINE_parse_body("{enabled}");
    $items = $tpl->_ENGINE_parse_body("{items}");
    $error_want_operation = $tpl->javascript_parse_text("{error_want_operation}");
    $events = $tpl->javascript_parse_text("{events}");
    $category = $tpl->javascript_parse_text("{category}");
    $title = $tpl->javascript_parse_text("{video_title}");
    $size = $tpl->javascript_parse_text("{size}");
    $duration = $tpl->javascript_parse_text("{duration}");
    $hits = $tpl->javascript_parse_text("{hits}");
    $remove = $tpl->javascript_parse_text("{remove}");
    $buttons = "\n\t\n\t// mysqldb_backup_containers (`md5`,`fullpath`,`duration`,`zDate`,`size`)\n\t\n\t\n\tbuttons : [\n\t\n\t{name: '{$online_help}', bclass: 'Help', onpress : ItemHelp{$t}},\n\t\n\t],\t";
    $html = "\n\t\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:99%'></table>\n\t\n<script>\nvar mem{$t}='';\n\$(document).ready(function(){\n\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?containers-items=yes&t={$t}&instance-id={$_GET["instance-id"]}&database={$_GET["database"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$date}', name : 'zDate', width :82, sortable : true, align: 'left'},\n\t\t{display: '{$filename}', name : 'fullpath', width :180, sortable : true, align: 'left'},\t\n\t\t{display: '{$duration}', name : 'duration', width :118, sortable : true, align: 'left'},\n\t\t{display: '{$size}', name : 'size', width :93, sortable : true, align: 'left'},\n\t\t{display: '&nbsp;', name : 'delete', width :38, sortable : true, align: 'center'},\n\t\t\n\t\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t\t{display: '{$filename}', name : 'fullpath'},\n\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span id=\"title-{$t}\"></span>',\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://mail-appliance.org/index.php?cID=371','1024','900');\n}\n\n\tvar x_FileNameMsqlDelete= function (obj) {\n\t \t\ttext=obj.responseText;\n\t \t\tif(text.length>3){alert(text);return;}\n\t \t\t\$('#row'+mem{$t}).remove();\n\t \t\t\n\t\t}\n\nfunction FileNameMsqlDelete(filename,md){\n\tmem{$t}=md;\n\tif(confirm('{$remove}\\n'+filename+' ?')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('remove-file',filename);\t\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_FileNameMsqlDelete);\n\t\t}\n\n}\n\n\n</script>";
    echo $html;
}
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $date = $tpl->_ENGINE_parse_body("{zDate}");
    $description = $tpl->_ENGINE_parse_body("{description}");
    $context = $tpl->_ENGINE_parse_body("{context}");
    $events = $tpl->_ENGINE_parse_body("{events}");
    $empty = $tpl->_ENGINE_parse_body("{empty}");
    $empty_events_text_ask = $tpl->javascript_parse_text("{empty_events_text_ask}");
    $service = $tpl->_ENGINE_parse_body("{servicew}");
    $client = $tpl->_ENGINE_parse_body("{client}");
    $sitename = $tpl->javascript_parse_text("{sitename}");
    $file = $tpl->javascript_parse_text("{filename}");
    $uri = $tpl->javascript_parse_text("{event}");
    $t = time();
    $SE_SERV = "{display: '{$service}', name : 'service'},";
    $TB_SERV = "{display: '{$service}', name : 'zDate', width :97, sortable : false, align: 'left'},";
    if ($_GET["force-prefix"] != null) {
        $MasterTitle = $_GET["force-prefix"];
        $TB_SERV = null;
        $SE_SERV = null;
    }
    if ($_GET["prepend"] != null) {
        $MasterTitle = $MasterTitle . "&raquo;{$_GET["prepend"]}";
    }
    $MasterTitle = $tpl->javascript_parse_text("VideoCache {events}");
    $buttons = "\nbuttons : [\n{name: '{$empty}', bclass: 'Delz', onpress : EmptyEvents},\n\n],\t";
    $buttons = null;
    $html = "\n<table class='events-table-{$t}' style='display: none' id='events-table-{$t}' style='width:99%'></table>\n<script>\n\n\$(document).ready(function(){\n\$('#events-table-{$t}').flexigrid({\nurl: '{$page}?search=yes&prepend={$_GET["prepend"]}&force-prefix={$_GET["force-prefix"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$date}', name : 'zDate', width :125, sortable : true, align: 'left'},\n\t{display: 'PID', name : 'zDate', width :40, sortable : false, align: 'left'},\n\t\n\t{display: '{$sitename}', name : 'sitename', width : 85, sortable : false, align: 'left'},\n\t{display: 'HIT', name : 'HIT', width : 131, sortable : false, align: 'left'},\n\t{display: '{$file}', name : 'sitename', width : 128, sortable : false, align: 'left'},\n\t{display: '{$uri}', name : 'uri', width : 532, sortable : false, align: 'left'},\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t{display: '{$events}', name : 'events'},\n\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '{$MasterTitle}',\nuseRp: true,\nrp: 50,\nshowTableToggleBtn: false,\nwidth: '99%',\nheight:450 ,\nsingleSelect: true,\nrpOptions: [10, 20, 30, 50,100,200,500]\n\n});\n});\n\n</script>";
    echo $html;
    return;
}
Example #16
0
function tableau()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $items = $tpl->_ENGINE_parse_body("{items}");
    $size = $tpl->_ENGINE_parse_body("{size}");
    $SaveToDisk = $tpl->_ENGINE_parse_body("{SaveToDisk}");
    $addCat = $tpl->_ENGINE_parse_body("{add} {category}");
    $date = $tpl->_ENGINE_parse_body("{zDate}");
    $task = $tpl->_ENGINE_parse_body("{task}");
    $new_schedule = $tpl->_ENGINE_parse_body("{new_rotate}");
    $explain = $tpl->_ENGINE_parse_body("{explain_squid_tasks}");
    $run = $tpl->_ENGINE_parse_body("{run}");
    $task = $tpl->_ENGINE_parse_body("{task}");
    $sizeT = $tpl->_ENGINE_parse_body("{size}");
    $filename = $tpl->_ENGINE_parse_body("{filename}");
    $empty = $tpl->_ENGINE_parse_body("{empty}");
    $askdelete = $tpl->javascript_parse_text("{empty_store} ?");
    $zdate = $tpl->javascript_parse_text("{date}");
    $action = $tpl->javascript_parse_text("{action}");
    $q = new mysql_storelogs();
    $files = $q->COUNT_ROWS("accesslogs");
    $size = $q->TABLE_SIZE("access_store");
    $title = $tpl->_ENGINE_parse_body("MySQL: {storage} {files}:" . FormatNumberX($files, 0) . " (" . FormatBytes($size / 1024) . ")");
    $t = time();
    $html = "\n\t\n\t<table class='{$t}' style='display: none' id='{$t}' style='width:99%'></table>\n\t<script>\n\tvar rowSquidTask='';\n\t\$(document).ready(function(){\n\t\$('#{$t}').flexigrid({\n\turl: '{$page}?search-store=yes&minisize={$_GET["minisize"]}&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$zdate}', name : 'filetime', width : 158, sortable : true, align: 'left'},\n\t{display: '{$filename}', name : 'filename', width : 378, sortable : true, align: 'left'},\n\t{display: '{$sizeT}', name : 'filesize', width : 95, sortable : true, align: 'left'},\n\t{display: '{$task}', name : 'taskid', width : 40, sortable : true, align: 'center'},\n\t{display: '{$action}', name : 'action', width : 40, sortable : false, align: 'center'},\n\t{display: '&nbsp;', name : 'delete', width : 32, sortable : false, align: 'center'}\n\t],\n\n\tsearchitems : [\n\t{display: '{$filename}', name : 'filename'},\n\t{display: '{$task}', name : 'taskid'},\n\t],\n\tsortname: 'filetime',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<strong>{$title}</strong>',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: 835,\n\theight: 400,\n\tsingleSelect: true\n\t\n\t});\n\t});\n\t\n\t\n\t\n\tfunction EmptyStorage(){\n\tif(confirm('{$askdelete}')){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('DELETE-STORE','yes');\n\tXHR.sendAndLoad('logrotate.php', 'POST',x_EmptyStorage);\n\t}\n\t}\n\t\n\tfunction SquidCrontaskUpdateTable(){\n\t\$('#{$t}').flexReload();\n\t}\n\t\n\tvar x_RotateTaskEnable=function (obj) {\n\tvar ID='{$_GET["ID"]}';\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\n\t}\n\t\n\tvar x_EmptyStorage=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);}\n\t\$('#{$t}').flexReload();\n\t}\n\t\n\t\n\t\n\tfunction DisableSquidDefaultScheduleCheck(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('DisableSquidDefaultSchedule').checked){XHR.appendData('DisableSquidDefaultSchedule',1);}\n\telse{XHR.appendData('DisableSquidDefaultSchedule',0);}\n\tXHR.sendAndLoad('{$page}', 'POST',x_DisableSquidDefaultScheduleCheck);\n\t}\n\t\n\t\n\t\n\t\n\tvar x_StorageTaskDelete=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);return;}\n\t\$('#row'+rowSquidTask).remove();\n\t}\n\t\n\tfunction StorageTaskDelete(filename,md5){\n\trowSquidTask=md5;\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('filename',filename);\n\tXHR.appendData('storage-delete','yes');\n\tXHR.sendAndLoad('logrotate.php', 'POST',x_StorageTaskDelete);\n\t}\n\t\n\t\n\t\n\t</script>";
    echo $html;
}
Example #17
0
function popup()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $DisableGoogleSSL = intval($sock->GET_INFO("DisableGoogleSSL"));
    $warn_squid_restart = $tpl->javascript_parse_text("{warn_squid_restart}");
    $display_dns_items = $tpl->javascript_parse_text("{display_dns_items}");
    $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance");
    if (!is_numeric($EnableRemoteStatisticsAppliance)) {
        $EnableRemoteStatisticsAppliance = 0;
    }
    $UnlockWebStats = $sock->GET_INFO("UnlockWebStats");
    if (!is_numeric($UnlockWebStats)) {
        $UnlockWebStats = 0;
    }
    if ($UnlockWebStats == 1) {
        $EnableRemoteStatisticsAppliance = 0;
    }
    $t = time();
    $button = button("{apply}", "DisableGoogleSSLSave{$t}()", 32);
    $enable = Paragraphe_switch_img("{enforce_google_to_non_ssl}", "{enforce_google_to_non_ssl_text}", "DisableGoogleSSL-{$t}", $DisableGoogleSSL, null, 750);
    $html = "\n\t<div id='{$t}-div'></div>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t\n\t\t<td width=99%>{$enable}</td>\n\t</tr>\n\t<tr>\n\t\t\n\t\t<td width=99% align='right'><a href=\"javascript:blur();\" OnClick=\"javascript:YahooWin4('500','{$page}?google-dns=yes','{$display_dns_items}')\"\n\t\tstyle='font-size:22px;text-decoration:underline'>{$display_dns_items}</a>\n\t\t</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>{$button}</td>\n\t</tr>\n\t</table>\n\n\t\n\t<script>\n\t\t\n\tvar x_DisableGoogleSSLSave{$t}=function(obj){\n     \tvar tempvalue=obj.responseText;\n      \tif(tempvalue.length>3){alert(tempvalue);}\n      \tLoadjs('squid.google.compile.progress.php');\n      \t\n     \t}\t\n\n\tfunction DisableGoogleSSLSave{$t}(){\n\t\tif(confirm('{$warn_squid_restart}')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('DisableGoogleSSL',document.getElementById('DisableGoogleSSL-{$t}').value);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_DisableGoogleSSLSave{$t});\t\t\n\t\t}\n\t\n\t}\t\t\n\t\t\n\t</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $date = $tpl->_ENGINE_parse_body("{zDate}");
    $description = $tpl->_ENGINE_parse_body("{description}");
    $context = $tpl->_ENGINE_parse_body("{context}");
    $events = $tpl->_ENGINE_parse_body("{events}");
    $empty = $tpl->_ENGINE_parse_body("{empty}");
    $daemon = $tpl->_ENGINE_parse_body("{daemon}");
    $settings = $tpl->javascript_parse_text("{watchdog_squid_settings}");
    $empty_events_text_ask = $tpl->javascript_parse_text("{empty_events_text_ask}");
    $TB_HEIGHT = 450;
    $TB_WIDTH = 927;
    $TB2_WIDTH = 551;
    $all = $tpl->_ENGINE_parse_body("{all}");
    $t = time();
    if (isset($_GET["important-only"])) {
        $critical = "&critical=0&important-only=yes";
        $TB2_WIDTH = "955";
        $zdate_width = "256";
    }
    $buttons = "\n\tbuttons : [\n\t{name: '<strong style=font-size:18px>{$empty}</strong>', bclass: 'Delz', onpress : EmptyEvents},\n\t{name: '<strong style=font-size:18px>Warn</strong>', bclass: 'Warn', onpress :  Warn{$t}},\n\t{name: '<strong style=font-size:18px>Info</strong>', bclass: 'Help', onpress :  info{$t}},\n\t{name: '<strong style=font-size:18px>Crit.</strong>', bclass: 'Err', onpress :  Err{$t}},\n\t{name: '<strong style=font-size:18px>{$all}</strong>', bclass: 'Statok', onpress :  All{$t}},\n\t\n\t\n\n\t],\t";
    $html = "\n<table class='events-table-{$t}' style='display: none' id='events-table-{$t}' style='width:99%'></table>\n\t<script>\n\nfunction BuildTable{$t}(){\n\t\$('#events-table-{$t}').flexigrid({\n\t\turl: '{$page}?events-table=yes&text-filter={$_GET["text-filter"]}{$critical}',\n\t\tdataType: 'json',\n\t\tcolModel : [\n\t\t{display: '', name : 'severity', width :40, sortable : true, align: 'center'},\n\t\t{display: '<span style=font-size:18px>{$date}</span>', name : 'zDate', width :180, sortable : true, align: 'left'},\n\t\t{display: '<span style=font-size:18px>{$events}</span>', name : 'subject', width : 961, sortable : false, align: 'left'},\n\t\t{display: '<span style=font-size:18px>{$daemon}</span>', name : 'filename', width :206, sortable : true, align: 'left'},\n\t\t],\n\t\t{$buttons}\n\t\n\t\tsearchitems : [\n\t\t{display: '{$events}', name : 'subject'},\n\t\t],\n\t\tsortname: 'zDate',\n\t\tsortorder: 'desc',\n\t\tusepager: true,\n\t\ttitle: '',\n\t\tuseRp: true,\n\t\trp: 50,\n\t\tshowTableToggleBtn: false,\n\t\twidth: '99%',\n\t\theight: {$TB_HEIGHT},\n\t\tsingleSelect: true,\n\t\trpOptions: [10, 20, 30, 50,100,200,500]\n\n\t});\n}\n\nfunction articaShowEvent(ID){\n\tYahooWin6('750','{$page}?ShowID='+ID,'{$title}::'+ID);\n}\n\nvar x_EmptyEvents= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\$('#events-table-{$t}').flexReload();\n\t//\$('#grid_list').flexOptions({url: 'newurl/'}).flexReload();\n\t// \$('#fgAllPatients').flexOptions({ query: 'blah=qweqweqwe' }).flexReload();\n\n}\n\nfunction Warn{$t}(){\n\t\$('#events-table-{$t}').flexOptions({url: '{$page}?events-table=yes&critical=1'}).flexReload(); \n}\nfunction info{$t}(){\n\t\$('#events-table-{$t}').flexOptions({url: '{$page}?events-table=yes&critical=2'}).flexReload(); \n}\nfunction Err{$t}(){\n\t\$('#events-table-{$t}').flexOptions({url: '{$page}?events-table=yes&critical=0'}).flexReload(); \n}\nfunction All{$t}(){\n\t\$('#events-table-{$t}').flexOptions({url: '{$page}?events-table=yes'}).flexReload(); \n}\nfunction Params{$t}(){\n\tLoadjs('squid.proxy.watchdog.php');\n}\n\nfunction EmptyEvents(){\n\tif(!confirm('{$empty_events_text_ask}')){return;}\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('empty-table','yes');\n\tXHR.sendAndLoad('{$page}', 'POST',x_EmptyEvents);\n}\nsetTimeout(\" BuildTable{$t}()\",800);\n</script>";
    echo $html;
}
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;
}
Example #20
0
function js(){
		$page=CurrentPageName();
		$tpl=new templates();
		$title=$tpl->_ENGINE_parse_body("{system_kernel}");
		$perform_installation_of=$tpl->javascript_parse_text("{perform_installation_of}");
		$server_will_be_rebooted=$tpl->javascript_parse_text("{server_will_be_rebooted}");
		$html="
		
		
		function system_kernel_load(){
			YahooWin('820','$page?popup=yes','$title');
			}
			
		var x_KernelInstall=function(obj){
	      var tempvalue=obj.responseText;
	      if(tempvalue.length>0){alert(tempvalue);}
	      YahooWinHide();
		}			
			
		function KernelInstall(package){
			if(confirm('$perform_installation_of:\\n--------------\\n'+package+'\\n--------------\\n$server_will_be_rebooted')){
				var XHR = new XHRConnection();
		 		XHR.appendData('upgrade-kernel-confirm',package);
			 	XHR.sendAndLoad('$page', 'GET',x_KernelInstall);
			}
		}
			
		system_kernel_load();
		";
		echo $html;
		
	
}
Example #21
0
function popup()
{
    $tpl = new templates();
    $sock = new sockets();
    $ENABLED = trim($sock->getFrameWork("squid.php?enable-http-violations-enabled=yes"));
    if ($ENABLED != "TRUE") {
        $html = "\n\t\t<table style='width:98%' class=form>\n\t\t<tr>\n\t\t\t<td valign='top' width=1%><img src='img/error-128.png'></td>\n\t\t\t<td valign='top'><div style='font-size:18px'>{HTTP_VIOLATIONS_NOT_ENABLED_IN_SQUID}</td>\n\t\t</tr>\n\t\t</table>\n\t\t\n\t\t";
        echo $tpl->_ENGINE_parse_body($html);
        return;
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $q = new mysql();
    $q->CheckTablesSquid();
    $enabled = $tpl->_ENGINE_parse_body("{enable}");
    $allow = $tpl->_ENGINE_parse_body("{allow}");
    $active = $tpl->javascript_parse_text("{activew}");
    $standard = $tpl->javascript_parse_text("{standard}");
    $anonymous_browsing = $tpl->_ENGINE_parse_body("{anonymous_browsing}");
    $standard_anonymous = $tpl->javascript_parse_text("{standard_anonymous}");
    $paranoid_anonymous = $tpl->javascript_parse_text("{paranoid_anonymous}");
    $set_the_new_value_for_this_header = $tpl->javascript_parse_text("{set_the_new_value_for_this_header}");
    $restart_onlysquid = $tpl->_ENGINE_parse_body("{restart_onlysquid}");
    $tt = $_GET["tt"];
    $t = time();
    $html = "\n\t<table class='table-{$t}' style='display: none' id='table-{$t}' style='width:99%'></table>\n<script>\nvar tmp{$t}='';\n\$(document).ready(function(){\n\$('#table-{$t}').flexigrid({\n\turl: '{$page}?headers-list=yes&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '&nbsp;', name : 'img', width : 24, sortable : true, align: 'left'},\n\t\t{display: 'header', name : 'header', width : 328, sortable : true, align: 'left'},\n\t\t{display: '{$active}', name : 'active', width : 80, sortable : false, align: 'center'},\n\t\t{display: '{$allow}', name : 'allow', width : 80, sortable : false, align: 'center'},\n\t\t\n\t\t\n\t\t\n\t],\nbuttons : [\n\t{name: '{$standard}', bclass: 'Script', onpress : standard{$t}},\n\t{name: '{$standard_anonymous}', bclass: 'Script', onpress : standard_anonymous},\n\t{name: '{$paranoid_anonymous}', bclass: 'Script', onpress : paranoid_anonymous},\n\t{name: '{$restart_onlysquid}', bclass: 'Reload', onpress : RestartProxy{$t}},\n\t],\t\n\tsearchitems : [\n\t\t{display: 'header', name : 'header'},\n\t\t],\n\tsortname: 'header',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '{$anonymous_browsing}',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: 580,\n\theight: 300,\n\tsingleSelect: true\n\t\n\t});   \n});\t\n\t\nfunction AddProxyChild(){\n\tYahooWin5('380','{$page}?add-proxy=yes&t={$t}','{$new_proxy}');\n\n}\n\n\n\n\tvar x_DeleteSquidChild{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>2){alert(results);return;}\n\t\t\t\$('#rowTSC'+tmp{$t}).remove();\n\t\t}\t\t\n\n\tfunction DeleteSquidChild(ID){\n\t\ttmp{$t}=ID;\n\t\tif(confirm('{$delete_this_child} ?')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('proxy-delete',ID);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_DeleteSquidChild{$t});\n\t\t}\n\t}\n\t\n\tvar x_EnableDisableProxyHeader{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>2){alert(results);return;}\n\t\t\t\n\t\t}\n\t\t\n\tvar x_standard_anonymous{$t}= function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>2){alert(results);return;}\n\t\t\t\$('#table-{$t}').flexReload();\n\t\t}\t\t\n\n\tfunction standard_anonymous(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('standard-anonymous',1);\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_standard_anonymous{$t});\t\n\t}\n\t\nfunction standard{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('standard',1);\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_standard_anonymous{$t});\n}\t\n\t\n\tfunction paranoid_anonymous(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('paranoid-anonymous',1);\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_standard_anonymous{$t});\t\n\t}\t\n\t\n\t\n\t\n\tfunction standard_anonymous(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('standard-anonymous',1);\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_standard_anonymous{$t});\t\n\t}\t\n\t\n\tfunction RestartProxy{$t}(){\n\t\tLoadjs('squid.restart.php?onlySquid=yes');\n\t}\n\t\n\t\n\t\n\tfunction EnableDisableProxyHeader(header,md){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('header-enable',header);\n\t\tif(document.getElementById(md).checked){\n\t\t\tXHR.appendData('enable',1);\n\t\t}else{\n\t\t\tXHR.appendData('enable',0);\n\t\t}\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_EnableDisableProxyHeader{$t});\t\n\t}\n\tfunction AllowProxyHeader(header,md){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('header-allow',header);\n\t\tif(document.getElementById(md).checked){\n\t\t\tXHR.appendData('enable',1);\n\t\t}else{\n\t\t\tXHR.appendData('enable',0);\n\t\t}\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_EnableDisableProxyHeader{$t});\t\n\t}\n\tfunction ChangeSquidHeader(header){\n\t\tvar vl=prompt('{$set_the_new_value_for_this_header}:'+header);\n\t\tif(vl){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('header-change',header);\n\t\t\tXHR.appendData('value',vl);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_standard_anonymous{$t});\n\t\t}\t\n\t}\n</script>\n";
    echo $html;
}
Example #22
0
function table()
{
    $tpl = new templates();
    $page = CurrentPageName();
    $sock = new sockets();
    $users = new usersMenus();
    $t = $_GET["t"];
    if (!is_numeric($t)) {
        $t = time();
    }
    $dns_nameservers = $tpl->javascript_parse_text("{dns_nameservers}");
    $new_dns = $tpl->javascript_parse_text("{new_dns_server}");
    $blacklist = $tpl->javascript_parse_text("{blacklist}");
    $domains = $tpl->javascript_parse_text("{domains}");
    $restart_service = $tpl->javascript_parse_text("{restart_service}");
    $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance");
    if (!is_numeric($EnableRemoteStatisticsAppliance)) {
        $EnableRemoteStatisticsAppliance = 0;
    }
    $SQUID_INSTALLED = 1;
    $newdns = "{name: '<strong style=font-size:18px>{$new_dns}</strong>', bclass: 'add', onpress : dnsadd},";
    if ($EnableRemoteStatisticsAppliance == 1) {
        $newdns = null;
    }
    if (!$users->SQUID_INSTALLED) {
        $SQUID_INSTALLED = 0;
    }
    $buttons = "\n\tbuttons : [\n\t\t{$newdns}\n\t\t{name: '<strong style=font-size:18px>{$domains}: {$blacklist}</strong>', bclass: 'Copy', onpress : BlackList{$t}},\n\t\t{name: '<strong style=font-size:18px>{$restart_service}</strong>', bclass: 'ReConf', onpress : RestartService{$t}},\n\t],";
    $html = "<table class='table-{$t}' style='display: none' id='table-{$t}' style='width:99%'></table>\n<script>\nvar xmemnum=0;\n\$(document).ready(function(){\n\$('#table-{$t}').flexigrid({\n\turl: '{$page}?details-tablerows=yes&t={$t}&field={$_GET["field"]}&value={$_GET["value"]}&EnableRemoteStatisticsAppliance={$EnableRemoteStatisticsAppliance}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '&nbsp;', name : 'zOrder', width :50, sortable : true, align: 'center'},\n\t\t{display: '{$dns_nameservers}', name : 'server', width :632, sortable : false, align: 'left'},\n\t\t{display: '&nbsp;', name : 'zOrder', width :122, sortable : true, align: 'center'},\n\t\t{display: '&nbsp;', name : 'dup', width :122, sortable : false, align: 'center'},\t\t\n\t\t{display: '&nbsp;', name : 'none2', width :122, sortable : false, align: 'center'},\n\t],\n\t{$buttons}\n\tsortname: 'zOrder',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 550,\n\tsingleSelect: true\n\t\n\t});   \n});\n\nfunction RestartService{$t}(){\n\tLoadjs('system.services.cmd.php?APPNAME=APP_DNSMASQ&action=restart&cmd=%2Fetc%2Finit.d%2Fdnsmasq&appcode=DNSMASQ');\n}\n\nfunction BlackList{$t}(){\n\tLoadjs('squid.dns.items.black.php');\n}\nvar x_dnsadd= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\$('#table-{$t}').flexReload();\n\tif(document.getElementById('squid-services')){\n\t\tLoadAjax('squid-services','squid.main.quicklinks.php?squid-services=yes');\n\t}\n}\n\t\t\nvar x_dnsdel= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\$('#rowsquid-dns-'+xmemnum).remove();\n\t\$('#table-{$t}').flexReload();\n}\t\t\n\t\t\nfunction dnsadd(){\n\tvar nameserver=prompt('{$dns_nameservers}:');\n\tif(nameserver){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('nameserver',nameserver);\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_dnsadd);\t\n\t}\n}\n\t\t\nfunction DnsDelete{$t}(num){\n\txmemnum=num;\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('DnsDelete',num);\n\tXHR.sendAndLoad('{$page}', 'POST',x_dnsdel);\t\n}\nvar x_dnsupd= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\$('#table-{$t}').flexReload();\n\t\n}\n\nfunction SquidDNSUpDown(ID,dir){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('SquidDNSUpDown',ID);\n\tXHR.appendData('direction',dir);\n\tXHR.sendAndLoad('{$page}', 'POST',x_dnsupd);\t\n}\n\n\n</script>";
    echo $html;
}
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $TB_HEIGHT = 500;
    $TB_WIDTH = 910;
    $uid = $_GET["uid"];
    $t = time();
    $sitename = $tpl->javascript_parse_text("{sitename}");
    $imapserv = $tpl->_ENGINE_parse_body("{imap_server}");
    $account = $tpl->_ENGINE_parse_body("{account}");
    //	$title=$tpl->_ENGINE_parse_body("$attachments_storage {items}:&nbsp;&laquo;$size&raquo;");
    $filessize = $tpl->_ENGINE_parse_body("{filesize}");
    $action_delete_rule = $tpl->javascript_parse_text("{action_delete_rule}");
    $enable = $tpl->_ENGINE_parse_body("{enable}");
    $compile_rules = $tpl->_ENGINE_parse_body("{compile_rules}");
    $online_help = $tpl->_ENGINE_parse_body("{online_help}");
    $enabled = $tpl->_ENGINE_parse_body("{enabled}");
    $items = $tpl->_ENGINE_parse_body("{items}");
    $error_want_operation = $tpl->javascript_parse_text("{error_want_operation}");
    $events = $tpl->javascript_parse_text("{events}");
    $category = $tpl->javascript_parse_text("{category}");
    $title = $tpl->javascript_parse_text("{video_title}");
    $size = $tpl->javascript_parse_text("{size}");
    $uri = $tpl->javascript_parse_text("{url}");
    $time = $tpl->javascript_parse_text("{time}");
    $hits = $tpl->javascript_parse_text("{hits}");
    $buttons = "\n\tbuttons : [\n\t\n\t{name: '{$online_help}', bclass: 'Help', onpress : ItemHelp{$t}},\n\t\n\t],\t";
    $html = "\n\t\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:99%'></table>\n\t\n<script>\nvar mem{$t}='';\n\$(document).ready(function(){\n\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?items=yes&t={$t}&table={$_GET["table"]}&field={$_GET["field"]}&value={$_GET["value"]}&sitename={$_GET["sitename"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$time}', name : 'zDate', width :120, sortable : true, align: 'left'},\n\t\t{display: '{$uri}', name : 'uri', width :459, sortable : true, align: 'left'},\n\t\t{display: '{$size}', name : 'size', width :107, sortable : true, align: 'left'},\n\t\t{display: '{$hits}', name : 'hits', width :88, sortable : true, align: 'left'},\n\t\t\n\t\n\t],\n\t{$buttons}\n\n\tsearchitems : [\n\t\t{display: '{$uri}', name : 'uri'},\n\t\t\n\t\t\n\n\t],\n\tsortname: 'zDate',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span id=\"title-{$t}\"></span>',\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\t//s_PopUpFull('http://www.mail-appliance.org/index.php?cID=339','1024','900');\n}\n\n\n</script>";
    echo $html;
}
function table()
{
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $sock = new sockets();
    $t = time();
    $members = $tpl->_ENGINE_parse_body("{members}");
    $add_member = $tpl->_ENGINE_parse_body("{add_member}");
    $delete = $tpl->javascript_parse_text("{delete}");
    $aliases = $tpl->javascript_parse_text("{aliases}");
    $about2 = $tpl->_ENGINE_parse_body("{about2}");
    $new_report = $tpl->javascript_parse_text("{new_report}");
    $report = $tpl->javascript_parse_text("{report}");
    $title = $tpl->javascript_parse_text("{current_members}");
    $progress = $tpl->javascript_parse_text("{progress}");
    $size = $tpl->javascript_parse_text("{size}");
    $hits = $tpl->javascript_parse_text("{hits}");
    $computers = $tpl->javascript_parse_text("{computers}");
    $my_proxy_aliases = $tpl->javascript_parse_text("{my_proxy_aliases}");
    $q = new mysql_squid_builder();
    //current_members
    $t = time();
    $buttons = "\n\tbuttons : [\n\t\t{name: '<strong style=font-size:22px>{$my_proxy_aliases}</strong>', bclass: 'link', onpress : GoToProxyAliases{$t}},\n\t\t{name: '<strong style=font-size:22px>{$computers}</strong>', bclass: 'link', onpress : GotoNetworkBrowseComputers{$t}},\n\t],";
    $html = "\n\t<table class='SQUID_CURRENT_MEMBERS' style='display: none' id='SQUID_CURRENT_MEMBERS' style='width:100%'></table>\n\t<script>\n\t\$(document).ready(function(){\n\t\$('#SQUID_CURRENT_MEMBERS').flexigrid({\n\turl: '{$page}?search=yes&ID={$_GET["ID"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '<strong style=font-size:18px>{$members}</strong>', name : 'member', width : 418, sortable : true, align: 'left'},\n\t{display: '<strong style=font-size:18px>{$hits}</strong>', name : 'hits', width : 228, sortable : true, align: 'right'},\n\t{display: '<strong style=font-size:18px>{$size}</strong>', name : 'size', width : 228, sortable : false, align: 'right'},\n\t],\n\t{$buttons}\n\tsearchitems : [\n\t{display: '{$members}', name : 'member'},\n\t\n\t],\n\tsortname: 'size',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span style=font-size:30px>{$title}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: '500',\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\n});\n});\n\n\nfunction NewReport{$t}(){\n\tLoadjs('squid.browse-users.php?callback=Addcategory{$t}');\n}\n\nfunction GoToProxyAliases{$t}(){\n\tGoToProxyAliases();\n}\n\nfunction GotoNetworkBrowseComputers{$t}(){\n\tGotoNetworkBrowseComputers();\n}\n\nvar xAddcategory{$t}=function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);}\n\t\$('#SQUID_MAIN_REPORTS').flexReload();\n\t\$('#SQUID_MAIN_REPORTS_USERZ').flexReload();\n}\n\nfunction Addcategory{$t}(field,value){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ID','{$_GET["ID"]}');\n\tXHR.appendData('field',field);\n\tXHR.appendData('value',value);\n\tXHR.sendAndLoad('{$page}', 'POST',xAddcategory{$t});\n}\n</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
function buildjs()
{
    $t = $_GET["t"];
    $time = time();
    $MEPOST = 0;
    $cachefile = $GLOBALS["PROGRESS_FILE"];
    $logsFile = $GLOBALS["LOG_FILE"];
    header("content-type: application/x-javascript");
    $tpl = new templates();
    $page = CurrentPageName();
    $array = unserialize(@file_get_contents($cachefile));
    $prc = intval($array["POURC"]);
    $title = $tpl->javascript_parse_text($array["TEXT"]);
    $warn = $tpl->javascript_parse_text("{refresh_ctrlf5}");
    if ($prc == 0) {
        echo "\nfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}&filename=" . urlencode($_GET["filename"]) . "');\n}\nsetTimeout(\"Start{$time}()\",1000);";
        return;
    }
    $md5file = md5_file($logsFile);
    if ($md5file != $_GET["md5file"]) {
        echo "\n\tvar xStart{$time}= function (obj) {\n\t\tif(!document.getElementById('text-{$t}')){return;}\n\t\tvar res=obj.responseText;\n\t\tif (res.length>3){\n\t\t\tdocument.getElementById('text-{$t}').value=res;\n\t\t}\t\t\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$md5file}&filename=" . urlencode($_GET["filename"]) . "');\n\t}\t\t\n\t\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('Filllogs', 'yes');\n\t\tXHR.appendData('filename','" . urlencode($_GET["filename"]) . "');\n\t\tXHR.appendData('t', '{$t}');\n\t\tXHR.setLockOff();\n\t\tXHR.sendAndLoad('{$page}', 'POST',xStart{$time},false); \n\t}\n\tsetTimeout(\"Start{$time}()\",1000);";
        return;
    }
    if ($prc > 100) {
        echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\tdocument.getElementById('title-{$t}').style.border='1px solid #C60000';\n\t\tdocument.getElementById('title-{$t}').style.color='#C60000';\n\t\t\$('#progress-{$t}').progressbar({ value: 100 });\n\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
        return;
    }
    if ($prc == 100) {
        echo "\n\tfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\talert('{$warn}');\n\t\tdocument.location.href='logoff.php';\n\t\t}\n\tsetTimeout(\"Start{$time}()\",1000);\n\t";
        return;
    }
    echo "\t\nfunction Start{$time}(){\n\t\tif(!RTMMailOpen()){return;}\n\t\tdocument.getElementById('title-{$t}').innerHTML='{$title}';\n\t\t\$('#progress-{$t}').progressbar({ value: {$prc} });\n\t\tLoadjs('{$page}?build-js=yes&t={$t}&md5file={$_GET["md5file"]}&filename=" . urlencode($_GET["filename"]) . "');\n\t}\n\tsetTimeout(\"Start{$time}()\",1500);\n";
    //Loadjs('$page?build-js=yes&t=$t&md5file={$_GET["md5file"]}');
}
function amavis_popup()
{
    $t = time();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $enable_amavisdeamon_ask = $tpl->javascript_parse_text("{enable_amavisdeamon_ask}");
    $disable_amavisdeamon_ask = $tpl->javascript_parse_text("{disable_amavisdeamon_ask}");
    $EnableAmavisDaemon = intval(trim($sock->GET_INFO("EnableAmavisDaemon", true)));
    $EnableAmavisInMasterCF = intval(trim($sock->GET_INFO("EnableAmavisInMasterCF")));
    if ($EnableAmavisDaemon == 0) {
        $EnableAmavisDaemonP = "{amavis_is_currently_disabled_text}";
    } else {
        $EnableAmavisDaemonP = "{amavis_is_currently_enabled_text}";
    }
    $prepost = Paragraphe("folder-equerre-64.png", '{postfix_hooking}', '{postfix_hooking_text}', "javascript:Loadjs('{$page}?hooking-js=yes')", 'postfix_hooking_text', 210, 100);
    $tr[] = $EnableAmavisDaemonP;
    $tr[] = Paragraphe32("watchdog", "watchdog_amavis_text", "Loadjs('amavis.daemon.watchdog.php')", "watchdog-32.png");
    $tr[] = Paragraphe32("postfix_hooking", "postfix_hooking_text", "Loadjs('amavis.index.php?hooking-js=yes')", "folder-equerre-32.png");
    $tr[] = Paragraphe32("amavis_wizard_rule_per_user", "amavis_wizard_rule_per_user_text", "Loadjs('amavis.wizard.users.php')", "32-wizard.png");
    $tr[] = Paragraphe32("reload_service", "reload_service_text", "AmavisCompileRules()", "service-restart-32.png");
    $EnableAmavisInMasterCFT = "{postfix_afterqueue}";
    $EnableAmavisInMasterCFE = "{postfix_afterqueue_text}";
    //https://192.168.1.213:9000/amavis.daemon.watchdog.php?_=1345459954124
    if ($EnableAmavisInMasterCF == 0) {
        $EnableAmavisInMasterCFT = "{postfix_beforequeue}";
        $EnableAmavisInMasterCFE = "{postfix_beforequeue_text}";
    }
    $html = "<table style='width:100%'>\n\t<tr>\n\t\t<td width=1% valign='top'>\n\t\t\t<div id='status-{$t}'></div>\n\t\t</td>\n\t\t<td valign='top' style='padding-left:20px'>\n\t\t\t<div style='font-size:32px;margin:bottom:10px;text-align:right'>{APP_AMAVIS}</div>\n\t\t\t" . Paragraphe_switch_img("{EnableAmavisDaemon}", "{AMAVIS_DEF}<br>{$EnableAmavisDaemonP}", "EnableAmavisDaemon", $EnableAmavisDaemon, null, 700) . "\n\t\t\t" . Paragraphe_switch_img("{postfix_afterqueue}", "{postfix_afterqueue_text}", "EnableAmavisInMasterCF", $EnableAmavisInMasterCF, null, 700) . "\n\t\t\t<p class=text-info style='font-size:14px'><strong style='font-size:16px'>{currently}:{$EnableAmavisInMasterCFT}</strong><br>{$EnableAmavisInMasterCFE}</p>\n\t\t\t<hr>\n\t\t\t<div style='width:100%;text-align:right'>" . button("{apply}", "SaveEnablePopupAmavis()", 26) . "</div>\n\t\t</td>\n\t</tr>\n\t</table>\n\t<script>\n\t\n\tvar x_EnablePopupAmavis= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);}\t\n\t\tRefreshTab('main_config_amavis');\n\t}\t\n\t\n\t\tfunction EnablePopupAmavis(){\n\t\t\tif(confirm('{$enable_amavisdeamon_ask}')){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tXHR.appendData('enable-amavis','yes');\n\t\t\t\tAnimateDiv('explain-{$t}');\n\t\t\t\tXHR.sendAndLoad('amavis.daemon.status.php', 'POST',x_EnablePopupAmavis);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction SaveEnablePopupAmavis(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('EnableAmavisDaemon',document.getElementById('EnableAmavisDaemon').value);\n\t\t\tXHR.appendData('EnableAmavisInMasterCF',document.getElementById('EnableAmavisInMasterCF').value);\n\t\t\tXHR.sendAndLoad('amavis.daemon.status.php', 'POST',x_EnablePopupAmavis);\n\t\t}\n\t\n\t\n\t\n\t\tLoadAjax('status-{$t}','{$page}?status=yes&t={$t}');\n\t\t\n\t\t\n\t</script>\n\t\n\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
function items()
{
    //1.4.010916
    $t = $_GET["t"];
    $tpl = new templates();
    $MyPage = CurrentPageName();
    $q = new mysql();
    $CommonName = $_GET["CommonName"];
    $data = array();
    $data['page'] = 1;
    $data['total'] = 0;
    $data['rows'] = array();
    $title = $tpl->javascript_parse_text("{privkey}");
    $jsEdit = "Loadjs('certificates.center.srca.php?CommonName={$CommonName}&js=yes');";
    $urljs = "<a href=\"javascript:blur();\" OnClick=\"{$jsEdit}\" style='font-size:22px;text-decoration:underline'>";
    $data['rows'][] = array('id' => "srca", 'cell' => array("<img src='img/certificate-32.png'>", "<span style='font-size:22px;'>{$urljs}{$title}</a></span>", "<span style='font-size:22px;'>PRIVATE KEY</a></span>"));
    $title = $tpl->javascript_parse_text("{RSA_PRIVATE_KEY}");
    $jsEdit = "Loadjs('certificates.center.privkey.php?CommonName={$CommonName}&js=yes');";
    $urljs = "<a href=\"javascript:blur();\" OnClick=\"{$jsEdit}\" style='font-size:22px;text-decoration:underline'>";
    $data['rows'][] = array('id' => "privkey", 'cell' => array("<img src='img/certificate-32.png'>", "<span style='font-size:22px;'>{$urljs}{$title}</a></span>", "<span style='font-size:22px;'>RSA PRIVATE KEY</a></span>"));
    $title = $tpl->javascript_parse_text("{certificate}");
    $jsEdit = "Loadjs('certificates.center.crt.php?CommonName={$CommonName}&js=yes');";
    $urljs = "<a href=\"javascript:blur();\" OnClick=\"{$jsEdit}\" style='font-size:22px;text-decoration:underline'>";
    $data['rows'][] = array('id' => "certificate", 'cell' => array("<img src='img/certificate-32.png'>", "<span style='font-size:22px;'>{$urljs}{$title}</a></span>", "<span style='font-size:22px;'>CERTIFICATE</a></span>"));
    $title = $tpl->javascript_parse_text("{CSR}");
    $jsEdit = "Loadjs('certificates.center.csr.php?CommonName={$CommonName}&js=yes');";
    $urljs = "<a href=\"javascript:blur();\" OnClick=\"{$jsEdit}\" style='font-size:22px;text-decoration:underline'>";
    $data['rows'][] = array('id' => "CSR", 'cell' => array("<img src='img/certificate-32.png'>", "<span style='font-size:22px;'>{$urljs}{$title}</a></span>", "<span style='font-size:22px;'>CERTIFICATE REQUEST</a></span>"));
    $data['total'] = count($data['rows']);
    echo json_encode($data);
}
function popup()
{
    $page = CurrentPageName();
    $users = new usersMenus();
    $tpl = new templates();
    $t = $_GET["t"];
    $members = $tpl->_ENGINE_parse_body("{members}");
    $delete_database_ask = $tpl->_ENGINE_parse_body("{delete_database_ask}");
    $database = $tpl->_ENGINE_parse_body("{database}");
    $member = $tpl->_ENGINE_parse_body("{member}");
    $database_size = $tpl->_ENGINE_parse_body("{database_size}");
    $perfrom_mysqlcheck = $tpl->javascript_parse_text("{perform_mysql_check}");
    $delete_database_ask = $tpl->javascript_parse_text("{delete_database_ask}");
    $new_user = $tpl->javascript_parse_text("{new_member}");
    $new_database = "New database";
    $bt_default_www = "{name: '{$add_default_www}', bclass: 'add', onpress : FreeWebAddDefaultVirtualHost},";
    $bt_webdav = "{name: '{$WebDavPerUser}', bclass: 'add', onpress : FreeWebWebDavPerUsers},";
    //$bt_rebuild="{name: '$rebuild_items', bclass: 'Reconf', onpress : RebuildFreeweb},";
    $bt_config = ",{name: '{$config_file}', bclass: 'Search', onpress : config_file}";
    $read = $tpl->_ENGINE_parse_body("{read}");
    $write = $tpl->_ENGINE_parse_body("{write}");
    $admin = $tpl->_ENGINE_parse_body("{admin}");
    $delete_user = $tpl->javascript_parse_text("{delete_user}");
    if ($_GET["instance-id"] > 0) {
        $q2 = new mysql_multi($_GET["instance-id"]);
        $mmultiTitle = "{$q2->MyServer}&raquo;";
    }
    $title = $tpl->_ENGINE_parse_body("{$mmultiTitle}{browse_mysql_server_text}&raquo;{members}&raquo;{$_GET["databasename"]}");
    $buttons = "\n\tbuttons : [\n\t\t{name: '<b>{$new_user}</b>', bclass: 'add', onpress : Add{$_GET["instance-id"]}SMember },\n\t\n\t\t],";
    $html = "\n\t<table class='mysqlS-member-{$t}' style='display: none' id='mysqlS-member-{$t}' style='width:100%;margin:-10px'></table>\n<script>\nmemedba{$t}='';\n\$(document).ready(function(){\n\$('#mysqlS-member-{$t}').flexigrid({\n\turl: '{$page}?member-list=yes&t={$t}&instance-id={$_GET["instance-id"]}&databasename={$_GET["databasename"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '&nbsp;', name : 'none', width : 31, sortable : false, align: 'center'},\n\t\t{display: '{$members}', name : 'User', width :467, sortable : true, align: 'left'},\n\t\t{display: 'SELECT', name : 'select', width :31, sortable : false, align: 'center'},\n\t\t{display: '&nbsp;', name : 'delete', width :31, sortable : false, align: 'center'},\n\t],\n\t\n\t{$buttons}\n\n\tsearchitems : [\n\t\t{display: '{$member}', name : 'User'},\n\t\t\n\t\t],\n\tsortname: 'User',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '{$title}',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: 627,\n\theight: 350,\n\tsingleSelect: true\n\t\n\t});   \n});\n\n\tvar x_EmptyEvents{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\t\$('#row'+memedb).remove();\n\t}\t\n\nfunction DatabaseDelete{$t}(db,md){\n\tif(confirm('\"'+db+'\"\\n {$delete_database_ask}')){\n\t\tmemedb=md;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('dropdb',db);\n\t\tXHR.appendData('instance-id','{$_GET["instance-id"]}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_EmptyEvents{$t});\n\t\t}\n\t}\n\t\n\tfunction RefreshTableau{$t}(){\n\t\t\$('#mysql-table-{$t}').flexReload();\n\t}\n\t\n\tvar x_Add{$_GET["instance-id"]}Database= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\t\$('#mysqlS-member-{$t}').flexReload();\n\t\t\n\t}\n\n\tvar x_UserDBSelect{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\t\$('#mysql-member-{$t}').flexReload();\n\t\t\n\t}\n\t\n\tvar x_UserDBRemove2{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\t\$('#mysql-member-{$t}').flexReload();\n\t\tif(!document.getElementById('row'+memedba{$t})){\n\t\t\t\$('#mysqlS-member-{$t}').flexReload();\n\t\t}else{\n\t\t\t\$('#row'+memedba{$t}).remove();\n\t\t}\n\t}\t\n\n\t\n\tfunction Add{$_GET["instance-id"]}SMember(){\n\t\tYahooWin('443','system.mysql.php?members-add=yes&instance-id={$_GET["instance-id"]}&t={$t}','{$add_user}');\n\t}\n\t\n\tfunction UserDBSelect(uenc){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('LinkUser','yes');\n\t\tXHR.appendData('instance-id','{$_GET["instance-id"]}');\n\t\tXHR.appendData('databasename','{$_GET["databasename"]}');\n\t\tXHR.appendData('user',uenc);\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_UserDBSelect{$t});\n\t\t\t\n\t}\n\t\n\tfunction UserDBRemove2(uenc,id){\n\t\t if(confirm('{$delete_user} ?')){\n\t\t\tmemedba{$t}=id;\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('Del-user','yes');\n\t\t\tXHR.appendData('instance-id','{$_GET["instance-id"]}');\n\t\t\tXHR.appendData('user',uenc);\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_UserDBRemove2{$t});\t\n\t\t}\n\t}\n\n\n\t\n</script>";
    echo $html;
}
Example #29
0
function page()
{
    $tpl = new templates();
    $sock = new sockets();
    $ID = $_GET["ID"];
    if (!is_numeric($ID)) {
        $ID = 0;
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $users = new usersMenus();
    $TB_HEIGHT = 400;
    $TB_WIDTH = 874;
    $path = base64_decode($_GET["path"]);
    $md5path = md5($path);
    $mailboxes = $tpl->_ENGINE_parse_body("{mailboxes}");
    $domains = $tpl->javascript_parse_text("{domains}");
    $t = time();
    $new_entry = $tpl->_ENGINE_parse_body("{new_rule}");
    $files = $tpl->_ENGINE_parse_body("{files}");
    $deletemailbox_infos = $tpl->javascript_parse_text("{deletemailbox_infos}");
    $help = $tpl->_ENGINE_parse_body("{online_help}");
    $EnableVirtualDomainsInMailBoxes = $sock->GET_INFO("EnableVirtualDomainsInMailBoxes");
    if (!is_numeric($EnableVirtualDomainsInMailBoxes)) {
        $EnableVirtualDomainsInMailBoxes = 0;
    }
    if ($EnableVirtualDomainsInMailBoxes == 1) {
        $swicthdomains = "{name: '{$domains}', bclass: 'Search', onpress : domains{$t}},";
    }
    $title = $tpl->javascript_parse_text("{mailboxes}");
    $buttons = "\n\tbuttons : [\n\t{name: '{$help}', bclass: 'Help', onpress : ItemHelp{$t}},{$swicthdomains}\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-list=yes&t={$t}&domain=',\n\tdataType: 'json',\n\tcolModel : [\t\n\t\t{display: '&nbsp;', name : 'action', width :31, sortable : false, align: 'center'},\n\t\t{display: '{$mailboxes}', name : 'mailbox', width :757, sortable : false, 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: '{$mailboxes}', name : 'files'},\n\t],\n\tsortname: 'files',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '<span id=title-{$t} style=font-size:22px>{$title}</span>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\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=330','1024','900');\n}\n\nvar x_DeleteRealMailBox{$t}= function (obj) {\n\t\$('#flexRT{$t}').flexReload();\t\n}\n\nfunction domains{$t}(){\n\tYahooWin2('550','{$page}?list-domains=yes&t={$t}','{$domains}');\n\n}\n\nfunction DeleteRealMailBox{$t}(mbx,id){\n\tif(confirm('{$deletemailbox_infos}: '+mbx)){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('DeleteRealMailBox',mbx);\n\t\tmem{$t}=id;\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_DeleteRealMailBox{$t});\t\t\t\n\t}\n\t\n}\n\n\n</script>\n";
    echo $html;
}
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;
}