function popup() { $page=CurrentPageName(); $tpl=new templates(); $dans=new dansguardian_rules(); $cats=$dans->LoadBlackListes(); $t=time(); while (list ($num, $ligne) = each ($cats) ){$newcat[$num]=$num;} $newcat[null]="{select}"; $field_category=Field_array_Hash($newcat,"category-add$t",null,null,"style:font-size:22px")."</span>"; $html="<div style='font-size:16px' class=text-info>{bad_category_explain}</div> <div style='width:95%;padding:15px' class=form> <center> <table style='width:100%'> <tr> <td style='font-size:22px'>{websites}:</td> <td> <textarea style='margin-top:5px;font-family:Courier New;font-weight:bold;width:99%;height:150px;border:5px solid #8E8E8E;overflow:auto;font-size:22px !important' id='www-$t'></textarea> </td> </tr> <tr> <td style='font-size:22px' nowrap>{should_categorized_to}:</td> <td>$field_category</td> </tr> <tr> <td colspan=2 align='right'><hr>". button("{submit}","Save$t();",30)."</td> </tr> </table> </center> </div> <div id='results-$t'></div> <script> var xSave$t= function (obj) { var res=obj.responseText; if (res.length>0){ alert(res); } ExecuteByClassName('SearchFunction'); } function Save$t(){ var XHR = new XHRConnection(); var cat=document.getElementById('category-add$t').value; if(cat.length==0){return;} XHR.appendData('category',cat); XHR.appendData('www',document.getElementById('www-$t').value); XHR.sendAndLoad('$page', 'POST',xSave$t); } </script>"; echo $tpl->_ENGINE_parse_body($html); }
function test() { $tpl = new templates(); $www = $_GET["test"]; $q = new mysql_squid_builder(); $www = $q->WebsiteStrip($www); if ($www == null) { echo "<p class=text-error>corrupted</p>"; return; } $catz = $q->GET_FULL_CATEGORIES($www); if (trim($catz) == null) { echo $tpl->_ENGINE_parse_body("<p class=text-error>{not_categorized}</p>"); return; } if (strpos(" {$catz}", ",") == 0) { $CATEGORIES[] = $catz; } else { $CATEGORIES = explode(",", $catz); } $dans = new dansguardian_rules(); $cats = $dans->LoadBlackListes(); $html = "\n\t<div style='width:95%;margin-top:15px' class=form>\t\t\n\t<table style='width:99%'>\n\t\t<tr>\n\t\t\t\n\t\t\t<td style='vertical-align:top' colspan=2><div style='font-size:18px;font-weight:bolder;letter-spacing:2px'>\n\t\t\t«{$www}»</td>\t\t\n\t\t</tr>\t\t\n\t\t\t\n\t"; while (list($num, $categoryF) = each($CATEGORIES)) { if (isset($ALREADY_PARSED[$categoryF])) { continue; } $ALREADY_PARSED[$categoryF] = true; $categoryF = trim($categoryF); if (!isset($cats[$categoryF])) { $cats[$categoryF] = null; } if ($cats[$categoryF] == null) { $sql = "SELECT category_description FROM personal_categories WHERE category='{$categoryF}'"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql)); $content = $ligne["category_description"]; } else { $content = $cats[$categoryF]; } $pic = "<img src='img/20-categories-personnal.png'>"; if (isset($dans->array_pics[$categoryF])) { $pic = "<img src='img/{$dans->array_pics[$categoryF]}'>"; } $html = $html . "\n\t\t<tr>\n\t\t\t<td style='width:22px;vertical-align:top'>{$pic}</td>\n\t\t\t<td style='vertical-align:top'><div style='font-size:18px;font-weight:bolder;letter-spacing:2px'>«{$categoryF}»</td>\t\t\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=2>\n\t\t\t\t<i style='font-size:16px;font-weight:normal'>{$content}</i>\n\t\t\t</td>\n\t\t</tr>\t\n\t\t<tr><td colspan=2> </td></tr>\t\t\n\t\t"; } $html = $html . "</table></div>"; echo $html; }
function report_main() { $page = CurrentPageName(); $tpl = new templates(); $q = new mysql_squid_builder(); $dans = new dansguardian_rules(); $cats = $dans->LoadBlackListes(); while (list($num, $ligne) = each($cats)) { $newcat[$num] = $num; } $newcat[null] = "{none}"; $sql = "SELECT DATE_FORMAT(zDate,'%Y-%m-%d') as tdate FROM tables_day ORDER BY zDate LIMIT 0,1"; $ligne2 = mysql_fetch_array($q->QUERY_SQL($sql)); $mindate = $ligne2["tdate"]; $sql = "SELECT DATE_FORMAT(zDate,'%Y-%m-%d') as tdate FROM tables_day ORDER BY zDate DESC LIMIT 0,1"; $ligne2 = mysql_fetch_array($q->QUERY_SQL($sql)); $maxdate = $ligne2["tdate"]; $ID = $_GET["ID"]; $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM `squid_reports` WHERE ID='{$ID}'")); $t = time(); $report_days[0] = "{date_range}"; $report_days[2] = "2 {days}"; $report_days[7] = "1 {week}"; $report_days[15] = "2 {weeks}"; $report_days[-1] = "{current_month}"; $report_days[30] = "1 {month}"; $report_days[60] = "2 {months}"; $report_days[90] = "3 {months}"; $report_days[180] = "6 {months}"; $report_days[365] = "1 {year}"; $report_build_time_start = $ligne["report_build_time_start"]; $report_build_time_end = $ligne["report_build_time_end"]; if ($report_build_time_start == 0) { $report_build_time_start = $mindate; } else { $report_build_time_start = date("Y-m-d", $report_build_time_start); } if ($report_build_time_end == 0) { $report_build_time_end = $maxdate; } else { $report_build_time_end = date("Y-m-d", $report_build_time_end); } if ($ligne["report_name"] == null) { $ligne["report_name"] = "New report"; } $html = "<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t" . Field_text_table("report_name-{$t}", "{report}", utf8_encode($ligne["report_name"]), 18, null, 350) . Field_text_table("description-{$t}", "{description}", utf8_encode($ligne["description"]), 18, null, 350) . Field_list_table("report_type-{$t}", "{type}", $ligne["report_type"], 18, $q->report_types) . Field_list_table("report_days-{$t}", "{from_the_last_time}", $ligne["report_days"], 18, $report_days, "ReportDaysCheck()") . "<tr>\n\t\t<td style='font-size:18px' class=legend>{from_date}:</td>\n\t\t<td>" . field_date("report_build_time_start-{$t}", $report_build_time_start, "font-size:18px;padding:3px;width:120px", "mindate:{$mindate};maxdate:{$maxdate}") . "</td>\n\t</tr>\n<tr>\n\t\t<td style='font-size:18px' class=legend>{to_date}:</td>\n\t\t<td>" . field_date("report_build_time_end-{$t}", $report_build_time_end, "font-size:18px;padding:3px;width:120px", "mindate:{$mindate};maxdate:{$maxdate}") . "</td>\n\t</tr>\t\t" . Field_checkbox_table("recategorize-{$t}", "{recategorize}", $ligne["recategorize"], 18) . Field_checkbox_table("categorize-{$t}", "{categorize}", $ligne["categorize"], 18) . Field_checkbox_table("report_not_categorized-{$t}", "{report_not_categorized}", $ligne["report_not_categorized"], 18) . Field_button_table_autonome("{apply}", "Save{$t}", 26) . "</table>\n\t</div>\t\n<script>\n\n\tvar xSave{$t}= function (obj) {\n\t\tvar res=obj.responseText;\n\t\t\n\t\tif (res.length>3){\n\t\t\talert(res);\n\t\t\treturn;\n\t\t}\n\t\t\$('#SQUID_MAIN_REPORTS').flexReload();\n\t\tRefreshTab('report_single_tab');\n\t}\t\n\t\n\tfunction ReportDaysCheck(){\n\t\tdocument.getElementById('report_build_time_start-{$t}').disabled=true;\n\t\tdocument.getElementById('report_build_time_end-{$t}').disabled=true;\n\t\tvar report_days=document.getElementById('report_days-{$t}').value;\n\t\tif(report_days==0){\n\t\t\tdocument.getElementById('report_build_time_start-{$t}').disabled=false;\n\t\t\tdocument.getElementById('report_build_time_end-{$t}').disabled=false;\t\t\n\t\t}\n\t}\n\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\t\n\t\tXHR.appendData('ID',{$ID});\n\t\tXHR.appendData('report_name',encodeURIComponent(document.getElementById('report_name-{$t}').value));\n\t\tXHR.appendData('description',encodeURIComponent(document.getElementById('description-{$t}').value));\n\t\t\n\t\tXHR.appendData('report_build_time_start',document.getElementById('report_build_time_start-{$t}').value);\n\t\tXHR.appendData('report_build_time_end',document.getElementById('report_build_time_end-{$t}').value);\n\t\t\n\t\tXHR.appendData('report_type',document.getElementById('report_type-{$t}').value);\n\t\tXHR.appendData('report_days',document.getElementById('report_days-{$t}').value);\n\t\tif(document.getElementById('recategorize-{$t}').checked){XHR.appendData('recategorize',1);}else{XHR.appendData('recategorize',0);}\n\t\tif(document.getElementById('categorize-{$t}').checked){XHR.appendData('categorize',1);}else{XHR.appendData('categorize',0);}\n\t\tif(document.getElementById('report_not_categorized-{$t}').checked){XHR.appendData('report_not_categorized',1);}else{XHR.appendData('report_not_categorized',0);}\n\t\t\n\t\t\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n\t}\n\t\nReportDaysCheck();\n</script>\n\t\t\t\n\t\t\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function categories_search() { $tpl = new templates(); $catz = new mysql_catz(); $tables = $catz->LIST_TABLES_CATEGORIES(); $dans = new dansguardian_rules(); $dans->LoadBlackListes(); $search = string_to_flexregex("categories-search"); $TransArray = $catz->TransArray(); while (list($key, $value) = each($tables)) { $categoryname = $TransArray[$key]; $text_category = $tpl->_ENGINE_parse_body($dans->array_blacksites[$categoryname]); if (!isset($dans->array_blacksites[$categoryname])) { continue; } if ($dans->array_pics[$categoryname] != null) { $pic = "<img src='img/{$dans->array_pics[$categoryname]}'>"; } else { $pic = " "; } $CTCOUNT = $catz->COUNT_ROWS($key); if ($CTCOUNT == 0) { continue; } $items = numberFormat($CTCOUNT, 0); if ($search != null) { if (!preg_match("#{$search}#", $categoryname)) { if (!preg_match("#{$search}#", $text_category)) { continue; } } } $tr[] = "\n\t\t<tr id='{$id}'>\n\t\t<td width=1% nowrap>{$pic}</td>\n\t\t<td><i class='icon-globe'></i> <strong>{$categoryname}</strong><div>{$text_category}</div></td>\n\t\t<td nowrap><i class='icon-info-sign'></i> <span style='font-size:18px'>{$items}</span></td>\n\t\t</tr>"; } echo $tpl->_ENGINE_parse_body("\n\t\n\t\t<table class='table table-bordered'>\n\t\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th colspan=2>{category}</th>\n\t\t\t\t\t<th>{websites}</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t <tbody>\n\t\t\t") . @implode("", $tr) . "</tbody></table>"; }
function rule_popup() { $dans = new dansguardian_rules(); $md5 = $_GET["rule-popup"]; $tpl = new templates(); $page = CurrentPageName(); $fields_size = 22; $q = new mysql_squid_builder(); $sock = new sockets(); $t = time(); $bt = "{add}"; if ($md5 != null) { $bt = "{apply}"; } $Timez[0] = "{default}"; $Timez[5] = "5 {minutes}"; $Timez[10] = "10 {minutes}"; $Timez[15] = "15 {minutes}"; $Timez[30] = "30 {minutes}"; $Timez[60] = "1 {hour}"; $Timez[120] = "2 {hours}"; $Timez[240] = "4 {hours}"; $Timez[720] = "12 {hours}"; $Timez[2880] = "2 {days}"; $cats = $dans->LoadBlackListes(); while (list($num, $ligne) = each($cats)) { $newcat[$num] = $num; } $newcat[null] = "{all_categories}"; $newcat["safebrowsing"] = "Google Safe Browsing"; $newcat["blacklist"] = "{blacklist}"; $newcat["generic"] = "{generic}"; if (!$q->FIELD_EXISTS("ufdb_page_rules", "ticket")) { $q->QUERY_SQL("ALTER TABLE `ufdb_page_rules` ADD `ticket` smallint(1) NOT NULL DEFAULT 0, ADD INDEX ( `ticket` )"); } if (!$q->FIELD_EXISTS("ufdb_page_rules", "ticket")) { $q->QUERY_SQL("ALTER TABLE `ufdb_page_rules` ADD `ticket` smallint(1) NOT NULL DEFAULT 0, ADD INDEX ( `ticket` )"); } if (!$q->FIELD_EXISTS("ufdb_page_rules", "webruleid")) { $q->QUERY_SQL("ALTER TABLE `ufdb_page_rules` ADD `webruleid` INT(10) NOT NULL NOT NULL DEFAULT 0, ADD INDEX ( `webruleid` )"); } $sql = "SELECT ID,groupname FROM webfilter_rules WHERE enabled=1"; $results = $q->QUERY_SQL($sql); $RULES["0"] = "{all_rules}"; $btname = "{add}"; $t = time(); while ($ligne = mysql_fetch_assoc($results)) { $RULES[$ligne["ID"]] = "{$ligne["groupname"]}"; } $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM ufdb_page_rules WHERE zmd5='{$md5}'")); $group_legend = "{active_directory_group}"; if ($sock->SQUID_IS_EXTERNAL_LDAP()) { $group_legend = "{ldap_group}"; } if (!$q->ok) { echo FATAL_ERROR_SHOW_128($q->mysql_error); return; } $html[] = "<div style='width:98%' class=form>"; $html[] = "<table style='width:100%'>"; $html[] = Field_list_table("webruleid-{$t}", "{rule}", $ligne["webruleid"], $fields_size, $RULES, null, 450); $html[] = Field_list_table("category-{$t}", "{category}", $ligne["category"], $fields_size, $newcat, null, 450); $html[] = Field_list_table("maxtime-{$t}", "{unlock_during}", $ligne["maxtime"], $fields_size, $Timez, null, 450); $html[] = Field_text_table("adgroup-{$t}", "{$group_legend}", $ligne["adgroup"], $fields_size, null, 450); if ($sock->SQUID_IS_EXTERNAL_LDAP()) { $html[] = Field_button_table_autonome("{browse}", "Loadjs('browse-extldap-groups.php?MainFunction=FdapGroup{$t}')"); } $html[] = Field_text_table("username-{$t}", "{username}", $ligne["username"], $fields_size, null, 450); $html[] = Field_checkbox_table("deny-{$t}", "{deny_unlock}", $ligne["deny"], $fields_size, null, "UnCheckAllow{$t}()"); $html[] = Field_checkbox_table("allow-{$t}", "{allow_unlock}", $ligne["allow"], $fields_size, null, "UnCheckDeny{$t}()"); $html[] = Field_checkbox_table("ticket-{$t}", "{submit_ticket}", $ligne["ticket"], $fields_size, null, "UnTicket{$t}()"); $html[] = Field_checkbox_table("noauth-{$t}", "{not_authenticate}", $ligne["noauth"], $fields_size); $html[] = Field_list_table("addTocat-{$t}", "{automatically_add_to}", $ligne["addTocat"], $fields_size, $newcat, null, 450); $html[] = Field_button_table_autonome($bt, "Submit{$t}", 30); $html[] = "</table>"; $html[] = "</div>\n\t<script>\n\tvar xSubmit{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);}\n\t\t\$('#UFDB_PAGE_RULE').flexReload();\n\t\n\t}\n\t\n\tfunction UnCheckAllow{$t}(){\n\t\tif(document.getElementById('deny-{$t}').checked){\n\t\t\tdocument.getElementById('allow-{$t}').checked=false;\n\t\t}else{\n\t\t\tdocument.getElementById('allow-{$t}').checked=true;\n\t\t\n\t\t}\n\t\n\t}\n\t\n\tfunction UnCheckDeny{$t}(){\n\t\tif(document.getElementById('allow-{$t}').checked){\n\t\t\tdocument.getElementById('deny-{$t}').checked=false;\n\t\t}else{\n\t\t\tdocument.getElementById('deny-{$t}').checked=true;\n\t\t}\n\t}\n\t\n\tfunction UnTicket{$t}(){\n\t\tif(document.getElementById('ticket-{$t}').checked){\n\t\t\tdocument.getElementById('deny-{$t}').checked=true;\n\t\t\tdocument.getElementById('allow-{$t}').checked=false;\n\t\t\tdocument.getElementById('noauth-{$t}').checked=true;\n\t\t\tdocument.getElementById('deny-{$t}').disabled=true;\n\t\t\tdocument.getElementById('allow-{$t}').disabled=true;\n\t\t\tdocument.getElementById('noauth-{$t}').disabled=true;\n\t\t\tdocument.getElementById('maxtime-{$t}').disabled=true;\n\t\t\tdocument.getElementById('addTocat-{$t}').disabled=true;\n\t\t}else{\n\t\t\tdocument.getElementById('deny-{$t}').disabled=false;\n\t\t\tdocument.getElementById('allow-{$t}').disabled=false;\n\t\t\tdocument.getElementById('noauth-{$t}').disabled=false;\n\t\t\tdocument.getElementById('maxtime-{$t}').disabled=false;\n\t\t\tdocument.getElementById('addTocat-{$t}').disabled=false;\n\t\t\t}\n\t\t\n\t}\n\t\n\tfunction FdapGroup{$t}(DN){\n\t\tdocument.getElementById('adgroup-{$t}').value='EXTLDAP:'+DN;\n\t}\n\t\n\t\n\tfunction Submit{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('rule','{$md5}');\n\t\tXHR.appendData('category',document.getElementById('category-{$t}').value);\n\t\tXHR.appendData('adgroup',document.getElementById('adgroup-{$t}').value);\n\t\tXHR.appendData('username',document.getElementById('username-{$t}').value);\n\t\tXHR.appendData('addTocat',document.getElementById('addTocat-{$t}').value);\n\t\tXHR.appendData('maxtime',document.getElementById('maxtime-{$t}').value);\n\t\tXHR.appendData('webruleid',document.getElementById('webruleid-{$t}').value);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tif(document.getElementById('deny-{$t}').checked){\n\t\t\tXHR.appendData('deny','1');\t\n\t\t}else{\n\t\t\tXHR.appendData('deny','0');\t\n\t\t\n\t\t}\n\t\tif(document.getElementById('allow-{$t}').checked){\n\t\t\tXHR.appendData('allow','1');\t\n\t\t}else{\n\t\t\tXHR.appendData('allow','0');\t\n\t\t\n\t\t}\t\n\n\t\tif(document.getElementById('noauth-{$t}').checked){\n\t\t\tXHR.appendData('noauth','1');\t\n\t\t}else{\n\t\t\tXHR.appendData('noauth','0');\t\n\t\t\n\t\t}\n\n\t\tif(document.getElementById('ticket-{$t}').checked){\n\t\t\tXHR.appendData('ticket','1');\t\n\t\t}else{\n\t\t\tXHR.appendData('ticket','0');\t\n\t\t\n\t\t}\t\t\t\n\t\t\n\t\t\n\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t}\n\t\n\tUnCheckAllow{$t}();\n\tUnTicket{$t}();\n\t</script>\n\t\t\n\t"; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function categories() { $page = CurrentPageName(); $tpl = new templates(); $q = new mysql_squid_builder(); if (!$q->TABLE_EXISTS("webfilters_categories_caches")) { $q->CheckTables(); } else { $q->QUERY_SQL("TRUNCATE TABLE webfilters_categories_caches"); } $q->QUERY_SQL("DELETE FROM personal_categories WHERE category='';"); $OnlyPersonal = null; $dans = new dansguardian_rules(); $dans->LoadBlackListes(); $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("{new_category}"); $purge = $tpl->_ENGINE_parse_body("{purgeAll}"); $category = $tpl->_ENGINE_parse_body("{category}"); $tablewith = 691; $compilesize = 35; $size_elemnts = 50; $size_size = 58; $title = $tpl->javascript_parse_text("{your_categories}"); $deletetext = $tpl->javascript_parse_text("{purge}"); $delete = "{display: '{$deletetext}', name : 'icon3', width : 90, sortable : false, align: 'center'},"; $t = time(); $html = "\n<table class='PERSONAL_CATEGORIES_TABLE' style='display: none' id='PERSONAL_CATEGORIES_TABLE' style='width:99%'></table>\n<script>\n\$(document).ready(function(){\n\t\$('#PERSONAL_CATEGORIES_TABLE').flexigrid({\n\turl: '{$page}?category-search=yes',\n\tdataType: 'json',\n\tcolModel : [\n\t{display: '{$category}', name : 'category', width : 416, sortable : false, align: 'left'},\n\t{display: '{$size}', name : 'category', width : 121, sortable : false, align: 'right'},\n\t{display: '{$items}', name : 'TABLE_ROWS', width : 121, sortable : true, align: 'right'},\n\t{display: 'compile', name : 'icon2', width : 121, sortable : false, align: 'center'},\n\t{$delete}\n\n\t],\n\tbuttons : [\n\t\t{name: '{$addCat}', bclass: 'add', onpress : AddNewCategory},\n\t\t{name: '{$size}', bclass: 'Search', onpress : LoadCategoriesSize},\n\t],\n\tsearchitems : [\n\t{display: '{$category}', name : 'category'},\n\t],\n\tsortname: 'table_name',\n\tsortorder: 'asc',\n\tusepager: true,\n\ttitle: '<span style=font-size:18px>{$title}</span>',\n\tuseRp: true,\n\trpOptions: [10, 20, 30, 50,100,200],\n\trp:50,\n\tshowTableToggleBtn: false,\n\twidth: '99%',\n\theight: 350,\n\tsingleSelect: true\n\n});\n});\n\n\nfunction AddNewCategory(){\n\tLoadjs('{$page}?add-perso-cat-js=yes&t={$t}');\n}\n\nfunction SwitchToArtica(){\n\$('#dansguardian2-category-{$t}').flexOptions({url: '{$page}?category-search=yes&minisize={$_GET["minisize"]}&t={$t}&artica=1'}).flexReload();\n}\n\nfunction SaveAllToDisk(){\nLoadjs('{$page}?compile-all-dbs-js=yes')\n\n}\n\nfunction LoadCategoriesSize(){\nLoadjs('dansguardian2.compilesize.php')\n}\n\nfunction CategoryDansSearchCheck(e){\nif(checkEnter(e)){CategoryDansSearch();}\n}\n\nfunction CategoryDansSearch(){\nvar se=escape(document.getElementById('category-dnas-search').value);\nLoadAjax('dansguardian2-category-list','{$page}?category-search='+se,false);\n\n}\n\nfunction DansGuardianCompileDB(category){\nLoadjs('ufdbguard.compile.category.php?category='+category);\n}\n\nfunction CheckStatsApplianceC(){\nLoadAjax('CheckStatsAppliance','{$page}?CheckStatsAppliance=yes',false);\n}\n\nvar X_PurgeCategoriesDatabase= function (obj) {\nvar results=obj.responseText;\nif(results.length>2){alert(results);}\nRefreshAllTabs();\n}\n\nfunction PurgeCategoriesDatabase(){\nif(confirm('{$purge_catagories_database_explain}')){\nvar XHR = new XHRConnection();\nXHR.appendData('PurgeCategoriesDatabase','yes');\nAnimateDiv('dansguardian2-category-list');\nXHR.sendAndLoad('{$page}', 'POST',X_PurgeCategoriesDatabase);\n}\n\n}\n\nvar X_TableCategoryPurge= function (obj) {\nvar results=obj.responseText;\nif(results.length>2){alert(results);}\n\$('#dansguardian2-category-{$t}').flexReload();\n}\n\nfunction TableCategoryPurge(tablename){\nif(confirm('{$purge_catagories_table_explain}')){\nvar XHR = new XHRConnection();\nXHR.appendData('PurgeCategoryTable',tablename);\nXHR.sendAndLoad('dansguardian2.databases.compiled.php', 'POST',X_TableCategoryPurge);\n}\n}\n\n\nCheckStatsApplianceC();\n</script>\n\n"; echo $tpl->_ENGINE_parse_body($html); }
function test_category_perform(){ $www=$_REQUEST["WEBTESTS"]; $tpl=new templates(); $q=new mysql_squid_builder(); $www=$q->WebsiteStrip($www); if($www==null){ echo $tpl->_ENGINE_parse_body("<p class=text-error>{corrupted_request}: «{$_REQUEST["WEBTESTS"]}»</p>"); return; } $dans=new dansguardian_rules(); $dans->LoadBlackListes(); $catz=$q->GET_CATEGORIES($www,true); if($catz==null){ echo $tpl->_ENGINE_parse_body("<p class=text-error>{unknown}: «{$_REQUEST["WEBTESTS"]}»</p>"); return; } if(strpos(" $catz", ",")>0){$CATs=explode(",", $catz);}else{$CATs[]=$catz;} $sql="SELECT * FROM personal_categories"; if(!$q->TABLE_EXISTS("personal_categories")){json_error_show("personal_categories no such table!",1);} $results=$q->QUERY_SQL($sql); if(!$q->ok){json_error_show("Mysql Error [".__LINE__."]: $q->mysql_error",1);} while($ligne=mysql_fetch_array($results,MYSQL_ASSOC)){$PERSONALSCATS[$ligne["category"]]=$ligne["category_description"];} while (list ($num, $categoryname) = each ($CATs) ){ if(!isset($dans->array_blacksites[$categoryname])){ if(isset($dans->array_blacksites[str_replace("_","-",$categoryname)])){$categoryname=str_replace("_","-",$categoryname);} if(isset($dans->array_blacksites[str_replace("_","/",$categoryname)])){$categoryname=str_replace("_","/",$categoryname);} } if($dans->array_pics[$categoryname]<>null){$pic="<img src='img/{$dans->array_pics[$categoryname]}'>";}else{$pic=" ";} $text_category=$dans->array_blacksites[$categoryname]; if(isset($PERSONALSCATS[$categoryname])){ $text_category=utf8_encode($PERSONALSCATS[$categoryname]); if($pic==" "){$pic="<img src='img/20-categories-personnal.png'>";} } $js="javascript:Loadjs('squid.categories.php?category=$categoryname&t=$t')"; $categoryText[]=$tpl->_ENGINE_parse_body(" <tr> <td width=1% nowrap>$pic</td> <td valign='top'> <div style='font-size:18px';font-weight:bold'> <a href=\"javascript:blur();\" OnClick=\"$js\" style='text-decoration:underline'>$categoryname</a>:</div> <div style='font-size:16px;width:100%;font-weight:normal'>{$text_category}</div> </td> </tr> "); } $found=$tpl->_ENGINE_parse_body("{found}"); echo "<div style='width:95%:padding-left:50px;padding-top:20px' class=text-info><div style='font-size:18px'>$found</div><table>".@implode("\n", $categoryText)."</table></div>"; }
function categories_search($forceArtica = false) { $MyPage = CurrentPageName(); $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $q = new mysql_squid_builder(); $dans = new dansguardian_rules(); $EnableWebProxyStatsAppliance = $sock->GET_INFO("EnableWebProxyStatsAppliance"); if (!is_numeric($EnableWebProxyStatsAppliance)) { $EnableWebProxyStatsAppliance = 0; } $t = $_GET["t"]; $artica = $forceArtica; if (isset($_GET["artica"])) { $artica = true; } $tableSchema = "squidlogs"; if (!$q->BD_CONNECT()) { json_error_show("Testing connection to MySQL server failed...", 1); } if (!$q->TABLE_EXISTS("webfilters_categories_caches")) { $q->CheckTables(); } $dans = new dansguardian_rules(); $dans->LoadBlackListes(); $sql = "SELECT * FROM personal_categories"; if (!$q->TABLE_EXISTS("personal_categories")) { json_error_show("personal_categories no such table!", 1); } $results = $q->QUERY_SQL($sql); if (!$q->ok) { json_error_show("Mysql Error [" . __LINE__ . "]: {$q->mysql_error}", 1); } while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) { $PERSONALSCATS[$ligne["category"]] = $ligne["category_description"]; } $search = '%'; $page = 1; $ORDER = "ORDER BY table_name"; $searchstring = "table_name LIKE 'category_%'"; if (isset($_POST["sortname"])) { if ($_POST["sortname"] != null) { $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}"; } } if ($artica) { $q = new mysql_catz(); writelogs("Artica mode -> {$q->database} " . $q->COUNT_CATEGORIES(), __FUNCTION__, __FILE__, __LINE__); $tableSchema = "catz"; } if (isset($_POST['page'])) { $page = $_POST['page']; } if ($_POST["query"] != null) { $_POST["query"] = "*{$_POST["query"]}*"; $_POST["query"] = str_replace("**", "*", $_POST["query"]); $_POST["query"] = str_replace("**", "*", $_POST["query"]); $_POST["query"] = str_replace("*", "%", $_POST["query"]); $search = $_POST["query"]; $searchstring = "table_name LIKE 'category_{$search}'"; $sql = "SELECT COUNT( table_name ) AS tcount FROM information_schema.tables WHERE table_schema = '{$tableSchema}' AND table_name LIKE 'category_{$search}'"; writelogs($sql, __FUNCTION__, __FILE__, __LINE__); $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); if (!$q->ok) { json_error_show("Mysql Error [" . __LINE__ . "]: {$q->mysql_error}", 1); } $total = $ligne["tcount"]; } else { $sql = "SELECT COUNT(table_name) as TCOUNT FROM information_schema.tables WHERE table_schema = '{$tableSchema}' AND table_name LIKE 'category_%'"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); if (!$q->ok) { json_error_show("Mysql Error [" . __LINE__ . "]: {$q->mysql_error}", 1); } $total = $ligne["TCOUNT"]; writelogs("{$sql} = {$total}", __FUNCTION__, __FILE__, __LINE__); } if (isset($_POST['rp'])) { $rp = $_POST['rp']; } $pageStart = ($page - 1) * $rp; $limitSql = "LIMIT {$pageStart}, {$rp}"; $sql = "SELECT table_name as c,TABLE_ROWS FROM information_schema.tables WHERE table_schema = '{$tableSchema}' AND {$searchstring} {$ORDER} {$limitSql}"; writelogs("{$q->mysql_admin}:{$q->mysql_password}:{$sql}", __FUNCTION__, __FILE__, __LINE__); $results = $q->QUERY_SQL($sql); if (!$q->ok) { json_error_show("Mysql Error [" . __LINE__ . "]: {$q->mysql_error}", 1); } if (mysql_num_rows($results) == 0) { if (!$artica) { categories_search(true); return; } } if (mysql_num_rows($results) == 0) { json_error_show("({$tableSchema}) No categories table found...", 1); } $data = array(); $data['page'] = $page; $data['total'] = $total; $data['rows'] = array(); $enc = new mysql_catz(); while ($ligne = mysql_fetch_assoc($results)) { $table = $ligne["c"]; writelogs("Scanning table {$table}", __FUNCTION__, __FILE__, __LINE__); $select = imgtootltip("32-parameters.png", "{apply}", "DansGuardianEditMember('{$ligne["ID"]}','{$ligne["pattern"]}')"); $items = $q->COUNT_ROWS($ligne["c"]); $itemsEnc = $enc->COUNT_ROWS($ligne["c"]); if (!preg_match("#^category_(.+)#", $table, $re)) { continue; } $categoryname = $re[1]; $compile = imgsimple("compile-distri-32.png", "{saveToDisk}", "DansGuardianCompileDB('{$categoryname}')"); if (!isset($dans->array_blacksites[$categoryname])) { if (isset($dans->array_blacksites[str_replace("_", "-", $categoryname)])) { $categoryname = str_replace("_", "-", $categoryname); } if (isset($dans->array_blacksites[str_replace("_", "/", $categoryname)])) { $categoryname = str_replace("_", "/", $categoryname); } } if ($dans->array_pics[$categoryname] != null) { $pic = "<img src='img/{$dans->array_pics[$categoryname]}'>"; } else { $pic = " "; } $sizedb_org = $q->TABLE_SIZE($table); $sizedb = FormatBytes($sizedb_org / 1024); $linkcat = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.categories.php?category={$categoryname}&t={$t}',true)\"\n\t\tstyle='font-size:14px;font-weight:bold;color:{$color};text-decoration:underline'>"; $text_category = $dans->array_blacksites[$categoryname]; if (isset($PERSONALSCATS[$categoryname])) { $text_category = utf8_encode($PERSONALSCATS[$categoryname]); if ($pic == " ") { $pic = "<img src='img/20-categories-personnal.png'>"; } $linkcat = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('{$MyPage}?add-perso-cat-js=yes&cat={$categoryname}&t={$t}',true)\"\n\t\t\tstyle='font-size:14px;font-weight:bold;color:{$color};text-decoration:underline'>"; } if ($EnableWebProxyStatsAppliance == 0) { if ($sizedb_org < 35) { $pic = "<img src='img/warning-panneau-32.png'>"; } } $viewDB = imgsimple("mysql-browse-database-32.png", "{view}", "javascript:Loadjs('squid.categories.php?category={$categoryname}',true)"); $categoryText = $tpl->_ENGINE_parse_body("<div style='font-size:14px';font-weight:bold'>{$linkcat}{$categoryname}</div>\n\t\t</a><div style='font-size:11px;width:100%;font-weight:normal'>{$text_category}</div>"); $items = numberFormat($items, 0, "", " "); $itemsEnc = numberFormat($itemsEnc, 0, "", " "); $compile = imgsimple("compile-distri-32.png", "{saveToDisk} {$categoryname}", "DansGuardianCompileDB('{$categoryname}')"); $delete = imgsimple("delete-32.png", "{delete}", "TableCategoryPurge('{$table}')"); if ($_GET["minisize"] == "yes") { $delete = null; } $cell = array(); $cell[] = $pic; $cell[] = $categoryText; $cell[] = "<div style='font-size:13px;padding-top:15px;font-weight:bold'>{$sizedb}</div>"; if (!$artica) { $cell[] = "<div style='font-size:13px;padding-top:5px;font-weight:bold'>{$items}<br>{$itemsEnc}</strong>"; } else { $cell[] = "<div style='font-size:13px;padding-top:15px;font-weight:bold'>-</strong>"; $cell[] = "<div style='font-size:13px;padding-top:15px;font-weight:bold'>{$items}</strong>"; } $cell[] = $compile; $cell[] = $delete; $data['rows'][] = array('id' => $ligne['ID'], 'cell' => $cell); } echo json_encode($data); }
function blacklist_list_group() { $page = CurrentPageName(); $tpl = new templates(); $t = time(); $q = new mysql_squid_builder(); if (!$q->TABLE_EXISTS("webfilters_categories_caches")) { $q->CheckTables(); } $dans = new dansguardian_rules(); $dans->LoadBlackListes(); $sql = "SELECT master_category FROM webfilters_categories_caches GROUP BY master_category"; $results = $q->QUERY_SQL($sql); if (!$q->ok) { echo "<H2>{$q->mysql_error}</H2><code style='font-size:11px'>{$sql}</code>"; } while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) { $catsz = $ligne["master_category"]; $butts[$catsz] = $catsz; } $t = time(); $butts[null] = "{all}"; $field = Field_array_Hash($butts, "CatzByGroup-{$t}", null, "RefreshBlackListTable{$t}()", null, 0, "font-size:26px"); $html = "<center style='width:95%;' class=form><br><br>{$field}<br><br></center>\n\t<script>\n\t\tfunction RefreshBlackListTable{$t}(){\n\t\t\tvar group=escape(document.getElementById('CatzByGroup-{$t}').value);\n\t\t\tvar iditem='{$_GET["iditem"]}';\n\t\t\tvar uriplus='';\n\t\t\tvar CatzByEnable={$_GET["CatzByEnable"]};\n\t\t\tif(CatzByEnable==1){uriplus='&CatzByEnabled=yes';}\n\t\t\t\$('#'+iditem).flexOptions({url: '{$page}?blacklist-list=yes&RULEID={$_GET["RULEID"]}&modeblk={$_GET["modeblk"]}&group='+group+uriplus+'&TimeID={$_GET["TimeID"]}&QuotaID={$_GET["QuotaID"]}'}).flexReload(); ExecuteByClassName('SearchFunction');\n\t\t\tYahooSearchUserHide();\n\t\t}\n\t\n\t</script>\n\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function categories_search($forceArtica = false) { $MyPage = CurrentPageName(); $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $q = new mysql_squid_builder(); $dans = new dansguardian_rules(); $EnableWebProxyStatsAppliance = $sock->GET_INFO("EnableWebProxyStatsAppliance"); if (!is_numeric($EnableWebProxyStatsAppliance)) { $EnableWebProxyStatsAppliance = 0; } $t = $_GET["t"]; $OnlyPersonal = 0; $artica = $forceArtica; if (isset($_GET["OnlyPersonal"])) { $OnlyPersonal = 1; } $rp = 200; if (isset($_GET["artica"])) { $artica = true; } if ($_POST["sortname"] == "table_name") { $_POST["sortname"] = "categorykey"; } if (!$q->BD_CONNECT()) { json_error_show("Testing connection to MySQL server failed...", 1); } $table = "webfilters_categories_caches"; $sql = "SELECT * FROM personal_categories"; if ($OnlyPersonal == 0) { if (!$q->TABLE_EXISTS($table)) { $q->create_webfilters_categories_caches(); } $dans = new dansguardian_rules(); if ($q->COUNT_ROWS($table) == 0) { $dans->CategoriesTableCache(); } $dans->LoadBlackListes(); } else { $table = "personal_categories"; if ($_POST["sortname"] == "categorykey") { $_POST["sortname"] = "category"; } } $prefix = "INSERT IGNORE INTO webfilters_categories_caches (`categorykey`,`description`,`picture`,`master_category`,`categoryname`) VALUES "; $searchstring = string_to_flexquery(); $page = 1; if (isset($_POST["sortname"])) { if ($_POST["sortname"] != null) { $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}"; } } if (isset($_POST['page'])) { $page = $_POST['page']; } if ($searchstring != null) { $sql = "SELECT COUNT( * ) AS tcount FROM {$table} WHERE 1 {$searchstring}"; writelogs($sql, __FUNCTION__, __FILE__, __LINE__); $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); if (!$q->ok) { json_error_show("Mysql Error [" . __LINE__ . "]: {$q->mysql_error}.<br>{$sql}", 1); } $total = $ligne["tcount"]; } else { $total = $q->COUNT_ROWS($table); } if (isset($_POST['rp'])) { $rp = $_POST['rp']; } $pageStart = ($page - 1) * $rp; $limitSql = "LIMIT {$pageStart}, {$rp}"; $sql = "SELECT * FROM {$table} WHERE 1 {$searchstring} {$ORDER} {$limitSql} "; writelogs("{$q->mysql_admin}:{$q->mysql_password}:{$sql}", __FUNCTION__, __FILE__, __LINE__); $results = $q->QUERY_SQL($sql); if (!$q->ok) { if ($q->mysql_error != null) { json_error_show(date("H:i:s") . "<br>SORT:{$_POST["sortname"]}:<br>Mysql Error [L." . __LINE__ . "]: {$q->mysql_error}<br>{$sql}", 1); } } if (mysql_num_rows($results) == 0) { json_error_show("Not found...", 1); } $data = array(); $data['page'] = $page; $data['total'] = $total; $data['rows'] = array(); $AS_SELECT = false; if ($_GET["select"] == "yes") { $AS_SELECT = true; } $enc = new mysql_catz(); $field = "categorykey"; $field_description = "description"; if ($OnlyPersonal == 1) { $field = "category"; $field_description = "category_description"; } $ProductName = "Artica"; $ProductNamef = dirname(__FILE__) . "/ressources/templates/{$_COOKIE["artica-template"]}/ProducName.conf"; if (is_file($ProductNamef)) { $ProductName = trim(@file_get_contents($ProductNamef)); } $CATZ_ARRAY = unserialize(base64_decode(@file_get_contents(CATZ_ARRAY_FILE()))); $FULL_ARRAY = unserialize(@file_get_contents("/usr/share/artica-postfix/ressources/logs/ARTICA_DBS_STATUS_FULL.db")); $TLSE_ARRAY = $FULL_ARRAY["TLSE_ARRAY"]; $ARTICA_ARRAY = $FULL_ARRAY["CAT_ARTICAT_ARRAY"]; //print_r($ARTICA_ARRAY); $TransArray = $enc->TransArray(); while (list($tablename, $items) = each($CATZ_ARRAY)) { if (!isset($TransArray[$tablename])) { continue; } $CATZ_ARRAY2[$TransArray[$tablename]] = $items; } while ($ligne = mysql_fetch_assoc($results)) { $sizedb = array(); $ZZCOUNT = 0; $categorykey = $ligne[$field]; if ($categorykey == null) { $categorykey = "UnkNown"; } //Array ( [category] => [category_description] => Ma catégorie [master_category] => [sended] => 1 ) if ($GLOBALS["VERBOSE"]) { echo "Found {$field}:{$categorykey}<br>\n"; } $categoryname = $categorykey; $ITEMS_COLONE = array(); $Time = array(); $text_category = null; $table = $q->cat_totablename($categorykey); if ($GLOBALS["VERBOSE"]) { echo "Scanning table {$table}<br>\n"; } $UnivToulouseItems = null; $ligne_databases = mysql_fetch_array($q->QUERY_SQL("SELECT * FROM UPDATE_DBWF_INFOS WHERE category='{$categoryname}'")); $size_artica = $ligne_databases["size_artica"]; $date_artica = $ligne_databases["date_artica"]; $count_artica = $ligne_databases["count_artica"]; $size_tlse = $ligne_databases["size_tlse"]; $date_tlse = $ligne_databases["date_tlse"]; $count_tlse = $ligne_databases["count_tlse"]; $size_perso = $ligne_databases["size_perso"]; $date_perso = $ligne_databases["date_perso"]; $count_perso = $ligne_databases["count_perso"]; $items = $count_perso; $itemsEnc = $count_artica; $ZZCOUNT = $ZZCOUNT + $items; $ZZCOUNT = $ZZCOUNT + $itemsEnc; if ($date_perso > 0) { $Time[] = date("m-d H:i", $date_perso); } else { $Time[] = "-"; } $sizeArtica = $size_artica; if ($date_artica > 0) { $Time[] = date("m-d H:i", $date_artica); } else { $Time[] = "-"; } $ITEMS_COLONE[] = "Perso.: " . numberFormat($items, 0, "", " "); $ITEMS_COLONE[] = "{$ProductName}: " . numberFormat($itemsEnc, 0, "", " "); if (!preg_match("#^category_(.+)#", $table, $re)) { continue; } $compile = imgsimple("compile-distri-32.png", "{saveToDisk}", "DansGuardianCompileDB('{$categoryname}')"); if (!isset($dans->array_blacksites[$categoryname])) { if (isset($dans->array_blacksites[str_replace("_", "-", $categoryname)])) { $categoryname = str_replace("_", "-", $categoryname); } if (isset($dans->array_blacksites[str_replace("_", "/", $categoryname)])) { $categoryname = str_replace("_", "/", $categoryname); } } if ($dans->array_pics[$categoryname] != null) { $pic = "<img src='img/{$dans->array_pics[$categoryname]}'>"; } else { $pic = " "; } $sizedb[] = FormatBytes($size_perso / 1024); $sizedb[] = FormatBytes($size_artica / 1024); $linkcat = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.categories.php?category={$categoryname}&t={$t}',true)\"\n\t\tstyle='font-size:14px;font-weight:bold;color:{$color};text-decoration:underline'>"; $text_category = $tpl->_ENGINE_parse_body(utf8_decode($ligne[$field_description])); $text_category = trim($text_category); $pic = "<img src='img/20-categories-personnal.png'>"; if ($ligne["picture"] != null) { $pic = "<img src='img/{$ligne["picture"]}'>"; } if ($OnlyPersonal == 0) { if (!isset($dans->array_blacksites[$categoryname])) { $linkcat = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('{$MyPage}?add-perso-cat-js=yes&cat={$categoryname}&t={$t}',true)\"\n\t\t\t\tstyle='font-size:14px;font-weight:bold;color:{$color};text-decoration:underline'>"; } } else { $linkcat = "<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('{$MyPage}?add-perso-cat-js=yes&cat={$categoryname}&t={$t}',true)\"\n\t\t\tstyle='font-size:14px;font-weight:bold;color:{$color};text-decoration:underline'>"; } $viewDB = imgsimple("mysql-browse-database-32.png", "{view}", "javascript:Loadjs('squid.categories.php?category={$categoryname}',true)"); $text_category = utf8_encode($text_category); $categoryname_text = utf8_encode($categoryname); $categoryText = $tpl->_ENGINE_parse_body("<span style='font-size:14px';font-weight:bold'>{$linkcat}{$categoryname_text}</span>\n\t\t</a><br><span style='font-size:11px;width:100%;font-weight:normal'>{$text_category}</span>"); if ($OnlyPersonal == 1) { $itemsEncTxt = "<br><span style='font-size:11px'>" . numberFormat($itemsEnc, 0, "", " "); "</span>"; } $compile = imgsimple("compile-distri-32.png", null, "DansGuardianCompileDB('{$categoryname}')"); $delete = imgsimple("delete-32.png", "{delete}", "TableCategoryPurge('{$table}')"); if ($_GET["minisize"] == "yes") { $delete = null; } if ($OnlyPersonal == 0) { $UnivToulouse_websitesnum = $count_tlse; $ZZCOUNT = $ZZCOUNT + $UnivToulouse_websitesnum; $UnivToulouse_size = $size_tlse; $sizedb[] = FormatBytes($UnivToulouse_size / 1024); $ITEMS_COLONE[] = "University: " . numberFormat($UnivToulouse_websitesnum, 0, "", " "); if ($date_tlse > 0) { $Time[] = date("m-d H:i", $date_tlse); } else { $Time[] = "-"; } } if ($categoryname == "UnkNown") { $linkcat = null; $delete = imgsimple("delete-32.png", "{delete}", "TableCategoryPurge('')"); } if ($EnableWebProxyStatsAppliance == 0) { if ($ZZCOUNT == 0) { $pic = "<img src='img/warning-panneau-32.png'>"; } } $cell = array(); $cell[] = $pic; $cell[] = $categoryText; $cell[] = "<span style='font-size:11px;padding-top:15px;font-weight:bold'>" . @implode("<br>", $sizedb) . "</span>"; $cell[] = "<span style='font-size:11px;padding-top:5px;font-weight:bold'>" . @implode("<br>", $ITEMS_COLONE) . "</span>"; if (!$AS_SELECT) { $cell[] = "<span style='font-size:11px;padding-top:5px;font-weight:bold'>" . @implode("<br>", $Time) . "</span>"; $cell[] = $compile; $cell[] = $delete; } else { $select = imgsimple("arrow-right-32.png", null, "{$_GET["callback"]}('{$categorykey}')"); $cell[] = $select; } $data['rows'][] = array('id' => $ligne['ID'], 'cell' => $cell); } echo json_encode($data); }
function rule_popup(){ $dans=new dansguardian_rules(); $md5=$_GET["rule-popup"]; $tpl=new templates(); $page=CurrentPageName(); $fields_size=22; $q=new mysql_squid_builder(); $sock=new sockets(); $t=time(); $bt="{add}"; if($md5<>null){$bt="{apply}";} $Timez[0]="{default}"; $Timez[5]="5 {minutes}"; $Timez[10]="10 {minutes}"; $Timez[15]="15 {minutes}"; $Timez[30]="30 {minutes}"; $Timez[60]="1 {hour}"; $Timez[120]="2 {hours}"; $Timez[240]="4 {hours}"; $Timez[720]="12 {hours}"; $Timez[2880]="2 {days}"; $cats=$dans->LoadBlackListes(); while (list ($num, $ligne) = each ($cats) ){$newcat[$num]=$num;} $newcat[null]="{none}"; $newcat["safebrowsing"]="Google Safe Browsing"; $newcat["blacklist"]="{blacklist}"; $ligne=mysql_fetch_array($q->QUERY_SQL("SELECT * FROM ufdb_page_rules WHERE zmd5='$md5'")); if(!$q->ok){echo FATAL_ERROR_SHOW_128($q->mysql_error);return;} $html[]="<div style='width:98%' class=form>"; $html[]="<table style='width:100%'>"; $html[]=Field_list_table("category-$t","{category}",$ligne["category"],$fields_size,$newcat,null,450); $html[]=Field_list_table("maxtime-$t","{unlock_during}",$ligne["maxtime"],$fields_size,$Timez,null,450); $html[]=Field_text_table("adgroup-$t","{active_directory_group}",$ligne["adgroup"],$fields_size,null,450); $html[]=Field_text_table("username-$t","{username}",$ligne["username"],$fields_size,null,450); $html[]=Field_checkbox_table("deny-$t", "{deny_unlock}",$ligne["deny"],$fields_size,null,"UnCheckAllow$t()"); $html[]=Field_checkbox_table("allow-$t", "{allow_unlock}",$ligne["allow"],$fields_size,null,"UnCheckDeny$t()"); $html[]=Field_checkbox_table("noauth-$t", "{not_authenticate}",$ligne["noauth"],$fields_size); $html[]=Field_list_table("addTocat-$t","{automatically_add_to}",$ligne["addTocat"],$fields_size,$newcat,null,450); $html[]=Field_button_table_autonome($bt,"Submit$t",30); $html[]="</table>"; $html[]="</div> <script> var xSubmit$t= function (obj) { var results=obj.responseText; if(results.length>3){alert(results);} $('#UFDB_PAGE_RULE').flexReload(); } function UnCheckAllow$t(){ if(document.getElementById('deny-$t').checked){ document.getElementById('allow-$t').checked=false; }else{ document.getElementById('allow-$t').checked=true; } } function UnCheckDeny$t(){ if(document.getElementById('allow-$t').checked){ document.getElementById('deny-$t').checked=false; }else{ document.getElementById('deny-$t').checked=true; } } function Submit$t(){ var XHR = new XHRConnection(); XHR.appendData('rule','$md5'); XHR.appendData('category',document.getElementById('category-$t').value); XHR.appendData('adgroup',document.getElementById('adgroup-$t').value); XHR.appendData('username',document.getElementById('username-$t').value); XHR.appendData('addTocat',document.getElementById('addTocat-$t').value); XHR.appendData('maxtime',document.getElementById('maxtime-$t').value); if(document.getElementById('deny-$t').checked){ XHR.appendData('deny','1'); }else{ XHR.appendData('deny','0'); } if(document.getElementById('allow-$t').checked){ XHR.appendData('allow','1'); }else{ XHR.appendData('allow','0'); } if(document.getElementById('noauth-$t').checked){ XHR.appendData('noauth','1'); }else{ XHR.appendData('noauth','0'); } XHR.sendAndLoad('$page', 'POST',xSubmit$t); } UnCheckAllow$t(); </script> "; echo $tpl->_ENGINE_parse_body(@implode("\n", $html)); }
function CategorizeAll_popup(){ $pattern=" AND sitename LIKE '%{$_GET["CategorizeAll"]}%' "; $pattern=str_replace("*","%",$pattern); $sql="SELECT COUNT( sitename ) AS tcount FROM `visited_sites` WHERE LENGTH( `category` )=0 $pattern"; $tpl=new templates(); $page=CurrentPageName(); $q=new mysql_squid_builder(); $ligne=@mysql_fetch_array($q->QUERY_SQL($sql,"artica_events")); $websites=$tpl->_ENGINE_parse_body("{websites}"); if(!$q->ok){echo "<H3>$q->mysql_error</H3>";} $count=$ligne["tcount"]; $dans=new dansguardian_rules(); $array_blacksites=$dans->LoadBlackListes(); while (list($num,$val)=each($array_blacksites)){ $blcks[$num]=$num; } $blcks[null]="{select}"; $field=Field_array_Hash($blcks,"CategorizeAll_category",null,"CategorizeAllDef()",null,0, "font-size:16px;padding:3px"); $html=" <div id='cat-perf-all'> <table style='width:99%' class=form> <tr> <td class=legend>{pattern}:</td> <td><strong style='font-size:13px'>{$_GET["CategorizeAll"]}</td> </tr> <tr> <td class=legend>{websites}:</td> <td><strong style='font-size:13px'>$count</td> </tr> <tr> <td class=legend>{category}:</td> <td>$field</td> </tr> <tr><td colspan=2><div id='cat-explain'></div></td> <tr> <td colspan=2 align='right'><hr>". button("{categorize}","CategorizeAllPerform();",16)."</td> </tr> </table> </div> <script> function CategorizeAllDef(){ LoadAjax('cat-explain','$page?cat-explain='+escape(document.getElementById('CategorizeAll_category').value)+'&day={$_GET["day"]}'); } var x_CategorizeAllPerform=function(obj){ var tempvalue=obj.responseText; if(tempvalue.length>3){alert(tempvalue);} if(document.getElementById('SQUIDNOCATREFRESHTABLEID')){SQUIDNOCATREFRESHTABLE();} YahooWin4Hide(); } function CategorizeAllPerform(){ var CategorizeAll_category=document.getElementById('CategorizeAll_category').value; if(CategorizeAll_category.length>0){ var XHR = new XHRConnection(); XHR.appendData('CategorizeAll_category',CategorizeAll_category); if(confirm('*{$_GET["CategorizeAll"]}*: -> $count $websites -> '+CategorizeAll_category+'?')){ var XHR = new XHRConnection(); XHR.appendData('CategorizeAll_category',CategorizeAll_category); XHR.appendData('pattern','{$_GET["CategorizeAll"]}'); XHR.appendData('day','{$_GET["day"]}'); XHR.appendData('week','{$_GET["week"]}'); document.getElementById('cat-perf-all').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>'; XHR.sendAndLoad('$page', 'GET',x_CategorizeAllPerform); } } } </script> "; echo $tpl->_ENGINE_parse_body($html); }
function category_explain($category) { $dans = new dansguardian_rules(); $cats = $dans->LoadBlackListes(); if (!isset($cats[$category])) { $cats[$category] = null; } if ($cats[$category] == null) { $q = new mysql_squid_builder(); $sql = "SELECT category_description FROM personal_categories WHERE category='{$category}'"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql)); $content = $ligne["category_description"]; $content = utf8_encode($content); } else { $content = $cats[$category]; } return utf8_encode($content); }
function per_category_settings(){ $dans=new dansguardian_rules(); $cats=$dans->LoadBlackListes(); $category=$_GET["per-categories-settings"]; if(trim($category)==null){die();} $explain=$cats[$category]; $page=CurrentPageName(); $sock=new sockets(); $hash=unserialize(base64_decode($sock->GET_INFO("UfdbGuardRedirectCategories"))); $datas=$hash[$category]; $tpl=new templates(); $block=0; $users=new usersMenus(); if(!$users->CORP_LICENSE){ $block=1; $MOD_TEMPLATE_ERROR_LICENSE=$tpl->javascript_parse_text("{MOD_TEMPLATE_ERROR_LICENSE}"); } $t=time(); $html="<div class=text-info style='font-size:18px'>$explain</div> <div style='width:98%' class=form> <table> <tr> <td class=legend style='font-size:14px'>{enable}:</td> <td>". Field_checkbox("enable-$t",1,$datas["enable"],"enable_uri_check()")."</td> </tr> <tr> <td class=legend style='font-size:14px'>{external_uri}:</td> <td>". Field_checkbox("external_uri",1,$datas["external_uri"],"external_uri_check()")."</td> </tr> <tr> <td class=legend style='font-size:14px'>{redirect_url}:</td> <td>". Field_text("redirect_url",$datas["redirect_url"],"font-size:14px;width:99%")."</td> </tr> <tr> <td class=legend style='font-size:14px'>{blank_page}:</td> <td>". Field_checkbox("blank_page",1,$datas["blank_page"],"blank_page_check()")."</td> </tr> <tr> <td colspan=2 align='center' style='font-size:16px'>{template}</td> </tr> <tr> <td colspan=2 align='center' style='font-size:16px'> <textarea style='width:100%;height:120px;overflow:auto;font-size:12px' id='template_data'>{$datas["template_data"]}</textarea></td> </tr> <tr> <td colspan=2 align='right'><hr>". button("{apply}", "SavePerCatForm()",18)."</td> </tr> </tbody> </table> </div> <script> var x_SavePerCatForm= function (obj) { var tempvalue=obj.responseText; if(tempvalue.length>3){alert(tempvalue)}; catgorized_choosen(); } function SavePerCatForm(){ var block=$block; if(block==1){ alert('$MOD_TEMPLATE_ERROR_LICENSE'); return; } var XHR = new XHRConnection(); if(document.getElementById('external_uri').checked){XHR.appendData('external_uri',1);}else{XHR.appendData('external_uri',0);} if(document.getElementById('blank_page').checked){XHR.appendData('blank_page',1);}else{XHR.appendData('blank_page',0);} if(document.getElementById('enable-$t').checked){XHR.appendData('enable',1);}else{XHR.appendData('enable',0);} XHR.appendData('redirect_url',document.getElementById('redirect_url').value); XHR.appendData('template_data',document.getElementById('template_data').value); XHR.appendData('category','$category'); AnimateDiv('free-category-form'); XHR.sendAndLoad('$page', 'POST',x_SavePerCatForm); } function external_uri_check(){ if(!document.getElementById('enable-$t').checked){return;} document.getElementById('redirect_url').disabled=true; document.getElementById('blank_page').disabled=true; document.getElementById('template_data').disabled=true; if(document.getElementById('external_uri').checked){ document.getElementById('redirect_url').disabled=false; }else{ document.getElementById('blank_page').disabled=false; document.getElementById('template_data').disabled=false; } blank_page_check(); } function blank_page_check(){ if(!document.getElementById('enable-$t').checked){return;} if(document.getElementById('external_uri').checked){return;} document.getElementById('template_data').disabled=true; if(document.getElementById('blank_page').checked){ document.getElementById('template_data').disabled=true; }else{ document.getElementById('template_data').disabled=false; } } function enable_uri_check(){ document.getElementById('redirect_url').disabled=true; document.getElementById('blank_page').disabled=true; document.getElementById('template_data').disabled=true; document.getElementById('external_uri').disabled=true; if(document.getElementById('enable-$t').checked){ document.getElementById('external_uri').disabled=false; } external_uri_check(); } enable_uri_check(); </script> "; echo $tpl->_ENGINE_parse_body($html); }
function skin_parameters() { $page = CurrentPageName(); $tpl = new templates(); $q = new mysql_squid_builder(); $sql = "SELECT ID,groupname FROM webfilter_rules WHERE enabled=1"; $results = $q->QUERY_SQL($sql); $RULES["0"] = "{default}"; $btname = "{add}"; $t = time(); while ($ligne = mysql_fetch_assoc($results)) { $RULES[$ligne["ID"]] = "{$ligne["groupname"]}"; } $dans = new dansguardian_rules(); $cats = $dans->LoadBlackListes(); $newcat["*"] = "{all}"; while (list($num, $ligne) = each($cats)) { $newcat[$num] = $num; } $newcat["safebrowsing"] = "Google Safe Browsing"; $newcat["blacklist"] = "{blacklist}"; $newcat["restricted_time"] = "{restricted_access}"; $newcat["generic"] = "{generic}"; $ligne["enabled"] = 1; if ($_GET["zmd5"] != null) { $sql = "SELECT * FROM ufdb_design WHERE zmd5='{$_GET["zmd5"]}'"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql)); if (!$q->ok) { echo $q->mysql_error_html(); } $btname = "{apply}"; } $html = "\n\t<div style='width:98%' class=form>\n\t\t\t<table style='width:100%'>\n\t\t" . Field_list_table("category-{$t}", "{category}", $ligne["category"], 26, $newcat) . Field_list_table("ruleid-{$t}", "{rule}", $ligne["ruleid"], 26, $RULES) . Field_checkbox_table("enabled-{$t}", "{enabled}", $ligne["enabled"], 26) . Field_spacer_table(50) . Field_button_table_autonome("{$btname}", "Save{$t}", 34) . "</table>\n\t</div>\n<script>\n\tvar xSave{$t}= function (obj) {\n\t\tvar zmd5='{$_GET["zmd5"]}';\n\t\tvar res=obj.responseText;\n\t\tif(res.length>3){alert(res);return;}\n\t\t\$('#UFDB_SKIN_RULES').flexReload();\n\t\tif(zmd5.length==0){YahooWin3Hide(); }\n\t}\t\n\n\t\n\tfunction Save{$t}(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('zmd5-params','{$_GET["zmd5"]}');\n\t\tXHR.appendData('category',document.getElementById('category-{$t}').value);\n\t\tXHR.appendData('ruleid',document.getElementById('ruleid-{$t}').value);\n\t\tif(document.getElementById('enabled-{$t}').checked){XHR.appendData('enabled',1);}else{XHR.appendData('enabled',0);}\n\t\tXHR.sendAndLoad('{$page}', 'POST',xSave{$t});\t\n\t}\n\n\tfunction check{$t}(){\n\t\tvar zmd5='{$_GET["zmd5"]}';\n\t\tif(zmd5.length>5){\n\t\t\tdocument.getElementById('category-{$t}').disabled=true;\n\t\t\tdocument.getElementById('ruleid-{$t}').disabled=true;\n\t\t\n\t\t}\n\t\n\t}\ncheck{$t}();\t\t\t\t\n</script>\t\t\t\t\n"; echo $tpl->_ENGINE_parse_body($html); }
function paragraphe1() { $table = $_GET["table"]; $user = $_GET["user"]; $field = $_GET["field"]; $category = $_GET["category"]; $page = CurrentPageName(); $tpl = new templates(); $q = new mysql_squid_builder(); $dans = new dansguardian_rules(); $categoriesExplain = $dans->LoadBlackListes(); $separator = "<center><hr style='border:1px dotted #CCCCCC;width:80%'></center>"; if (strpos($category, ",") > 0) { $categories = explode(",", $category); while (list($a, $b) = each($categories)) { $titleCat = $titleCat . "<div style='font-weight:bold;border-bottom:1px solid #CCCCCC'>{$b}:</div>\n\t\t\t<div style='font-size:12px;margin-bottom:8px;font-style:italic'><i>{$categoriesExplain["{$b}"]}</i></div>"; } } else { $titleCat = "<div style='font-weight:bold;border-bottom:1px solid #CCCCCC;font-size:13.5px'>{category}: {$category}</div>\n\t<div style='font-size:12px;margin-bottom:8px;font-style:italic'>{$categoriesExplain["{$category}"]}</div>"; } $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(size) as tsize FROM {$table}")); $downloadedINT = $ligne["tsize"]; $sql = "SELECT COUNT(sitename) as tcount FROM {$table} WHERE category='{$category}'"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql)); $NombreDeSites = $ligne["tcount"]; $sql = "SELECT SUM(size) as tsize FROM {$table} WHERE `category`='{$category}'"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql)); $total_category_size_bin = $ligne["tsize"]; $total_category_size_text = "<strong>" . FormatBytes($total_category_size_bin / 1024) . "</strong>"; $sql = "SELECT SUM(hits) as tsize FROM {$table} WHERE `category`='{$category}'"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql)); $total_category_hits_bin = $ligne["tsize"]; $sql = "SELECT SUM(size) as tsize FROM {$table} WHERE `category`='{$category}' AND cached=1"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql)); $total_category_cache_bin = $ligne["tsize"]; $total_category_cache_text = "<strong>" . FormatBytes($total_category_size_bin / 1024) . "</strong>"; $PRC = $total_category_size_bin / $downloadedINT * 100; $PRC = round($PRC, 3); $text2 = $tpl->_ENGINE_parse_body("{webstatsCatIntro2}"); $text2 = str_replace("XMB", "<strong>{$total_category_size_text}</strong>", $text2); $text2 = str_replace("XRQ", "<strong>{$total_category_hits_bin}</strong>", $text2); $text2 = str_replace("XPRC", "<strong>{$PRC}%</strong>", $text2); //***************************************************************************************** $sql = "SELECT SUM(size) as tsize,sitename,category FROM {$table} GROUP BY sitename,category HAVING `category`='{$category}' ORDER BY tsize DESC"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql)); $siteWebLeplusLourd = $ligne["sitename"]; $siteWebLeplusLourd_bin = $ligne["tsize"]; $siteWebLeplusLourd_text = FormatBytes($ligne["tsize"] / 1024); $sql = "SELECT SUM(hits) as tsize,sitename,category FROM {$table} GROUP BY sitename,category HAVING `category`='{$category}' ORDER BY tsize DESC"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql)); $siteWebLeplusVisite = $ligne["sitename"]; $siteWebLeplusVisite_bin = $ligne["tsize"]; $catz = sitename_MergeCategories(array($siteWebLeplusLourd, $siteWebLeplusVisite)); $phrase_the_most_websites = $tpl->_ENGINE_parse_body("{phrase_the_most_websites}"); $phrase_the_most_websites = str_replace("XXWWWS", "<strong>{$siteWebLeplusLourd}</strong>", $phrase_the_most_websites); $phrase_the_most_websites = str_replace("XWSZE", "<strong>{$siteWebLeplusLourd_text}</strong>", $phrase_the_most_websites); $phrase_the_most_websites = str_replace("XXWWWR", "<strong>{$siteWebLeplusVisite}</strong>", $phrase_the_most_websites); $phrase_the_most_websites = str_replace("XWSZR", "<strong>{$siteWebLeplusVisite_bin}</strong>", $phrase_the_most_websites); $phrase_the_most_websites = str_replace("XWSCAT", $catz, $phrase_the_most_websites); $phrase_the_most_websites = "<div style='font-size:12px;'>{$phrase_the_most_websites}</div>"; $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(hits) as tsize FROM {$table} WHERE `{$field}`='{$user}'")); $X2_bin = $ligne["tsize"]; $X2_text = "<strong>{$X2_bin}</strong>"; $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(familysite) as familysite,`{$field}` FROM {$table} WHERE `{$field}`='{$user}'")); $X0_bin = $ligne["familysite"]; $X0_text = "<strong>{$X0_bin}</strong>"; $webstatsUserIntro1 = $tpl->_ENGINE_parse_body("{webstatsUserIntro1}"); $webstatsUserIntro1 = str_replace("X3PRC", "<strong style='color:#CF1717'>{$PRC}%</strong>", $webstatsUserIntro1); $webstatsUserIntro1 = str_replace("X0", $X0_text, $webstatsUserIntro1); $webstatsUserIntro1 = str_replace("X1", $X1_text, $webstatsUserIntro1); $webstatsUserIntro1 = str_replace("X2", $X2_text, $webstatsUserIntro1); $webstatsUserIntro1 = str_replace("X3", $X3_text, $webstatsUserIntro1); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(size) as tsize,familysite,`{$field}` FROM {$table} GROUP BY familysite,`{$field}` HAVING `{$field}`='{$user}' ORDER BY tsize DESC LIMIT 0,1")); $XXWWWS = $ligne["familysite"]; $XWSZE = FormatBytes($ligne["tsize"] / 1024); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(hits) as tsize,familysite,`{$field}` FROM {$table} GROUP BY familysite,`{$field}` HAVING `{$field}`='{$user}' ORDER BY tsize DESC LIMIT 0,1")); $XXWWWR = $ligne["familysite"]; $XWSZR = $ligne["tsize"]; $XWSCAT = familysite_MergeCategories(array($XXWWWS, $XXWWWR)); $line = $tpl->_ENGINE_parse_body("{phrase_the_most_websites}"); $line = str_replace("XXWWWS", "<strong>{$XXWWWS}</strong>", $line); $line = str_replace("XWSZE", "<strong>{$XWSZE}</strong>", $line); $line = str_replace("XXWWWR", "<strong>{$XXWWWR}</strong>", $line); $line = str_replace("XWSZR", "<strong>{$XWSZR}</strong>", $line); $line = str_replace("XWSCAT", "<strong>{$XWSCAT}</strong>", $line); $webstatsUserIntro2 = "<div style='font-size:12px;text-align:justify'>{$line}</div>"; //*********************************************************************** GRAPHIQUE PAR JOUR $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT `day`,SUM(hits) as thits,SUM(size) as tsize,\n\t`category` FROM {$table} GROUP BY `day`,`category` HAVING `category`='{$category}' ORDER BY thits DESC LIMIT 0,1")); if (!$q->ok) { echo $q->mysql_error; } $MostActiveDayNum = $ligne["day"] - 1; $MostActiveDaySize = FormatBytes($ligne["tsize"] / 1024); $Cyear = substr($table, 0, 4); $Cweek = substr($table, 4, 2); $Cweek = str_replace("_", "", $Cweek); $days = $q->getDaysInWeek($Cweek, $Cyear); $dayText = date('{l}', $days[$MostActiveDayNum]); $title = "{$dayText} {phrase_most_day_activeday} {for} {$category}"; $prc = round($ligne["tsize"] / $downloadedINT, 2) * 100; $webstatsUserIntro3 = "<div style='color:#CF1717;font-weight:bold;margin-top:5px;font-size:13.5px'>{$title}</div>\n\t<div style='font-size:12px;text-align:justify;'>{with} <strong>{$ligne["thits"]} {hits}</strong> {or} <strong>{$MostActiveDaySize}</strong> {it_represents} <strong>{$prc}%</strong> {of_bandwith}</div>\n\t<div style='font-size:12px;text-align:justify;margin-top:10px;margin-bottom:15px'>{phrase_thisisthegraph1}:</div>"; $sql = "SELECT `day`,SUM(hits) as thits,`category` FROM {$table} GROUP BY `day`,category HAVING category='{$category}' ORDER BY `day`"; $results = $q->QUERY_SQL($sql); while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { $xdata[] = $ligne["day"]; $ydata[] = $ligne["thits"]; } $time = time(); $targetedfile = "ressources/logs/" . basename(__FILE__) . "." . __FUNCTION__ . ".{$table}.{$time}.png"; $gp = new artica_graphs(); $gp->width = 270; $gp->height = 150; $gp->filename = "{$targetedfile}"; $gp->xdata = $xdata; $gp->ydata = $ydata; $gp->y_title = null; $gp->x_title = $tpl->_ENGINE_parse_body("{days}"); $gp->title = null; $gp->margin0 = true; $gp->Fillcolor = "blue@0.9"; $gp->color = "146497"; $gp->line_green(); if (!is_file($targetedfile)) { $targetedfile = "img/nograph-000.png"; } $graph1 = "<center style='margin-top:5px'><img src='{$targetedfile}'></center>"; $HTML = "{$titleCat}\n\t<p style='font-size:12px'><strong>{$NombreDeSites}</strong> {webstatsCatIntro1}.</p>\n\t<p style='font-size:12px'>{$text2}</p>\n\t{$phrase_the_most_websites}\n\t{$separator}\n\t{$webstatsUserIntro3}\n\t{$graph1}\n\t\n\t<script>LoadUserReport2()</script>\n\t"; echo $tpl->_ENGINE_parse_body($HTML); }