function WhiteListSender() { $sql = "SELECT mail_from,mail_to from messages WHERE zMD5=\"{$_GET["id"]}\""; $result = QUERY_SQL($sql); $ligne = @sqlite3_fetch_array(QUERY_SQL($sql)); $mail_from = $ligne["mail_from"]; if ($mail_from == null) { SinglePage(ParseLogs("ERROR\n")); exit; } $ldap = new clladp(); $upd["KasperkyASDatasAllow"] = $mail_from; $uid = $ldap->uid_from_email($ligne["mail_to"]); if ($uid == null) { SinglePage(ParseLogs("ERROR\n")); exit; } $hash = $ldap->UserDatas($uid); $dn = $hash["dn"]; if (!$ldap->Ldap_add_mod($dn, $upd)) { $error = $ldap->ldap_last_error . "\n"; } $sock = new sockets(); $error = $error . $sock->getfile('releaseallmailfrommd5:' . $_GET["id"]); SinglePage(ParseLogs($error)); }
function BigDomainsReceive($email) { $sql = "SELECT count( ID ) as tcount ,mailfrom_domain,filter_action,mail_to FROM `messages` GROUP BY mailfrom_domain,filter_action,mail_to HAVING filter_action = 'quarantine' AND count( ID )>0 AND mail_to='{$email}' ORDER BY count( ID ) DESC\nlimit 0,20"; $results = QUERY_SQL($sql); $html = "<table style='width:100%'>"; while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { if ($ligne["mailfrom_domain"] != null) { $html = $html . "<tr>\n\t\t\t<td class='bottom'><strong>{$ligne["tcount"]}</td>\n\t\t\t<td class='bottom'><strong>{$ligne["mailfrom_domain"]}</td>\n\t\t\t</tr>\n\t\t\t"; } } return $html . "</table>"; }
function Graph($email) { include_once 'ressources/class.mysql.inc'; include_once 'ressources/charts.php'; $usermenus = new usersMenus(); $tpl = new templates(); $sql = "SELECT COUNT(ID) as tcount FROM messages WHERE mail_to LIKE '%{$mail}%' AND quarantine='1'"; $ligne = sqlite3_fetch_array(QUERY_SQL($sql)); $quarantine_count = $ligne["tcount"]; $sql = "SELECT COUNT(ID) as tcount FROM messages WHERE mail_to LIKE '%{$mail}%' AND quarantine='0'"; $ligne = sqlite3_fetch_array(QUERY_SQL($sql)); $safe = $ligne["tcount"]; $Graph = InsertChart('js/charts.swf', "js/charts_library", "listener.graphs.php?USER_QUARANTINE={$quarantine_count}&SAFE={$safe}", 250, 250, "FFFFFF", true, $usermenus->ChartLicence); $Graph2 = InsertChart('js/charts.swf', "js/charts_library", "listener.graphs.php?tempsQuarantine={$email}", 250, 250, "FFFFFF", true, $usermenus->ChartLicence); $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td>\n\t<H5>{quarantines_graph}</H5>\n\t<center>\n\t{$Graph}\n\t</center>\n\t</td>\n\t<td width=50%>\n\t<H5>{quarantines_graph} ({monthly})</H5>\t\n\t{$Graph2}\n\t</td>\n\t</tr>\n\t</table>\n\t"; return $html; }
function pie_month_by_blocked_type() { $sql = "SELECT count(ID) as tcount,strftime('%Y-%m',received_date),filter_action FROM messages GROUP BY \n\tfilter_action,strftime('%Y-%m',received_date) HAVING strftime('%Y-%m',received_date)='" . date('Y-m') . "' AND filter_action!='send' ORDER BY tcount DESC"; $results = QUERY_SQL($sql); $textes[] = 'title'; $donnees[] = ''; while ($ligne = sqlite3_fetch_array($results)) { $textes[] = $ligne["filter_action"]; $donnees[] = $ligne["tcount"]; } $links = array("url" => "javascript:LoadAjax('graph2','system_statistics.php?MonthCourbeDay=yes',_category_)", "target" => "javascript"); BuildPieChart(array($textes, $donnees), $links); }
<?php include_once dirname(__FILE__) . '/functions.sql.inc'; include_once dirname(__FILE__) . '/class.files.inc'; $sql = "SELECT SUM(rowsnum) as tsum FROM indexcats"; $ligne = mysql_fetch_array(QUERY_SQL($sql, null, 0, "articafr9")); $websites = $ligne["tsum"]; $websites = numberFormat($websites, 0, "", " "); $sql = "SELECT tablename,category,rowsnum FROM indexcats ORDER BY rowsnum DESC"; $results = QUERY_SQL($sql, null, 0, "articafr9"); $c = 0; while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { if (trim($ligne["category"]) == null) { continue; } if ($ligne["rowsnum"] < 3) { continue; } $c++; $ligne["rowsnum"] = numberFormat($ligne["rowsnum"], 0, "", " "); $table = $table . "\n\t\t<tr>\n\t\t\t<td width=1% valign='middle'><img src='/img/arrow-right-16.png'></td>\n\t\t\t<td style='font-size:16px;font-weight:bold' width=99% nowrap>{$ligne["category"]}:</td>\n\t\t\t<td style='font-size:16px;font-weight:bold' width=1% nowrap>{$ligne["rowsnum"]} items</td>\n\t\t</tr>\n\t\t<tr><td colspan=3 style='border-top:1px solid #CCCCCC'> </td></tr>\n\t\t\n\t\t"; } $html = "\n<table style='width:900px'>\n<tr>\n\n\t<td valign='top' width=1%><center><img src='/img/squid-350.png' style='border:3px solid #CCCCCC'></center></td>\n\t<td valign='top'>\n<H1>Artica For Proxy appliance, {$c} Available Categories: </H1>\n" . RoundedLightGrey("<p style='font-size:16px'>Currently <strong>{$websites}</strong> categorized websites</p>\n<div style='text-align:right;margin-top:-10px'><a href=\"index.php?option=com_content&view=article&catid=null&id=449:proxy-appliances-features-list\" style='font-size:14px'>See all Artica For Proxy Appliance features</a></div>\n\n") . "\n<center style='margin-top:10px;'><table style='width:25%;border:3px solid #CCCCCC;padding:3px'><tbody>{$table}</tbody></table></center>\n</td>\n</tr>\n</table>"; echo $html; function numberFormat($number, $decimals = 2, $dec_point = '.', $sep = ',', $group = 3) { $num = sprintf("%0.{$decimals}f", $number); $num = explode('.', $num); while (strlen($num[0]) % $group) { $num[0] = ' ' . $num[0]; }
function QuarantineMessageDelete() { $ID = $_GET["QuarantineMessageDelete"]; $sql = "SELECT message_path FROM messages WHERE ID='{$ID}'"; $ligne = mysql_fetch_array(QUERY_SQL($sql)); $lines = $ligne["message_path"]; $tempfile = dirname(__FILE__) . "/ressources/conf/" . md5($sql); $fp = fopen($tempfile, "w", 0); fputs($fp, $lines); fclose($fp); $sock = new sockets(); $res = trim($sock->getfile("QuarantineDeletePattern:{$tempfile}")); if ($res == "OK") { $sql = "UPDATE `messages` SET `Deleted` = '1' WHERE ID='{$ID}' "; QUERY_SQL($sql); echo "OK"; } }
function CountPosts() { $sql = "SELECT COUNT(post_id) as tcount FROM phpbb_posts"; $ligne = mysql_fetch_array(QUERY_SQL($sql, null, 0, "articafr1")); return $ligne["tcount"]; }
<?php include_once dirname(__FILE__) . '/functions.sql.inc'; include_once dirname(__FILE__) . '/class.files.inc'; $sql = "SELECT SUM(rowsnum) as tsum FROM indexcats"; $ligne = mysql_fetch_array(QUERY_SQL($sql, null, 0, "articafr9")); $websites = $ligne["tsum"]; $websites = numberFormat($websites, 0, "", " "); if (preg_match("#^([0-9]+)\\s+#", $websites, $re)) { $websites = $re[1]; } $ressources_artica = "\n <table>\n <tr><td colspan=2 style='padding-bottom:15px'><strong style='font-size:18px'>Artica For Squid Appliance resources</strong></td></tr>\n <tr>\n \t<td width=1%><img src='/img/arrow-right-24.png'></td>\n \t<td><a href='http://proxy-appliance.org' style='font-size:16px;font-weight:bold'>The dedicated Website proxy-appliance.org</a></td>\n </tr>\n <tr>\n \t<td width=1%><img src='/img/arrow-right-24.png'></td>\n \t<td><a href='http://sourceforge.net/projects/artica-squid/files/' style='font-size:16px;font-weight:bold'>Download the ISO file 32/64 bits</a></td>\n </tr> \n <tr>\n \t<td width=1%><img src='/img/arrow-right-24.png'></td>\n \t<td><a href='http://www.artica.fr/support' style='font-size:16px;font-weight:bold'>Help desk & Support</a></td>\n </tr> \n <tr>\n \t<td width=1%><img src='/img/arrow-right-24.png'></td>\n \t<td><a href='http://forum.artica.fr/viewforum.php?f=38' style='font-size:16px;font-weight:bold'>Community Forum</a></td>\n </tr> \n </table> \n "; $ufbContent = "<hr>\n<table style='width:100%;margin-top:20px'>\n<tr>\n\n\t<td valign='top' width=1%><center><img src='/img/ufb-350.png'></center></td>\n\t<td valign='top'>\n\n" . RoundedLightGrey("<div style='font-size:18px;font-weight:bold;'>Url Filter Box features list:</div>") . "\n<p>\n\t<strong style='font-size:16px'>Internet Accelerator and URL/Content Filtering.</strong>\n<br><span style='font-size:16px'>The URL Filter Box is the highly powerful solution available on the market, combining Cache Acceleration and URL Filtering Engine.<br>\nDepending your style of Internet surfing, you will be able to <strong>reach 95% of Save Bandwidth</strong>.<br>\nWe have optimized our solution for Youtube, DailyMotion, Microsoft WindowsUpdate, Compressed Files, Images, Video files, etc... <br>\nWe also provide an unique solution to <strong>accelerate</strong>, at a second level, your Internet surf with our <strong>Turbo-Booster</strong> engine increasing your \nsurf again and again.<br>\nThe URL Filter Box maximizes performance and flexibility of your Network Organization.<br>\nDatabase ensures maximum, in-line performance and minimal latency.<br>\nFlexible policies can be implemented to control employees and network activity\nComparing competitor solutions, we have pushed our URL Filter Box to the extreme limit giving you the possibility to use your hardware and your bandwidth how it should be.\n<br> We have simplified to the maximum the Management Console to concentrate your time to the most important options, we have <strong>tuned by ourselves 99% of the configuration.</strong></p>\n <p> </p>\n{$ressourcesufb}\n\n</td>\n</tr>\n</table>"; $ressources_artica = RoundedLightGrey($ressources_artica); $ressourcesufb = "\n <table>\n <tr><td colspan=2 style='padding-bottom:15px'><strong style='font-size:18px'>Url Filter Box Appliance resources</strong></td></tr>\n <tr>\n \t<td width=1%><img src='/img/arrow-right-24.png'></td>\n \t<td><a href='http://www.artica.fr/index.php/home/urlfilterbox' style='font-size:16px;font-weight:bold'>Technical informations</a></td>\n </tr>\n <tr>\n \t<td width=1%><img src='/img/arrow-right-24.png'></td>\n \t<td><a href='http://sourceforge.net/projects/artica-squid/files/ISO/UrlFilterBox/' style='font-size:16px;font-weight:bold'>Download the ISO file 32/64 bits</a></td>\n </tr> \n <tr>\n \t<td width=1%><img src='/img/arrow-right-24.png'></td>\n \t<td><a href='http://www.artica.fr/support' style='font-size:16px;font-weight:bold'>Help desk & Support</a></td>\n </tr> \n <tr>\n \t<td width=1%><img src='/img/arrow-right-24.png'></td>\n \t<td><a href='http://www.artica.fr/forum/viewforum.php?f=133' style='font-size:16px;font-weight:bold'>Community Forum</a></td>\n </tr> \n </table> \n "; $ressourcesufb = RoundedLightGrey($ressourcesufb); $html = "\n<p style='font-size:16px'>Artica Proxy appliance delivers a scalable proxy platform architecture \nto secure Web communications and accelerate delivery of business applications.\n<p style='font-size:16px'>\nYour Internet Bandwidth is not big enough ?<br>\nYou do not manage where are your users surfing ?<br>\nYou need to protect your network against Malwares, Phishing, P**n, Warez, etc... ?<br> \nArtica Proxy Appliance will provide you all these needs ! and more...<br>\nIncluding {$websites}+ Millions Domains, compatibility with LDAP and Microsoft AD, Accelerate your surf, etc....\n</p>\n<p style='font-size:16px'>\n<i>Artica appliance is based on Debian 6 with Squid cache 3.2x and UfdbgGuard.</i>\n</p>\n\n\n<table style='width:100%'>\n<tr>\n\n\t<td valign='top' width=1%><center><img src='/img/squid-350.png'></center></td>\n\t<td valign='top'>\n\n" . RoundedLightGrey("<div style='font-size:18px;font-weight:bold;'>Artica For Squid Appliance features list:</div>") . "\n<p> </p>\n <table>\n \t<tr>\n \t\t<td> </td>\n \t\t<td width=1% valign='middle'><img src='/img/arrow-right-16.png'></td>\n \t\t<td style='font-size:16px'><strong>Authenticate</strong> your users with Microsoft <strong>Active Directory</strong> or <strong>LDAP</strong> database</td>\n \t</tr> \n \t<tr><td colspan=3> </td></tr> \n \t<tr>\n \t\t<td> </td>\n \t\t<td width=1% valign='middle'><img src='/img/arrow-right-16.png'></td>\n \t\t<td style='font-size:16px'><strong>Protect</strong> users and networks from web threats, phishing and other attacks</td>\n \t</tr>\n \t\t<tr><td colspan=3> </td></tr> \n \t<tr>\n \t\t<td> </td>\n \t\t<td width=1% valign='middle'><img src='/img/arrow-right-16.png'></td>\n \t\t<td style='font-size:16px'><strong>Accelerate</strong> application performances with files, email, web, ssl and rich media</td>\n \t</tr> \n \t\t<tr><td colspan=3> </td></tr> \n \t<tr>\n \t\t<td> </td>\n \t\t<td width=1% valign='middle'><img src='/img/arrow-right-16.png'></td>\n \t\t<td style='font-size:16px'>Defines rules in order to <strong>reduce bandwith</strong> when accessing specifics websites.</td>\n \t</tr> \n \t\t<tr><td colspan=3> </td></tr> \n \t<tr>\n \t\t<td> </td>\n \t\t<td width=1% valign='middle'><img src='/img/arrow-right-16.png'></td>\n \t\t<td style='font-size:16px'>Ban websites with a database of more <a href=\"http://artica.fr/index.php/component/content/article/453-artica-for-proxy-appliance-available-categories\" style='font-weight:bold'>{$websites}+ million categorized websites</a> in <strong>150 categories</strong></td>\n \t</tr> \n \t\t<tr><td colspan=3> </td></tr> \t \t \n \t<tr>\n \t\t<td> </td>\n \t\t<td width=1% valign='middle'><img src='/img/arrow-right-16.png'></td>\n \t\t<td style='font-size:16px'>Provide extended <strong>statistics</strong> in realtime, including users, websites and categories - by Day/Week/Month/Year</td>\n \t</tr> \t\t\n </table>\n <p> </p>\n{$ressources_artica}\n</td>\n</tr>\n</table>\n\n"; echo $html; function numberFormat($number, $decimals = 2, $dec_point = '.', $sep = ',', $group = 3) { $num = sprintf("%0.{$decimals}f", $number); $num = explode('.', $num); while (strlen($num[0]) % $group) { $num[0] = ' ' . $num[0]; } $num[0] = str_split($num[0], $group); $num[0] = join($sep[0], $num[0]); $num[0] = trim($num[0]); $num = join($dec_point[0], $num); return $num; }