function table() { $t = time(); $page = CurrentPageName(); $tpl = new templates(); $users = new usersMenus(); $sock = new sockets(); $t = time(); $websites = $tpl->_ENGINE_parse_body("{websites}"); $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("{websites}: {not_categorized}"); $progress = $tpl->javascript_parse_text("{progress}"); $size = $tpl->javascript_parse_text("{size}"); $hits = $tpl->javascript_parse_text("{hits}"); $computers = $tpl->javascript_parse_text("{computers}"); $launch = $tpl->javascript_parse_text("{analyze}"); $export = $tpl->javascript_parse_text("{export}"); $q = new mysql_squid_builder(); $NOT_CATEGORIZED_TIME = intval(@file_get_contents("{$GLOBALS["BASEDIR"]}/NOT_CATEGORIZED_TIME")); $lastscan = null; if ($NOT_CATEGORIZED_TIME > 0) { $lastscan = $tpl->javascript_parse_text("{last_scan} " . distanceOfTimeInWords($NOT_CATEGORIZED_TIME, time())); } //current_members $t = time(); $buttons = "\n\tbuttons : [\n\t\t{name: '<strong style=font-size:22px>{$launch}</strong>', bclass: 'link', onpress : Launch{$t}},\n\t\t{name: '<strong style=font-size:22px>{$export}</strong>', bclass: 'link', onpress : export{$t}},\n\t],"; $html = "\n\t<table class='SQUID_NOT_CATEGORIZED_TABLE' style='display: none' id='SQUID_NOT_CATEGORIZED_TABLE' style='width:100%'></table>\n\t<script>\n\t\$(document).ready(function(){\n\t\$('#SQUID_NOT_CATEGORIZED_TABLE').flexigrid({\n\turl: '{$page}?search=yes&ID={$_GET["ID"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '<strong style=font-size:18px>{$websites}</strong>', name : 'familysite', 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: '{$websites}', name : 'familysite'},\n\t\n\t],\n\tsortname: 'size',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span style=font-size:30px>{$title} {$lastscan}</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 Launch{$t}(){\n\tLoadjs('squid.statistics.not-categorized.progress.php');\n}\n\nfunction export{$t}(){\n\tLoadjs('{$page}?export=yes');\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 tabs() { $tpl = new templates(); $array["index"] = '{parameters}'; $array["rules"] = '{rules}'; $array["transparent"] = '{transparent_rules}'; $array["events"] = '{events}'; //$array["plugins"]='{squid_plugins}'; $page = CurrentPageName(); $tpl = new templates(); $q = new mysql(); $style = "style='font-size:22px'"; $t = time(); while (list($num, $ligne) = each($array)) { if ($num == "index") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"ss5.php\" {$style}><span>{$ligne}</span></a></li>\n"); continue; } if ($num == "events") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"ss5.events.php\" {$style}><span>{$ligne}</span></a></li>\n"); continue; } if ($num == "rules") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"ss5.rules.php\" {$style}><span>{$ligne}</span></a></li>\n"); continue; } if ($num == "transparent") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"ss5.transparent.php\" {$style}><span>{$ligne}</span></a></li>\n"); continue; } $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\" {$style}><span>{$ligne}</span></a></li>\n"); } echo build_artica_tabs($html, "ss5_main", 1490); }
function tabs() { $uuid = $_GET["uuid"]; $fontsize = 18; $tpl = new templates(); $page = CurrentPageName(); $array["RTT"] = "{realtime}"; $array["WEEK"] = "{this_week}"; $array["websites"] = "{websites}"; while (list($num, $ligne) = each($array)) { if ($num == "RTT") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.bandwidth.rtt.week.php?uuid={$uuid}&meta=1\" style='font-size:{$fontsize};font-weight:normal'><span>{$ligne}</span></a></li>\n"); continue; } if ($num == "WEEK") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.bandwidth.rttw.week.php?uuid={$uuid}&meta=1\" style='font-size:{$fontsize};font-weight:normal'><span>{$ligne}</span></a></li>\n"); continue; } if ($num == "websites") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.bandwidth.rweb.week.php?uuid={$uuid}&meta=1\" style='font-size:{$fontsize};font-weight:normal'><span>{$ligne}</span></a></li>\n"); continue; } $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\" style='font-size:{$fontsize};font-weight:normal'><span>{$ligne}</span></a></li>\n"); } $html = build_artica_tabs($html, 'main_bandwidth_meta_tabs'); echo $html; }
function rules() { $tpl = new templates(); $page = CurrentPageName(); $q = new mysql_squid_builder(); $action_delete_rule = $tpl->javascript_parse_text("{action_delete_rule}"); $rule_text = $tpl->_ENGINE_parse_body("{rule}"); $sql = "SELECT ID,enabled,groupmode,groupname FROM webfilter_rules ORDER BY groupname"; $results = $q->QUERY_SQL($sql); if (!$q->ok) { echo "<H2>{$q->mysql_error}</H2>"; } $add = imgtootltip("plus-24.png", "{add} {rule}", "DansGuardianEditRule(-1)"); $select = imgtootltip("32-parameters.png", "{edit}", "DansGuardianEditRule('0','default')"); $style = "style='font-size:14px;font-weight:bold;color:black'"; $html = "<center><span id='DansAnimate'></span>\n<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:99%'>\n<thead class='thead'>\n\t<tr>\n\t\t<th width=1%>{$add}</th>\n\t\t<th width=99%>{rules}</th>\n\t\t<th width=1%>{groups}</th>\n\t\t<th width=1%>{blacklists}</th>\n\t\t<th width=1%>{whitelists}</th>\n\t\t<th width=1%> </th>\n\t</tr>\n</thead>\n<tbody class='tbody'>\n\t\t<tr class=oddRow>\n\t\t\t<td width=1%>{$select}</td>\n\t\t\t<td {$style} width=99%>" . texthref("Default", "DansGuardianEditRule('0','default')") . "<div><i style='font-size:10px'>{$ligne["ipaddr"]}</i></div></a></td>\n\t\t\t<td width=1% align='center' {$style}>-</td>\n\t\t\t<td width=1% align='center' {$style}>" . COUNTDEGBLKS(0) . "</td>\n\t\t\t<td width=1% align='center' {$style}>" . COUNTDEGBWLS(0) . "</td>\n\t\t\t<td width=1% > </td>\n\t\t</tr>\n"; $classtr = "oddRow"; while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) { if ($classtr == "oddRow") { $classtr = null; } else { $classtr = "oddRow"; } $select = imgtootltip("32-parameters.png", "{edit}", "DansGuardianEditRule('{$ligne["ID"]}','{$ligne["groupname"]}')"); $delete = imgtootltip("delete-32.png", "{delete}", "DansGuardianDeleteMainRule('{$ligne["ID"]}')"); $color = "black"; if ($ligne["enabled"] == 0) { $color = "#CCCCCC"; } $style = "style='font-size:14px;font-weight:bold;color:{$color}'"; $html = $html . "\n\t\t<tr class={$classtr}>\n\t\t\t<td width=1%>{$select}</td>\n\t\t\t<td {$style} width=99%>" . texthref($ligne["groupname"], "DansGuardianEditRule('{$ligne["ID"]}','{$ligne["groupname"]}')") . "<div><i style='font-size:10px'>{$ligne["ipaddr"]}</i></div></a></td>\n\t\t\t<td width=1% align='center' {$style}>" . COUNTDEGROUPES($ligne["ID"]) . "</td>\n\t\t\t<td width=1% align='center' {$style}>" . COUNTDEGBLKS($ligne["ID"]) . "</td>\n\t\t\t<td width=1% align='center' {$style}>" . COUNTDEGBWLS($ligne["ID"]) . "</td>\n\t\t\t<td width=1% >{$delete}</td>\n\t\t</tr>\n\t\t"; } $html = $html . "</table>\n\t</center>\n\t<script>\n\t\tfunction DansGuardianEditRule(ID,rname){\n\t\t\tYahooWin3('600','dansguardian2.edit.php?ID='+ID,'{$rule_text}::'+ID+'::'+rname);\n\t\t}\n\t\t\n\t\tvar x_DansGuardianDeleteMainRule= function (obj) {\n\t\t\tvar res=obj.responseText;\n\t\t\tif (res.length>3){alert(res);}\n\t\t\tif(document.getElementById('main_dansguardian_tabs')){RefreshTab('main_dansguardian_tabs');}\n\t\t\tGroupsDansRuleSearch();\t\t\n\t\t\t\n\t\t\t\n\t\t}\t\t\n\t\t\n\t\tfunction DansGuardianDeleteMainRule(ID){\n\t\t\tif(confirm('{$action_delete_rule}')){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tAnimateDiv('DansAnimate');\n\t\t \tXHR.appendData('DansGuardianDeleteMainRule', ID);\n\t\t \tXHR.sendAndLoad('{$page}', 'POST',x_DansGuardianDeleteMainRule); \n\t\t\t}\n\t\t}\n\t\n\t\n\t</script>"; echo $tpl->_ENGINE_parse_body($html); }
function tabs() { $fontsize = 18; $tpl = new templates(); $page = CurrentPageName(); $users = new usersMenus(); $sock = new sockets(); $SquidUrgency = intval($sock->GET_INFO("SquidUrgency")); if ($SquidUrgency == 1) { echo FATAL_ERROR_SHOW_128("<div style='font-size:22px'>{proxy_in_emergency_mode}</div>\n\t\t\t<div style='font-size:18px'>{proxy_in_emergency_mode_explain}</div>\n\t\t\t<div style='text-align:right'><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.urgency.php?justbutton=yes');\"\n\t\t\tstyle='text-decoration:underline'>{disable_emergency_mode}</a></div>\t\n\t\t\t"); return; } $array["thishour"] = '{this_hour}'; $array["thishour2"] = '{this_hour} ({compressed})'; while (list($num, $ligne) = each($array)) { if ($num == "thishour") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.accesslogs.php\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n"); continue; } if ($num == "thishour2") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.accesslogs.compressed.php\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n"); continue; } if ($num == "thishour3") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.accesslogs.day.compressed.php\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n"); continue; } $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}={$time}\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n"); } echo build_artica_tabs($html, "main_squid_logs_subtabs"); }
function certificate_edit_csr() { $commonName = $_GET["CommonName"]; $page = CurrentPageName(); $q = new mysql(); $tpl = new templates(); $sql = "SELECT `csr`,`UsePrivKeyCrt` FROM sslcertificates WHERE CommonName='{$commonName}'"; $upload_text = $tpl->_ENGINE_parse_body("{upload_content}"); $t = $_GET["t"]; if (!is_numeric($t)) { $t = time(); } $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); if (!$q->ok) { senderror($q->mysql_error); } $tt = time(); if (strlen($ligne["csr"]) < 50) { $sock = new sockets(); $CommonName = urlencode($CommonName); echo base64_decode($sock->getFrameWork("system.php?BuildCSR={$commonName}")); $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); } $CommonNameURL = urlencode("{$commonName}"); $button_upload = button("{$upload_text}", "Loadjs('certificates.center.upload.php?certificate-upload-js=yes&CommonName={$CommonNameURL}&type=csr&t={$_GET["t"]}&textid=text{$t}&RunAfter=VerifyCertificate{$tt}',true)"); if ($ligne["UsePrivKeyCrt"] == 0) { $button_upload = null; } $csr_ssl_explain = $tpl->_ENGINE_parse_body("{csr_ssl_explain}"); $html = "\n<div class=text-info style='font-size:18px'>{$csr_ssl_explain}</div>\n\t<div id='verify-{$tt}'></div>\n\t\t<center>{$button_upload}</center>\n\t\t<center style='margin:10px'>\n\t\t<textarea id='text{$t}' style='font-family:Courier New;\n\t\tfont-weight:bold;width:100%;height:520px;border:5px solid #8E8E8E;\n\t\toverflow:auto;font-size:16px !important;width:99%;height:390px'>{$ligne["csr"]}</textarea>\n\t\t</center>\n\t</div>\n<script>\n\tfunction VerifyCertificate{$tt}(){\n\tLoadAjax('verify-{$tt}','{$page}?verify-csr=yes&CommonName={$CommonNameURL}',true);\n}\nVerifyCertificate{$tt}();\n</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function table() { $page = CurrentPageName(); $tpl = new templates(); $t = time(); $new_webiste = $tpl->_ENGINE_parse_body("{new_website}"); $email = $tpl->_ENGINE_parse_body("{email}"); $enabled = $tpl->_ENGINE_parse_body("{enabled}"); $delete_this_member_ask = $tpl->javascript_parse_text("{delete_this_member_ask}"); $SSL_BUMP_WL = $tpl->_ENGINE_parse_body("{SSL_BUMP_WL}"); $website_ssl_wl_help = $tpl->javascript_parse_text("{website_ssl_wl_help}"); $parameters = $tpl->javascript_parse_text("{parameters}"); $website_name = $tpl->javascript_parse_text("{websites}"); $apply = $tpl->javascript_parse_text("{apply}"); $decrypted_ssl_websites = $tpl->javascript_parse_text("{decrypted_ssl_websites}"); $squid = new squidbee(); if ($squid->hasProxyTransparent == 1) { $explain = $tpl->_ENGINE_parse_body("<div style='font-weight:bold;color:#BD0000'>{sslbum_wl_not_supported_transp}</div>"); } //$q=new mysql_squid_builder(); //$q->QUERY_SQL("ALTER TABLE `usersisp` ADD UNIQUE (`email`)"); $buttons = "\n\tbuttons : [\n\t{name: '<b>{$new_webiste}</b>', bclass: 'Add', onpress : sslBumbAddwl},\n\t{name: '<b>{$apply}</b>', bclass: 'Apply', onpress : Apply{$t}}\n\t],"; $html = "\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:100%'></table>\n\n\n\t<script>\n\trow_id='';\n\t\$(document).ready(function(){\n\t\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?whitelist-list=yes&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$website_name}', name : 'website_name', width : 606, sortable : false, align: 'left'},\n\t{display: '{$enabled}', name : 'enabled', width : 68, sortable : true, align: 'center'},\n\t{display: ' ', name : 'delete', width : 68, sortable : false, align: 'center'},\n\t],\n\t{$buttons}\n\tsearchitems : [\n\t{display: '{$website_name}', name : 'website_name'},\n\t],\n\tsortname: 'website_name',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<strong style=font-size:18px>{$decrypted_ssl_websites}</strong>',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: '95%',\n\theight: 310,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\n});\n});\n\nvar x_sslBumbAddwl{$t}=function(obj){\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\t\$('#flexRT{$t}').flexReload();\n}\n\nfunction sslBumbAddwlCheck(e){\n\tif(checkEnter(e)){sslBumbAddwl();}\n}\n\nfunction sslBumbAddwl(){\nvar www=prompt('{$website_ssl_wl_help}');\nif(www){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('website_ssl_wl',www);\n\tXHR.sendAndLoad('{$page}', 'GET',x_sslBumbAddwl{$t});\n\t}\n}\n\nvar x_sslbumpEnableW=function(obj){\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\tif(row_id.length>0){ \$('#row'+row_id).remove();}\n}\n\nfunction sslbumpEnableW(idname){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById(idname).checked){XHR.appendData('enable',1);}else{XHR.appendData('enable',0);}\n\tXHR.appendData('website_ssl_eble',idname);\n\tXHR.sendAndLoad('{$page}', 'GET',x_sslbumpEnableW);\n}\n\nfunction Apply{$t}(){\n\tLoadjs('squid.compile.progress.php');\n}\n\nfunction sslbumpAllowSquidSSLDropBox(){\nvar XHR = new XHRConnection();\nif(document.getElementById('AllowSquidSSLDropBox').checked){XHR.appendData('AllowSquidSSLDropBox',1);}else{XHR.appendData('AllowSquidSSLDropBox',0);}\nXHR.sendAndLoad('{$page}', 'POST',x_sslBumbAddwl{$t});\n\n}\n\nfunction sslbumpAllowSquidSSLSkype(){\nvar XHR = new XHRConnection();\nif(document.getElementById('AllowSquidSSLSkype').checked){XHR.appendData('AllowSquidSSLSkype',1);}else{XHR.appendData('AllowSquidSSLSkype',0);}\nXHR.sendAndLoad('{$page}', 'POST',x_sslBumbAddwl{$t});\n}\n\nfunction sslBumSettings(){\nYahooWin3('550','{$page}?add-params=yes','{$parameters}');\n}\n\n\nfunction sslbumpDeleteW(ID,rowid){\nrow_id=rowid;\nvar XHR = new XHRConnection();\nXHR.appendData('website_ssl_del',ID);\nXHR.sendAndLoad('{$page}', 'GET',x_sslBumbAddwl{$t});\n}\n\n\n</script>\n\n"; echo $html; }
function popup() { $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}"); $progress = $tpl->javascript_parse_text("{progress}"); $size = $tpl->javascript_parse_text("{size}"); $hits = $tpl->javascript_parse_text("{hits}"); $computers = $tpl->javascript_parse_text("{computers}"); $uid = $tpl->javascript_parse_text("{uid}"); $q = new mysql_squid_builder(); $mac = $tpl->javascript_parse_text("{MAC}"); $ipaddr = $tpl->javascript_parse_text("{ipaddr}"); $websites = $tpl->javascript_parse_text("{websites}"); $categories = $tpl->javascript_parse_text("{categories}"); $TIMES_SLOT["day"] = "{this_day}"; $TIMES_SLOT["hour"] = "{this_hour}"; $TIMES_SLOT["week"] = "{this_week}"; $TIMES_SLOT["month"] = "{this_month}"; $title = $tpl->javascript_parse_text("{$TIMES_SLOT[$_GET["timeslot"]]}"); $t = time(); $buttons = "\n\tbuttons : [\n\t{name: '<strong style=font-size:16px>{$uid}</strong>', bclass: 'link', onpress : GoToUID{$t}},\n\t{name: '<strong style=font-size:16px>{$mac}</strong>', bclass: 'link', onpress : GotoMAC{$t}},\n\t{name: '<strong style=font-size:16px>{$ipaddr}</strong>', bclass: 'link', onpress : GotoIPADDR{$t}},\n\t{name: '<strong style=font-size:16px>{$websites}</strong>', bclass: 'link', onpress : GotoWEBS{$t}},\n\t{name: '<strong style=font-size:16px>{$categories}</strong>', bclass: 'link', onpress : GotoCATS{$t}},\n\t],"; $html = "\n\t<table class='RTT{$t}' style='display: none' id='RTT{$t}' style='width:100%'></table>\n\t<script>\n\$(document).ready(function(){\n\t\$('#RTT{$t}').flexigrid({\n\turl: '{$page}?search=yes×lot={$_GET["timeslot"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '<strong style=font-size:18px>{$members}</strong>', name : 'USER', width : 418, sortable : true, align: 'left'},\n\t{display: '<strong style=font-size:18px>{$size}</strong>', name : 'SIZE', width : 228, sortable : true, align: 'right'},\n\t],\n\t{$buttons}\n\tsearchitems : [\n\t{display: '{$members}', name : 'USER'},\n\t\n\t],\n\tsortname: 'SIZE',\n\tsortorder: 'desc',\n\tusepager: true,\n\ttitle: '<span style=font-size:26px>" . $tpl->javascript_parse_text("{$TIMES_SLOT[$_GET["timeslot"]]}") . "</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\t\n\t});\n});\n\nfunction GoToUID{$t}(){\n\$('#RTT{$t}').flexOptions({url: '{$page}?search=yes×lot={$_GET["timeslot"]}'}).flexReload();\n\n}\nfunction GotoMAC{$t}(){\n\$('#RTT{$t}').flexOptions({url: '{$page}?search=yes×lot={$_GET["timeslot"]}&SUBDIR=MAC'}).flexReload();\n}\nfunction GotoIPADDR{$t}(){\n\$('#RTT{$t}').flexOptions({url: '{$page}?search=yes×lot={$_GET["timeslot"]}&SUBDIR=IPADDR'}).flexReload();\n}\nfunction GotoWEBS{$t}(){\n\$('#RTT{$t}').flexOptions({url: '{$page}?search=yes×lot={$_GET["timeslot"]}&SUBDIR=WEBS'}).flexReload();\n}\nfunction GotoCATS{$t}(){\n\$('#RTT{$t}').flexOptions({url: '{$page}?search=yes×lot={$_GET["timeslot"]}&SUBDIR=CATS'}).flexReload();\n}\n\n</script>\n"; echo $html; }
function tabs() { $tpl = new templates(); $stats_appliance = new stats_appliance(); $array["popup"] = '{active_requests}'; $time = time(); $style = "style='font-size:22px'"; $page = CurrentPageName(); $t = time(); while (list($num, $ligne) = each($array)) { if ($num == "categories") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.active.requests.categories.php\"><span {$style}>{$ligne}</span></a></li>\n"); continue; } if ($num == "categories-day") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.active.requests.categories.day.php\"><span {$style}>{$ligne}</span></a></li>\n"); continue; } if ($num == "popup-members") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.active.requests.members.php\"><span {$style}>{$ligne}</span></a></li>\n"); continue; } if ($num == "popup-members-day") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.active.requests.members.day.php\"><span {$style}>{$ligne}</span></a></li>\n"); continue; } $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes&t={$time}\"><span {$style}>{$ligne}</span></a></li>\n"); } echo build_artica_tabs($html, "squid_active_requests_relatime"); }
function tabs() { $tpl = new templates(); $array["popup-index"] = '{index}'; $array["smtp_connection_cache_destinations"] = '{smtp_connection_cache_destinations}'; $array["address_verify_map"] = '{address_verify_map}'; $array["title_postfix_tuning"] = '{title_postfix_tuning}'; if ($_GET["hostname"] == null) { $_GET["hostname"] = "master"; } $page = CurrentPageName(); $t = time(); while (list($num, $ligne) = each($array)) { if ($num == "smtp_connection_cache_destinations") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"postfix.performances.cache.php?with-tabs=yes&hostname={$_GET["hostname"]}\"><span style='font-size:13px'>{$ligne}</span></a></li>\n"); continue; } if ($num == "address_verify_map") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"postfix.performances.verify.map.php?with-tabs=yes&hostname={$_GET["hostname"]}\"><span style='font-size:13px'>{$ligne}</span></a></li>\n"); continue; } if ($num == "title_postfix_tuning") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"postfix.performances.tuning.php?with-tabs=yes&hostname={$_GET["hostname"]}\"><span style='font-size:13px'>{$ligne}</span></a></li>\n"); continue; } $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes&hostname={$_GET["hostname"]}\"><span style='font-size:13px'>{$ligne}</span></a></li>\n"); } echo "{$menus}\n\t<div id=main_post_perfs_tabs style='width:100%;height:650px;overflow:auto'>\n\t\t<ul>" . implode("\n", $html) . "</ul>\n\t</div>\n\t\t<script>\n\t\t\t\t\$(document).ready(function(){\n\t\t\t\t\t\$('#main_post_perfs_tabs').tabs();\n\t\t\t\n\t\t\t\n\t\t\t});\n\t\t</script>"; }
function page() { $t = time(); $page = CurrentPageName(); $tpl = new templates(); $users = new usersMenus(); $sock = new sockets(); $t = time(); $websites = $tpl->_ENGINE_parse_body("{websites}"); $add_website = $tpl->_ENGINE_parse_body("{add_website}"); $select = $tpl->javascript_parse_text("{select}"); $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("{statistics}:: {websites}"); $progress = $tpl->javascript_parse_text("{progress}"); $run = $tpl->javascript_parse_text("{run}"); $size = $tpl->javascript_parse_text("{size}"); $hits = $tpl->javascript_parse_text("{hits}"); $q = new mysql_squid_builder(); $build = $tpl->javascript_parse_text("{rebuild_items}"); $buttons = "\n\tbuttons : [\n\t{name: '<strong style=font-size:16px >{$build}</strong>', bclass: 'Reconf', onpress : BuildCache{$t}},\n\t],"; $html = "\n\t<table class='SQUID_FAMZ' style='display: none' id='SQUID_FAMZ' style='width:100%'></table>\n\t<script>\n\t\$(document).ready(function(){\n\t\$('#SQUID_FAMZ').flexigrid({\n\turl: '{$page}?search=yes&callback={$_GET["callback"]}',\n\tdataType: 'json',\n\t\tcolModel : [\n\t\t{display: '{$websites}', name : 'familysite', width : 390, sortable : true, align: 'left'},\n\t\t{display: '{$size}', name : 'size', width : 124, sortable : true, align: 'right'},\n\t\t{display: '{$hits}', name : 'hits', width : 124, sortable : true, align: 'right'},\n\t\t{display: '{$select};', name : 'explain', width : 70, sortable : false, align: 'center'},\n\t\t],\n\t\t{$buttons}\n\tsearchitems : [\n\t{display: '{$websites}', name : 'familysite'},\n\t\n\t],\n\tsortname: 'size',\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: '350',\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\t\n\t});\n\t});\n\t\n\t\nfunction NewReport{$t}(){\n\tLoadjs('squid.browse-familysites.php?callback=Addcategory{$t}');\n}\n\nfunction BuildCache{$t}(){\n\tLoadjs('squid.browse-familysites.progress.php');\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_FAMZ').flexReload();\n}\n\t\nfunction Addcategory{$t}(categorykey){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('ID','{$_GET["ID"]}');\n\tXHR.appendData('categorykey',categorykey);\n\tXHR.sendAndLoad('{$page}', 'POST',xAddcategory{$t});\n}\n</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function popup() { $page = CurrentPageName(); $tpl = new templates(); $folders = $tpl->_ENGINE_parse_body("{folders}"); $enabled = $tpl->_ENGINE_parse_body("{enabled}"); $proto = $tpl->_ENGINE_parse_body("{proto}"); $uri = $tpl->_ENGINE_parse_body("{url}"); $member = $tpl->_ENGINE_parse_body("{member}"); $user = $tpl->_ENGINE_parse_body("{user}"); $title = $tpl->_ENGINE_parse_body("{today}: {realtime_requests} " . date("H") . "h"); $new_rule = $tpl->_ENGINE_parse_body("{new_rule}"); $delete_rule = $tpl->javascript_parse_text("{delete_rule}"); $refresh = $tpl->_ENGINE_parse_body("{refresh}"); $t = time(); $fetch = new Fetchmail_settings(); $rule = $fetch->LoadRule($_GET["ruldeid"]); $port = 143; $tls = "notls"; if ($rule["ssl"] == 1) { $port = 993; $tls = "ssl/novalidate-cert"; } $title = "{$rule["poll"]}:{$port}/{$tls}"; $import = $tpl->_ENGINE_parse_body("{import}"); $buttons = "\n\tbuttons : [\n\t{name: '{$new_rule}', bclass: 'Add', onpress : add_fetchmail_rules{$t}},\n\t{name: '{$import}', bclass: 'Copy', onpress : ImportBulk{$t}},\n\t{name: '{$refresh}', bclass: 'Reload', onpress : Reload{$t}},\n\t\t],\t"; $buttons = null; $html = "\n\t<div>\n\t<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:100%'></table>\n\t</div>\n\t\n<script>\nvar fetchid=0;\n\$(document).ready(function(){\n\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?browse-imap=yes&ruldeid={$_GET["ruldeid"]}&uid={$_GET["uid"]}&t={$t}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$folders}', name : 'uid', width :542, sortable : false, align: 'left'},\n\t\t{display: '{$enabled}', name : 'enabled', width :31, sortable : false, align: 'left'},\n\t\t],{$buttons}\n\t\n\tsearchitems : [\n\t\t{display: '{$folders}', name : 'folders'},\n\t\t],\n\tsortname: 'uid',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '{$title}',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: 620,\n\theight: 408,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\t\n\t}); \n});\n\n \n\n \n function Reload{$t}(){\n \t\$('#flexRT{$t}').flexReload();\n }\n \n\tvar x_EnableImapf= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);return;}\n\t} \n \n function EnableImapf(md,folderbased){\n \t var XHR = new XHRConnection();\n \t if(document.getElementById('ck_'+md).checked){XHR.appendData('enabled',1);}else{XHR.appendData('enabled',0);}\n \t XHR.appendData('ruldeid','{$_GET["ruldeid"]}');\n \t XHR.appendData('uid','{$_GET["uid"]}');\n \t XHR.appendData('folderenc',folderbased);\n \t XHR.appendData('md5',md);\n \t XHR.setLockOff();\n \t XHR.sendAndLoad('{$page}', 'POST',x_EnableImapf); \n }\n\n</script>"; echo $html; return; }
function PageAveserverLicence() { $yum = new usersMenus(); $tpl = new templates(); $tpl = new templates(); if ($yum->AsPostfixAdministrator == false) { return $tpl->_ENGINE_parse_body("<h3>{not allowed}</H3>"); } $sock = new sockets(); $file = $sock->getfile("aveserver_licence"); $file = htmlentities($file); $table = explode("\n", $file); $html = "<table style='width:100%'>"; while (list($num, $val) = each($table)) { if (preg_match('#(.+)\\:(.+)#', $val, $regs)) { if ($val != null) { $html = $html . "<tr><td nowrap align='right'><strong>{$regs[1]}: </strong><td style='border-bottom:1px solid #CCCCCC'>{$regs[2]}</td></tr>"; } } if (preg_match('#Key file\\s+(.+?)\\.key#', $val, $regs)) { $html = $html . "<tr><td nowrap align='right' colspan=2><input type='button' value='{delete} {$regs[1]}' OnClick=\"javascript:TreeAveServerLicenceDeleteKey('{$regs[1]}.key');\"></td></tr>"; } if (preg_match("#Serial#i", $val)) { $html = $html . "<tr><td colspan=2 style='border-bottom:2px solid #CCCCCC'> </td></tr>"; } } $html = "<h4>{licence status}</h4>{$html}</table>"; return $tpl->_ENGINE_parse_body("{$html}"); }
function popup() { $q = new mysql(); $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $hostname = $_GET["hostname"]; // $array["backup-status"] = "{backupemail_behavior}"; $array["backup-options"] = '{options}'; $array["backup-storage"] = '{storage}'; $fontsize = "font-size:18px;"; while (list($num, $ligne) = each($array)) { if ($num == "backup-options") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"postfix.archiver.php?hostname={$hostname}\" style='{$fontsize}'><span>{$ligne}</span></a></li>\n"); continue; } if ($num == "backup-status") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"postfix.archiver.php?hostname={$hostname}&status=yes\" style='{$fontsize}'><span>{$ligne}</span></a></li>\n"); continue; } if ($num == "backup-storage") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"postfix.archiver.database.php?hostname={$hostname}&status=yes\" style='{$fontsize}'><span>{$ligne}</span></a></li>\n"); continue; } $html[] = "<li><a href=\"{$page}?{$num}=yes\" style='{$fontsize}' ><span>{$ligne}</span></a></li>\n"; } $html = build_artica_tabs($html, 'main_backup_fly', 975) . "\n\t\t<script>LeftDesign('folder-256-backup-white-opac20.png');</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: ' ', 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(); $users = new usersMenus(); $tpl = new templates(); $t = time(); $privileges = $tpl->_ENGINE_parse_body("{privileges}"); $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}"); $delete_user = $tpl->javascript_parse_text("{delete_user}"); $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}"); $apply_privileges = $tpl->_ENGINE_parse_body("{apply_privileges}"); if ($_GET["instance-id"] > 0) { $q2 = new mysql_multi($_GET["instance-id"]); $mmultiTitle = "{$q2->MyServer}»"; } $title = $tpl->_ENGINE_parse_body("{$mmultiTitle}{browse_mysql_server_text}"); $buttons = "\n\tbuttons : [\n\t\t{name: '<b>{$new_user}</b>', bclass: 'add', onpress : Add{$_GET["instance-id"]}Member },\n\t\t{name: '<b>{$apply_privileges}</b>', bclass: 'Reload', onpress : ApplyPrivs{$t} },\n\t\n\t\t],"; $html = "\n\t<table class='mysql-member-{$t}' style='display: none' id='mysql-member-{$t}' style='width:100%;margin:-10px'></table>\n<script>\nmemedb{$t}='';\n\$(document).ready(function(){\n\$('#mysql-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: ' ', name : 'none', width : 31, sortable : false, align: 'center'},\n\t\t{display: '{$member}', name : 'User', width :344, sortable : true, align: 'left'},\n\t\t{display: '{$read}', name : 'read', width :43, sortable : true, align: 'center'},\n\t\t{display: '{$write}', name : 'write', width :43, sortable : true, align: 'center'},\n\t\t{display: '{$admin}', name : 'admin', width :43, sortable : true, align: 'center'},\n\t\t{display: ' ', 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: '{$_GET["databasename"]} {$privileges}',\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\n\tfunction Add{$_GET["instance-id"]}Member(){\n\t\tLoadjs('mysql.browse.members.php?instance-id={$_GET["instance-id"]}&t={$t}&databasename={$_GET["databasename"]}');\n\t}\n\t\n\tvar x_UpdateDPriv= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\t\n\t}\n\n\tvar x_DeletePrivs= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\tif(!document.getElementById('row'+memedb{$t})){alert('row'+memedb{$t} +' no such id');\$('#mysql-member-{$t}').flexReload();}\n\t\t\$('#row'+memedb{$t}).remove();\n\t}\t\n\t\n\tfunction DeletePrivs(uid,md){\n\t\tmemedb{$t}=md;\n\t\tif(confirm('{$delete_user} ?')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('user-del','yes');\n\t\t\tXHR.appendData('databasename','{$_GET["databasename"]}');\n\t\t\tXHR.appendData('instance-id','{$_GET["instance-id"]}');\n\t\t\tXHR.appendData('user',uid);\t\t\t\t\t\t\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_DeletePrivs);\t\t\t\n\t\t\n\t\t}\n\t\n\t}\n\t\n\tvar x_ApplyPrivs{$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\tfunction ApplyPrivs{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('flush-privs','yes');\n\t\tXHR.appendData('instance-id','{$_GET["instance-id"]}');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_ApplyPrivs{$t});\t\t\n\t\t\n\t}\n\t\n\tfunction UpdateDPriv(id,userenc,type){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tif(document.getElementById(id).checked){XHR.appendData('enable',1);}else{XHR.appendData('enable',0);}\n\t\t\tXHR.appendData('user-privs',type);\n\t\t\tXHR.appendData('databasename','{$_GET["databasename"]}');\n\t\t\tXHR.appendData('instance-id','{$_GET["instance-id"]}');\n\t\t\tXHR.appendData('user',userenc);\n\t\t\tXHR.appendData('type',type);\t\t\t\t\t\t\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_UpdateDPriv);\t\t\n\t\t\n\t}\n\n</script>"; echo $html; }
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); }
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}"); $html = "\n\t\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}?groups-list=yes&t={$t}&field-user={$_GET["field-user"]}&NOComputers={$_GET["NOComputers"]}&prepend={$_GET["prepend"]}&prepend-guid={$_GET["prepend-guid"]}&OnlyUsers={$_GET["OnlyUsers"]}&organization={$_GET["organization"]}&OnlyGroups={$_GET["OnlyGroups"]}&OnlyGUID={$_GET["OnlyGUID"]}&callback={$_GET["callback"]}&Zarafa={$_GET["Zarafa"]}&OnlyAD={$_GET["OnlyAD"]}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: ' ', name : 'select', width : 42, sortable : false, align: 'center'},\n\t\t{display: '{$GroupName}', name : 'groupname', width : 372, sortable : true, align: 'left'},\n\t\t{display: '{$Members}', name : 'none', width : 60, sortable : false, align: 'center'},\n\t\t\n\t\t\n\t],\n\n\tsearchitems : [\n\t\t{display: '{$GroupName}', name : 'groupname'},\n\t\t],\n\tsortname: 'groupname',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '',\n\tuseRp: true,\n\trp: 15,\n\tshowTableToggleBtn: false,\n\twidth: 530,\n\theight: 250,\n\tsingleSelect: true\n\t\n\t}); \n});\n\tfunction BrowseFindUserGroupClick(e){\n\t\tif(checkEnter(e)){BrowseFindUserGroup();}\n\t}\n\t\n\tvar x_BrowseFindUserGroup=function (obj) {\n\t\ttempvalue=obj.responseText;\n\t\tdocument.getElementById('finduserandgroupsidBrwse').innerHTML=tempvalue;\n\t}\n\n\n\tfunction BrowseFindUserGroup(){\n\t\tLoadAjax('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\t\n\t}\t\n\t\n\t\n\tfunction BrowseSelect{$t}(id,prependText,guid){\n\t\t\t{$callback}\n\t\t\tvar prepend={$_GET["prepend"]};\n\t\t\tvar prepend_gid={$_GET["prepend-guid"]};\n\t\t\tvar OnlyGUID={$OnlyGUID};\n\t\t\tif(document.getElementById('{$_GET["field-user"]}')){\n\t\t\t\tvar selected=id;\n\t\t\t\tif(OnlyGUID==1){\n\t\t\t\t\tdocument.getElementById('{$_GET["field-user"]}').value=guid;\n\t\t\t\t\tWinORGHide();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(prepend==1){selected=prependText+id;}\n\t\t\t\tif(prepend_gid==1){\n\t\t\t\t\tif(guid>1){\n\t\t\t\t\t\tselected=prependText+id+':'+guid;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdocument.getElementById('{$_GET["field-user"]}').value=selected;\n\t\t\t\tWinORGHide();\n\t\t\t}\n\t\t}\n\n\n\t\n</script>\t\n\t\n\t"; echo $html; }
function wizard_certificate_1() { $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $hostname = $sock->GET_INFO("myhostname"); $t = time(); $ENC[1024] = 1024; $ENC[2048] = 2048; $ENC[4096] = 4096; if ($hostname == null) { $hostname = $sock->getFrameWork("system.php?hostname-g=yes"); $sock->SET_INFO($hostname, "myhostname"); } $title = $tpl->_ENGINE_parse_body("{new_certificate}"); $html[] = "<div class=text-info style='font-size:18px'>{wizard_certificate_1}<br><i>{CSR_MULTIPLE_EXPLAIN}</i></div>"; $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = Field_text_table("wizard-certificate-commonname", "{CommonName}", $hostname, 22, null, 400); $html[] = Field_list_table("wizard-certificate-levelenc", "{level_encryption}", 2048, 22, $ENC); $html[] = Field_password_table("wizard-certificate-password", "{password}", "secret", 22, null, 300); $html[] = Field_button_table_autonome("{add}", "Submit{$t}", 30); $html[] = "</table>"; $html[] = "</div>\n<script>\nvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\t\$('#flexRT{$_GET["t"]}').flexReload();\n\tYahooWin6Hide();\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('wizard-certificate-commonname',encodeURIComponent(document.getElementById('wizard-certificate-commonname').value));\n\tXHR.appendData('wizard-certificate-levelenc',document.getElementById('wizard-certificate-levelenc').value);\n\tXHR.appendData('wizard-certificate-password',encodeURIComponent(document.getElementById('wizard-certificate-password').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n}\n</script>\n\t\t\n\t"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function main_rules_exceptionsitelist_list($rule_main, $noecho = 0) { $dans = new dansguardian_rules($_GET["hostname"], $rule_main); $sql = "SELECT * FROM dansguardian_files WHERE filename='exceptionsitelist' AND RuleID={$rule_main} ORDER BY ID DESC"; $q = new mysql(); $results = $q->QUERY_SQL($sql, "artica_backup"); $style = CellRollOver(); $categ = "\n\t<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n\t<thead class='thead'>\n\t\t<tr>\n\t\t<th width=99% colspan=2> </th>\n\t\t</tr>\n\t</thead>\n\t<tbody class='tbody'>"; while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { if ($classtr == "oddRow") { $classtr = null; } else { $classtr = "oddRow"; } $num = $ligne["ID"]; $pattern = $ligne["pattern"]; $categ = $categ . "<tr class={$classtr}>\n\t\t<td width=99%><strong style='font-size:16px'>{$pattern}</strong></td>\n\t\t<td width=1%>" . imgtootltip('delete-32.png', '{delete}', "exceptionsitelist_del('{$hostname}','{$rule_main}','{$num}')") . "</td>\n\t\t</tr>\n\t\t"; } $categ = $categ . "</table>"; $tpl = new templates(); if ($noecho == 1) { return $tpl->_ENGINE_parse_body("{$categ}"); } echo $tpl->_ENGINE_parse_body("{$categ}"); $tpl = new templates(); }
function PostFixVerifyDatabaseSave() { $main = new main_cf(); $tpl = new templates(); $OldValue = $main->main_array["address_verify_map"]; $OldValue = str_replace('btree:', '', $OldValue); $newvalue = $_GET["address_verify_map"]; if ($newvalue != null) { if ($OldValue == $newvalue) { PostFixVerifyDatabaseSaveParseOthers(); echo $tpl->_ENGINE_parse_body('{success}'); return null; } if ($OldValue != $newvalue) { if ($OldValue != null) { $socks = new sockets(); $socks->getfile('DeleteTheMainFilePostfixSettings:' . $OldValue); } $main->main_array["address_verify_map"] = "btree:{$newvalue}"; $main->save_conf(); } } else { if ($OldValue != null) { $main->main_array["address_verify_map"] = ""; $main->save_conf(); $socks = new sockets(); $socks->getfile('DeleteTheMainFilePostfixSettings:' . $OldValue); } } PostFixVerifyDatabaseSaveParseOthers(); echo $tpl->_ENGINE_parse_body('{success}'); }
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 etch() { $interface = $_GET["etch"]; $cmdr[] = "ressources/logs/vnstat-{$interface}-resume.png"; $cmdr[] = "ressources/logs/vnstat-{$interface}-hourly.png"; $cmdr[] = "ressources/logs/vnstat-{$interface}-daily.png"; $cmdr[] = "ressources/logs/vnstat-{$interface}-monthly.png"; $cmdr[] = "ressources/logs/vnstat-{$interface}-top.png"; $imgs = array(); $tpl = new templates(); $page = CurrentPageName(); $error = "<center style='font-size:18px;color:red;margin:5px;font-weight:bolder'>{NO_DATA_COME_BACK_LATER}</center><center><img src='img/report-warning-256.png'></center>"; while (list($num, $filename) = each($cmdr)) { if (!is_file($filename)) { continue; } $t = time(); $imgs[] = "<center style='margin:10px'><img src='{$filename}?{$t}'></center>"; } if (count($imgs) == 0) { echo $tpl->_ENGINE_parse_body("{$error}"); return; } echo $tpl->_ENGINE_parse_body(@implode("\n", $imgs)); }
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}»"; } $title = $tpl->_ENGINE_parse_body("{$mmultiTitle}{browse_mysql_server_text}»{members}»{$_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: ' ', 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: ' ', 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; }
function popup() { $users = new usersMenus(); $users->LoadModulesEnabled(); $page = CurrentPageName(); $tpl = new templates(); $kas_enabled = 0; $amavis_enabled = 0; $kas = new kas_mysql("default"); if ($kas->GET_KEY("ACTION_SPAM_MODE") == 2) { $ACTION_SPAM_MODE = 1; } if ($kas->GET_KEY("ACTION_PROBABLE_MODE") == 2) { $ACTION_PROBABLE_MODE = 1; } if ($kas->GET_KEY("ACTION_FORMAL_MODE") == 2) { $ACTION_FORMAL_MODE = 1; } $amavis = new amavis(); $sa_tag3_level_defltl = $tpl->_ENGINE_parse_body('{sa_tag3_level_deflt}'); if ($users->kas_installed) { if ($users->KasxFilterEnabled == 1) { $kas_enabled = 1; } } if ($users->AMAVIS_INSTALLED) { if ($users->EnableAmavisDaemon == 1) { $amavis_enabled = 1; } } $html = "\n\t<div id='kas3feature'>\n\t\t<table style='width:100%' class=form>\n\t\t<tr>\n\t\t\t<td colspan=2><strong style='font-size:16px'>{APP_KAS3}</strong></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{spam option 1}</td>\n\t\t\t<td>" . Field_checkbox("ACTION_SPAM_MODE", 1, $ACTION_SPAM_MODE) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{spam option 2}</td>\n\t\t\t<td>" . Field_checkbox("ACTION_PROBABLE_MODE", 1, $ACTION_PROBABLE_MODE) . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend>{spam option 4}</td>\n\t\t\t<td>" . Field_checkbox("ACTION_FORMAL_MODE", 1, $ACTION_FORMAL_MODE) . "</td>\n\t\t</tr>\t\n\t\t</table>\n\t</div>\n\t\n\t<div id='amavisfeature'>\n\t\t<table style='width:100%' class=form>\n\t\t\t<tr>\n\t\t\t\t<td colspan=2><strong style='font-size:16px'>{APP_AMAVIS}/{APP_SPAMASSASSIN}</strong></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{spam option 1} <b>({score} {$amavis->main_array["BEHAVIORS"]["sa_tag3_level_deflt"]})</b></td>\n\t\t\t\t<td>" . Field_checkbox("EnableQuarantineSpammy2", 1, $amavis->EnableQuarantineSpammy2) . "</td>\n\t\t\t</tr>\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{spam option 2} <b>({score} {$amavis->main_array["BEHAVIORS"]["sa_tag2_level_deflt"]})</b></td>\n\t\t\t\t<td>" . Field_checkbox("EnableQuarantineSpammy", 1, $amavis->EnableQuarantineSpammy) . "</td>\n\t\t\t</tr>\n\t\n\t\t\t</table>\n\t</div>\n\t\n\t\n\t<div style='text-align:right;width:100%'><hr>" . button("{apply}", "SaveQuarPolicies()") . "</div>\n\t\n\t<script>\n\t\tfunction DisableQuarPolicies(){\n\t\t\tvar kas_enabled={$kas_enabled};\n\t\t\tvar amavis_enabled={$amavis_enabled};\n\t\t\tif(kas_enabled!==1){\n\t\t\t\tdocument.getElementById('ACTION_SPAM_MODE').disabled=true;\n\t\t\t\tdocument.getElementById('ACTION_PROBABLE_MODE').disabled=true;\n\t\t\t\tdocument.getElementById('ACTION_FORMAL_MODE').disabled=true;\n\t\t\t}\n\t\t\t\n\t\t\tif(amavis_enabled!==1){\n\t\t\t\tdocument.getElementById('EnableQuarantineSpammy2').disabled=true;\n\t\t\t\tdocument.getElementById('EnableQuarantineSpammy').disabled=true;\n\t\t\t}\t\t\t\n\t\t\n\t\t}\n\t\t\nvar x_SaveQuarPolicies= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\tYahooWin3Hide();\n}\t\t\n\t\n\t\n\t\tfunction SaveQuarPolicies(){\n\t\t\tvar kas_enabled={$kas_enabled};\n\t\t\tvar amavis_enabled={$amavis_enabled};\t\t\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('SAVE_QUAR',1);\n\t\t\tif(kas_enabled==1){\n\t\t\t\tXHR.appendData('SAVE_KAS',1);\n\t\t\t\tif(document.getElementById('ACTION_SPAM_MODE').checked){XHR.appendData('ACTION_SPAM_MODE',1);}else{XHR.appendData('ACTION_SPAM_MODE',0);}\n\t\t\t\tif(document.getElementById('ACTION_PROBABLE_MODE').checked){XHR.appendData('ACTION_PROBABLE_MODE',1);}else{XHR.appendData('ACTION_PROBABLE_MODE',0);}\n\t\t\t\tif(document.getElementById('ACTION_FORMAL_MODE').checked){XHR.appendData('ACTION_FORMAL_MODE',1);}else{XHR.appendData('ACTION_FORMAL_MODE',0);}\n\t\t\t}\n\t\t\t\n\t\t\tif(amavis_enabled==1){\n\t\t\t\tXHR.appendData('SAVE_AMAVIS',1);\n\t\t\t\tif(document.getElementById('EnableQuarantineSpammy2').checked){XHR.appendData('EnableQuarantineSpammy2',1);}else{XHR.appendData('EnableQuarantineSpammy2',0);}\n\t\t\t\tif(document.getElementById('EnableQuarantineSpammy').checked){XHR.appendData('EnableQuarantineSpammy',1);}else{XHR.appendData('EnableQuarantineSpammy',0);}\n\t\t\t}\n\t\t\t\n\t\t\tdocument.getElementById('kas3feature').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\t\t\tdocument.getElementById('amavisfeature').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveQuarPolicies);\t\t\t\n\t\t\n\t\t}\n\t\n\t\n\tDisableQuarPolicies();\n\t</script>\n\t\n\t\n\n\n"; echo $tpl->_ENGINE_parse_body($html); }
function SaveSettings() { $priv = new usersMenus(); if (isset($_GET["ou"])) { if ($priv->AllowChangeKas == false) { header('location:users.index.php'); exit; } $kas = new kas_user(null, $_GET["ou"]); } else { if ($priv->AllowChangeAntiSpamSettings == false) { header('location:users.index.php'); exit; } $kas = new kas_user($_SESSION["uid"]); } $tpl = new templates(); while (list($num, $val) = each($_GET)) { $kas->mail_array[$num] = $val; } if (!$kas->SaveConf()) { echo $tpl->_ENGINE_parse_body('{failed}'); } else { echo $tpl->_ENGINE_parse_body('{success}'); } }
function popup() { $tpl = new templates(); $page = CurrentPageName(); $group = $tpl->_ENGINE_parse_body("{group}"); $members = $tpl->_ENGINE_parse_body("{members}"); $description = $tpl->_ENGINE_parse_body("{description}"); $new_group = $tpl->_ENGINE_parse_body("{new_group}"); $tt = $_GET["t"]; if (!is_numeric($tt)) { $tt = time(); } $t = time(); $ldap = new clladp(); $ou = $_GET["ou"]; if (is_base64_encoded($ou)) { $ou = base64_decode($ou); } $dn = urlencode($_GET["dn"]); $buttons = "\nbuttons : [\n{name: '<b>{$new_group}</b>', bclass: 'add', onpress : CreateGroup{$t}},\n],"; if ($ldap->IsOUUnderActiveDirectory($ou)) { $buttons = null; } $html = "\n<span id='DomainsGroupFindPopupDiv'></span>\n<table class='flexRT{$t}' style='display: none' id='flexRT{$t}' style='width:100%'></table>\n\n\t\n<script>\n\$(document).ready(function(){\n\$('#flexRT{$t}').flexigrid({\n\turl: '{$page}?search=yes&ou={$_GET["ou"]}&t={$t}&tt={$tt}&dn={$dn}',\n\tdataType: 'json',\n\tcolModel : [\n\t\t{display: '{$group}', name : 'member', width : 183, sortable : false, align: 'left'},\t\n\t\t{display: '{$members}', name : 'email', width :71, sortable : false, align: 'center'},\n\t\t{display: '{$description}', name : 'desc', width : 199, sortable : true, align: 'left'},\n\t\t{display: ' ', name : 'del', width : 31, sortable : true, align: 'center'},\n\t\t\n\t\t],\n\t{$buttons}\n\tsearchitems : [\n\t\t{display: '{$group}', name : 'find-member'},\n\t\t],\n\tsortname: 'pattern',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '',\n\tuseRp: true,\n\trp: 50,\n\tshowTableToggleBtn: false,\n\twidth: 550,\n\theight: 350,\n\tsingleSelect: true,\n\trpOptions: [10, 20, 30, 50,100,200]\n\t\n\t}); \n});\n\tfunction DomainsGroupFindPopupDivRefresh(){\n\t\t\$('#flexRT{$t}').flexReload();\n\t}\n\t\n\tfunction CreateGroup{$t}(){\n\t\tLoadjs('domains.edit.group.php?popup-add-group=yes&ou={$_GET["ou"]}&t={$t}&tt={$tt}');\n\t}\n\n\n</script>\n\n"; echo $html; }
function tabs() { $sock = new sockets(); $fontsize = 16; $tpl = new templates(); $page = CurrentPageName(); $date = date("Ym"); $table = "{$date}_maccess"; $q = new mysql_squid_builder(); if (!$q->TABLE_EXISTS($table)) { echo FATAL_ERROR_SHOW_128("{no_table_see_support}"); return; } $array["popup"] = '{members_this_month}'; while (list($num, $ligne) = each($array)) { if ($num == "parameters") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.accesslogs.params.php?parameters=yes\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n"); continue; } if ($num == "schedule") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"squid.databases.schedules.php?TaskType=54\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n"); continue; } $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n"); } echo build_artica_tabs($html, "squid_users_profiling", 1100) . "<script>LeftDesign('user-stats-256.png');</script>"; }
function PageFetchmail_status() { include_once 'ressources/class.fetchmail.inc'; $tpl = new templates(); $yum = new usersMenus(); if ($yum->AsMailBoxAdministrator == false) { $html = $tpl->_ENGINE_parse_body("<h3>{not allowed}</H3>"); return $html; } $status = new status(1); $stat = $status->fetchmail_satus(); $html = $stat; if ($usersmenus->AutomaticConfig == false) { $html = $html . "<br><fieldset><legend>{apply config}</legend>\n\t\t\t\t\t<center><input type='button' value='{apply config}' OnClick=\"javascript:TreeFetchMailApplyConfig()\"></center>\n\t\t\t\t</fieldset>"; } $fetch = new fetchmail(); if (is_array($fetch->array_servers)) { $html = $html . "<fieldset>\n\t\t\t\t<legend>{servers_list}</legend>\n\t\t\t\t<center>\n\t\t\t\t<table style='width:90%;border:1px solid #CCCCCC'>\n\t\t\t\t<tr style='border-bottom:1px solid #CCCCCC'>\n\t\t\t\t\t<td colspan=2><strong>{servers_list}</td>\n\t\t\t\t\t<td align='center'><strong>{number_users}</strong></td>\n\t\t\t\t</tr>"; while (list($num, $val) = each($fetch->array_servers)) { $html = $html . "<tr>\n\t\t\t\t\t<td width=1%><img src='img/webmin_on-22.gif'></td>\n\t\t\t\t\t<td><a href=\"javascript:TreeFetchmailShowServer('{$num}');\">{$num}</a></td>\n\t\t\t\t\t<td align='center'>" . count($val) . "</td>\n\t\t\t\t\t</tr>"; } $html = $html . "</table></center></fieldset>"; } return $tpl->_ENGINE_parse_body("<div id=status>{$html}</div>"); }
function page() { $page = CurrentPageName(); $tpl = new templates(); $q = new mysql(); $databases = $q->DATABASE_LIST(); while (list($database, $line) = each($databases)) { $tbs = $tbs + $line[0]; $tx = trim($line[1]); $re = explode(" ", $tx); $tsize = $re[0]; $unit = $re[1]; if ($unit == "KB") { $size = $size + $tsize; } if ($unit == "MB") { $tsize = intval($tsize) * 1024; $size = $size + $tsize; } if ($unit == "GB") { $tsize = intval($tsize) * 1024; $tsize = $tsize * 1024; $size = $size + $tsize; } } $text = $tpl->_ENGINE_parse_body("{INNODB_FILE_PER_TABLE_ASK}"); $size = FormatBytes($size); $text = str_replace("%free", "<strong>{$size}</strong>", $text); $text = str_replace("%tablesnum", "<strong>{$tbs}</strong>", $text); $t = time(); $html = "\n\t\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<td valign='top' width=1%><img src='img/database-connect-128.png'></td>\n\t\t<td valign='top' width=99% style='padding-left:20px'>\n\t\t<div style='font-size:18px;font-weight:bold'>InnoDB File per Table</div>\n\t\t<div id='{$t}-div'></div>\n\t\t<div style='font-size:14px'>{$text}</div>\n\t\t<div style='margin:10px;text-align:center'>" . button("{i_understand_continue}", "SaveContinue{$t}()", "18px") . "</div>\n\t\t<div style='margin:10px;text-align:center'>" . button("{convertto_innodb_file_per_table}", "ConvertInnodb{$t}()", "18px") . "</div>\n\t\t<div style='margin:10px;text-align:center'>\n\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:s_PopUpFull('http://www.mail-appliance.org/index.php?cID=278','1024','900');\"\n\t\tstyle='font-size:18px;'>{online_help}</a>\n\t\t\n\t\t\n\t\t</td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\t\tvar x_SaveContinue{$t}= function (obj) {\n\t\t\tvar tempvalue=obj.responseText;\n\t\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\t\tdocument.location.href='admin.index.php';\n\t\t\t\n\t\t}\n\t\n\t\n\t\tfunction SaveContinue{$t}(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('InnoDBFilePerTableAsk','yes');\n\t\t\tAnimateDiv('{$t}-div');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveContinue{$t});\t\n\t\t}\n\t\t\n\t\tfunction ConvertInnodb{$t}(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('ConvertInnoDB','yes');\n\t\t\tAnimateDiv('{$t}-div');\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveContinue{$t});\t\t\t\n\t\t\n\t\t}\n\t\n\t</script>\n\t\n\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }