Esempio n. 1
0
function tweaks()
{
    if (GET_CACHED(__FILE__, __FUNCTION__, null)) {
        return;
    }
    $sock = new sockets();
    $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance");
    $users = new usersMenus();
    $page = CurrentPageName();
    $tpl = new templates();
    if ($users->ALTERMIME_INSTALLED) {
        $altermime = Paragraphe('icon_settings-64.png', '{disclaimer}', '{disclaimer_text}', "javascript:Loadjs('amavis.index.php?altermime-js=yes')", 90);
    } else {
        //$altermime=ParagrapheTEXT_disabled('icon_settings-48.png','{disclaimer}','{disclaimer_text}',null,90);
    }
    if ($users->POMMO_INSTALLED) {
        $pommo = Paragraphe('64-pommo.png', '{APP_POMMO}', '{APP_POMMO_TEXT}', "javascript:Loadjs('pommo.index.php?pommo-js=yes')", 90);
    } else {
        //$pommo=ParagrapheTEXT_disabled('48-pommo.png','{APP_POMMO}','{APP_POMMO_TEXT}',null,90);
    }
    if ($users->zip_installed) {
        if ($users->AMAVIS_INSTALLED) {
            if ($users->EnableAmavisDaemon == 1) {
                $winzip = Paragraphe('64-winzip.png', '{auto-compress}', '{auto-compress_text}', "javascript:Loadjs('auto-compress.php?script=winzip')", 90);
            }
        }
    }
    if ($users->POSTMULTI) {
        $multi = Paragraphe('postfix-multi-64.png', '{POSTFIX_MULTI_INSTANCE}', '{POSTFIX_MULTI_INSTANCE_TINY_TEXT}', "javascript:Loadjs('postfix.network.php?POSTFIX_MULTI_INSTANCE_JS=yes')", 90);
    } else {
        //$multi=ParagrapheTEXT_disabled('postfix-multi-48.png','{POSTFIX_MULTI_INSTANCE}','{POSTFIX_MULTI_INSTANCE_TINY_TEXT}',null,90);
    }
    if ($users->MEM_TOTAL_INSTALLEE < 700000) {
        $multi = ParagrapheTEXT_disabled('postfix-multi-64.png', '{POSTFIX_MULTI_INSTANCE}', '{POSTFIX_MULTI_INSTANCE_TINY_TEXT}', null, 90);
        $multi = null;
    }
    $postfixStop = Paragraphe('pause-64.png', '{stop_messaging}', '{stop_messaging_text}', "javascript:Loadjs('postfix.stop.php',true)", 90);
    //$postfix_restrictions_classes=Paragraphe('folder-64-restrictions-classes.png','{postfix_restrictions_classes}','{restriction_classes_minitext}',"javascript:Loadjs('postfix.restrictions.classes.php?js=yes')",90);
    $events = Paragraphe('64-mailevents.png', '{postfix_events}', '{logs_viewer_text}', "javascript:s_PopUp('postfix.events.php?pop=true',450,400)", 90);
    //$storage=Paragraphe('folder-storage2-64.png','{storage_rules}','{storage_rules_text}',"javascript:Loadjs('postfix.storage.rules.php')",90);
    //$main_src=Paragraphe('folder-script-database-64.png','{main_ldap}','{main_ldap_explain}',"javascript:s_PopUp(\"postfix.report.php\",500,500,true)",90);
    $watchdog_queue = Paragraphe('folder-watch-64.png', '{watchdog_queue}', '{watchdog_queue_text}', "javascript:Loadjs('postfix.postqueuep.php',true)", 90);
    $postmaster = Paragraphe('postmaster-64.png', '{postmaster}', '{postmaster_text}', "javascript:Loadjs('postfix.postmaster.php')", 90);
    $postmaster_identity = Paragraphe('postmaster-identity.png', '{postmaster_identity}', '{postmaster_identity_text}', "javascript:Loadjs('postfix.postmaster-ident.php',true)", 90);
    $UnknownUsers = Paragraphe('unknown-user-64.png', '{unknown_users}', '{postfix_unknown_users_tinytext}', "javascript:Loadjs('postfix.luser_relay.php',true)", 90);
    $RemoveMessaging = Paragraphe('delete-64.png', '{disable_messaging}', '{disable_messaging_text}', "javascript:Loadjs('postfix.disable.php',true)", 90);
    $ActiveDirectory = Paragraphe('wink-64.png', '{active_directory_link}', '{active_directory_linkmail_text}', "javascript:Loadjs('{$page}?active_directory_link=yes')", 90);
    //$massmailing=ParagrapheTEXT_disabled('mass-mailing-postfix-48.png','{emailings}','{ENABLE_MASSMAILING_TEXT}',null,90);
    if ($users->EMAILRELAY_INSTALLED) {
        $massmailing = Paragraphe('mass-mailing-postfix-64.png', '{emailings}', '{ENABLE_MASSMAILING_TEXT}', "javascript:Loadjs('postfix.massmailing.php',true)", 90);
    }
    //$multi_infos=ParagrapheTEXT_disabled('postfix-multi-48-info.png','{POSTFIX_MULTI_INSTANCE_INFOS}',
    ///'{POSTFIX_MULTI_INSTANCE_INFOS_TEXT}',null,90);
    if ($EnablePostfixMultiInstance == 1) {
        $main_src = null;
        $performances = ParagrapheTEXT_disabled('folder-performances-64.png', '{performances_settings}', '{performances_settings_text}', null, 90);
        $performances = null;
        $mastercf = null;
        $maincfedit = null;
        $maincf = null;
        $postfix_restrictions_classes = null;
        $storage = null;
        $other = null;
        $multi_infos = Paragraphe('postfix-multi-64-info.png', '{POSTFIX_MULTI_INSTANCE_INFOS}', '{POSTFIX_MULTI_INSTANCE_INFOS_TEXT}', "javascript:Loadjs('postfix.multiple.instances.infos.php')");
        $postfixStop = Paragraphe('pause-64-grey.png', '{stop_messaging}', '{stop_messaging_text}', "", 90);
    }
    $q = new mysql();
    $table_storage = $q->TABLE_STATUS("storage", "artica_backup");
    if ($table_storage["Rows"] > 0) {
        $backup_query = Paragraphe('64-backup.png', "{$table_storage["Rows"]} {backuped_mails}", '{all_mailbackup_text}', "javascript:Loadjs('domains.backup.php?js=yes&Master=yes')");
    }
    if ($users->MAILMAN_INSTALLED) {
        $mailman = Paragraphe('mailman-64.png', '{APP_MAILMAN}', '{manage_distribution_lists}', "javascript:Loadjs('mailman.php?script=yes')");
    }
    $tr[] = $multi;
    $tr[] = $multi_infos;
    $tr[] = $postfixStop;
    $tr[] = $RemoveMessaging;
    $tr[] = $watchdog_queue;
    $tr[] = $massmailing;
    $tr[] = $pommo;
    $tr[] = $postmaster;
    $tr[] = $postmaster_identity;
    $tr[] = $UnknownUsers;
    $tr[] = $backup_query;
    $tr[] = $mailman;
    $tr[] = $events;
    $tr[] = $altermime;
    $tr[] = $maincf;
    $tr[] = $main_src;
    $tr[] = $maincfedit;
    $tr[] = $mastercf;
    $tr[] = $storage;
    $tr[] = $postfix_restrictions_classes;
    $tr[] = $other;
    $icons = CompileTr2($tr, 'form');
    $refresh = "<div style='width:100%;text-align:right'>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshIndexPostfixAjax()") . "</div>";
    $main = "<input type='hidden' id='monitor_page' value='1' name='monitor_page'>\n{$refresh}\n<table style='width:100%'>\n<tbody>\n<tr>\n\t<td style='width:99%'>{$icons}</td>\n\t<td style='vertical-align:top'><div id='Postfixservinfos' style='width:450px'></div>\n</tr>\n</tbody>\n</table>\n";
    $html = "{$main}\n\n<script>\n\t\t\n</script>\n";
    $datas = $tpl->_ENGINE_parse_body($html);
    $datas = $datas . "\n<script>\n\tLoadAjax('Postfixservinfos','{$page}?postfix-status=yes');\n</script>\n";
    SET_CACHED(__FILE__, __FUNCTION__, null, $datas);
    return $datas;
}
Esempio n. 2
0
function mysql_toolbox()
{
    $tpl = new templates();
    $free = new freeweb($_GET["servername"]);
    if ($free->useMysql == 0) {
        $browse = ParagrapheTEXT_disabled("table-show-48.png", "{browse_database}", "{browse_database_mysql_text}");
    } else {
        $js = "YahooWin4('650','mysql.browse.php?database={$free->mysql_database}&instance-id={$free->mysql_instance_id}','&raquo;{$free->mysql_database}');";
        $browse = ParagrapheTEXT("table-show-48.png", "{browse_database}", "{browse_database_mysql_text}", "javascript:{$js}");
    }
    echo $tpl->_ENGINE_parse_body("<div style='width:210px;margin-rigth:5px'>{$browse}</div>");
}
Esempio n. 3
0
function popup()
{
    $t = time();
    $html = "<div id='{$t}'></div>\n\t<script>\n\t\tLoadAjax('{$t}','freeweb.edit.main.php?servername={$_GET["servername"]}&force-groupware={$_GET["force-groupware"]}&t={$_GET["t"]}');\n\t</script>\n\t\n\t\n\t";
    echo $html;
    return;
    $sql = "SELECT * FROM freeweb WHERE servername='{$_GET["servername"]}'";
    $page = CurrentPageName();
    $users = new usersMenus();
    $tpl = new templates();
    $q = new mysql();
    $sock = new sockets();
    $APACHE_PROXY_MODE = 0;
    $DNS_INSTALLED = false;
    $remove_sql = false;
    $OnlyWebSite = false;
    $countloops = countloops();
    $no_usersameftpuser = $tpl->javascript_parse_text("{no_usersameftpuser}");
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    $error_field_max_length = $tpl->javascript_parse_text("{error_field_max_length}");
    $error_please_fill_field = $tpl->javascript_parse_text("{error_please_fill_field}");
    $acl_dstdomain = $tpl->javascript_parse_text("{acl_dstdomain}");
    $mysql_database = $tpl->javascript_parse_text("{mysql_database}");
    $username = $tpl->javascript_parse_text("{username}");
    $password = $tpl->javascript_parse_text("{password}");
    $vgservices = unserialize(base64_decode($sock->GET_INFO("vgservices")));
    $checkboxes = 1;
    $ButtonName = "{apply}";
    if ($ligne["groupware"] == "cachemgr") {
        $checkboxes = 0;
    }
    $users = new usersMenus();
    $PUREFTP_INSTALLED = 1;
    if (!$users->PUREFTP_INSTALLED) {
        $PUREFTP_INSTALLED = 0;
    }
    $ServerIPVAL = trim($ligne["ServerIP"]);
    $ServerPort = trim($ligne["ServerPort"]);
    $UseDefaultPort = 0;
    if ($users->APACHE_PROXY_MODE) {
        $APACHE_PROXY_MODE = 1;
    }
    $parcourir_domaines = "<input type='button' OnClick=\"javascript:Loadjs('browse.domains.php?field=domainname')\" value='{browse}...'>";
    if ($users->dnsmasq_installed) {
        $DNS_INSTALLED = true;
    }
    if ($users->POWER_DNS_INSTALLED) {
        $DNS_INSTALLED = true;
    }
    $FreeWebDisableSSL = trim($sock->GET_INFO("FreeWebDisableSSL"));
    if (!is_numeric($FreeWebDisableSSL)) {
        $FreeWebDisableSSL = 0;
    }
    $check_configuration = $tpl->_ENGINE_parse_body("{check_configuration}");
    $webservice = $tpl->_ENGINE_parse_body("{webservice}");
    $ServerIPVAL = "{$ServerIPVAL}:{$ServerPort}";
    if ($vgservices["freewebs"] != null) {
        if (!is_numeric($ligne["lvm_size"])) {
            $ligne["lvm_size"] = 5000;
        }
        if ($ligne["lvm_vg"] == null) {
            $ligne["lvm_vg"] = $vgservices["freewebs"];
        }
        $sizelimit = "\n\t\t<tr>\n\t\t<td class=legend>{size}:</td>\n\t\t<td style='font-size:13px;'>" . Field_text("vg_size", $ligne["lvm_size"], "font-size:13px;padding:3px;width:60px") . "&nbsp;MB</td>\n\t\t<td>&nbsp;</td>\n\t\t</tr>";
    }
    $freeweb = new freeweb($_GET["servername"]);
    $groupwarelink = $freeweb->groupwares_InstallLink();
    $groupwares_textintro = $freeweb->groupwares_textintro();
    if ($groupwarelink != null) {
        $explain = "\n\t\t<div class=explain>{$groupwares_textintro}:<br><strong style='font-size:14px'>\n\t\t\t<a href=\"javascript:blur()\" OnClick=\"javascript:s_PopUpFull('{$groupwarelink}',1024,768)\" style='text-decoration:underline;font-weight:bold;color:#969696'>{$groupwarelink}</a></strong></div>\t\t\n\t\t";
    }
    $img = "website-64.png";
    if ($_GET["force-groupware"] != null) {
        $vhosts = new vhosts();
        $img = $vhosts->IMG_ARRAY_64[$_GET["force-groupware"]];
        $imgtitle = "<div style='font-size:14px;font-weight:bold'>{" . $vhosts->TEXT_ARRAY[$_GET["force-groupware"]]["TITLE"] . "}</div>";
        if ($_GET["force-groupware"] == "ZARAFA") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($_GET["force-groupware"] == "Z-PUSH") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($_GET["force-groupware"] == "ZARAFA_MOBILE") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($_GET["force-groupware"] == "ROUNDCUBE") {
            $OnlyWebSite = true;
        }
    }
    if ($_GET["servername"] == null) {
        $ButtonName = "{add}";
    }
    $freeweb = new freeweb($_GET["servername"]);
    if ($ligne["domainname"] == null) {
        $dda = explode(".", $ligne["servername"]);
        $hostname = $dda[0];
        unset($dda[0]);
        $domainname = @implode(".", $dda);
    } else {
        $ff = explode(".", $ligne["servername"]);
        if (count($ff) > 2) {
            $hostname = str_replace(".{$ligne["domainname"]}", "", $ligne["servername"]);
        } else {
            $hostname = null;
        }
        $domainname = $ligne["domainname"];
        $parcourir_domaines = null;
    }
    if ($hostname == "_default_") {
        $parcourir_domaines = null;
    }
    if ($DNS_INSTALLED) {
        include_once dirname(__FILE__) . "/ressources/class.system.network.inc";
        include_once dirname(__FILE__) . "/ressources/class.pdns.inc";
        $pdns = new pdns();
        if ($ligne["servername"] == null) {
            $ip = new networking();
            $ips = $ip->ALL_IPS_GET_ARRAY();
            $ips[null] = "{none}";
            $dns_field = "<tr>\n\t\t\t\t<td class=legend nowrap>{dns_entry}:</td>\n\t\t\t\t<td>" . Field_array_Hash($ips, "ADD_DNS_ENTRY", null, "style:font-size:14px") . "</td>\n\t\t\t\t<td>" . help_icon("freeweb_add_dns_entry_explain") . "</td>\n\t\t\t</tr>";
        } else {
            $hostip = $pdns->GetIp($ligne["servername"]);
            if ($hostip != null) {
                $dns_field = "<tr>\n\t\t\t\t<td class=legend nowrap>{dns_entry}:</td>\n\t\t\t\t<td style='font-size:14px'>{$hostip}</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>";
            } else {
                $ip = new networking();
                $ips = $ip->ALL_IPS_GET_ARRAY();
                $ips[null] = "{none}";
                $dns_field = "<tr>\n\t\t\t\t<td class=legend nowrap>{dns_entry}:</td>\n\t\t\t\t<td>" . Field_array_Hash($ips, "ADD_DNS_ENTRY", null, "style:font-size:14px") . "</td>\n\t\t\t\t<td>" . help_icon("freeweb_add_dns_entry_explain") . "</td>\n\t\t\t</tr>";
            }
        }
    }
    $domain = "<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td>" . Field_text("servername", $hostname, "font-size:15px;padding:3px;font-weight:bold;width:90px") . "</td>\n\t\t\t<td style='font-size:14px' align='center' width=1%>&nbsp;.&nbsp;</td>\n\t\t\t<td>" . Field_text("domainname", $domainname, "font-size:15px;padding:3px;width:220px;font-weight:bold") . "</td>\n\t\t\t<td>{$parcourir_domaines}</td>\n\t\t</tr>\n\t\t</table>";
    if (!$users->AsSystemAdministrator) {
        if ($ligne["domainname"] == null) {
            $dd = explode(".", $ligne["servername"]);
            $hostname = $dd[0];
            unset($dd[0]);
            $domainname = @implode(".", $dd);
        } else {
            $ff = explode(".", $ligne["servername"]);
            if (count($ff) > 2) {
                $hostname = str_replace(".{$ligne["domainname"]}", "", $ligne["servername"]);
            } else {
                $hostname = null;
            }
            $domainname = $ligne["domainname"];
        }
        $ldap = new clladp();
        $domains = $ldap->Hash_domains_table($_SESSION["ou"]);
        while (list($a, $b) = each($domains)) {
            $c[$a] = $a;
        }
        $domain = "\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td>" . Field_text("servername", $hostname, "font-size:15px;padding:3px;font-weight:bold;width:90px") . "</td>\n\t\t\t<td style='font-size:14px' align='center' width=1%>&nbsp;.&nbsp;</td>\n\t\t\t<td>" . Field_array_Hash($c, "domainname", $domainname, "style:font-size:15px;padding:3px;font-weight:bold;width:220px;") . "</td>\n\t\t</tr>\n\t\t</table>";
    }
    $NewServer = 0;
    $reconfigure = ParagrapheTEXT("48-settings-refresh.png", "{rebuild}", "{rebuild_apache_text}", "javascript:FreeWebsRebuildvHosts()");
    if (trim($ligne["servername"] == null)) {
        $reconfigure = ParagrapheTEXT_disabled("48-settings-refresh.png", "{rebuild}", "{rebuild_apache_text}");
        $NewServer = 1;
    }
    if ($NewServer == 0) {
        $domain = "<div style='font-size:16px'>{$ligne["servername"]}</div>\n\t\t\t<input type='hidden' value='{$ligne["servername"]}' id='servername'>\n\t\t\t<input type='hidden' value='{$ligne["domainname"]}' id='domainname'>";
    }
    if ($ligne["groupware"] != null) {
        $apache = new vhosts();
        $img = $apache->IMG_ARRAY_64[$ligne["groupware"]];
        $rebuild_groupware = ParagrapheTEXT("setup-icon-48.png", "{software}", "{rebuild_apache_groupware_text}", "javascript:FreeWebsRebuildGroupware()");
        $sql = "SELECT ID FROM drupal_queue_orders WHERE `ORDER`='REBUILD_GROUPWARE' AND `servername`='{$servername}'";
        $ligneDrup = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
        if (!is_numeric($ligneDrup["ID"])) {
            $ligneDrup["ID"] = 0;
        }
        if ($ligneDrup["ID"] > 0) {
            $rebuild_groupware = ParagrapheTEXT_disabled("setup-icon-48.png", "{software}", "{rebuild_apache_groupware_text}");
        }
        if ($ligne["groupware"] == "ZARAFA") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($ligne["groupware"] == "Z-PUSH") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($ligne["groupware"] == "ZARAFA_MOBILE") {
            $remove_sql = true;
            $OnlyWebSite = true;
        }
        if ($ligne["groupware"] == "ROUNDCUBE") {
            $OnlyWebSite = true;
        }
        if ($ligne["ForceInstanceZarafaID"] > 0) {
            $_GET["ForceInstanceZarafaID"] = $ligne["ForceInstanceZarafaID"];
        }
    }
    $checksDebug = ParagrapheTEXT("setup-check-icon-48.png", "{check_configuration}", "{check_configuration_text}", "javascript:FreeWebsCheckGroupware()");
    if ($remove_sql) {
        $js_removesql = "HideMysql()";
    }
    if ($OnlyWebSite) {
        $js_OnlyWebSite = "OnlyWebsite()";
    }
    $uid_uri = urlencode(base64_encode($ligne["uid"]));
    $nets = unserialize(base64_decode($sock->GET_INFO("FreeWebsApacheListenTable")));
    $znets[null] = "{default}";
    while (list($num, $ip) = each($nets)) {
        $znets[$num] = $num;
    }
    $ServerIP = Field_array_Hash($znets, 'ServerIP', $ServerIPVAL, null, null, 0, 'font-size:14px;');
    $q = new mysql();
    include_once dirname(__FILE__) . "/ressources/class.squid.reverse.inc";
    $squid_reverse = new squid_reverse();
    $sslcertificates = $squid_reverse->ssl_certificates_list();
    $sslcertificate = Field_array_Hash($sslcertificates, $ligne["sslcertificate"], "style:font-size:14px");
    $html = "\n\t<input type='hidden' id='force-groupware' name ='force-groupware' value='{$_GET["force-groupware"]}'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top' width=1%>\n\t\t\t<center>\n\t\t\t\t<img src='img/{$img}'>{$imgtitle}\n\t\t\t</center><br>\n\t\t\t<div style='width:190px'>\n\t\t\t{$reconfigure}{$rebuild_groupware}{$checksDebug}{$see_config}\n\t\t\t</div>\n\t\t</td>\n\t\t<td valign='top' width=99%>\n\t{$explain}\n\t<div style='font-size:16px'><a href=\"javascript:blur();\" style='font-size:18px;text-decoration:underline;margin-bottom:5px' \n\tOnClick=\"javascript:document.getElementById('block2').style.display='none';document.getElementById('block1').style.display='block';\">{$webservice}:</a></div>\n\t\n\t<div id='freewebdiv'>\n\t\t<div id='block1' style='display:block;'>\n\t\t\t<table style='width:99%' class=form>\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap>{acl_dstdomain}:</td>\n\t\t\t\t<td colspan=2>{$domain}</td>\n\t\t\t</tr>\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap>{listen_address}:</td>\n\t\t\t\t<td colspan=2>{$ServerIP}</td>\n\t\t\t</tr>\t\t\t\t\t\n\t\t\t{$dns_field}\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap>{www_forward}:</td>\n\t\t\t\t<td width=1%>" . Field_checkbox("Forwarder", 1, $ligne["Forwarder"], "CheckForwarder()") . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\t\t\t\t\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap>{reverse_proxy}:</td>\n\t\t\t\t<td width=1%>" . Field_checkbox("UseReverseProxy", 1, $ligne["UseReverseProxy"], "CheckUseReverseProxy()") . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\t\t\n\t\t\t\n\t\t\t<tr> \n\t\t\t\t<td class=legend nowrap>{directory}:</td>\n\t\t\t\t<td>" . Field_text("www_dir", $ligne["www_dir"], "font-size:13px;padding:3px;") . "</td>\n\t\t\t\t<td>" . button_browse("www_dir") . "</td>\n\t\t\t</tr>\t\t\t\n\t\t\t\n\t\t\t{$sizelimit}\n\t\t\t<tr>\n\t\t\t\t<td class=legend nowrap>{UseLoopDisk}:</td>\n\t\t\t\t<td>" . Field_checkbox("UseLoopDisk", 1, $ligne["UseLoopDisk"], "CheckLoops()") . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\n\t\t\t<tr style='height:auto'>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t<td colspan=2 style='height:auto'><span id='loops-list'></span></td></tr>\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{member}:</td>\n\t\t\t\t<td>" . Field_text("www_uid", $ligne["uid"], "font-size:13px;padding:3px;") . "</td>\n\t\t\t\t<td><span id='bb_button'><input type='button' OnClick=\"javascript:Loadjs('user.browse.php?field=www_uid&YahooWin=6')\" value='{browse}...'></span>\n\t\t\t\t<span id='status-uid-www' style='float:right'></span></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{group}:</td>\n\t\t\t\t<td>" . Field_text("www_group", $ligne["gpid"], "font-size:13px;padding:3px;") . "</td>\n\t\t\t\t<td><span id='bb_button1'><input type='button' OnClick=\"javascript:Loadjs('MembersBrowse.php?field-user=www_group&OnlyGroups=1&OnlyGUID=1');\" value='{browse}...'></span>\n\t\t\t\t<span id='status-gpid-www' style='float:right'></span></td>\n\t\t\t</tr>\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{ssl}:</td>\n\t\t\t\t<td>" . Field_checkbox("useSSL", 1, $ligne["useSSL"]) . "</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{certificate}:</td>\n\t\t\t\t<td>{$sslcertificate}</td>\n\t\t\t\t<td>&nbsp;</td>\n\t\t\t</tr>\t\t\t\n\t\t\t</table>\n\t</div>\n\n\t<div style='font-size:16px'><a href=\"javascript:blur();\" style='font-size:18px;text-decoration:underline;margin-bottom:5px' OnClick=\"javascript:document.getElementById('block2').style.display='block';document.getElementById('block1').style.display='none';\">{mysql_database}:</a></div>\n\t<div id='block2' style='display:none;'>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t<td class=legend>{useMySQL}:</td>\n\t\t<td>" . Field_checkbox("useMysql", 1, $ligne["useMysql"], "useMysqlCheck()") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{mysql_instance}:</td>\n\t\t<td><div id='freeweb-mysql-instances'></div></td>\n\t\t<td align='left'>" . imgtootltip("plus-24.png", "{add}:{mysql_instance}", "Loadjs('mysql.multi.php?mysql-server-js=yes&ID=');") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td class=legend>{mysql_database}:</td>\n\t\t<td>" . Field_text("mysql_database", $ligne["mysql_database"], "width:150px;font-size:13px;padding:3px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{mysql_username}:</td>\n\t\t<td>" . Field_text("mysql_username", $ligne["mysql_username"], "width:120px;font-size:13px;padding:3px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{password}:</td>\n\t\t<td>" . Field_password("mysql_password", $ligne["mysql_password"], "width:90px;font-size:13px;padding:3px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3><span style='font-size:16px'>{ftp_access}<hr style='border-color:005447'></td>\n\t</tr>\t\n\t\n\t\n\t<tr>\n\t\t<td class=legend>{allowftp_access}:</td>\n\t\t<td>" . Field_checkbox("useFTP", 1, $ligne["useFTP"], "useMysqlCheck()") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td class=legend>{ftp_user}:</td>\n\t\t<td>" . Field_text("ftpuser", $ligne["ftpuser"], "width:120px;font-size:13px;padding:3px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t<tr>\n\t\t<td class=legend>{password}:</td>\n\t\t<td>" . Field_password("ftppassword", $ligne["ftppassword"], "width:90px;font-size:13px;padding:3px") . "</td>\n\t\t<td>&nbsp;</td>\n\t</tr>\t\n\t</table>\n\t\n\n\t\n\t<div id='block3' style='display:none'>\n\t\t<table style='width:99%' class=form>\n\t\t<tr>\n\t\t\t<td class=legend>{www_ForwardTo}:</td>\n\t\t\t<td>" . Field_text("ForwardTo", $ligne["ForwardTo"], "width:270px;font-size:14px;padding:3px") . "</td>\n\t\t\t<td>&nbsp;</td>\n\t\t</tr>\n\t\t</table>\t\n\t</div>\t\n\t</div>\n\t\n\t<div style='width:100%;text-align:right'><hr>" . button("{$ButtonName}", "SaveFreeWebMain()", 18) . "</div>\n\n\n\n\t\n\t\n\t</td>\n\t</tr>\n\t</table>\n<script>\n\n\tfunction CheckDatas(){\n\t\tvar APACHE_PROXY_MODE={$APACHE_PROXY_MODE};\n\t\tvar FreeWebDisableSSL={$FreeWebDisableSSL};\n\t\t \n\t\t\n\t\tif(APACHE_PROXY_MODE==0){\n\t\t\tdocument.getElementById('UseReverseProxy').checked=false;\n\t\t\tdocument.getElementById('UseReverseProxy').disabled=true;\n\t\t}\n\t\t\n\t\tvar x=document.getElementById('servername').value;\n\t\tvar z=document.getElementById('domainname').value;\n\t\tvar w=x.length+z.length;\n\t\tif(w>0){\n\t\t\tdocument.getElementById('servername').disabled=true;\n\t\t\tdocument.getElementById('domainname').disabled=true;\n\t\t\t}\n\t\tvar x=document.getElementById('mysql_database').value;\n\t\tif(x.length>0){document.getElementById('mysql_database').disabled=true;}\t\n\n\t\tif(FreeWebDisableSSL==1){\n\t\t\tdocument.getElementById('useSSL').disabled=true;\n\t\t}\n\t\t\n\t}\n\t\n\n\t\n\tfunction useMysqlCheck(){\n\t\tvar mysql_instance_id=0;\n\t\tvar checkboxes={$checkboxes};\n\t\tvar PUREFTP_INSTALLED={$PUREFTP_INSTALLED};\n\t\tif(document.getElementById('mysql_instance_id')){mysql_instance_id=document.getElementById('mysql_instance_id').value;}\n\t\tdocument.getElementById('useFTP').disabled=true;\n\t\tdocument.getElementById('useMysql').disabled=true;\n\t\t\n\t\tif(checkboxes==1){\n\t\t\tif(PUREFTP_INSTALLED==1){document.getElementById('useFTP').disabled=false;}\n\t\t\tif(mysql_instance_id==0){document.getElementById('useMysql').disabled=false;}\t\n\t\t}\n\t\tif(PUREFTP_INSTALLED==1){\n\t\t\tdocument.getElementById('useFTP').disabled=false;\n\t\t}else{\n\t\t\tdocument.getElementById('useFTP').disabled=true;\n\t\t\tdocument.getElementById('useFTP').checked=false;\n\t\t}\n\t\t\n\t\tdocument.getElementById('mysql_database').disabled=true;\n\t\tdocument.getElementById('mysql_username').disabled=true;\n\t\tdocument.getElementById('mysql_password').disabled=true;\n\t\tdocument.getElementById('ftpuser').disabled=true;\n\t\tdocument.getElementById('ftppassword').disabled=true;\n\t\tif(mysql_instance_id==0){\n\t\t\tif(document.getElementById('useMysql').checked){\n\t\t\t\tvar mysql_database=document.getElementById('mysql_database').value;\n\t\t\t\tif(mysql_database.length==0){document.getElementById('mysql_database').disabled=false;}\n\t\t\t\tdocument.getElementById('mysql_username').disabled=false;\n\t\t\t\tdocument.getElementById('mysql_password').disabled=false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(mysql_instance_id==1){\n\t\t\tdocument.getElementById('mysql_database').disabled=false;\n\t\t}\n\t\t\n\t\tif(!document.getElementById('useFTP').checked){return;}\n\t\tdocument.getElementById('ftpuser').disabled=false;\n\t\tdocument.getElementById('ftppassword').disabled=false;\t\t\n\t\t\n\t\t\n\t}\n\t\n\tfunction CheckForwarder(){\n\t\tif(document.getElementById('Forwarder').checked){\n\t\t\tdocument.getElementById('block2').style.display='none';\n\t\t\tdocument.getElementById('block3').style.display='block';\n\t\t\tdocument.getElementById('UseReverseProxy').disabled=true;\n\t\t\tdocument.getElementById('UseLoopDisk').disabled=true;\n\t\t}else{\n//\t\t\tdocument.getElementById('block2').style.display='block';\n\t\t\tdocument.getElementById('block3').style.display='none';\n\t\t\tdocument.getElementById('UseReverseProxy').disabled=false;\n\t\t\tdocument.getElementById('UseLoopDisk').disabled=false;\n\t\t\tCheckLoops();\n\t\t}\n\t\n\t}\n\t\t\n\tfunction FreeWebsRebuildvHosts(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('FreeWebsRebuildvHosts','{$_GET["servername"]}');\n\t\tAnimateDiv('freewebdiv');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveFreeWebMain);\n\t}\n\t\n\tfunction FreeWebsRebuildGroupware(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('FreeWebsRebuildGroupware','{$_GET["servername"]}');\n\t\tAnimateDiv('freewebdiv');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_SaveFreeWebMain);\n\t}\t\t\t\n\n\n\tvar x_SaveFreeWebMain=function (obj) {\n\t\t    var NewServer={$NewServer};\n\t\t\tvar results=obj.responseText;\n\t\t\tif(results.length>0){alert(results);}\t\t\t\n\t\t\tRefreshTab('main_config_freewebedit');\n\t\t\tif(document.getElementById('container-www-tabs')){RefreshTab('container-www-tabs');}\n\t\t\tif(document.getElementById('main_config_freeweb')){RefreshTab('main_config_freeweb');}\n\t\t\tif(document.getElementById('sarg_tabs')){RefreshTab('sarg_tabs');}\n\t\t\t\n\t\t\tif(NewServer==1){YahooWin5Hide();}\n\t\t\t\n\t\t}\t\n\t\t\n\t\tfunction SaveFreeWebMain(){\n\t\t\tvar NewServer={$NewServer};\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tif(NewServer==1){\n\t\t\t\tvar sitename=document.getElementById('servername').value;\n\t\t\t\tvar www_a=document.getElementById('domainname').value;\n\t\t\t\tvar www_b=document.getElementById('servername').value;\n\t\t\t\tvar www_t=www_a.length+www_b.length;\n\t\t\t\tif(www_t<2){\n\t\t\t\t\talert('{$error_please_fill_field}:{$acl_dstdomain}'); \n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif(sitename!=='_default_'){\n\t\t\t\t\tvar x=document.getElementById('domainname').value;\n\t\t\t\t\tif(x.length==0){alert('{$error_please_fill_field}:{$acl_dstdomain}');return;}\n\t\t\t\t}else{\n\t\t\t\t\tdocument.getElementById('domainname').value='';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(document.getElementById('ADD_DNS_ENTRY')){\n\t\t\t\tXHR.appendData('ADD_DNS_ENTRY',document.getElementById('ADD_DNS_ENTRY').value);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(document.getElementById('useMysql').checked){\n\t\t\t\tvar mysql_database=document.getElementById('mysql_database').value;\n\t\t\t\tif(mysql_database.length==0){\n\t\t\t\t\talert('{$error_please_fill_field}:{$mysql_database}');\n\t\t\t\t\treturn;\t\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t\tvar x=document.getElementById('mysql_password').value;\n\t\t\t\tif(x.length==0){\n\t\t\t\t\talert('{$error_please_fill_field}:{$mysql_database}/{$password}');\n\t\t\t\t\treturn;\n\t\t\t\t}\t\n\t\t\t\tvar x=document.getElementById('mysql_username').value;\n\t\t\t\tif(x.length==0){\n\t\t\t\t\talert('{$error_please_fill_field}:{$mysql_database}/{$username}');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(mysql_database.length>16){\n\t\t\t\t\talert('mysql_database:{$error_field_max_length}: 16');\n\t\t\t\t\tdocument.getElementById('mysql_database').disabled=false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(document.getElementById('useSSL').checked){XHR.appendData('useSSL',1);}else{XHR.appendData('useSSL',0);}\n\t\t\tif(document.getElementById('useMysql').checked){XHR.appendData('useMysql',1);}else{XHR.appendData('useMysql',0);}\n\t\t\tif(document.getElementById('useFTP').checked){XHR.appendData('useFTP',1);}else{XHR.appendData('useFTP',0);}\n\t\t\tXHR.appendData('UseDefaultPort',0)\n\t\t\tif(document.getElementById('UseReverseProxy').checked){XHR.appendData('UseReverseProxy',1);}else{XHR.appendData('UseReverseProxy',0);}\n\t\t\tif(document.getElementById('Forwarder').checked){XHR.appendData('Forwarder',1);}else{XHR.appendData('Forwarder',0);}\n\t\t\tXHR.appendData('ForceInstanceZarafaID','{$_GET["ForceInstanceZarafaID"]}');\n\t\t\t\n\t\t\tif(document.getElementById('www_dir')){\n\t\t\t\tXHR.appendData('www_dir',document.getElementById('www_dir').value);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif(document.getElementById('LoopMounts')){\n\t\t\t\tvar LoopMounts=document.getElementById('LoopMounts').value;\n\t\t\t\tif(LoopMounts.length>3){\n\t\t\t\t\tif(document.getElementById('UseLoopDisk').checked){XHR.appendData('UseLoopDisk',1);}else{XHR.appendData('UseLoopDisk',0);}\n\t\t\t\t\tXHR.appendData('LoopMounts',LoopMounts);\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tvar ftpuser=trim(document.getElementById('ftpuser').value);\n\t\t\tvar uid=trim(document.getElementById('www_uid').value);\n\t\t\tif(document.getElementById('useFTP').checked){\t\n\t\t\t\tif(uid==ftpuser){\n\t\t\t\t\talert('{$no_usersameftpuser}');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(document.getElementById('vg_size')){XHR.appendData('vg_size',document.getElementById('vg_size').value);}\n\t\t\tXHR.appendData('lvm_vg','{$ligne["lvm_vg"]}');\n\t\t\tif(NewServer==1){\n\t\t\t\tif(sitename!=='_default_'){\n\t\t\t\t\tvar www_b=document.getElementById('domainname').value;\n\t\t\t\t\tvar www_a=document.getElementById('servername').value;\n\t\t\t\t\tif(www_a.length>0){XHR.appendData('servername',www_a+'.'+www_b);}else{XHR.appendData('servername',www_b);}\n    \t\t\t\t}else{\n    \t\t\t\tXHR.appendData('servername','_default_');\n    \t\t\t}\n    \t\t}\n    \t\tif(NewServer==0){XHR.appendData('servername',document.getElementById('servername').value);}\n    \t\tXHR.appendData('domainname',document.getElementById('domainname').value);\n    \t\tXHR.appendData('uid',uid);\n    \t\tXHR.appendData('gpid',document.getElementById('www_group').value);\n    \t\tXHR.appendData('mysql_instance_id',document.getElementById('mysql_instance_id').value);\n    \t\tXHR.appendData('mysql_database',document.getElementById('mysql_database').value);\n    \t\tXHR.appendData('mysql_password',document.getElementById('mysql_password').value);\n    \t\tXHR.appendData('mysql_username',document.getElementById('mysql_username').value);\n    \t\tXHR.appendData('ftpuser',ftpuser);\n    \t\tXHR.appendData('ftppassword',document.getElementById('ftppassword').value);\n    \t\tXHR.appendData('ForwardTo',document.getElementById('ForwardTo').value);\n    \t\tXHR.appendData('force-groupware',document.getElementById('force-groupware').value);\n    \t\tXHR.appendData('mysql_instance_id',document.getElementById('mysql_instance_id').value);\n    \t\tXHR.appendData('ServerIP',document.getElementById('ServerIP').value);\n    \t\tXHR.appendData('sslcertificate',document.getElementById('sslcertificate').value);\n    \t\t\n    \t\t\n    \t\t\n    \t\tAnimateDiv('freewebdiv');\n    \t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveFreeWebMain);\n\t\t\t\n\t\t}\t\n\t\t\n\tfunction CheckLoops(){\n\t\tvar countloops={$countloops};\n\t\tdocument.getElementById('UseLoopDisk').disabled=true;\n\t\tif(countloops>0){\n\t\t\tdocument.getElementById('UseLoopDisk').disabled=false;\n\t\t}\n\t\tdocument.getElementById('loops-list').innerHTML='';\n\t\t\n\t\tif(document.getElementById('UseLoopDisk').checked){\n\t\t\tif(document.getElementById('vg_size')){\n\t\t\t\tdocument.getElementById('vg_size').disabled=true;\n\t\t\t}\n\t\t\tLoadAjax('loops-list','{$page}?loops-list=yes&servername={$ligne["servername"]}');\n\t\t}\n\t}\n\t\n\t\n\tfunction FreeWebsCheckGroupware(){\n\t\tLoadWinORG2('850','{$page}?FreeWebsCheck=yes&servername={$ligne["servername"]}','{$check_configuration}::{$ligne["servername"]}');\n\t\n\t}\n\t\n\t\t\n\tfunction CheckLoops(){\n\t\tvar countloops={$countloops};\n\t\tdocument.getElementById('UseLoopDisk').disabled=true;\n\t\tif(countloops>0){document.getElementById('UseLoopDisk').disabled=false;}\n\t\tdocument.getElementById('loops-list').innerHTML='';\n\t\t\n\t\tif(document.getElementById('UseLoopDisk').checked){\n\t\t\tif(document.getElementById('vg_size')){\n\t\t\t\tdocument.getElementById('vg_size').disabled=true;\n\t\t\t}\n\t\t\tLoadAjax('loops-list','{$page}?loops-list=yes&servername={$ligne["servername"]}');\n\t\t}\n\t}\n\t\n\tfunction CheckUseReverseProxy(){\n\t\tCheckDatas();\n\t\tuseMysqlCheck();\n\t\tCheckLoops();\n\t\t{$js_removesql};\n\t\t{$js_OnlyWebSite};\n\t}\n\t\n\tfunction HideMysql(){\n\t\tdocument.getElementById('useMysql').disabled=true;\n\t}\n\t\n\tfunction OnlyWebsite(){\n\t\tif(document.getElementById('Forwarder')){document.getElementById('Forwarder').disabled=true;}\n\t\tif(document.getElementById('UseReverseProxy')){document.getElementById('UseReverseProxy').disabled=true;}\n\t\tif(document.getElementById('useFTP')){document.getElementById('useFTP').disabled=true;}\n\t}\n\t\n\tfunction CheckUId(){\n\t\tLoadAjaxTiny('status-uid-www','{$page}?uid-check={$uid_uri}');\n\t}\n\n\t\n\tfunction freeweb_mysql_instances(){\n\t\tLoadAjaxTiny('freeweb-mysql-instances','{$page}?freeweb-mysql-instances-field=yes&servername={$ligne["servername"]}');\n\t\n\t}\n\t\n\tfunction mysql_instance_id_check(){\n\t\t\t\n\t\t\tvar mysql_instance_id=document.getElementById('mysql_instance_id').value;\n\t\t\t\n\t\t\tif(mysql_instance_id>0){\n\t\t\t\tdocument.getElementById('useMysql').disabled=true;\n\t\t\t\tuseMysqlCheck();\n\t\t\t}else{\n\t\t\t\tdocument.getElementById('useMysql').disabled=false;\n\t\t\t\tuseMysqlCheck();\n\t\t\t}\n\t\t}\n\t\t\n\n\t\n\tCheckDatas();\n\tuseMysqlCheck();\n\tCheckLoops();\n\tCheckForwarder();\n\tCheckUId();\n\t{$js_removesql};\n\t{$js_OnlyWebSite};\n\t\n\tfreeweb_mysql_instances();\n\t\n\t</script>\t\t\n\t";
    echo $tpl->_ENGINE_parse_body($html);
}
Esempio n. 4
0
function status()
{
    $users = new usersMenus();
    $tpl = new templates();
    $DeleteAllipTablesRules_text = $tpl->javascript_parse_text("{DeleteAllipTablesRules_text}");
    $page = CurrentPageName();
    if (!$users->AsPostfixAdministrator) {
        $error = $tpl->_ENGINE_parse_body("{ERROR_NO_PRIVS}");
        echo "<H3>{$error}<H3>";
        die;
    }
    for ($i = 0; $i < 91; $i++) {
        $arr_day[$i] = $i;
    }
    $sock = new sockets();
    $EnablePostfixAutoBlock = $sock->GET_INFO("EnablePostfixAutoBlock");
    $InstantIpTablesInLeftMenu = $sock->GET_INFO("InstantIpTablesInLeftMenu");
    if ($InstantIpTablesInLeftMenu == null) {
        $InstantIpTablesInLeftMenu = 1;
    }
    $InstantIptablesEventAll = $sock->GET_INFO("InstantIptablesEventAll");
    if (!is_numeric($InstantIptablesEventAll)) {
        $InstantIptablesEventAll = 1;
    }
    $EnablePostfixAutoBlockWhiteListed = $sock->GET_INFO("EnablePostfixAutoBlockWhiteListed");
    if (!is_numeric($EnablePostfixAutoBlockWhiteListed)) {
        $EnablePostfixAutoBlockWhiteListed = 0;
    }
    $form = Paragraphe_switch_img("{enable_postfix_autoblock}", "{enable_postfix_autoblock_text}", 'EnablePostfixAutoBlock', $EnablePostfixAutoBlock, "{enable_disable}", 330);
    $form = "\n    <div id='EnablePostfixAutoBlockDiv'>\n\t\t\t{$form}\n\t\t\t\n\t\t<table>\n\t\t<tr>\n\t\t\t<td class=legend>{enable_in_left_menus}:</td>\n\t\t\t<td>" . Field_checkbox("InstantIpTablesInLeftMenu", 1, $InstantIpTablesInLeftMenu, "InstantIpTablesInLeftMenuSave()") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{log_all_events}:</td>\n\t\t\t<td>" . Field_checkbox("InstantIptablesEventAll", 1, $InstantIptablesEventAll, "InstantIptablesEventAllSave()") . "</td>\n\t\t</tr>\t\t\n\t\t</table>\n\t\t\t\n\t\t<div style='width:100%;text-align:right;margin-top:8px'>\n\t\t\t" . button("{apply}", "javascript:EnablePostfixAutoBlockDeny()") . "\n\t\t</div>\n\t</div>";
    $PostfixAutoBlockDenyAddWhiteList = $tpl->_ENGINE_parse_body("{PostfixAutoBlockDenyAddWhiteList}", "postfix.index.php");
    $add_whitelist = ParagrapheTEXT("32-bind9-add-zone.png", "{$PostfixAutoBlockDenyAddWhiteList}", "{PostfixAutoBlockDenyAddWhiteList_explain}", "javascript:PostfixAutoBlockDenyAddWhiteList();", null, 337);
    $manage_fw = ParagrapheTEXT("folder-64-firewall.png", "{PostfixAutoBlockManageFW}", "{PostfixAutoBlockManageFW_text}", "javascript:PostfixAutoBlockLoadFW();");
    $compile = ParagrapheTEXT("system-32.png", "{PostfixAutoBlockCompileFW}", "{PostfixAutoBlockCompileFW_text}", "javascript:PostfixAutoBlockCompileFW();", null, 337);
    $parameters = ParagrapheTEXT("32-parameters.png", "{PostfixAutoBlockParameters}", "{PostfixAutoBlockParameters_text}", "javascript:PostfixAutoBlockParameters();");
    $addbann = ParagrapheTEXT("32-bann-server-auto.png", "{bann_smtp_servers}", "{bann_smtp_servers_text}", "javascript:Loadjs('postfix.iptables.php?ban-servers=yes')", null, 337);
    $deletallrules = ParagrapheTEXT("firewall-delete-32.png", "{delete_all_rules}", "{delete_all_rules_iptables_text}", "javascript:DeleteAllRules()", null, 337);
    $whiteListedMode = ParagrapheTEXT("Firewall-Secure-32.png", "{white_listed_mode}", "{instant_iptables_whitelisted_explain}", "javascript:Loadjs('postfix.iptables.whitelistedmode.php')");
    if ($EnablePostfixAutoBlockWhiteListed == 1) {
        $addbann = ParagrapheTEXT_disabled("32-bann-server-auto.png", "{bann_smtp_servers}", "{bann_smtp_servers_text}");
    }
    //$parameters
    //$manage_fw
    $html = "\n\t\t<table style='width:100%;'>\n\t<tr>\n\t\t<td valign='top'>\n\t\t<img src='img/bg_firewall.jpg'>\n\t\t<div style='width:100%;clear:left'>\n\t\t\t<div style='float:left;width:50%'>{$compile}</div>\n\t\t\t<div style='float:left;width:50%'>{$add_whitelist}</div>\n\t\t\t<div style='float:left;width:50%'>{$addbann}</div>\n\t\t\t<div style='float:left;width:50%'>{$whiteListedMode}</div>\n\t\t</div>\t\t\t\t\n\t\t</td>\n\t\t<td valign='top'>\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>{$form}<hr></td>\n\t</tr>\n\t<tr>\n\t<td valign='top'>\n\t\t<div class=explain>{postfix_autoblock_explain}</div>\n\t\t<div id='instantIptables-status'></div>\n\t</td>\n\t</table>\n</td>\n</tr>\n</table>\n\n<script>\n\tvar x_InstantIpTablesInLeftMenuSave= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\tCacheOff();\n\t}\t\n\n\tvar x_DeleteAllRules= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue)};\n\t\t\n\t}\t\n\t\t\n\tfunction InstantIpTablesInLeftMenuSave(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('InstantIpTablesInLeftMenu').checked){XHR.appendData('InstantIpTablesInLeftMenu','1');}else{XHR.appendData('InstantIpTablesInLeftMenu','0');}\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_InstantIpTablesInLeftMenuSave);\t\n\t}\t\n\t\n\tfunction InstantIptablesEventAllSave(){\n\t\tvar XHR = new XHRConnection();\n\t\tif(document.getElementById('InstantIptablesEventAll').checked){XHR.appendData('InstantIptablesEventAll','1');}else{XHR.appendData('InstantIptablesEventAll','0');}\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_DeleteAllRules);\t\t\n\t}\n\t\n\tfunction DeleteAllRules(){\n\t\tif(confirm('{$DeleteAllipTablesRules_text}')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('DeleteAllIpTablesRules','yes');\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_DeleteAllRules);\t\n\t\t}\n\t\n\t}\n\t\n\tLoadAjax('instantIptables-status','{$page}?instantIptables-status=yes');\n\t\n</script>\n\t";
    echo $tpl->_ENGINE_parse_body($html, "postfix.index.php");
}
Esempio n. 5
0
function tweaks()
{
    if (GET_CACHED(__FILE__, __FUNCTION__, null)) {
        return;
    }
    $sock = new sockets();
    $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance");
    $users = new usersMenus();
    $page = CurrentPageName();
    $tpl = new templates();
    if ($users->ALTERMIME_INSTALLED) {
        $altermime = ParagrapheTEXT('icon_settings-48.png', '{disclaimer}', '{disclaimer_text}', "javascript:Loadjs('amavis.index.php?altermime-js=yes')", 90);
    } else {
        $altermime = ParagrapheTEXT_disabled('icon_settings-48.png', '{disclaimer}', '{disclaimer_text}', null, 90);
    }
    if ($users->POMMO_INSTALLED) {
        $pommo = ParagrapheTEXT('48-pommo.png', '{APP_POMMO}', '{APP_POMMO_TEXT}', "javascript:Loadjs('pommo.index.php?pommo-js=yes')", 90);
    } else {
        $pommo = ParagrapheTEXT_disabled('48-pommo.png', '{APP_POMMO}', '{APP_POMMO_TEXT}', null, 90);
    }
    if ($users->zip_installed) {
        if ($users->AMAVIS_INSTALLED) {
            if ($users->EnableAmavisDaemon == 1) {
                $winzip = ParagrapheTEXT('48-winzip.png', '{auto-compress}', '{auto-compress_text}', "javascript:Loadjs('auto-compress.php?script=winzip')", 90);
            }
        }
    }
    if ($users->POSTMULTI) {
        $multi = ParagrapheTEXT('postfix-multi-48.png', '{POSTFIX_MULTI_INSTANCE}', '{POSTFIX_MULTI_INSTANCE_TINY_TEXT}', "javascript:Loadjs('postfix.network.php?POSTFIX_MULTI_INSTANCE_JS=yes')", 90);
    } else {
        $multi = ParagrapheTEXT_disabled('postfix-multi-48.png', '{POSTFIX_MULTI_INSTANCE}', '{POSTFIX_MULTI_INSTANCE_TINY_TEXT}', null, 90);
    }
    if ($users->MEM_TOTAL_INSTALLEE < 700000) {
        $multi = ParagrapheTEXT_disabled('postfix-multi-48.png', '{POSTFIX_MULTI_INSTANCE}', '{POSTFIX_MULTI_INSTANCE_TINY_TEXT}', null, 90);
    }
    $artica_stats = ParagrapheTEXT('graphs-48.png', '{ARTICA_STATS}', '{ARTICA_SMTP_STATS_TEXT}', "javascript:Loadjs('postfix.artica-stats.php')", 90);
    $postfix_restrictions_classes = ParagrapheTEXT('folder-48-restrictions-classes.png', '{postfix_restrictions_classes}', '{restriction_classes_minitext}', "javascript:Loadjs('postfix.restrictions.classes.php?js=yes')", 90);
    $events = ParagrapheTEXT('48-mailevents.png', '{postfix_events}', '{logs_viewer_text}', "javascript:s_PopUp('postfix.events.php?pop=true',450,400)", 90);
    $performances = ParagrapheTEXT('folder-performances-48.png', '{performances_settings}', '{performances_settings_text}', "javascript:Loadjs('postfix.performances.php')", 90);
    $maincf = ParagrapheTEXT('folder-script-48.png', '{main.cf}', '{main.cf_explain}', "javascript:Loadjs('postfix.main.cf.php')", 90);
    $storage = ParagrapheTEXT('folder-storage2-48.png', '{storage_rules}', '{storage_rules_text}', "javascript:Loadjs('postfix.storage.rules.php')", 90);
    $maincfedit = ParagrapheTEXT('folder-maincf-48.png', '{main.cf_edit}', '{main.cfedit_explain}', "javascript:Loadjs('postfix.main.cf.edit.php?js=yes')", 90);
    $mastercf = ParagrapheTEXT('folder-script-48-master.png', '{master.cf}', '{mastercf_explain}', "javascript:Loadjs('postfix.master.cf.php?script=yes')", 90);
    $other = ParagrapheTEXT('folder-tools2-48.png', '{other_settings}', '{other_settings_text}', "javascript:Loadjs('postfix.other.php')", 90);
    $main_src = ParagrapheTEXT('folder-script-database-48.png', '{main_ldap}', '{main_ldap_explain}', "javascript:s_PopUp(\"postfix.report.php\",500,500,true)", 90);
    $postmaster = ParagrapheTEXT('postmaster-48.png', '{postmaster}', '{postmaster_text}', "javascript:Loadjs('postfix.postmaster.php')", 90);
    $postmaster_identity = ParagrapheTEXT('postmaster-identity-48.png', '{postmaster_identity}', '{postmaster_identity_text}', "javascript:Loadjs('postfix.postmaster-ident.php')", 90);
    $UnknownUsers = ParagrapheTEXT('unknown-user-48.png', '{unknown_users}', '{postfix_unknown_users_tinytext}', "javascript:Loadjs('postfix.luser_relay.php')", 90);
    $massmailing = ParagrapheTEXT_disabled('mass-mailing-postfix-48.png', '{emailings}', '{ENABLE_MASSMAILING_TEXT}', null, 90);
    if ($users->EMAILRELAY_INSTALLED) {
        $massmailing = ParagrapheTEXT('mass-mailing-postfix-48.png', '{emailings}', '{ENABLE_MASSMAILING_TEXT}', "javascript:Loadjs('postfix.massmailing.php')", 90);
    }
    $multi_infos = ParagrapheTEXT_disabled('postfix-multi-48-info.png', '{POSTFIX_MULTI_INSTANCE_INFOS}', '{POSTFIX_MULTI_INSTANCE_INFOS_TEXT}', null, 90);
    if ($EnablePostfixMultiInstance == 1) {
        $main_src = null;
        $performances = ParagrapheTEXT_disabled('folder-performances-48.png', '{performances_settings}', '{performances_settings_text}', null, 90);
        $mastercf = null;
        $maincfedit = null;
        $maincf = null;
        $postfix_restrictions_classes = null;
        $storage = null;
        $other = null;
        $multi_infos = ParagrapheTEXT('postfix-multi-48-info.png', '{POSTFIX_MULTI_INSTANCE_INFOS}', '{POSTFIX_MULTI_INSTANCE_INFOS_TEXT}', "javascript:Loadjs('postfix.multiple.instances.infos.php')");
        if ($users->MAILMAN_INSTALLED) {
            $mailman = ParagrapheTEXT('folder-group2-48.png', '{APP_MAILMAN}', '{manage_distribution_lists}', "javascript:Loadjs('mailman.php?script=yes')");
        }
    }
    $q = new mysql();
    $table_storage = $q->TABLE_STATUS("storage", "artica_backup");
    if ($table_storage["Rows"] > 0) {
        $backup_query = ParagrapheTEXT('48-backup.png', "{$table_storage["Rows"]} {backuped_mails}", '{all_mailbackup_text}', "javascript:Loadjs('domains.backup.php?js=yes&Master=yes')");
    }
    $tr[] = $performances;
    $tr[] = $massmailing;
    $tr[] = $pommo;
    $tr[] = $artica_stats;
    $tr[] = $postmaster;
    $tr[] = $postmaster_identity;
    $tr[] = $UnknownUsers;
    $tr[] = $backup_query;
    $tr[] = $mailman;
    $tr[] = $events;
    $tr[] = $altermime;
    $tr[] = $maincf;
    $tr[] = $main_src;
    $tr[] = $maincfedit;
    $tr[] = $mastercf;
    $tr[] = $storage;
    $tr[] = $postfix_restrictions_classes;
    $tr[] = $other;
    $t = 0;
    $tables[] = "<table style='width:100%'><tr>";
    $t = 0;
    while (list($key, $line) = each($tr)) {
        $line = trim($line);
        if ($line == null) {
            continue;
        }
        $t = $t + 1;
        $tables[] = "<td valign='top'>{$line}</td>";
        if ($t == 3) {
            $t = 0;
            $tables[] = "</tr><tr>";
        }
    }
    if ($t < 3) {
        for ($i = 0; $i <= $t; $i++) {
            $tables[] = "<td valign='top'>&nbsp;</td>";
        }
    }
    $tables[] = "</table>";
    $icons = @implode("\n", $tables);
    $refresh = "<div style='width:100%;text-align:right'>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshIndexPostfixAjax()") . "</div>";
    $main = "<input type='hidden' id='monitor_page' value='1' name='monitor_page'>\n{$refresh}\n<div style='width:100%'>\n\t<div id='Postfixservinfos' style='width:350px;float:right;padding-right:50px;padding-left:50px;padding-top:70px'></div>\n\t<div style='float:right;width:160px;margin:8px' id='barstatus'>{$multi}</div>\n\t<div style='float:right;width:160px;margin:8px'>{$multi}</div>\n\t<div style='float:right;width:160px;margin:8px'>{$multi_infos}</div>\n\t\n\t\n</div>\n\n\t<div style='clear:both;width:100%'>\n\t{$icons}\n\t</div>\n\t";
    $html = "{$main}\n\n<script>\n\t\t\n</script>\n";
    $datas = $tpl->_ENGINE_parse_body($html);
    $datas = $datas . "\n<script>\n\tLoadAjax('Postfixservinfos','{$page}?postfix-status=yes');\n</script>\n";
    SET_CACHED(__FILE__, __FUNCTION__, null, $datas);
    return $datas;
}