function today()
{
    if (isset($_GET["today"])) {
        $user = $_GET["today"];
        $t = "today";
        $Q1 = " AND DATE_FORMAT( zdate, '%Y-%m-%d' )=DATE_FORMAT( NOW(), '%Y-%m-%d' )";
    }
    if (isset($_GET["week"])) {
        $t = "week";
        $user = $_GET["week"];
        $Q1 = " AND WEEK( zdate)=WEEK( NOW()) AND YEAR(zdate)=YEAR(NOW())";
    }
    if (isset($_GET["month"])) {
        $t = "month";
        $user = $_GET["month"];
        $Q1 = " AND MONTH( zdate)=MONTH( NOW()) AND YEAR(zdate)=YEAR(NOW())";
    }
    $dansguardian_events = "dansguardian_events_" . date('Ym');
    $sql = "SELECT SUM(QuerySize) as tsize, sitename FROM {$dansguardian_events} WHERE CLIENT='{$user}'{$Q1} GROUP BY sitename ORDER BY SUM(QuerySize) DESC";
    $html = "\n\t<br>\n\t<center>\n\t<table style='width:500px;border:1px solid #CCCCCC'>\n\t<tr>\n\t\t<th colspan=2>{website}</th>\n\t\t<th>size</th>\n\t</tr>\n\t";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_events");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $js = "Loadjs('squid.uris.stats.php?domain={$ligne["sitename"]}&user={$user}&t={$t}')";
        $html = $html . "\n\t<tr" . CellRollOver() . ">\n\t\t<td width=1%><img src='img/web-22.png'></td>\n\t\t<td style='font-size:13px' " . CellRollOver($js, "{display_queries_list}") . ">{$ligne["sitename"]}</td>\n\t\t<td style='font-size:13px'>" . FormatBytes($ligne["tsize"] / 1024) . "</td>\n\t</tr>\n\t";
    }
    $html = $html . "</table></center>";
    echo $html;
}
function search()
{
    $ocs = new ocs();
    $page = CurrentPageName();
    $sql = $ocs->COMPUTER_SEARCH_QUERY($_GET["search"]);
    $q = new mysql();
    $FILEID = $_GET["FILEID"];
    $results = $q->QUERY_SQL($sql, "ocsweb");
    if (!$q->ok) {
        echo "<p>&nbsp;</p><p style='font-size:15px'>{$q->mysql_error}<hr>{$sql}</p>";
        return;
    }
    $html = "\n\t<table style='width:100%;'>\n\t<tr>\n\t\t<th colspan=2>{computer}</th>\n\t\t<th>{ip_address}</th>\n\t\t<th>{affected}</th>\n\t</tr>";
    $hash = $ocs->PACKAGE_HASH_AFFECTED_COMPUTERS($FILEID);
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        if ($ligne["IPADDRESS"] == "0.0.0.0") {
            continue;
        }
        $HARDWARE_ID = $ligne["ID"];
        $html = $html . "\n\t\t<tr " . CellRollOver() . ">\n\t\t<td width=1%><img src='img/laptop-32.png'></td>\n\t\t\t<td style='font-size:13px'>{$ligne["NAME"]}</td>\n\t\t\t<td style='font-size:13px'>{$ligne["IPSRC"]}</td>\n\t\t\t<td>" . Field_checkbox("ID_{$HARDWARE_ID}", 1, $hash[$HARDWARE_ID], "OCSPackageAffectID({$HARDWARE_ID})") . "</td>\n\t\t</tr>\n\t\t";
    }
    $html = $html . "</table>\n\t<script>\n\t\tvar x_OCSPackageAffectID=function (obj) {\n\t\t\tvar results=obj.responseText;\n\t\t\tif (results.length>0){\n\t\t\t\talert(results);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(document.getElementById('packages-list')){\n\t\t\t\tRefreshOCSPackageList();\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction OCSPackageAffectID(HARDWARE_ID){\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tif(document.getElementById('ID_'+HARDWARE_ID).checked){\n\t\t\t\t\tXHR.appendData('AffectPackageToValue','1');\n\t\t\t\t}else{\n\t\t\t\t\tXHR.appendData('AffectPackageToValue','0');\n\t\t\t\t}\n\t\t\t\tXHR.appendData('FILEID','{$FILEID}');\n\t\t\t\tXHR.appendData('HARDWARE_ID',HARDWARE_ID);\n\t\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_OCSPackageAffectID);\n\t\t}\t\n\t\n\t</script>\n\t\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Exemple #3
0
function popup_list()
{
    $tpl = new templates();
    $sock = new sockets();
    $array = unserialize(base64_decode($sock->getFrameWork("cmd.php?samba-events-list=yes")));
    if (!is_array($array)) {
        echo $tpl->_ENGINE_parse_body("<H2>{error_no_datas}</H2>");
        exit;
    }
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<th>&nbsp;</th>\n\t\t<th>{filename}</th>\n\t\t<th>{size}</th>\n\t\t<th>&nbsp;</th>\n\t</tr>\n\t";
    while (list($filename, $size) = each($array)) {
        $img = "30-computer.png";
        if (preg_match("#log\\.(.+)\$#", $filename, $re)) {
            $hostname = $re[1];
        }
        $text_addon = null;
        if (preg_match("#winbindd#", $filename)) {
            $img = "30-logs.png";
            $text_addon = " ({APP_SAMBA_WINBIND})";
        }
        if (preg_match("#nmbd#", $filename)) {
            $img = "30-logs.png";
            $text_addon = " ({APP_SAMBA_NMBD})";
        }
        if (preg_match("#smbd#", $filename)) {
            $img = "30-logs.png";
            $text_addon = " ({APP_SAMBA_SMBD})";
        }
        $html = $html . "\n\t\t<tr " . CellRollOver() . ">\n\t\t\t<td width=1%>" . imgtootltip($img, "{download}", "SambaDownloadEvent('{$filename}')") . "</td>\n\t\t\t<td><strong style='font-size:13px'>" . texttooltip("{$hostname}{$text_addon}", "{download}", "SambaDownloadEvent('{$filename}')", null, 0, "font-size:13px") . "</td>\n\t\t\t<td><strong style='font-size:13px'>" . FormatBytes($size) . "</td>\n\t\t\t<td width=1%>" . imgtootltip("delete-30.png", "{delete}", "SambaDeleteEvent('{$filename}')") . "</td>\n\t\t</tr>\n\t\t";
    }
    $html = $html . "</table>";
    echo $tpl->_ENGINE_parse_body($html);
}
Exemple #4
0
function popup()
{
    $mysql = new mysqlserver();
    $net = new networking();
    $array = $net->ALL_IPS_GET_ARRAY();
    $sock = new sockets();
    $EnableZarafaTuning = $sock->GET_INFO("EnableZarafaTuning");
    if (!is_numeric($EnableZarafaTuning)) {
        $EnableZarafaTuning = 0;
    }
    $users = new usersMenus();
    if (!$users->ZARAFA_INSTALLED) {
        $EnableZarafaTuning = 0;
    }
    $array[null] = "{loopback}";
    $bind = Field_array_Hash($array, "bind-address", $mysql->main_array["bind-address"], null, null, 0, "font-size:13px;padding:3px");
    $chars = Charsets();
    $charsets = Field_array_Hash($chars, "default-character-set", $mysql->main_array["default-character-set"], null, null, 0, "font-size:13px;padding:3px");
    //Les devs de mysql conseillent un key_buffer de la taille de la somme de tous les fichiers .MYI dans le repertoire mysql.
    $hover = CellRollOver();
    $form = "\t<table style='width:100%' class=form>\n\t<tr {$hover}>\n\t\t<td class=legend>{skip-external-locking}:</td>\n\t\t<td>" . Field_yesno_checkbox('skip-external-locking', $mysql->main_array["skip_external_locking"]) . "</td>\n\t\t<td><code>skip-external-locking</code></td>\n\t\t<td>" . help_icon('{skip-external-locking_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{skip-character-set-client-handshake}:</td>\n\t\t<td>" . Field_yesno_checkbox('skip-character-set-client-handshake', $mysql->main_array["skip-character-set-client-handshake"]) . "</td>\n\t\t<td><code>skip-character-set-client-handshake</code></td>\n\t\t<td>" . help_icon('{skip-character-set-client-handshake_text}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>Default charset:</td>\n\t\t<td colspan=3>{$charsets}</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{bind-address}:</td>\n\t\t<td>{$bind}</td>\n\t\t<td><code>bind-address</code></td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{key_buffer}:</td>\n\t\t<td>" . Field_text("key_buffer", $mysql->main_array["key_buffer"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>key_buffer</code></td>\n\t\t<td>" . help_icon('{key_buffer_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{key_buffer_size}:</td>\n\t\t<td>" . Field_text("key_buffer_size", $mysql->main_array["key_buffer_size"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>key_buffer_size</code></td>\n\t\t<td>" . help_icon('{key_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t<tr {$hover}>\n\t\t<td class=legend>{innodb_buffer_pool_size}:</td>\n\t\t<td>" . Field_text("innodb_buffer_pool_size", $mysql->main_array["innodb_buffer_pool_size"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>innodb_buffer_pool_size</code></td>\n\t\t<td>" . help_icon('{innodb_buffer_pool_size_text}') . "</td>\n\t</tr>\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{innodb_additional_mem_pool_size}:</td>\n\t\t<td>" . Field_text("innodb_additional_mem_pool_size", $mysql->main_array["innodb_additional_mem_pool_size"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>innodb_additional_mem_pool_size</code></td>\n\t\t<td>" . help_icon('{innodb_additional_mem_pool_size_text}') . "</td>\n\t</tr>\t\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{myisam_sort_buffer_size}:</td>\n\t\t<td>" . Field_text("myisam_sort_buffer_size", $mysql->main_array["myisam_sort_buffer_size"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>myisam_sort_buffer_size</code></td>\n\t\t<td>" . help_icon('{myisam_sort_buffer_size_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{sort_buffer_size}:</td>\n\t\t<td>" . Field_text("sort_buffer_size", $mysql->main_array["sort_buffer_size"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>sort_buffer_size</code></td>\n\t\t<td>" . help_icon('{sort_buffer_size_text}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{join_buffer_size}:</td>\n\t\t<td>" . Field_text("join_buffer_size", $mysql->main_array["join_buffer_size"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>join_buffer_size</code></td>\n\t\t<td>" . help_icon('{join_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t<tr {$hover}>\n\t\t<td class=legend>{read_buffer_size}:</td>\n\t\t<td>" . Field_text("read_buffer_size", $mysql->main_array["read_buffer_size"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>read_buffer_size</code></td>\n\t\t<td>" . help_icon('{read_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t\t<td class=legend>{query_cache_size}:</td>\n\t\t<td>" . Field_text("query_cache_size", $mysql->main_array["query_cache_size"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>query_cache_size</code></td>\n\t\t<td>" . help_icon('{query_cache_size_text}') . "</td>\n\t</tr>\t\t\n\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{query_cache_limit}:</td>\n\t\t<td>" . Field_text("query_cache_limit", $mysql->main_array["query_cache_limit"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>query_cache_limit</code></td>\n\t\t<td>" . help_icon('{query_cache_limit_text}') . "</td>\n\t</tr>\t\n\t\n\t\n\n\t\n\t\n\t\n\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{read_rnd_buffer_size}:</td>\n\t\t<td>" . Field_text("read_rnd_buffer_size", $mysql->main_array["read_rnd_buffer_size"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>read_rnd_buffer_size</code></td>\n\t\t<td>" . help_icon('{read_rnd_buffer_size_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{table_cache}:</td>\n\t\t<td>" . Field_text("table_cache", $mysql->main_array["table_cache"], "font-size:13px;width:60px;padding:3px") . "&nbsp;table(s)</td>\n\t\t<td><code>table_cache</code></td>\n\t\t<td>" . help_icon('{table_cache}') . "</td>\n\t</tr>\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{tmp_table_size}:</td>\n\t\t<td>" . Field_text("tmp_table_size", $mysql->main_array["tmp_table_size"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>tmp_table_size</code></td>\n\t\t<td>" . help_icon('{tmp_table_size}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{max_allowed_packet}:</td>\n\t\t<td>" . Field_text("max_allowed_packet", $mysql->main_array["max_allowed_packet"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>max_allowed_packet</code></td>\n\t\t<td>" . help_icon('{max_allowed_packet}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{max_connections}:</td>\n\t\t<td>" . Field_text("max_connections", $mysql->main_array["max_connections"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>max_connections</code></td>\n\t\t<td>" . help_icon('{max_connections}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{net_buffer_length}:</td>\n\t\t<td>" . Field_text("net_buffer_length", $mysql->main_array["net_buffer_length"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>net_buffer_length</code></td>\n\t\t<td>" . help_icon('{net_buffer_length_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{thread_cache_size}:</td>\n\t\t<td>" . Field_text("thread_cache_size", $mysql->main_array["thread_cache_size"], "font-size:13px;width:60px;padding:3px") . "&nbsp;M</td>\n\t\t<td><code>thread_cache_size</code></td>\n\t\t<td>" . help_icon('{thread_cache_size_text}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=4 align='right'>\n\t\t<hr>" . button("{apply}", "SaveUMysqlParameters()") . "\n\t\t\n\t\t</td>\n\t</tr>\n\t</table>";
    $html = "<div style='font-size:16px'>{mysql_settings} v. {$mysql->mysql_version_string} ({$mysql->mysqlvbin})</H1>\n\t<div id='mysqlsettings'>{$form}</div>\n\t\n\t\n\t<script>\nfunction EnableZarafaTuningCheck(){\n\tvar EnableZarafaTuning={$EnableZarafaTuning};\n\tif(EnableZarafaTuning==0){return;}\n\tif(document.getElementById('innodb_buffer_pool_size')){document.getElementById('innodb_buffer_pool_size').disabled=true;}\n\tif(document.getElementById('query_cache_size')){document.getElementById('query_cache_size').disabled=true;}\n\tif(document.getElementById('innodb_log_file_size')){document.getElementById('innodb_log_file_size').disabled=true;}\n\tif(document.getElementById('innodb_log_buffer_size')){document.getElementById('innodb_log_buffer_size').disabled=true;}\n\tif(document.getElementById('max_allowed_packet')){document.getElementById('max_allowed_packet').disabled=true;}\n\tif(document.getElementById('max_connections')){document.getElementById('max_connections').disabled=true;}\n}\nEnableZarafaTuningCheck();\n</script>\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function ParseSqlresults($results)
{
    $html = "\n<div style='height:400px;overflow:auto;margin-top:5px'>\n<table style='width:99%' class=table_form>\n\t<tr " . CellRollOver() . ">\n\t<th>&nbsp;</th>\n\t<th><strong>{time}</strong></th>\n\t<th><strong>{mail_from}</th>\n\t<th><strong>{subject}</th>\n\t<th>&nbsp;</th>\n\t</tr>";
    writelogs("LastQuarantines -> Query sql end", __FUNCTION__, __FILE__);
    while ($ligne = @mysql_fetch_array($results)) {
        $count = $ligne["ID"];
        writelogs("{$count}", __FUNCTION__, __FILE__);
        $file = basename($ligne["message_path"]);
        $delete = imgtootltip('x.gif', '{delete}', "QuarantineMessageDelete('{$ligne["ID"]}')");
        $ligne["subject"] = htmlentities($ligne["subject"]);
        $tooltip = "<H4>{view}</H4><ul style=font-size:13px><li><b>Date:</b>{$ligne["zDate"]}</li><li><b>From:</b>{$ligne["mailfrom"]}</li></ul>";
        if (strlen($ligne["mailfrom"]) > 30) {
            $ligne["mailfrom"] = substr($ligne["mailfrom"], 0, 27) . "...";
        }
        if (strlen($ligne["subject"]) > 34) {
            $ligne["subject"] = substr($ligne["subject"], 0, 31) . "...";
        }
        $ligne["subject"] = substr($ligne["subject"], 0, 500);
        $edit = "OnClick=\"javascript:Loadjs('domains.quarantine.php?message-id={$ligne["MessageID"]}')\"";
        if ($color == "#CCCCCC") {
            $color = "#FFFFFF";
        } else {
            $color = "#CCCCCC";
        }
        $html = $html . "\n\t\t<tr id='line{$count}' style='background-color:{$color};font-size:12px' " . CellRollOver_black(null, $tooltip, $color) . ">\n\t\t\t<td valign='top' style='padding:3px'><img src='img/fw_bold.gif'></td>\t\n\t\t\t<td nowrap style='font-size:12px;padding:3px' {$edit}>{$ligne["tdate"]}</a></td>\n\t\t\t<td nowrap style='font-size:12px;padding:3px' {$edit}>{$ligne["mailfrom"]}</a></td>\n\t\t\t<td nowrap style='font-size:12px;padding:3px' {$edit}>{$ligne["subject"]}</td>\n\t\t\t<td>{$delete}</td>\n\t\t</tr>\n\t\t\n\t\t";
    }
    $html = $html . "</table></div>";
    return RoundedLightGrey($html);
}
Exemple #6
0
function autmount_list()
{
    $samba = new samba();
    $ldap = new clladp();
    $dn = "ou=auto.automounts,ou=mounts,{$ldap->suffix}";
    $filter = "(&(ObjectClass=automount)(automountInformation=*))";
    $attrs = array("automountInformation", "cn");
    $html = "<table style='width:99%'>";
    $sr = @ldap_search($ldap->ldap_connection, $dn, $filter, $attrs);
    if ($sr) {
        $hash = ldap_get_entries($ldap->ldap_connection, $sr);
        if ($hash["count"] > 0) {
            for ($i = 0; $i < $hash["count"]; $i++) {
                $path = $hash[$i]["cn"][0];
                $automountInformation = $hash[$i][strtolower("automountInformation")][0];
                $js = "ShareDevice('{$path}');";
                $delete = "&nbsp;";
                if (is_array($samba->main_array[$path])) {
                    $delete = imgtootltip('ed_delete.gif', '{delete}', "DeleteUsbShare('{$path}')");
                    $js = "FolderProp('{$path}')";
                }
                $html = $html . "\n\t\t\t\t\t<tr " . CellRollOver($js) . ">\n\t\t\t\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t\t\t\t<td colspan=2 ><code style='font-size:13px;font-weight:bold'>{$path}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t<td ><code style='font-size:1Opx;font-weight:bold'>{$automountInformation}</td>\n\t\t\t\t\t\t<td width=1%>{$delete}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr><td colspan=3><hr></td></tr>\t";
            }
        }
    }
    $html = $html . "</table>";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html);
}
function main_rules_categories_list($rule_main, $noecho = 0)
{
    $dans = new dansguardian_rules();
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<th>{category}</th>\n\t\t<th colspan=2>{enabled}</th>\n\t</tr>";
    $q = new mysql();
    $sql = "SELECT * FROM dansguardian_files WHERE filename='bannedsitelist' AND RuleID={$rule_main}";
    $results = $q->QUERY_SQL($sql, "artica_backup");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $val = $ligne["pattern"];
        $array_selected[$val] = $ligne["ID"];
    }
    $array_cat = $dans->array_blacksites;
    while (list($num, $val) = each($array_cat)) {
        if ($array_selected[$num] > 0) {
            $enabled = 1;
        } else {
            $enabled = 0;
        }
        $md = md5($num);
        $html = $html . "\n\t\t<tr " . CellRollOver() . ">\n\t\t\t<td><strong style='font-size:11px'>{$val}</td>\n\t\t\t<td>" . Field_checkbox("{$md}", 1, $enabled, "DansCategoryEnable('{$md}','{$num}','{$array_selected[$num]}','{$rule_main}')") . "</td>\n\t\t\t<td>{$num}</td>\n\t\t\t\n\t\t</tr> \n\t\t\n\t\t";
    }
    $categ = "<div style='width:100%;height:600px;overflow:auto'>{$html}</div>";
    $tpl = new templates();
    if ($noecho == 1) {
        return $tpl->_ENGINE_parse_body($categ);
    }
    echo $tpl->_ENGINE_parse_body("{$categ}");
}
function getlist()
{
    $sock = new sockets();
    $res = base64_decode($sock->getFrameWork("cmd.php?etc-hosts-open=yes"));
    writelogs($res, __FUNCTION__, __FILE__, __LINE__);
    $datas = unserialize($res);
    while (list($num, $ligne) = each($datas)) {
        if (preg_match("#^([0-9\\.\\:]+)\\s+(.+?)\\s+(.+?)\$#", $ligne, $re)) {
            $array[] = array("name" => $re[2], "alias" => $re[3], "ip" => $re[1], "md" => md5($ligne));
            continue;
        }
        if (preg_match("#^([0-9\\.\\:]+)\\s+(.+?)\$#", $ligne, $re)) {
            $array[] = array("name" => $re[2], "ip" => $re[1], "md" => md5($ligne));
            continue;
        }
    }
    if (!is_array($array)) {
        return null;
    }
    $html = "<table style='width:98%' class=table_form>\n\t<tr>\n\t\t<th>&nbsp;</th>\n\t\t<th>{ip_address}</th>\n\t\t<th>{servername}</th>\n\t\t<th>{alias}</th>\n\t\t<th>&nbsp;</th>\n\t</tr>\n\t";
    while (list($num, $ligne) = each($array)) {
        $html = $html . "<tr " . CellRollOver() . ">\n\t\t\t<td width=1% nowrap><img src='img/base.gif'></td>\n\t\t\t<td width=1% nowrap>{$ligne["ip"]}</td>\n\t\t\t<td width=60% nowrap>{$ligne["name"]}</td>\n\t\t\t<td width=1% nowrap>{$ligne["alias"]}</td>\n\t\t\t<td width=1% nowrap>" . imgtootltip("ed_delete.gif", "{delete}", "etc_hosts_del('{$ligne["md"]}')") . "</td>\n\t\t\t</tr>\n\t\t\t\n\t\t\t";
    }
    $html = $html . "</table>";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body("{$html}");
}
function section_rules_list()
{
    if ($_GET["tab"] == 1) {
        section_config();
        exit;
    }
    $fetch = new Fetchmail_settings();
    $rules = $fetch->LoadAllRules();
    $html = section_tabs() . "<br><H5>{fetchmail_rules}</H5>";
    $rd = "<table style='width:1OO%' class=table_form>";
    while (list($num, $hash) = each($rules)) {
        $uid = $hash["uid"];
        $user = new user($uid);
        if ($hash["enabled"] == 0) {
            $img = 'status_ok-grey.gif';
        } else {
            $img = "status_ok.gif";
        }
        $link = CellRollOver("UserFetchMailRule('{$num}','{$uid}')", '{edit}');
        $rd = $rd . "<tr {$link}>\n\t\t<td width=1% valign='top'><img src='img/{$img}'></td>\n\t\t<td valign='top'><strong>{$user->mail}</strong></td>\n\t\t<td ><strong>{$hash["poll"]}</strong></td>\n\t\t<td ><strong>{$hash["proto"]}</strong></td>\n\t\t<td ><strong>{$hash["user"]}</strong></td>\n\t\t\n\t\t</tr>";
    }
    $rd = $rd . "</table>";
    $rd = "<div style='width:100%;height:400px;overflow:auto'>{$rd}</div>";
    $tpl = new templates();
    if (isset($_GET["ajax"])) {
        return $tpl->_ENGINE_parse_body($html . $rd);
    }
    echo $tpl->_ENGINE_parse_body($html . $rd);
}
function main_extensions_bannedextensionslist_list($rule_main = null, $noecho = 0)
{
    $q = new mysql();
    if ($rule_main == null) {
        $rule_main = $_GET["rule_main"];
    }
    $dans = new dansguardian_rules(null, $rule_main);
    writelogs("Loading RuleID={$rule_main}", __FUNCTION__, __FILE__);
    $sql = "SELECT * FROM dansguardian_files WHERE filename='bannedextensionlist' AND RuleID={$rule_main}";
    writelogs("{$sql}", __FUNCTION__, __FILE__);
    $results = $q->QUERY_SQL($sql, "artica_backup");
    $style = CellRollOver();
    $categ = "\n\t<table style='width:99%' class=form>";
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $num = $ligne["ID"];
        $onoff = Field_checkbox("bannedextensionlist_id_{$num}", 1, $ligne["enabled"], "bannedextensionlist_switch('{$num}')");
        $ext = $ligne["pattern"];
        $ext = str_replace('.', '', $ext);
        $img = "img/ext/def_small.gif";
        if (file_exists("img/ext/{$ext}_small.gif")) {
            $img = "img/ext/{$ext}_small.gif";
        }
        $categ = $categ . "<tr {$style}>\n\t\t<td width=1%><IMG SRC='{$img}' id='image_{$num}'></td>\n\t\t<td width=1%>{$onoff}</td>\n\t\t<td width=1% style='font-size:12px'> <strong id='pattern_{$num}'>{$ligne["pattern"]}</strong></td>\n\t\t<td width=98% style='font-size:12px'><strong id='info_{$num}'>{$ligne["infos"]}</strong></td>\n\t\t<td width=1%>" . imgtootltip('ed_delete.gif', '{delete}', "bannedextensionlist_del('{$hostname}','{$rule_main}','{$num}')") . "</td>\n\t\t</tr>\n\t\t";
    }
    $categ = $categ . "</table>";
    $tpl = new templates();
    $categ = $tpl->_ENGINE_parse_body($categ);
    if ($noecho == 1) {
        return $categ;
    }
    echo $categ;
}
function LoadRblist($ou)
{
    $ldap = new clladp();
    $oudat = $ldap->OUDatas($ou);
    if (!is_array($oudat["SURBLServers"])) {
        echo "&nbsp;";
        exit;
    }
    $cell = CellRollOver() . " style='font-size:12px'";
    $serverlist = RblForm(1);
    $html = "\n\t<H5>{rbl_servers}</H5>\n\t<table style='width:90%'>";
    while (list($num, $val) = each($oudat["SURBLServers"])) {
        if (strpos($val, ':') > 0) {
            $tb = explode(":", $val);
            $rbl = $tb[0];
            $purc = $tb[1];
            $count = $count + $purc;
        } else {
            $country = $val;
            $action = "delete";
        }
        $html = $html . "\n\t\t\t<tr>\n\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t<td {$cell}><strong>{$rbl}</strong></td>\n\t\t\t<td {$cell} width=1%'><img src='img/i16.gif'></td>\n\t\t\t<td {$cell}><strong><a href='{$serverlist["{$rbl}"]["uri"]}' target='_new'>{$serverlist["{$rbl}"]["name"]}</a></strong></td>\n\t\t\t<td {$cell}><strong>" . Field_text("{$num}", $purc, 'width:50px', null, 'EditSurblRblServer(this)') . "</strong></td>\n\t\t\t<td {$cell} width=1%>" . imgtootltip('x.gif', '{delete}', "SURblDelete({$num})") . "</td>\n\t\t\t</tr>";
    }
    $html = $html . "<tr><td colspan=4 align='right' style='color:#005447;font-size:12px;border-top:1px solid black;padding:5px'><strong>{$count}%</strong></td></tr>";
    $tpl = new templates();
    echo "<br>" . RoundedLightGrey($tpl->_ENGINE_parse_body($html . "</table>"));
}
Exemple #12
0
function smtpd_client_restrictions_popup()
{
    $sock = new sockets();
    $users = new usersMenus();
    $EnablePostfixAntispamPack_value = $sock->GET_INFO('EnablePostfixAntispamPack');
    $EnableGenericrDNSClients = $sock->GET_INFO("EnableGenericrDNSClients");
    $reject_forged_mails = $sock->GET_INFO('reject_forged_mails');
    $EnablePostfixInternalDomainsCheck = $sock->GET_INFO('EnablePostfixInternalDomainsCheck');
    $RestrictToInternalDomains = $sock->GET_INFO('RestrictToInternalDomains');
    $reject_unknown_client_hostname = $sock->GET_INFO('reject_unknown_client_hostname');
    $reject_unknown_reverse_client_hostname = $sock->GET_INFO('reject_unknown_reverse_client_hostname');
    $reject_unknown_sender_domain = $sock->GET_INFO('reject_unknown_sender_domain');
    $reject_invalid_hostname = $sock->GET_INFO('reject_invalid_hostname');
    $reject_non_fqdn_sender = $sock->GET_INFO('reject_non_fqdn_sender');
    $disable_vrfy_command = $sock->GET_INFO('disable_vrfy_command');
    if ($EnablePostfixInternalDomainsCheck == null) {
        $EnablePostfixInternalDomainsCheck = 0;
    }
    $whitelists = Paragraphe("routing-domain-relay.png", "{PostfixAutoBlockDenyAddWhiteList}", "{PostfixAutoBlockDenyAddWhiteList_explain}", "javascript:Loadjs('postfix.iptables.php?white-js=yes')");
    $rollover = CellRollOver();
    if (!$users->POSTFIX_PCRE_COMPLIANCE) {
        $EnableGenericrDNSClients = 0;
        $EnableGenericrDNSClientsDisabled = 1;
        $EnableGenericrDNSClientsDisabledText = "<br><i><span style='color:red;font-size:11px'>{EnableGenericrDNSClientsDisabledText}</span></i>";
    }
    $html = "\n\n\n<div style='float:right;margin:5px'>{$whitelists}</div><div class=explain>{smtpd_client_restrictions_text}</div>\n\t<input type='hidden' id='EnableGenericrDNSClientsDisabled' value='{$EnableGenericrDNSClientsDisabled}'>\n\t<div id='smtpd_client_restrictions_div' style='height:300px;overflow:auto'>\n\t<table class=tableView>\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("disable_vrfy_command", 1, $disable_vrfy_command) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{disable_vrfy_command}</td>\n\t<td valign='middle' width=1%>" . help_icon("{disable_vrfy_command_text}") . "</td>\n\t</tr>\t\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_unknown_client_hostname", 1, $reject_unknown_client_hostname) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_unknown_client_hostname}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_unknown_client_hostname_text}") . "</td>\n\t</tr>\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_unknown_reverse_client_hostname", 1, $reject_unknown_reverse_client_hostname) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_unknown_reverse_client_hostname}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_unknown_reverse_client_hostname_text}") . "</td>\n\t</tr>\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_unknown_sender_domain", 1, $reject_unknown_sender_domain) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_unknown_sender_domain}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_unknown_sender_domain_text}") . "</td>\n\t</tr>\n\t\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_invalid_hostname", 1, $reject_invalid_hostname) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_invalid_hostname}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_invalid_hostname_text}") . "</td>\n\t</tr>\n\t\n\t<tr  class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_non_fqdn_sender", 1, $reject_non_fqdn_sender) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_non_fqdn_sender}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_non_fqdn_sender_text}") . "</td>\n\t</tr>\n\t\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_forged_mails", 1, $reject_forged_mails) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_forged_mails}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_forged_mails_text}") . "</td>\n\t</tr>\t\n\t\n\t\n\t<tr  class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("EnablePostfixAntispamPack", 1, $EnablePostfixAntispamPack_value) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{EnablePostfixAntispamPack}</td>\n\t<td valign='middle' width=1%>" . help_icon("{EnablePostfixAntispamPack_text}") . "</td>\n\t</tr>\n\t\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("EnableGenericrDNSClients", 1, $EnableGenericrDNSClients, null, null) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{EnableGenericrDNSClients}{$EnableGenericrDNSClientsDisabledText}</td>\n\t<td valign='middle' width=1%>" . help_icon("{EnableGenericrDNSClients_text}") . "</td>\n\t</tr>\n\n\t<tr  class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("EnablePostfixInternalDomainsCheck", 1, $EnablePostfixInternalDomainsCheck) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{EnablePostfixInternalDomainsCheck}</td>\n\t<td valign='middle' width=1%>" . help_icon("{EnablePostfixInternalDomainsCheck_text}") . "</td>\n\t</tr>\t\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("RestrictToInternalDomains", 1, $RestrictToInternalDomains, null, null) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{RestrictToInternalDomains}</td>\n\t<td valign='middle' width=1%>" . help_icon("{RestrictToInternalDomains_text}") . "</td>\n\t</tr>\t\n\t\t\t\t\t\t\n\t</table>\n\t</div>\n\n\t<div style='width:100%;text-align:right'>\n\t" . button("{edit}", "smtpd_client_restrictions_save()") . "\n\t\n\t</div>\n\n\t<script>\n\t\tfunction EnableGenericrDNSClientsDisabledCheck(){\n\t\t\tif(document.getElementById('EnableGenericrDNSClientsDisabled').value==1){\n\t\t\t\tdocument.getElementById('EnableGenericrDNSClients').disabled=true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tEnableGenericrDNSClientsDisabledCheck();\n\t</script>\n\t\n\t";
    //smtpd_client_connection_rate_limit = 100
    //smtpd_client_recipient_rate_limit = 20
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, "postfix.index.php");
}
Exemple #13
0
function PostfixLogs()
{
    include_once 'ressources/class.mysql.inc';
    $sql = "SELECT * FROM events WHERE event_id={$_GET["event"]} ORDER BY zDate DESC LIMIT 0,100";
    $my = new mysql();
    $html = "<table style='width:100%'>";
    $html = $html . "<tr style='background-color:#005447'>\n\t  <td width=1%>&nbsp;</td>\n\t  <td width=1% nowrap>&nbsp;</td>\n\t  <td>&nbsp;</td>\n\t  </tr>";
    $resultat = $my->QUERY_SQL($sql, 'artica_events');
    while ($ligne = @mysql_fetch_array($resultat, MYSQL_ASSOC)) {
        switch ($ligne["event_type"]) {
            case 0:
                $img = "icon_mini_warning.gif";
                break;
            case 1:
                $img = "icon-mini-ok.gif";
                break;
            case 2:
                $img = "icon-mini-info.gif";
                break;
            default:
                $img = "icon-mini-info.gif";
                break;
        }
        $html = $html . "<tr " . CellRollOver() . ">\n\t  <td width=1%><img src='img/{$img}' style='margin:2px'></td>\n\t  <td width=1% nowrap>{$ligne["zDate"]}</td>\n\t  <td>{$ligne["text"]}</td>\n\t  </tr>";
    }
    $html = $html . "</table>";
    $html = RoundedLightGrey($html);
    $page = $html;
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($page);
}
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>&nbsp;</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 smtpd_client_restrictions_popup()
{
    $sock = new sockets();
    $users = new usersMenus();
    $EnablePostfixAntispamPack_value = $sock->GET_INFO('EnablePostfixAntispamPack');
    $EnableGenericrDNSClients = $sock->GET_INFO("EnableGenericrDNSClients");
    $reject_forged_mails = $sock->GET_INFO('reject_forged_mails');
    $EnablePostfixInternalDomainsCheck = $sock->GET_INFO('EnablePostfixInternalDomainsCheck');
    $RestrictToInternalDomains = $sock->GET_INFO('RestrictToInternalDomains');
    $reject_unknown_client_hostname = $sock->GET_INFO('reject_unknown_client_hostname');
    $reject_unknown_reverse_client_hostname = $sock->GET_INFO('reject_unknown_reverse_client_hostname');
    $reject_unknown_sender_domain = $sock->GET_INFO('reject_unknown_sender_domain');
    $reject_invalid_hostname = $sock->GET_INFO('reject_invalid_hostname');
    $reject_non_fqdn_sender = $sock->GET_INFO('reject_non_fqdn_sender');
    $disable_vrfy_command = $sock->GET_INFO('disable_vrfy_command');
    if ($EnablePostfixInternalDomainsCheck == null) {
        $EnablePostfixInternalDomainsCheck = 0;
    }
    $whitelists = Paragraphe("routing-domain-relay.png", "{PostfixAutoBlockDenyAddWhiteList}", "{PostfixAutoBlockDenyAddWhiteList_explain}", "javascript:Loadjs('postfix.iptables.php?white-js=yes')");
    $rollover = CellRollOver();
    if (!$users->POSTFIX_PCRE_COMPLIANCE) {
        $EnableGenericrDNSClients = 0;
        $EnableGenericrDNSClientsDisabled = 1;
        $EnableGenericrDNSClientsDisabledText = "<br><i><span style='color:red;font-size:11px'>{EnableGenericrDNSClientsDisabledText}</span></i>";
    }
    $t = time();
    $page = CurrentPageName();
    $html = "\n\n\n\n\n\t<div class=text-info style='font-size:18px'>{smtpd_client_restrictions_text}</div>\n\t<input type='hidden' id='EnableGenericrDNSClientsDisabled' value='{$EnableGenericrDNSClientsDisabled}'>\n\t<div id='smtpd_client_restrictions_div' style='width:98%' class=form>\n\t\n\t" . Paragraphe_switch_img("{disable_vrfy_command}", "{disable_vrfy_command_text}", "disable_vrfy_command-{$t}", $disable_vrfy_command, null, 900) . "\n\t" . Paragraphe_switch_img("{reject_unknown_client_hostname}", "{reject_unknown_client_hostname_text}", "reject_unknown_client_hostname-{$t}", $reject_unknown_client_hostname, null, 900) . "\n\t" . Paragraphe_switch_img("{reject_unknown_reverse_client_hostname}", "{reject_unknown_reverse_client_hostname_text}", "reject_unknown_reverse_client_hostname-{$t}", $reject_unknown_reverse_client_hostname, null, 900) . "\n\t" . Paragraphe_switch_img("{reject_unknown_sender_domain}", "{reject_unknown_sender_domain_text}", "reject_unknown_sender_domain-{$t}", $reject_unknown_sender_domain, null, 900) . "\n\t" . Paragraphe_switch_img("{reject_invalid_hostname}", "{reject_invalid_hostname_text}", "reject_invalid_hostname-{$t}", $reject_invalid_hostname, null, 900) . "\n\t" . Paragraphe_switch_img("{reject_non_fqdn_sender}", "{reject_non_fqdn_sender_text}", "reject_non_fqdn_sender-{$t}", $reject_non_fqdn_sender, null, 900) . "\n\t" . Paragraphe_switch_img("{reject_forged_mails}", "{reject_forged_mails_text}", "reject_forged_mails-{$t}", $reject_forged_mails, null, 900) . "\n\t" . Paragraphe_switch_img("{EnablePostfixAntispamPack}", "{EnablePostfixAntispamPack_text}", "EnablePostfixAntispamPack-{$t}", $EnablePostfixAntispamPack_value, null, 900) . "\n\t" . Paragraphe_switch_img("{EnableGenericrDNSClients}", "{EnableGenericrDNSClients_text}", "EnableGenericrDNSClients-{$t}", $EnableGenericrDNSClients, null, 900) . "\n\t" . Paragraphe_switch_img("{EnablePostfixInternalDomainsCheck}", "{EnablePostfixInternalDomainsCheck_text}", "EnablePostfixInternalDomainsCheck-{$t}", $EnablePostfixInternalDomainsCheck, null, 900) . "\n\t" . Paragraphe_switch_img("{RestrictToInternalDomains}", "{RestrictToInternalDomains_text}", "RestrictToInternalDomains-{$t}", $RestrictToInternalDomains, null, 900) . "\n\t\t\t\n\t\n\t\t\t\t\t\t\n\t</table>\n\t</div>\n\n\t<div style='width:100%;text-align:right'><hr>\n\t" . button("{apply}", "Save{$t}()", 26) . "\n\t\n\t</div>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\tYahooWin2Hide();\n\tif(document.getElementById('main_config_postfix_security')){\n\t\tRefreshTab('main_config_postfix_security');\n\t}\n}\n\t\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\t\n\t\tXHR.appendData('reject_unknown_client_hostname',document.getElementById('reject_unknown_client_hostname-{$t}').value);\n\t\tXHR.appendData('reject_unknown_reverse_client_hostname',document.getElementById('reject_unknown_reverse_client_hostname-{$t}').value);\n\t\tXHR.appendData('reject_unknown_sender_domain',document.getElementById('reject_unknown_sender_domain-{$t}').value);\n\t\tXHR.appendData('reject_invalid_hostname',document.getElementById('reject_invalid_hostname-{$t}').value);\n\t\tXHR.appendData('reject_non_fqdn_sender',document.getElementById('reject_non_fqdn_sender-{$t}').value);\n\t\tXHR.appendData('EnablePostfixAntispamPack',document.getElementById('EnablePostfixAntispamPack-{$t}').value);\n\t\tXHR.appendData('reject_forged_mails',document.getElementById('reject_forged_mails-{$t}').value);\n\t\tXHR.appendData('EnableGenericrDNSClients',document.getElementById('EnableGenericrDNSClients-{$t}').value);\n\t\tXHR.appendData('EnablePostfixInternalDomainsCheck',document.getElementById('EnablePostfixInternalDomainsCheck-{$t}').value);\n\t\tXHR.appendData('RestrictToInternalDomains',document.getElementById('RestrictToInternalDomains-{$t}').value);\n\t\tXHR.appendData('disable_vrfy_command',document.getElementById('disable_vrfy_command-{$t}').value);\n\t\tXHR.sendAndLoad('{$page}', 'GET',xSave{$t});\t\n\t}\n</script>\t\t\t\n\t";
    //smtpd_client_connection_rate_limit = 100
    //smtpd_client_recipient_rate_limit = 20
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, "postfix.index.php");
}
function query()
{
    $direction = $_GET["direction"];
    $uid = $_SESSION["uid"];
    $email = $_GET["email"];
    $subject = $_GET["subject"];
    $body = $_GET["body"];
    writelogs("found direction={$direction},uid={$uid},email={$email},subject={$subject}", __FUNCTION__, __FILE__);
    $ldap = new clladp();
    $user = new user($uid);
    $back = new backup_query($uid);
    $mymails = $back->sql_mymails;
    if ($body != null) {
        $bodyf = " ,MATCH (`storage`.MessageBody) AGAINST ('{$body}') AS bod";
        $body = " AND MATCH (`storage`.MessageBody) AGAINST ('{$body}')>0";
        $order = " bod DESC,";
    }
    $sql_start = "SELECT `storage`.MessageID,`storage`.zDate,`storage`.subject{$bodyf} FROM `storage`,storage_recipients WHERE \n\t\t`storage`.MessageID=storage_recipients.MessageID ";
    //$sq_direction="OR (`storage`.mailfrom='{$user->mail}')";
    if ($email != null) {
        $email_sql = " AND `storage`.mailfrom LIKE '%{$email}%'";
        if ($direction == null) {
            $sq_direction = "AND (`storage`.mailfrom LIKE '%{$email}%')";
        }
    }
    if ($subject != null) {
        $subject = " AND (`storage`.subject LIKE '%{$subject}%')";
    }
    switch ($direction) {
        case null:
            $sql = "{$sql_start} AND ({$mymails}) {$sq_direction} {$subject} {$body}";
            break;
        case "TO":
            $sql = "{$sql_start} AND ({$mymails}) {$email_sql} {$subject} {$body}";
            break;
        case "FROM":
            $email_sql = " AND (`storage_recipients`.recipient LIKE '%{$email}%')";
            $sql = "{$sql_start} AND (`storage`.mailfrom='{$user->mail}') {$email_sql} {$subject} {$body}";
            break;
    }
    $sql = $sql . " ORDER BY {$order}`storage`.zDate DESC LIMIT 0,50";
    writelogs($sql, __FUNCTION__, __FILE__);
    $s = new mysql();
    $results = $s->QUERY_SQL($sql, "artica_backup");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $arr[$ligne["MessageID"]] = array($ligne["zDate"], $ligne["subject"]);
    }
    if (!is_array($arr)) {
        echo "None...<br><br><code>{$sql}</code>";
        exit;
    }
    $html = "<table style='width:100%'>\n<tr>\n\t<th>{date}</th>\n\t<th>{subject}</th>\n</tr>\n\n";
    while (list($num, $array) = each($arr)) {
        $html = $html . "\n\t<tr " . CellRollOver("ShowBackupMail('{$num}')") . " >\n\t<td nowrap valign='top' style='border-bottom:1px dotted #CCCCCC;padding:3px'>{$array[0]}</td>\n\t<td style='border-bottom:1px dotted #CCCCCC;padding:3px'>{$array[1]}</td>\n\t</tr>\n\t\n\t";
    }
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html . "</table><br><br><code>{$sql}</code>");
}
function popup()
{
    $ou = base64_decode($_GET["ou"]);
    $main = new maincf_multi($_GET["hostname"], $ou);
    $page = CurrentPageName();
    $tpl = new templates();
    $PostFixEnableAiguilleuse = $main->GET("PostFixEnableAiguilleuse");
    $enable = Paragraphe_switch_img("{PostFixEnableAiguilleuse}", "{PostFixEnableAiguilleuse_text}", "PostFixEnableAiguilleuse", $PostFixEnableAiguilleuse, null, 350);
    $html = "\n<table style='width:100%'>\n<td valign='top' width=1%>\n<center>\n\t<img src='img/128-nodes.png' id='128-nodes'>\n</center>\n\t\t<table style='width:100%;margin-top:10px;padding:10px;width:220px'>\n\t\t<tr " . CellRollOver("PostFixEnableAiguilleuseAdd()") . ">\n\t\t\t<td valign=top width=1% style='padding:5px'><img src='img/48-network-server-add.png'></td>\n\t\t\t<td valign='top' style='padding:5px'>\n\t\t\t<div>\n\t\t\t\t<strong style='font-size:13px'>{add_mail_server}</strong>\n\t\t\t</div>\n\t\t\t<div><i style='font-size:11px'>{postfix_multi_add_aiguilleuse_server}</i></div>\n\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n</td>\n<td valign='top' width=99%>\n{$enable}\n<div style='margin:12px;text-align:right'>\t\n\t" . button("{apply}", "PostFixEnableAiguilleuseSave()") . "<hr>\n</div>\n<div id='PostFixEnableAiguilleuse-list' style='height:250px;width:100%;overflow:auto'>\t\n\n\n\n<script>\n\nvar x_PostFixEnableAiguilleuseSave= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);}\n\tdocument.getElementById('PostFixEnableAiguilleuse').src='img/128-nodes.png';\n\t}\n\t\n\t\n\tfunction PostFixEnableAiguilleuseSave(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('PostFixEnableAiguilleuse',document.getElementById('PostFixEnableAiguilleuse').value);\n\t\tXHR.appendData('ou','{$_GET["ou"]}');\n\t\tXHR.appendData('hostname','{$_GET["hostname"]}');\n\t\tdocument.getElementById('PostFixEnableAiguilleuse').src='img/img/wait_verybig.gif';\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_PostFixEnableAiguilleuseSave);\n\t\n\t}\n\n\tfunction RefreshPostfixAiguilleuseList(){\n\t\tLoadAjax('PostFixEnableAiguilleuse-list','{$page}?PostFixEnableAiguilleuse-list=yes&ou={$_GET["ou"]}&hostname={$_GET["hostname"]}');\n\t}\n\t\n\tRefreshPostfixAiguilleuseList();\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
function SHARED_FOLDERS_LIST($gid)
{
    $group = new groups($gid);
    $res = $group->SharedFolders_list;
    $html = "<table style='width:100%'>";
    while (list($num, $ligne) = each($res)) {
        $html = $html . "<tr " . CellRollOver() . ">\n\t\t<td width=1%>\n\t\t\t<img src='img/folder.gif'>\n\t\t</td>\n\t\t<td style='font-size:12px;font-weight:bold'>{$ligne}</td>\n\t\t<td width=1%>" . imgtootltip('x.gif', '{delete}', "SharedDelete({$num})") . "</td>\n\t\t</tr>";
    }
    $html = $html . "</table>";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html, "domains.edit.group.php");
}
Exemple #19
0
function websites_list()
{
    $html = "<table style='width:90%;margin:5px;padding:5px;border:1px dotted #CCCCCC'>\n\t<tr>\n\t<th colspan=2>{website}</th>\n\t<th>{ip_address}</th>\n\t<th>&nbsp;</th>\n\t</tr>";
    $sql = "SELECT * FROM squid_accel ORDER BY ID DESC";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_backup");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $html = $html . "\n\t\t<tr " . CellRollOver() . ">\n\t\t\t<td width=1%><img src='img/website-32.png'></td>\n\t\t\t<td style='font-size:14px' width=99%><strong>{$ligne["website_name"]}:{$ligne["website_port"]}</strong></td>\n\t\t\t<td style='font-size:14px' width=1%><strong>{$ligne["website_ip"]}</strong></td>\n\t\t\t<td width=1%>" . imgtootltip("delete-32.png", "{delete}", "AccelAddReverseSiteDelete({$ligne["ID"]})") . "</td>\n\t\t</tr>\n\t\t";
    }
    $html = $html . "</table>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function BlockDenyWhiteList()
{
    $sql = "SELECT * FROM postfix_multi WHERE `key`='ip_white_listed' AND `ou`='{$_GET["ou"]}' ORDER BY ID DESC;";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_backup");
    $html = "<table style='width:100%'>";
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $html = $html . "<tr " . CellRollOver() . ">\n\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t<td><strong style='font-size:14px'><code>{$ligne["value"]}</code></td>\n\t\t<td width=1%>" . imgtootltip("ed_delete.gif", "{delete}", "OUPostfixAutoBlockDenyDelWhiteList('{$ligne["ID"]}')") . "</td>\n\t</tr>";
    }
    $html = $html . "</table>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function popup()
{
    $mysql = new mysqlserver();
    $net = new networking();
    $array = $net->ALL_IPS_GET_ARRAY();
    $array[null] = "{all}";
    $bind = Field_array_Hash($array, "bind-address", $mysql->main_array["bind-address"]);
    //Les devs de mysql conseillent un key_buffer de la taille de la somme de tous les fichiers .MYI dans le repertoire mysql.
    $hover = CellRollOver();
    $form = "\t<table style='width:100%'>\n\t<tr {$hover}>\n\t\t<td class=legend>{skip-external-locking}:</td>\n\t\t<td>" . Field_yesno_checkbox('skip-external-locking', $mysql->main_array["skip_external_locking"]) . "</td>\n\t\t<td><code>skip-external-locking</code></td>\n\t\t<td>" . help_icon('{skip-external-locking_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{bind-address}:</td>\n\t\t<td>{$bind}</td>\n\t\t<td><code>bind-address</code></td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{key_buffer}:</td>\n\t\t<td>" . Field_text("key_buffer", $mysql->main_array["key_buffer"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>key_buffer</code></td>\n\t\t<td>" . help_icon('{key_buffer_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{key_buffer_size}:</td>\n\t\t<td>" . Field_text("key_buffer_size", $mysql->main_array["key_buffer_size"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>key_buffer_size</code></td>\n\t\t<td>" . help_icon('{key_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t<tr {$hover}>\n\t\t<td class=legend>{innodb_buffer_pool_size}:</td>\n\t\t<td>" . Field_text("innodb_buffer_pool_size", $mysql->main_array["innodb_buffer_pool_size"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>innodb_buffer_pool_size</code></td>\n\t\t<td>" . help_icon('{innodb_buffer_pool_size_text}') . "</td>\n\t</tr>\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{innodb_additional_mem_pool_size}:</td>\n\t\t<td>" . Field_text("innodb_additional_mem_pool_size", $mysql->main_array["innodb_additional_mem_pool_size"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>innodb_additional_mem_pool_size</code></td>\n\t\t<td>" . help_icon('{innodb_additional_mem_pool_size_text}') . "</td>\n\t</tr>\t\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{myisam_sort_buffer_size}:</td>\n\t\t<td>" . Field_text("myisam_sort_buffer_size", $mysql->main_array["myisam_sort_buffer_size"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>myisam_sort_buffer_size</code></td>\n\t\t<td>" . help_icon('{myisam_sort_buffer_size_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{sort_buffer_size}:</td>\n\t\t<td>" . Field_text("sort_buffer_size", $mysql->main_array["sort_buffer_size"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>sort_buffer_size</code></td>\n\t\t<td>" . help_icon('{sort_buffer_size_text}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{join_buffer_size}:</td>\n\t\t<td>" . Field_text("join_buffer_size", $mysql->main_array["join_buffer_size"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>join_buffer_size</code></td>\n\t\t<td>" . help_icon('{join_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t<tr {$hover}>\n\t\t<td class=legend>{read_buffer_size}:</td>\n\t\t<td>" . Field_text("read_buffer_size", $mysql->main_array["read_buffer_size"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>read_buffer_size</code></td>\n\t\t<td>" . help_icon('{read_buffer_size_text}') . "</td>\n\t</tr>\t\t\n\t\t<td class=legend>{query_cache_size}:</td>\n\t\t<td>" . Field_text("query_cache_size", $mysql->main_array["query_cache_size"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>query_cache_size</code></td>\n\t\t<td>" . help_icon('{query_cache_size_text}') . "</td>\n\t</tr>\t\t\n\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{query_cache_limit}:</td>\n\t\t<td>" . Field_text("query_cache_limit", $mysql->main_array["query_cache_limit"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>query_cache_limit</code></td>\n\t\t<td>" . help_icon('{query_cache_limit_text}') . "</td>\n\t</tr>\t\n\t\n\t\n\n\t\n\t\n\t\n\t\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{read_rnd_buffer_size}:</td>\n\t\t<td>" . Field_text("read_rnd_buffer_size", $mysql->main_array["read_rnd_buffer_size"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>read_rnd_buffer_size</code></td>\n\t\t<td>" . help_icon('{read_rnd_buffer_size_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{table_cache}:</td>\n\t\t<td>" . Field_text("table_cache", $mysql->main_array["table_cache"], "width:60px") . "&nbsp;table(s)</td>\n\t\t<td><code>table_cache</code></td>\n\t\t<td>" . help_icon('{table_cache}') . "</td>\n\t</tr>\n\t\n\t<tr {$hover}>\n\t\t<td class=legend>{tmp_table_size}:</td>\n\t\t<td>" . Field_text("tmp_table_size", $mysql->main_array["tmp_table_size"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>tmp_table_size</code></td>\n\t\t<td>" . help_icon('{tmp_table_size}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{max_allowed_packet}:</td>\n\t\t<td>" . Field_text("max_allowed_packet", $mysql->main_array["max_allowed_packet"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>max_allowed_packet</code></td>\n\t\t<td>" . help_icon('{max_allowed_packet}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{max_connections}:</td>\n\t\t<td>" . Field_text("max_connections", $mysql->main_array["max_connections"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>max_connections</code></td>\n\t\t<td>" . help_icon('{max_connections}') . "</td>\n\t</tr>\t\n\t<tr {$hover}>\n\t\t<td class=legend>{net_buffer_length}:</td>\n\t\t<td>" . Field_text("net_buffer_length", $mysql->main_array["net_buffer_length"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>net_buffer_length</code></td>\n\t\t<td>" . help_icon('{net_buffer_length_text}') . "</td>\n\t</tr>\n\t<tr {$hover}>\n\t\t<td class=legend>{thread_cache_size}:</td>\n\t\t<td>" . Field_text("thread_cache_size", $mysql->main_array["thread_cache_size"], "width:60px") . "&nbsp;M</td>\n\t\t<td><code>thread_cache_size</code></td>\n\t\t<td>" . help_icon('{thread_cache_size_text}') . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=4 align='right'>\n\t\t<hr>" . button("{apply}", "SaveUMysqlParameters()") . "\n\t\t\n\t\t</td>\n\t</tr>\n\t</table>";
    $html = "<H1>{mysql_settings} v. {$mysql->mysql_version_string} ({$mysql->mysqlvbin})</H1>\n\t<div id='mysqlsettings'>" . RoundedLightWhite($form) . "</div>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
function smtpd_client_restrictions_popup()
{
    $sock = new sockets();
    $EnablePostfixAntispamPack_value = $sock->GET_INFO('EnablePostfixAntispamPack');
    $reject_forged_mails = $sock->GET_INFO('reject_forged_mails');
    $restrictions = get_restrictions_classes();
    $whitelists = Paragraphe("routing-domain-relay.png", "{PostfixAutoBlockDenyAddWhiteList}", "{PostfixAutoBlockDenyAddWhiteList_explain}", "javascript:Loadjs('postfix.iptables.php?white-js=yes')");
    $rollover = CellRollOver();
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%>\n\t<img src='img/96-planetes-free.png'>\n\t</td>\n\t<td valign='top'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>\n\t\t<p class=caption>{smtpd_client_restrictions_text}</p>\n\t</td>\n\t<td valign='top'>\n\t\t{$whitelists}\n\t</td>\n\t</tr>\n\t</table>\n\t\n\t</td>\n\t</tr>\n\t</table>\n\t<div id='smtpd_client_restrictions_div'>\n\t<table style='width:100%'>\n\t<tr {$rollover}>\n\t<td valign='top' width=1%>" . Field_checkbox("reject_unknown_client_hostname", 1, $restrictions["reject_unknown_client_hostname"]) . "</td>\n\t<td valign='top' style='font-size:14px;text-transform:capitalize'>{reject_unknown_client_hostname}</td>\n\t<td valign='top' width=1%>" . help_icon("{reject_unknown_client_hostname_text}") . "</td>\n\t</tr {$rollover}>\n\t<tr>\n\t<td valign='top' width=1%>" . Field_checkbox("reject_unknown_reverse_client_hostname", 1, $restrictions["reject_unknown_reverse_client_hostname"]) . "</td>\n\t<td valign='top' style='font-size:14px;text-transform:capitalize'>{reject_unknown_reverse_client_hostname}</td>\n\t<td valign='top' width=1%>" . help_icon("{reject_unknown_reverse_client_hostname_text}") . "</td>\n\t<tr {$rollover}>\n\t<td valign='top' width=1%>" . Field_checkbox("reject_unknown_sender_domain", 1, $restrictions["reject_unknown_sender_domain"]) . "</td>\n\t<td valign='top' style='font-size:14px;text-transform:capitalize'>{reject_unknown_sender_domain}</td>\n\t<td valign='top' width=1%>" . help_icon("{reject_unknown_sender_domain_text}") . "</td>\n\t</tr>\n\t<tr {$rollover}>\n\t<td valign='top' width=1%>" . Field_checkbox("reject_invalid_hostname", 1, $restrictions["reject_invalid_hostname"]) . "</td>\n\t<td valign='top' style='font-size:14px;text-transform:capitalize'>{reject_invalid_hostname}</td>\n\t<td valign='top' width=1%>" . help_icon("{reject_invalid_hostname_text}") . "</td>\n\t</tr>\n\t<tr {$rollover}>\n\t<td valign='top' width=1%>" . Field_checkbox("reject_non_fqdn_sender", 1, $restrictions["reject_non_fqdn_sender"]) . "</td>\n\t<td valign='top' style='font-size:14px;text-transform:capitalize'>{reject_non_fqdn_sender}</td>\n\t<td valign='top' width=1%>" . help_icon("{reject_non_fqdn_sender_text}") . "</td>\n\t</tr>\n\t<tr {$rollover}>\n\t<td valign='top' width=1%>" . Field_checkbox("reject_forged_mails", 1, $reject_forged_mails) . "</td>\n\t<td valign='top' style='font-size:14px;text-transform:capitalize'>{reject_forged_mails}</td>\n\t<td valign='top' width=1%>" . help_icon("{reject_forged_mails_text}") . "</td>\n\t</tr>\t\n\t\n\t\n\t<tr {$rollover}>\n\t<td valign='top' width=1%>" . Field_checkbox("EnablePostfixAntispamPack", 1, $EnablePostfixAntispamPack_value) . "</td>\n\t<td valign='top' style='font-size:14px;text-transform:capitalize'>{EnablePostfixAntispamPack}</td>\n\t<td valign='top' width=1%>" . help_icon("{EnablePostfixAntispamPack_text}") . "</td>\n\t</tr>\t\t\t\t\t\n\t</table>\n\t</div>\n<hr>\n\t<div style='width:100%;text-align:right'>\n\t" . button("{edit}", "smtpd_client_restrictions_save()") . "\n\t\n\t</div>\t\n\t";
    //smtpd_client_connection_rate_limit = 100
    //smtpd_client_recipient_rate_limit = 20
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, "postfix.index.php");
}
function popup_table()
{
    $sync = new articaSMTPSync();
    if (!is_array($sync->serverList)) {
        return;
    }
    $html = "<table style='width:100%'>";
    while (list($server, $array) = each($sync->serverList)) {
        $html = $html . "\n\t\t<tr " . CellRollOver() . ">\n\t\t\t<td width=1%><img src='img/fw_bold.gif'></td>\n\t\t\t<td><strong style='font-size:12px'>{$server}</strong></td>\n\t\t\t<td><strong style='font-size:12px'>{$array["PORT"]}</strong></td>\n\t\t\t<td><strong style='font-size:12px'>{$array["user"]}</strong></td>\n\t\t\t<td><strong style='font-size:12px'>{$array["users"]} {users}</strong></td>\n\t\t\t<td width=1%>" . imgtootltip("ed_delete.gif", "{delete}", "DelServerSyncArticaSMTP('{$server}:{$array["PORT"]}')") . "</td>\n\t\t</tr>\n\t\t";
    }
    $html = $html . "</table>";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html);
}
function group_list()
{
    $sql = "SELECT * FROM dansguardian_groups WHERE RuleID='{$_GET["groups-list"]}';";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_backup");
    $style = CellRollOver();
    $html = "\n\t<table style='width:99%'>\n\t<tr>\n\t\t<th>&nbsp;</th>\n\t\t<th nowrap>{group}</th>\n\t\t<th nowrap>{ou}</th>\n\t\t<th nowrap>{members}</th>\n\t\t<th nowrap></th>\n\t</tR>\n\t\t\n\t";
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $groups = new groups($ligne["group_id"]);
        $html = $html . "\n\t\t<tr {$style}>\n\t\t\t<td width=1%><img src='img/tree-groups.gif'></td>\n\t\t\t<td width=99% nowrap style='font-size:14px' nowrap align='right'>{$groups->groupName}</td>\n\t\t\t<td width=1% nowrap style='font-size:14px' nowrap align='right'>{$groups->ou}</td>\n\t\t\t<td width=1% nowrap style='font-size:14px' nowrap align='right'>" . count($groups->members) . "</td>\n\t\t\t<td width=1% nowrap style='font-size:14px'>" . imgtootltip("ed_delete.gif", "{delete}", "DansGuardianGroupsDel('{$ligne["ID"]}')") . "</td>\n\t\t</tr>\n\t\t";
    }
    $html = $html . "</table>";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Exemple #25
0
function smtpd_client_restrictions_popup()
{
    $main = new maincf_multi($_GET["hostname"], $_GET["ou"]);
    $datas = $main->GET_BIGDATA("hash_smtp_restrictions");
    $restrictions = unserialize(base64_decode($datas));
    $EnablePostfixAntispamPack_value = $restrictions["EnablePostfixAntispamPack"];
    $reject_forged_mails = $restrictions['reject_forged_mails'];
    //$whitelists=Paragraphe("routing-domain-relay.png","{PostfixAutoBlockDenyAddWhiteList}","{PostfixAutoBlockDenyAddWhiteList_explain}","javascript:Loadjs('postfix.iptables.php?white-js=yes')");
    $rollover = CellRollOver();
    $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%>\n\t<img src='img/96-planetes-free.png'>\n\t</td>\n\t<td valign='top'>\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top'>\n\t\t<div class=explain>{smtpd_client_restrictions_text}</div>\n\t</td>\n\t<td valign='top'>\n\t\t{$whitelists}\n\t</td>\n\t</tr>\n\t</table>\n\t\n\t</td>\n\t</tr>\n\t</table>\n\t<div id='smtpd_client_restrictions_div'>\n\t<table cellspacing='0' cellpadding='0' border='0' class='tableView'>\n\t\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("disable_vrfy_command", 1, $restrictions["disable_vrfy_command"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{disable_vrfy_command}</td>\n\t<td valign='middle' width=1%>" . help_icon("{disable_vrfy_command_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_unknown_client_hostname", 1, $restrictions["reject_unknown_client_hostname"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_unknown_client_hostname}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_unknown_client_hostname_text}") . "</td>\n\t</tr>\n\t\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_unknown_reverse_client_hostname", 1, $restrictions["reject_unknown_reverse_client_hostname"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_unknown_reverse_client_hostname}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_unknown_reverse_client_hostname_text}") . "</td>\n\t</tr>\n\t\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_unknown_sender_domain", 1, $restrictions["reject_unknown_sender_domain"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_unknown_sender_domain}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_unknown_sender_domain_text}") . "</td>\n\t</tr>\n\t\n\t<tr >\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_invalid_hostname", 1, $restrictions["reject_invalid_hostname"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_invalid_hostname}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_invalid_hostname_text}") . "</td>\n\t</tr>\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_non_fqdn_sender", 1, $restrictions["reject_non_fqdn_sender"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_non_fqdn_sender}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_non_fqdn_sender_text}") . "</td>\n\t</tr>\n\t<tr >\n\t<td valign='middle' width=1%>" . Field_checkbox("reject_forged_mails", 1, $reject_forged_mails) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{reject_forged_mails}</td>\n\t<td valign='middle' width=1%>" . help_icon("{reject_forged_mails_text}") . "</td>\n\t</tr>\t\n\t\n\t\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("EnablePostfixAntispamPack", 1, $EnablePostfixAntispamPack_value) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{EnablePostfixAntispamPack}</td>\n\t<td valign='middle' width=1%>" . help_icon("{EnablePostfixAntispamPack_text}") . "</td>\n\t</tr>\t\n\n\t<tr>\n\t<td valign='middle' width=1%>" . Field_checkbox("EnablePostfixInternalDomainsCheck", 1, $restrictions["EnablePostfixInternalDomainsCheck"]) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{EnablePostfixInternalDomainsCheck}</td>\n\t<td valign='middle' width=1%>" . help_icon("{EnablePostfixInternalDomainsCheck_text}") . "</td>\n\t</tr>\t\n\t<tr class=oddRow>\n\t<td valign='middle' width=1%>" . Field_checkbox("RestrictToInternalDomains", 1, $restrictions["RestrictToInternalDomains"], null, null) . "</td>\n\t<td valign='middle' style='font-size:14px;text-transform:capitalize'>{RestrictToInternalDomains}</td>\n\t<td valign='middle' width=1%>" . help_icon("{RestrictToInternalDomains_text}") . "</td>\n\t</tr>\t\t\n\t\n\t\n\t</table>\n\t</div>\n<hr>\n\t<div style='width:100%;text-align:right'>\n\t" . button("{edit}", "smtpd_client_restrictions_multi_save()") . "\n\t\n\t</div>\t\n\t";
    //smtpd_client_connection_rate_limit = 100
    //smtpd_client_recipient_rate_limit = 20
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html, "postfix.index.php");
}
Exemple #26
0
function events()
{
    if (!is_file('ressources/logs/php.log')) {
        $tpl = new templates();
        echo $tpl->_ENGINE_parse_body("alert('{error_no_datas}');");
        return false;
    }
    $datas = explode("\n", file_get_contents("ressources/logs/php.log"));
    if (!is_array($datas)) {
        $tpl = new templates();
        echo $tpl->_ENGINE_parse_body("alert('{error_no_datas}');");
        return false;
    }
    rsort($datas);
    $html = "<table style='width:99%'>";
    while (list($num, $val) = each($datas)) {
        if (trim($datas) == null) {
            continue;
        }
        if (preg_match("#\\[(.+?)\\]\\s+([0-9:]+)\\s+(.+)#", $val, $re)) {
            $d = $re[1];
            $t = $re[2];
            $e = trim($re[3]);
        } else {
            if (preg_match('#([0-9A-Za-z\\-])\\s+([0-9:]+)\\s+(.+)#', $val, $re)) {
                $d = $re[1];
                $t = $re[2];
                $e = trim($re[3]);
            } else {
                if (preg_match("#\\[(.+?)\\s+([0-9:]+)\\]\\s+(.+)#", $val, $re)) {
                    $d = $re[1];
                    $t = $re[2];
                    $e = trim($re[3]);
                } else {
                    $d = "&nbsp;";
                    $t = "&nbsp;";
                    $e = trim($val);
                }
            }
        }
        if ($e == null) {
            continue;
        }
        $t = str_replace("PHP", '', $t);
        $html = $html . "<tr " . CellRollOver() . ">\n\t\t<td width=1% nowrap valign='top' style='border-bottom:1px dotted #CCCCCC'><code style='font-size:11px'>{$d}</code></td>\n\t\t<td  width=1% valign='top' nowrap style='border-bottom:1px dotted #CCCCCC'><code style='font-size:11px' >{$t}</code></td>\n\t\t<td style='border-bottom:1px dotted #CCCCCC'><code style='font-size:11px' >" . htmlspecialchars($e) . "</code></td>\n\t\t</tr>\n\t\t";
    }
    echo $html . "</table>";
}
function popup_select_days()
{
    $q = new mysql();
    $sql = "SELECT DATE_FORMAT(zDate,'%Y-%m-%d') as tday ,DATE_FORMAT(zDate,'%W %d %M %Y') as tdayS\nFROM `dansguardian_events`  GROUP BY tday,tdayS ORDER BY tday DESC";
    $html = "\n<h1>{days}</H1>\n<div style='width:100%;height:250px;overflow:auto'>";
    $t = "\n<table style='width:100%'>";
    $results = $q->QUERY_SQL($sql, "artica_events");
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        $cel = CellRollOver("DansGuardianStatsLoadMainPageDay('{$ligne["tday"]}');");
        $t = $t . "\n\t<tr {$cel}>\n\t\t<td><code style='font-size:12px'>{$ligne["tday"]}</td>\n\t\t<td><code style='font-size:12px'>{$ligne["tdayS"]}</td>\n\t</tr>\n\t";
    }
    $t = RoundedLightWhite($t . "</table>");
    $html = $html . $t;
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Exemple #28
0
function nsfacls($folder)
{
    $nfs = new nfs();
    $array = $nfs->main_array[$folder]["C"];
    if (!is_array($array)) {
        return "\n\t<h3>{$folder}</H3>\n\t<p class=caption>{share_this_NFS_explain}</p>";
    }
    $arraacls = array("ro" => "{read}", "rw" => "{write}");
    $html = "<div style='height:250px;overflow:auto;width:100%'>\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<th>&nbsp;</th>\n\t\t\t<th>{computer}</th>\n\t\t\t<th>{access}</th>\n\t\t\t<th>&nbsp;</th>\n\t\t\t<th>&nbsp;</th>\n\t\t</tr>";
    while (list($user, $acl) = each($array)) {
        $html = $html . "<tr " . CellRollOver() . ">\n\t\t<td width=1%><img src='img/base.gif'></td>\n\t\t<td><code style='font-size:13px'>{$user}</td>\n\t\t<td width=1%><code style='font-size:13px'>" . Field_array_Hash($arraacls, "acl_{$user}", $acl) . "</td>\n\t\t<td width=1%><input type='button' OnClick=\"javascript:SaveAcl('{$user}');\" value='{edit}&nbsp;&raquo;'></td>\n\t\t<td width=1%>" . imgtootltip('ed_delete.gif', "{delete}", "NFSComputerDelete('{$user}')") . "</td>\n\t\t</tr>\n\t\n\t";
    }
    $html = $html . "</table></div>";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html);
}
Exemple #29
0
function mailman_lists()
{
    $ldap = new clladp();
    $user = new usersMenus();
    if ($user->AsPostfixAdministrator == false) {
        $filter = "(&(Objectclass=ArticaMailManClass)(cn=*)(mailmanouowner={$_GET["ou"]}))";
    } else {
        $filter = "(&(Objectclass=ArticaMailManClass)(cn=*))";
    }
    $sr = @ldap_search($ldap->ldap_connection, "cn=mailman,cn=artica,{$ldap->suffix}", $filter, array("mailmanouowner", "cn", "MailmanListOperation"));
    if ($sr) {
        $html = "<table style=width:100%'>\n\t\t<tr style='background-color:#CCCCCC'>\n\t\t<td>&nbsp;</td>\n\t\t<td><strong>{name}</strong></td>\n\t\t<td><strong>{organization}</strong></td>\n\t\t<td><strong>{address}</strong></td>\n\t\t<td>&nbsp;</td>\n\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t";
        $hash = ldap_get_entries($ldap->ldap_connection, $sr);
        if ($hash["count"] > 0) {
            //	print_r($hash);
            for ($i = 0; $i < $hash["count"]; $i++) {
                $mailmanouowner = $hash[$i]["mailmanouowner"][0];
                $name = $hash[$i]["cn"][0];
                $MailmanListOperation = $hash[$i][strtolower("MailmanListOperation")][0];
                $delete = "<td width=1%>" . imgtootltip('x.gif', '{delete}', "mailman_delete_list('{$name}');") . "</td>";
                if ($mailmanouowner != "undefined") {
                    $address = "<td width=1% align='center'>" . imgtootltip('outicon_1002.gif', "{$name} {address}", "mailman_addresses('{$name}')") . "</td>";
                } else {
                    $address = "<td width=1% align='center'>" . imgtootltip('icon_mini_off.gif', "{error_no_ou_saved}", "") . "</td>";
                }
                $ico = "status_ok.png";
                $cell = CellRollOver("LoadMailmanListSettings('{$name}')");
                if ($MailmanListOperation == "ADD") {
                    $ico = "status_warning.png";
                    $cell = CellRollOver("mailman_applysettings('{$name}')", '{mailman_waiting_replication}');
                }
                if ($MailmanListOperation == "DEL") {
                    $ico = "status_warning.png";
                    $cell = CellRollOver("mailman_applysettings('{$name}')", '{mailman_waiting_replication}');
                    $style = "style='color:#CCCCCC'";
                }
                $html = $html . "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=1%><img src='img/{$ico}'></td>\n\t\t\t\t\t\t<td {$cell}><strong {$style}>{$name}</strong></td>\n\t\t\t\t\t\t<td {$cell}><strong {$style}>{$mailmanouowner}</strong></td>\n\t\t\t\t\t\t{$address}\n\t\t\t\t\t\t{$delete}\n\t\t\t\t\t\t<td width=1% align='center'>" . imgtootltip('icon_sync.gif', "{$name} {apply_settings}", "mailman_applysettings('{$name}')") . "</td>\n\t\t\t\t\t</tr>\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t";
            }
        }
        $html = $html . "</table>";
    }
    if ($html) {
        $html = RoundedLightGrey($html);
        $tpl = new templates();
        echo $tpl->_ENGINE_parse_body($html);
    }
}
function mynetworks_table()
{
    $sql = "SELECT * FROM postfix_multi WHERE `key`='mynetworks' AND `ou`='{$_GET["ou"]}' ORDER BY ID DESC;";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_backup");
    $style = CellRollOver();
    $html = $html . "\n\t\t<center>\n\t\t<table class=form align='center' style='width:99%'>";
    while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
        if (trim($ligne["value"]) == null) {
            continue;
        }
        $html = $html . "\n\t\t<tr " . CellRollOver() . ">\n\t\t\t<td width=1%><img src='img/network-1.gif'></td>\n\t\t\t<td style='font-size:13px'>{$ligne["value"]}</td>\n\t\t\t<td  width=1%>" . imgtootltip('x.gif', '{delete} {network}', "PostFixDeleteMyNetwork({$ligne["ID"]})") . "</td>\n\t\t</tr>";
    }
    $html = $html . "</table>\n\t</center>";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html);
}