Ejemplo n.º 1
0
function build_single_instance($ip)
{
    $sql = "SELECT `value`,`ou` FROM postfix_multi WHERE `key`='myhostname' AND `ip_address`='{$ip}'";
    $q = new mysql();
    $unix = new unix();
    $ldap = new clladp();
    $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup'));
    $ou = $ligne["ou"];
    $hostname = $ligne["value"];
    $main = new maincf_multi($hostname, $ou);
    echo "Starting......: dkimproxy {$hostname}\n";
    $freeport = $main->GET("dkimproxy_listenport");
    $array = unserialize(base64_decode($main->GET_BIGDATA("dkimproxy_datas")));
    $unix = new unix();
    $key = "/etc/dkimproxy/{$hostname}/private.key";
    @mkdir("/etc/dkimproxy/{$hostname}", 640, true);
    if (!is_file($key)) {
        echo "Starting......: dkimproxy {$hostname} generating public and private key\n";
        $openssl = $unix->find_program("openssl");
        @mkdir("/etc/dkimproxy/{$hostname}", 640, true);
        shell_exec("{$openssl} genrsa -out /etc/dkimproxy/{$hostname}/private.key 1024");
        shell_exec("{$openssl} rsa -in /etc/dkimproxy/{$hostname}/private.key -pubout -out /etc/dkimproxy/{$hostname}/public.key");
    }
    if ($hostname == "master") {
        $domains = $ldap->AllDomains();
    } else {
        $domains = $ldap->hash_get_domains_ou($ou);
    }
    while (list($dom, $nil) = each($domains)) {
        $dd[] = $dom;
    }
    $conf[] = "# specify what address/port DKIMproxy should listen on";
    $conf[] = "listen    {$ip}:{$freeport}";
    $conf[] = "# specify what address/port DKIMproxy forwards mail to";
    $conf[] = "relay     {$ip}:33560";
    $conf[] = "# specify what domains DKIMproxy can sign for (comma-separated, no spaces)";
    $conf[] = "domain    " . @implode(",", $dd);
    $conf[] = "# specify what signatures to add";
    $conf[] = "signature dkim(c=relaxed)";
    $conf[] = "signature domainkeys(c=nofws)";
    $conf[] = "# specify location of the private key";
    $conf[] = "keyfile   /etc/dkimproxy/{$hostname}/private.key";
    $conf[] = "# specify the selector (i.e. the name of the key record put in DNS)";
    $conf[] = "selector  {$array["selector_name"]}";
    $conf[] = "min_servers 5";
    $conf[] = "min_spare_servers 2";
    $conf[] = "";
    echo "Starting......: dkimproxy {$hostname} generating {$hostname}.conf " . count($dd) . " domain(s)\n";
    @file_put_contents("/etc/dkimproxy/{$hostname}.conf", @implode("\n", $conf));
}
Ejemplo n.º 2
0
function popup()
{
    $ldap = new clladp();
    $hash = $ldap->AllDomains();
    $page = CurrentPageName();
    $sock = new sockets();
    $luser_relay = $sock->GET_INFO("luser_relay");
    if (preg_match("#(.+?)@(.+)#", $luser_relay, $re)) {
        $email = $re[1];
        $domain = $re[2];
    }
    $html = "\n\t<div id='luser_relaydiv'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'><img src='img/unknown-user-90.png'></td>\n\t\t<td valign='top'>\n\t\t\t<div style='font-size:16px;padding:5px'>{postfix_unknown_users_tinytext}\n\t\t\t</div>\n\t\t\t<table style='width:100%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=legend style='font-size:13px'>{email}:</td>\n\t\t\t\t\t<td width=1%>" . Field_text("luser_relay", $email, "font-size:13px;padding:3px;width:120px") . "</td>\n\t\t\t\t\t<td width=1%><strong style='font-size:13px'>@</td>\n\t\t\t\t\t<td width=1%>" . Field_array_Hash($hash, "luser_relay_domain", $domain, null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=4 align='right'>\n\t\t\t\t\t\t<hr>" . button("{apply}", "Saveluser_relayForm()") . "</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</td>\n\t</tr>\n\t</table>\n\t</div>\n\t\n\t<script>\n\t\n\tvar x_Saveluser_relayForm= function (obj) {\n\t\tvar results=trim(obj.responseText);\n\t\tif(results.length>0){alert(results);}\n\t\tYahooWinHide();\n\t}\t\n\t\n\tfunction Saveluser_relayForm(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('luser_relay',document.getElementById('luser_relay').value+'@'+document.getElementById('luser_relay_domain').value);\n\t\tdocument.getElementById('luser_relaydiv').innerHTML='<div style=\"width:100%\"><center style=\"margin:20px;padding:20px\"><img src=\"img/wait_verybig.gif\"></center></div>';\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_Saveluser_relayForm);\n\t}\n\t\t\n\t\n\t</script>\t\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Ejemplo n.º 3
0
function popup()
{
    $ldap = new clladp();
    $hash = $ldap->AllDomains();
    $page = CurrentPageName();
    $sock = new sockets();
    $PostfixPostmaster = $sock->GET_INFO("PostfixPostmaster");
    if (preg_match("#(.+?)@(.+)#", $PostfixPostmaster, $re)) {
        $email = $re[1];
        $domain = $re[2];
    }
    $html = "\n\t<div id='postmasterdiv' style='width:80%;margin:30px' class=form>\n\t<center>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td class=legend style='font-size:26px' nowrap>" . texttooltip("{postmaster}", "{postmaster_text}") . ":</td>\n\t\t\t<td width=1%>" . Field_text("postmaster_email", $email, "font-size:26px;padding:3px;width:480px") . "</td>\n\t\t\t<td width=1%><strong style='font-size:26px'>@</td>\n\t\t\t<td width=1%>" . Field_array_Hash($hash, "postmaster_domain", $domain, null, null, 0, "font-size:26px;padding:3px") . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td colspan=4 align='right'>\n\t\t\t<hr>" . button("{apply}", "SavePostMasterForm()", 40) . "</td>\n\t\t</tr>\n\t</table>\n\t</center>\n\t</div>\n\t\n\t<script>\n\t\n\tvar x_SavePostMasterForm= function (obj) {\n\t\tvar results=trim(obj.responseText);\n\t\tif(results.length>0){alert(results);}\n\t}\t\n\t\n\tfunction SavePostMasterForm(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('postmaster',document.getElementById('postmaster_email').value+'@'+document.getElementById('postmaster_domain').value);\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_SavePostMasterForm);\n\t}\n\t\t\n\t\n\t</script>\t\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
Ejemplo n.º 4
0
function page_localdomains_search()
{
    $conf = new dnsmasq();
    $tpl = new templates();
    $page = CurrentPageName();
    $Params = $conf->ARTICA_ARRAY["LOCALNET"];
    if (count($Params) == 0) {
        $ldap = new clladp();
        $hash = $ldap->AllDomains();
        $hash["localdomain"] = "localdomain";
        $hash["localhost.localdomain"] = "localhost.localdomain";
        while (list($key, $line) = each($hash)) {
            $conf->ARTICA_ARRAY["LOCALNET"][$key] = 0;
        }
        $conf->SaveConf();
    }
    $data = array();
    $data['page'] = 0;
    $data['total'] = count($conf->ARTICA_ARRAY["LOCALNET"]);
    $data['rows'] = array();
    $search = null;
    ksort($conf->ARTICA_ARRAY["LOCALNET"]);
    $search = string_to_flexregex();
    while (list($domain, $enabled) = each($conf->ARTICA_ARRAY["LOCALNET"])) {
        if ($search != null) {
            if (!preg_match("#{$search}#", $domain)) {
                continue;
            }
        }
        $domain_plus = null;
        $md5 = md5($domain);
        $enable = Field_checkbox($md5, 1, $enabled, "DnsMasqLocalDomainEnable('{$domain}','{$md5}')");
        $delete = imgtootltip("delete-32.png", "{delete} {$domain}", "DnsMasqLocalDomainDelete('{$domain}')");
        $color = "black";
        if ($enabled == 0) {
            $color = "#D0D0D0";
        }
        if (isset($conf->ARTICA_ARRAY["RRDNS"][$domain])) {
            $domain_plus = " &raquo;&raquo;<i>{$conf->ARTICA_ARRAY["RRDNS"][$domain]}</i>";
        }
        $data['rows'][] = array('id' => $md5, 'cell' => array("<span style='font-size:22px;color:{$color}'>{$domain}{$domain_plus}</span>", $enable, $delete));
    }
    echo json_encode($data);
}
Ejemplo n.º 5
0
function TESTKeyView()
{
    $unix = new unix();
    $opendkim = $unix->find_program("opendkim-testkey");
    $dig = $unix->find_program("dig");
    $chmod = $unix->find_program("chmod");
    if (!is_file($opendkim)) {
        return;
    }
    $ldap = new clladp();
    $domainsH = $ldap->AllDomains();
    if (is_array($domainsH)) {
        while (list($num, $DOMAIN) = each($domainsH)) {
            unset($results);
            shell_exec("{$chmod} -R 0770 /etc/mail/dkim/keys/{$DOMAIN}");
            $results[] = "\n\n{$dig} TXT +short default._domainkey.{$DOMAIN} :\n-------------------------------\n";
            exec("{$dig} TXT +short default._domainkey.{$DOMAIN} 2>&1", $results);
            $results[] = "\n\n";
            exec("{$opendkim} -d {$DOMAIN} -s default -k /etc/mail/dkim/keys/{$DOMAIN}/default 2>&1", $results);
            $array[$DOMAIN] = @implode("\n", $results);
        }
    }
    @file_put_contents("/etc/mail/dkim.domains.tests.key", base64_encode(serialize($array)));
}
Ejemplo n.º 6
0
function BuildAllMyDomains()
{
    $ldap = new clladp();
    $hash = $ldap->AllDomains();
    while (list($num, $ligne) = each($hash)) {
        $ligne = trim($ligne);
        if ($ligne == null) {
            continue;
        }
        $doms[] = "{$ligne}\tOK";
    }
    @file_put_contents("/etc/postfix/all_internal_domains", @implode("\n", $doms));
    shell_exec("{$GLOBALS["postmap"]} hash:/etc/postfix/all_internal_domains");
}
Ejemplo n.º 7
0
function TESTKeyView()
{
    $unix = new unix();
    $opendkim = $unix->find_program("dkim-testkey");
    if (!is_file($opendkim)) {
        return;
    }
    $ldap = new clladp();
    $domainsH = $ldap->AllDomains();
    if (is_array($domainsH)) {
        while (list($num, $DOMAIN) = each($domainsH)) {
            unset($results);
            exec("{$opendkim} -d {$DOMAIN} -s default 2>&1", $results);
            $array[$DOMAIN] = @implode("\n", $results);
        }
    }
    @file_put_contents("/etc/mail/dkim.domains.tests.key", base64_encode(serialize($array)));
}
Ejemplo n.º 8
0
function main_cyrusconf()
{
    $cyrus = new cyrus_conf();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $EnableMechCramMD5 = $sock->GET_INFO("EnableMechCramMD5");
    $EnableMechDigestMD5 = $sock->GET_INFO("EnableMechDigestMD5");
    $EnableMechLogin = $sock->GET_INFO("EnableMechLogin");
    $EnableMechPlain = $sock->GET_INFO("EnableMechPlain");
    $DisableIMAPVerif = $sock->GET_INFO("DisableIMAPVerif");
    if (!is_numeric($EnableMechCramMD5)) {
        $EnableMechCramMD5 = 0;
    }
    if (!is_numeric($EnableMechDigestMD5)) {
        $EnableMechDigestMD5 = 0;
    }
    if (!is_numeric($EnableMechLogin)) {
        $EnableMechLogin = 1;
    }
    if (!is_numeric($EnableMechPlain)) {
        $EnableMechPlain = 1;
    }
    if (!is_numeric($DisableIMAPVerif)) {
        $DisableIMAPVerif = 0;
    }
    $impad_form = "\n\t<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>{allowallsubscribe}:</stong></td>\n\t<td>" . Field_checkbox_design('allowallsubscribe', 1, $cyrus->impad_array["allowallsubscribe"]) . "</td>\n\t<td width=1%>" . help_icon("{allowallsubscribe_text}") . "</td>\n\t</tr>\n\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>{allowanonymouslogin}:</stong></td>\n\t<td>" . Field_checkbox_design('allowanonymouslogin', 1, $cyrus->impad_array["allowanonymouslogin"]) . "</td>\n\t<td width=1%>" . help_icon("{allowanonymouslogin_text}") . "</td>\n\t</tr>\t\t\n\t\n\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>{createonpost}:</stong></td>\n\t<td>" . Field_checkbox_design('createonpost', 1, $cyrus->impad_array["createonpost"]) . "</td>\n\t<td width=1%>" . help_icon("{createonpost_text}") . "</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>{duplicatesuppression}:</stong></td>\n\t<td>" . Field_checkbox_design('duplicatesuppression', 1, $cyrus->impad_array["duplicatesuppression"]) . "</td>\n\t<td width=1%>" . help_icon("{duplicatesuppression_text}") . "</td>\n\t</tr>\t\n\t\n\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>{autocreateinboxfolders}:</stong></td>\n\t<td>" . Field_text("autocreateinboxfolders", $cyrus->impad_array["autocreateinboxfolders"], 'width:290px;font-size:18px;padding:3px', null, null, null, FALSE, null, false) . "</td>\n\t<td width=1%>" . help_icon("{autocreateinboxfolders_text}") . "</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>{autocreatequota}:</stong></td>\n\t<td>" . Field_text("autocreatequota", $cyrus->impad_array["autocreatequota"], 'width:220px;font-size:18px;padding:3px', null, null) . "</td>\n\t<td width=1%>" . help_icon("{autocreatequota_text}") . "</td>\n\t</tr>\t\n\t\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>{maxmessagesize}:</stong></td>\n\t<td>" . Field_text("maxmessagesize", $cyrus->impad_array["maxmessagesize"], 'width:120px;font-size:18px;padding:3px', null, null) . "</td>\n\t<td width=1%>" . help_icon("{maxmessagesize_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>{popminpoll}:</stong></td>\n\t<td style='font-size:18px'>" . Field_text("popminpoll", $cyrus->impad_array["popminpoll"], 'width:90px;font-size:18px;padding:3px', null, null) . " {minutes}</td>\n\t<td width=1%>" . help_icon("{popminpoll_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>{quotawarn}:</stong></td>\n\t<td style='font-size:18px'>" . Field_text("quotawarn", $cyrus->impad_array["quotawarn"], 'width:45px;font-size:18px;padding:3px', null, null) . " %</td>\n\t<td width=1%>" . help_icon("{quotawarn_text}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 align='left'><span style='font-size:32px'>{authentication}</span><hr></td>\n\t</tr>\t\n\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>plain:</stong></td>\n\t<td>" . Field_checkbox_design('plain', 1, $EnableMechPlain) . "</td>\n\t<td width=1%></td>\n\t</tr>\n\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>login:</stong></td>\n\t<td>" . Field_checkbox_design('login', 1, $EnableMechLogin) . "</td>\n\t<td width=1%></td>\n\t</tr>\t\n\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>cram-md5:</stong></td>\n\t<td>" . Field_checkbox_design('cram-md5', 1, $EnableMechCramMD5) . "</td>\n\t<td width=1%></td>\n\t</tr>\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:18px'>digest-md5:</stong></td>\n\t<td>" . Field_checkbox_design('digest-md5', 1, $EnableMechDigestMD5) . "</td>\n\t<td width=1%></td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "CyrusMasterSaveConfig()", 26) . "</td>\n\t</tr>\n\n\t\n\t</table>\n\t</form>\n\t";
    $os = new networking();
    $ips = $os->ALL_IPS_GET_ARRAY();
    $ips["127.0.0.1"] = "127.0.0.1";
    $ips[null] = "{all}";
    $ldap = new clladp();
    $hash = $ldap->AllDomains();
    $hash[null] = "None";
    if (!is_numeric($cyrus->main_array["CYRUS"]["service_lmtp_listen"])) {
        $cyrus->main_array["CYRUS"]["service_lmtp_listen"] = 2005;
    }
    if (!is_numeric($cyrus->main_array["CYRUS"]["service_lmtp_enabed"])) {
        $cyrus->main_array["CYRUS"]["service_lmtp_enabed"] = 1;
    }
    $defaultsDomain = Field_array_Hash($hash, 'defaultdomain', $cyrus->impad_array["defaultdomain"], null, null, 0, 'font-size:18px;padding:3px');
    $html = "\n\t<div class=explain style='font-size:16px'>{services_settings_text}</div>\n\t\n\t\t\t<div style='font-size:40px'>{ports}</a></div>\n\t<div id='cyrusconf' style='width:98%' class=form>\n\t\t\t\t\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td style='font-size:18px'>{service}</td>\n\t\t\t\t\t\t\t\t\t<td style='font-size:18px'>{enable}</td>\n\t\t\t\t\t\t\t\t\t<td style='font-size:18px'>{port}</td>\n\t\t\t\t\t\t\t\t\t<td style='font-size:18px'>{maxchild}</td>\n\t\t\t\t\t\t\t\t\t<td style='font-size:18px'>&nbsp;</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:18px'>IMAP:</stong></td>\n\t\t\t\t\t\t\t<td width=1%><img src='img/status_ok-grey.png'></td>\n\t\t\t\t\t\t\t<td><input type='hidden' name='service_imap_listen' value='{$cyrus->main_array["CYRUS"]["service_imap_listen"]}'><strong style='font-size:18px'>imap:143</strong></td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_imap_maxchild", $cyrus->main_array["CYRUS"]["service_imap_maxchild"], 'width:95px;font-size:18px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{maxchild_text}') . "</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:18px'>IMAP SSL:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("service_imapssl_enabed", 1, $cyrus->main_array["CYRUS"]["service_imapssl_enabed"]) . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_imapssl_listen", $cyrus->main_array["CYRUS"]["service_imapssl_listen"], 'width:150px;font-size:18px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_imapssl_maxchild", $cyrus->main_array["CYRUS"]["service_imapssl_maxchild"], 'width:95px;font-size:18px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:18px'>POP3:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("service_pop3_enabed", 1, $cyrus->main_array["CYRUS"]["service_pop3_enabed"]) . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_pop3_listen", $cyrus->main_array["CYRUS"]["service_pop3_listen"], 'width:150px;font-size:18px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_pop3_maxchild", $cyrus->main_array["CYRUS"]["service_pop3_maxchild"], 'width:95px;font-size:18px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:18px'>POP3 SSL:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("service_pop3ssl_enabed", 1, $cyrus->main_array["CYRUS"]["service_pop3ssl_enabed"]) . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_pop3ssl_listen", $cyrus->main_array["CYRUS"]["service_pop3ssl_listen"], 'width:150px;font-size:18px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_pop3ssl_maxchild", $cyrus->main_array["CYRUS"]["service_pop3ssl_maxchild"], 'width:95px;font-size:18px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:18px'>NNTP:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("service_nntpd_enabed", 1, $cyrus->main_array["CYRUS"]["service_nntpd_enabed"]) . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_nntpd_listen", $cyrus->main_array["CYRUS"]["service_nntpd_listen"], 'width:150px;font-size:18px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:18px'>NNTP SSL:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("service_nntpds_enabed", 1, $cyrus->main_array["CYRUS"]["service_nntpds_enabed"]) . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_nntpds_listen", $cyrus->main_array["CYRUS"]["service_nntpds_listen"], 'width:150px;font-size:18px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:18px'>LMTP:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("service_lmtp_enabed", 1, $cyrus->main_array["CYRUS"]["service_lmtp_enabed"]) . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_lmtp_listen", $cyrus->main_array["CYRUS"]["service_lmtp_listen"], 'width:150px;font-size:18px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{howto_service_lmtp}') . "</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:18px'>{defaultdomain}:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>&nbsp;</td>\n\t\t\t\t\t\t\t<td>{$defaultsDomain}</td>\n\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{defaultdomain_text}') . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:18px'>{ip_address}:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>&nbsp;</td>\n\t\t\t\t\t\t\t<td>" . Field_array_Hash($ips, 'ListenAddress', $cyrus->main_array["CYRUS"]["ListenAddress"], 'style:font-size:18px') . "</td>\n\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t<td width=1%>&nbsp;</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:18px'>{disable_incompatibility_mech}:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("DisableIMAPVerif", 1, $DisableIMAPVerif) . "</td>\n\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t<td width=1%>&nbsp;</td>\n\t\t\t\t\t\t</tr>\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=5 align='right'>" . button("{apply}", "CyrusMasterSaveConfig()", 26) . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<div style='font-size:40px'>{options}</div>\n\t\t\t{$impad_form}\n\n\t\n\t<script>\n\t\n\t\t\n\t\nvar x_CyrusMasterSaveConfigSave = function (obj) {\n\tvar results=trim(obj.responseText);\n\tif(results.length>0){alert(results);}\n\tRefreshTab('main_config_cyrus');\n}\n\n\nfunction CyrusMasterSaveConfig(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('allowallsubscribe').checked){XHR.appendData('allowallsubscribe',1);}else{XHR.appendData('allowallsubscribe',0);}\n\tif(document.getElementById('allowanonymouslogin').checked){XHR.appendData('allowanonymouslogin',1);}else{XHR.appendData('allowanonymouslogin',0);}\n\tif(document.getElementById('createonpost').checked){XHR.appendData('createonpost',1);}else{XHR.appendData('createonpost',0);}\n\tif(document.getElementById('duplicatesuppression').checked){XHR.appendData('duplicatesuppression',1);}else{XHR.appendData('duplicatesuppression',0);}\n\n\t\n\tif(document.getElementById('service_lmtp_enabed').checked){XHR.appendData('service_lmtp_enabed',1);}else{XHR.appendData('service_lmtp_enabed',0);}\n\tXHR.appendData('service_lmtp_listen',document.getElementById('service_lmtp_listen').value);\n\t\n\t\n\tif(document.getElementById('service_imapssl_enabed').checked){XHR.appendData('service_imapssl_enabed',1);}else{XHR.appendData('service_imapssl_enabed',0);}\n\tif(document.getElementById('service_pop3_enabed').checked){XHR.appendData('service_pop3_enabed',1);}else{XHR.appendData('service_pop3_enabed',0);}\n\tif(document.getElementById('service_pop3ssl_enabed').checked){XHR.appendData('service_pop3ssl_enabed',1);}else{XHR.appendData('service_pop3ssl_enabed',0);}\n\tif(document.getElementById('service_nntpd_enabed').checked){XHR.appendData('service_nntpd_enabed',1);}else{XHR.appendData('service_nntpd_enabed',0);}\n\tif(document.getElementById('service_nntpds_enabed').checked){XHR.appendData('service_nntpds_enabed',1);}else{XHR.appendData('service_nntpds_enabed',0);}\n\t\n\tif(document.getElementById('cram-md5').checked){XHR.appendData('cram-md5',1);}else{XHR.appendData('cram-md5',0);}\n\tif(document.getElementById('digest-md5').checked){XHR.appendData('digest-md5',1);}else{XHR.appendData('digest-md5',0);}\n\tif(document.getElementById('plain').checked){XHR.appendData('plain',1);}else{XHR.appendData('plain',0);}\n\tif(document.getElementById('login').checked){XHR.appendData('login',1);}else{XHR.appendData('login',0);}\n\tif(document.getElementById('DisableIMAPVerif').checked){XHR.appendData('DisableIMAPVerif',1);}else{XHR.appendData('DisableIMAPVerif',0);}\n\t\n\t\n\t\n\tXHR.appendData('autocreateinboxfolders',document.getElementById('autocreateinboxfolders').value);\n\tXHR.appendData('autocreatequota',document.getElementById('autocreatequota').value);\n\tXHR.appendData('maxmessagesize',document.getElementById('maxmessagesize').value);\n\tXHR.appendData('popminpoll',document.getElementById('popminpoll').value);\n\tXHR.appendData('quotawarn',document.getElementById('quotawarn').value);\n\tXHR.appendData('service_imap_maxchild',document.getElementById('service_imap_maxchild').value);\n\tXHR.appendData('service_imapssl_listen',document.getElementById('service_imapssl_listen').value);\n\tXHR.appendData('service_imapssl_maxchild',document.getElementById('service_imapssl_maxchild').value);\n\tXHR.appendData('service_pop3_listen',document.getElementById('service_pop3_listen').value);\n\tXHR.appendData('service_pop3_maxchild',document.getElementById('service_pop3_maxchild').value);\n\tXHR.appendData('service_pop3ssl_listen',document.getElementById('service_pop3ssl_listen').value);\n\tXHR.appendData('service_pop3ssl_maxchild',document.getElementById('service_pop3ssl_maxchild').value);\n\tXHR.appendData('service_nntpd_listen',document.getElementById('service_nntpd_listen').value);\n\tXHR.appendData('service_nntpds_listen',document.getElementById('service_nntpds_listen').value);\n\tXHR.appendData('ListenAddress',document.getElementById('ListenAddress').value);\n\tAnimateDiv('cyrusconf');\n\tXHR.sendAndLoad('{$page}', 'GET',x_CyrusMasterSaveConfigSave);\n\t\n\t}\t\n\n\t\n\t\$(function() {\n\t\t\t\$( \"#NavigationForms3\" ).accordion({autoHeight: false,navigation: true});});\t\n\t\n\t</script>\n\t";
    return $tpl->_ENGINE_parse_body($html);
}
Ejemplo n.º 9
0
function page_localdomains_search()
{
    $conf = new dnsmasq();
    $tpl = new templates();
    $page = CurrentPageName();
    $Params = $conf->ARTICA_ARRAY["LOCALNET"];
    if (count($Params) == 0) {
        $ldap = new clladp();
        $hash = $ldap->AllDomains();
        $hash["localdomain"] = "localdomain";
        $hash["localhost.localdomain"] = "localhost.localdomain";
        while (list($key, $line) = each($hash)) {
            $conf->ARTICA_ARRAY["LOCALNET"][$key] = 0;
        }
        $conf->SaveConf();
    }
    $data = array();
    $data['page'] = 0;
    $data['total'] = count($conf->ARTICA_ARRAY["LOCALNET"]);
    $data['rows'] = array();
    $search = null;
    ksort($conf->ARTICA_ARRAY["LOCALNET"]);
    if ($_POST["query"] != null) {
        $_POST["query"] = "*" . $_POST["query"] . "*";
        $_POST["query"] = str_replace("**", "*", $_POST["query"]);
        $_POST["query"] = str_replace("**", "*", $_POST["query"]);
        $_POST["query"] = str_replace("*", ".*?", $_POST["query"]);
        $search = $_POST["query"];
    }
    while (list($domain, $enabled) = each($conf->ARTICA_ARRAY["LOCALNET"])) {
        if ($search != null) {
            if (!preg_match("#{$search}#", $domain)) {
                continue;
            }
        }
        $md5 = md5($domain);
        $enable = Field_checkbox($md5, 1, $enabled, "DnsMasqLocalDomainEnable('{$domain}','{$md5}')");
        $delete = imgtootltip("delete-24.png", "{delete} {$domain}", "DnsMasqLocalDomainDelete('{$domain}')");
        $color = "black";
        if ($enabled == 0) {
            $color = "#D0D0D0";
        }
        writelogs("{$ligne["ID"]} => {$ligne["rulename"]}", __FUNCTION__, __FILE__, __LINE__);
        $data['rows'][] = array('id' => $ligne['ID'], 'cell' => array("<span style='font-size:18px;color:{$color}'>{$domain}</span>", $enable, $delete));
    }
    echo json_encode($data);
}
Ejemplo n.º 10
0
function main_cyrusconf()
{
    $cyrus = new cyrus_conf();
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $EnableMechCramMD5 = $sock->GET_INFO("EnableMechCramMD5");
    $EnableMechDigestMD5 = $sock->GET_INFO("EnableMechDigestMD5");
    $EnableMechLogin = $sock->GET_INFO("EnableMechLogin");
    $EnableMechPlain = $sock->GET_INFO("EnableMechPlain");
    if (!is_numeric($EnableMechCramMD5)) {
        $EnableMechCramMD5 = 0;
    }
    if (!is_numeric($EnableMechDigestMD5)) {
        $EnableMechDigestMD5 = 0;
    }
    if (!is_numeric($EnableMechLogin)) {
        $EnableMechLogin = 1;
    }
    if (!is_numeric($EnableMechPlain)) {
        $EnableMechPlain = 1;
    }
    $impad_form = "\n\t<table style='width:99%' class=form>\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>{allowallsubscribe}:</stong></td>\n\t<td>" . Field_checkbox('allowallsubscribe', 1, $cyrus->impad_array["allowallsubscribe"]) . "</td>\n\t<td width=1%>" . help_icon("{allowallsubscribe_text}") . "</td>\n\t</tr>\n\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>{allowanonymouslogin}:</stong></td>\n\t<td>" . Field_checkbox('allowanonymouslogin', 1, $cyrus->impad_array["allowanonymouslogin"]) . "</td>\n\t<td width=1%>" . help_icon("{allowanonymouslogin_text}") . "</td>\n\t</tr>\t\t\n\t\n\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>{createonpost}:</stong></td>\n\t<td>" . Field_checkbox('createonpost', 1, $cyrus->impad_array["createonpost"]) . "</td>\n\t<td width=1%>" . help_icon("{createonpost_text}") . "</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>{duplicatesuppression}:</stong></td>\n\t<td>" . Field_checkbox('duplicatesuppression', 1, $cyrus->impad_array["duplicatesuppression"]) . "</td>\n\t<td width=1%>" . help_icon("{duplicatesuppression_text}") . "</td>\n\t</tr>\t\n\t\n\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>{autocreateinboxfolders}:</stong></td>\n\t<td>" . Field_text("autocreateinboxfolders", $cyrus->impad_array["autocreateinboxfolders"], 'width:190px;font-size:13px;padding:3px', null, null, null, FALSE, null, false) . "</td>\n\t<td width=1%>" . help_icon("{autocreateinboxfolders_text}") . "</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>{autocreatequota}:</stong></td>\n\t<td>" . Field_text("autocreatequota", $cyrus->impad_array["autocreatequota"], 'width:90px;font-size:13px;padding:3px', null, null) . "</td>\n\t<td width=1%>" . help_icon("{autocreatequota_text}") . "</td>\n\t</tr>\t\n\t\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>{maxmessagesize}:</stong></td>\n\t<td>" . Field_text("maxmessagesize", $cyrus->impad_array["maxmessagesize"], 'width:90px;font-size:13px;padding:3px', null, null) . "</td>\n\t<td width=1%>" . help_icon("{maxmessagesize_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>{popminpoll}:</stong></td>\n\t<td>" . Field_text("popminpoll", $cyrus->impad_array["popminpoll"], 'width:25px;font-size:13px;padding:3px', null, null) . " mn</td>\n\t<td width=1%>" . help_icon("{popminpoll_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>{quotawarn}:</stong></td>\n\t<td>" . Field_text("quotawarn", $cyrus->impad_array["quotawarn"], 'width:25px;font-size:13px;padding:3px', null, null) . " %</td>\n\t<td width=1%>" . help_icon("{quotawarn_text}") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=3 align='left'><span style='font-size:16px'>{authentication}</span><hr></td>\n\t</tr>\t\n\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>plain:</stong></td>\n\t<td>" . Field_checkbox('plain', 1, $EnableMechPlain) . "</td>\n\t<td width=1%></td>\n\t</tr>\n\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>login:</stong></td>\n\t<td>" . Field_checkbox('login', 1, $EnableMechLogin) . "</td>\n\t<td width=1%></td>\n\t</tr>\t\n\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>cram-md5:</stong></td>\n\t<td>" . Field_checkbox('cram-md5', 1, $EnableMechCramMD5) . "</td>\n\t<td width=1%></td>\n\t</tr>\t\n\t\n\t<tr>\n\t<td align='right' class=legend style='font-size:13px'>digest-md5:</stong></td>\n\t<td>" . Field_checkbox('digest-md5', 1, $EnableMechDigestMD5) . "</td>\n\t<td width=1%></td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td colspan=3 align='right'><hr>" . button("{apply}", "CyrusMasterSaveConfig()") . "</td>\n\t</tr>\n\n\t\n\t</table>\n\t</form>\n\t";
    $ldap = new clladp();
    $hash = $ldap->AllDomains();
    $hash[null] = "None";
    $defaultsDomain = Field_array_Hash($hash, 'defaultdomain', $cyrus->impad_array["defaultdomain"], null, null, 0, 'font-size:13px;padding:3px');
    $html = "\n\t<div class=explain>{services_settings_text}</div>\n\t<div id='cyrusconf'>\n\t\t<div id='NavigationForms3'>\t\n\t\t\t<h3><a href=\"javascript:blur();\"  OnClick=\"javascript:\$('#NavigationForms3').accordion( 'activate' , 0 );\">{ports}</a></h3>\n\t\t\t\t<div>\n\t\t\t\t\t<table cellspacing='0' cellpadding='0' border='0' class='tableView'>\n\t\t\t\t\t\t<thead class='thead'>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th>{service}</th>\n\t\t\t\t\t\t\t\t\t<th>{enable}</th>\n\t\t\t\t\t\t\t\t\t<th>{port}</th>\n\t\t\t\t\t\t\t\t\t<th>{maxchild}</th>\n\t\t\t\t\t\t\t\t\t<th>&nbsp;</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<tr class=oddRow>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:13px'>IMAP:</stong></td>\n\t\t\t\t\t\t\t<td width=1%><img src='img/status_ok-grey.gif'></td>\n\t\t\t\t\t\t\t<td><input type='hidden' name='service_imap_listen' value='{$cyrus->main_array["CYRUS"]["service_imap_listen"]}'><strong style='font-size:13px'>imap:143</strong></td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_imap_maxchild", $cyrus->main_array["CYRUS"]["service_imap_maxchild"], 'width:80px;font-size:13px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{maxchild_text}') . "</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:13px'>IMAP SSL:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("service_imapssl_enabed", 1, $cyrus->main_array["CYRUS"]["service_imapssl_enabed"]) . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_imapssl_listen", $cyrus->main_array["CYRUS"]["service_imapssl_listen"], 'width:150px;font-size:13px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_imapssl_maxchild", $cyrus->main_array["CYRUS"]["service_imapssl_maxchild"], 'width:80px;font-size:13px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t\t<tr class=oddRow>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:13px'>POP3:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("service_pop3_enabed", 1, $cyrus->main_array["CYRUS"]["service_pop3_enabed"]) . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_pop3_listen", $cyrus->main_array["CYRUS"]["service_pop3_listen"], 'width:150px;font-size:13px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_pop3_maxchild", $cyrus->main_array["CYRUS"]["service_pop3_maxchild"], 'width:80px;font-size:13px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:13px'>POP3 SSL:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("service_pop3ssl_enabed", 1, $cyrus->main_array["CYRUS"]["service_pop3ssl_enabed"]) . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_pop3ssl_listen", $cyrus->main_array["CYRUS"]["service_pop3ssl_listen"], 'width:150px;font-size:13px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_pop3ssl_maxchild", $cyrus->main_array["CYRUS"]["service_pop3ssl_maxchild"], 'width:80px;font-size:13px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\n\t\t\t\t\t\t<tr class=oddRow>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:13px'>NNTP:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("service_nntpd_enabed", 1, $cyrus->main_array["CYRUS"]["service_nntpd_enabed"]) . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_nntpd_listen", $cyrus->main_array["CYRUS"]["service_nntpd_listen"], 'width:150px;font-size:13px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:13px'>NNTP SSL:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>" . Field_checkbox("service_nntpds_enabed", 1, $cyrus->main_array["CYRUS"]["service_nntpds_enabed"]) . "</td>\n\t\t\t\t\t\t\t<td>" . Field_text("service_nntpds_listen", $cyrus->main_array["CYRUS"]["service_nntpds_listen"], 'width:150px;font-size:13px;padding:3px') . "</td>\n\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\t\t<tr class=oddRow>\n\t\t\t\t\t\t\t<td align='right' class=legend style='font-size:13px'>{defaultdomain}:</stong></td>\n\t\t\t\t\t\t\t<td width=1%>&nbsp;</td>\n\t\t\t\t\t\t\t<td>{$defaultsDomain}</td>\n\t\t\t\t\t\t\t<td>&nbsp;</td>\n\t\t\t\t\t\t\t<td width=1%>" . help_icon('{defaultdomain_text}') . "</td>\n\t\t\t\t\t\t</tr>\t\n\t\t\t\t\t\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td colspan=5 align='right'>" . button("{apply}", "CyrusMasterSaveConfig()") . "</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t\n\t\t\t\n\t\t\t<h3><a href=\"javascript:blur();\" OnClick=\"\$('#NavigationForms3').accordion( 'activate' , 1);\">{options}</a></h3>\n\t\t\t\t<div>\t\t\t\n\t\t\t\t\t{$impad_form}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t\n\t<script>\n\t\n\t\t\n\t\nvar x_CyrusMasterSaveConfigSave = function (obj) {\n\tvar results=trim(obj.responseText);\n\tif(results.length>0){alert(results);}\n\tRefreshTab('main_config_cyrus');\n}\n\n\nfunction CyrusMasterSaveConfig(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('allowallsubscribe').checked){XHR.appendData('allowallsubscribe',1);}else{XHR.appendData('allowallsubscribe',0);}\n\tif(document.getElementById('allowanonymouslogin').checked){XHR.appendData('allowanonymouslogin',1);}else{XHR.appendData('allowanonymouslogin',0);}\n\tif(document.getElementById('createonpost').checked){XHR.appendData('createonpost',1);}else{XHR.appendData('createonpost',0);}\n\tif(document.getElementById('duplicatesuppression').checked){XHR.appendData('duplicatesuppression',1);}else{XHR.appendData('duplicatesuppression',0);}\n\n\t\n\tif(document.getElementById('service_imapssl_enabed').checked){XHR.appendData('service_imapssl_enabed',1);}else{XHR.appendData('service_imapssl_enabed',0);}\n\tif(document.getElementById('service_pop3_enabed').checked){XHR.appendData('service_pop3_enabed',1);}else{XHR.appendData('service_pop3_enabed',0);}\n\tif(document.getElementById('service_pop3ssl_enabed').checked){XHR.appendData('service_pop3ssl_enabed',1);}else{XHR.appendData('service_pop3ssl_enabed',0);}\n\tif(document.getElementById('service_nntpd_enabed').checked){XHR.appendData('service_nntpd_enabed',1);}else{XHR.appendData('service_nntpd_enabed',0);}\n\tif(document.getElementById('service_nntpds_enabed').checked){XHR.appendData('service_nntpds_enabed',1);}else{XHR.appendData('service_nntpds_enabed',0);}\n\t\n\tif(document.getElementById('cram-md5').checked){XHR.appendData('cram-md5',1);}else{XHR.appendData('cram-md5',0);}\n\tif(document.getElementById('digest-md5').checked){XHR.appendData('digest-md5',1);}else{XHR.appendData('digest-md5',0);}\n\tif(document.getElementById('plain').checked){XHR.appendData('plain',1);}else{XHR.appendData('plain',0);}\n\tif(document.getElementById('login').checked){XHR.appendData('login',1);}else{XHR.appendData('login',0);}\n\t\n\t\n\tXHR.appendData('autocreateinboxfolders',document.getElementById('autocreateinboxfolders').value);\n\tXHR.appendData('autocreatequota',document.getElementById('autocreatequota').value);\n\tXHR.appendData('maxmessagesize',document.getElementById('maxmessagesize').value);\n\tXHR.appendData('popminpoll',document.getElementById('popminpoll').value);\n\tXHR.appendData('quotawarn',document.getElementById('quotawarn').value);\n\tXHR.appendData('service_imap_maxchild',document.getElementById('service_imap_maxchild').value);\n\tXHR.appendData('service_imapssl_listen',document.getElementById('service_imapssl_listen').value);\n\tXHR.appendData('service_imapssl_maxchild',document.getElementById('service_imapssl_maxchild').value);\n\tXHR.appendData('service_pop3_listen',document.getElementById('service_pop3_listen').value);\n\tXHR.appendData('service_pop3_maxchild',document.getElementById('service_pop3_maxchild').value);\n\tXHR.appendData('service_pop3ssl_listen',document.getElementById('service_pop3ssl_listen').value);\n\tXHR.appendData('service_pop3ssl_maxchild',document.getElementById('service_pop3ssl_maxchild').value);\n\tXHR.appendData('service_nntpd_listen',document.getElementById('service_nntpd_listen').value);\n\tXHR.appendData('service_nntpds_listen',document.getElementById('service_nntpds_listen').value);\n\tdocument.getElementById('cyrusconf').innerHTML='<center style=\"margin:20px;padding:20px\"><img src=\"img/wait_verybig.gif\"></center>';\n\t\n\t\n\tXHR.sendAndLoad('{$page}', 'GET',x_CyrusMasterSaveConfigSave);\n\t\n\t}\t\n\n\t\n\t\$(function() {\n\t\t\t\$( \"#NavigationForms3\" ).accordion({autoHeight: false,navigation: true});});\t\n\t\n\t</script>\n\t";
    return $tpl->_ENGINE_parse_body($html);
}
Ejemplo n.º 11
0
function main_cyrusconf()
{
    $cyrus = new cyrus_conf();
    $page = CurrentPageName();
    $tpl = new templates();
    $impad_form = "\n\t<table style='width:99%'>\n\t\n\t<tr>\n\t<td align='right' class=legend>{allowallsubscribe}:</stong></td>\n\t<td>" . Field_checkbox('allowallsubscribe', 1, $cyrus->impad_array["allowallsubscribe"]) . "</td>\n\t<td width=1%>" . help_icon("{allowallsubscribe_text}") . "</td>\n\t</tr>\n\n\t<tr>\n\t<td align='right' class=legend>{allowanonymouslogin}:</stong></td>\n\t<td>" . Field_checkbox('allowanonymouslogin', 1, $cyrus->impad_array["allowanonymouslogin"]) . "</td>\n\t<td width=1%>" . help_icon("{allowanonymouslogin_text}") . "</td>\n\t</tr>\t\t\n\t\n\t\n\t\n\t<tr>\n\t<td align='right' class=legend>{createonpost}:</stong></td>\n\t<td>" . Field_checkbox('createonpost', 1, $cyrus->impad_array["createonpost"]) . "</td>\n\t<td width=1%>" . help_icon("{createonpost_text}") . "</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t<td align='right' class=legend>{duplicatesuppression}:</stong></td>\n\t<td>" . Field_checkbox('duplicatesuppression', 1, $cyrus->impad_array["duplicatesuppression"]) . "</td>\n\t<td width=1%>" . help_icon("{duplicatesuppression_text}") . "</td>\n\t</tr>\t\n\t\n\t\n\t\n\t<tr>\n\t<td align='right' class=legend>{autocreateinboxfolders}:</stong></td>\n\t<td>" . Field_text("autocreateinboxfolders", $cyrus->impad_array["autocreateinboxfolders"], 'width:190px', null, null, null) . "</td>\n\t<td width=1%>" . help_icon("{autocreateinboxfolders_text}") . "</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t<td align='right' class=legend>{autocreatequota}:</stong></td>\n\t<td>" . Field_text("autocreatequota", $cyrus->impad_array["autocreatequota"], 'width:90px', null, null) . "</td>\n\t<td width=1%>" . help_icon("{autocreatequota_text}") . "</td>\n\t</tr>\t\n\t\t\n\t\n\t<tr>\n\t<td align='right' class=legend>{maxmessagesize}:</stong></td>\n\t<td>" . Field_text("maxmessagesize", $cyrus->impad_array["maxmessagesize"], 'width:90px', null, null) . "</td>\n\t<td width=1%>" . help_icon("{maxmessagesize_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t<td align='right' class=legend>{popminpoll}:</stong></td>\n\t<td>" . Field_text("popminpoll", $cyrus->impad_array["popminpoll"], 'width:25px', null, null) . " mn</td>\n\t<td width=1%>" . help_icon("{popminpoll_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t<td align='right' class=legend>{quotawarn}:</stong></td>\n\t<td>" . Field_text("quotawarn", $cyrus->impad_array["quotawarn"], 'width:25px', null, null) . " %</td>\n\t<td width=1%>" . help_icon("{quotawarn_text}") . "</td>\n\t</tr>\t\n\t\n\t<tr><td colspan=3 align='right'>\n\t<hr>\n\t " . button("{apply}", "CyrusMasterSaveConfig()") . "\n\t</td></tr>\n\t\n\t\n\t</table>\n\t</form>\n\t";
    $ldap = new clladp();
    $hash = $ldap->AllDomains();
    $hash[null] = "None";
    $defaultsDomain = Field_array_Hash($hash, 'defaultdomain', $cyrus->impad_array["defaultdomain"]);
    $html = "\n\t<p class=caption>{services_settings_text}</p>\n\t<div style='width:100%;'>\n\t<div id='cyrusconf'>\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td valign='top' width=1%></td>\n\t\t\t<td valign='top'>\n\t\t<table style='width:99%'>\n\t\t<tr>\n\t\t\t<th>{service}</th>\n\t\t\t<th>{enable}</th>\n\t\t\t<th>{port}</th>\n\t\t\t<th>{maxchild}</th>\n\t\t\t<th>&nbsp;</th>\n\t\t</tr>\n\t\t<tr " . CellRollOver() . ">\n\t\t\t<td align='right' class=legend>IMAP:</stong></td>\n\t\t\t<td width=1%><img src='img/status_ok-grey.gif'></td>\n\t\t\t<td><input type='hidden' name='service_imap_listen' value='{$cyrus->main_array["CYRUS"]["service_imap_listen"]}'><strong>imap:143</strong></td>\n\t\t\t<td>" . Field_text("service_imap_maxchild", $cyrus->main_array["CYRUS"]["service_imap_maxchild"], 'width:80px') . "</td>\n\t\t\t<td width=1%>" . help_icon('{maxchild_text}') . "</td>\n\t\t</tr>\t\n\t\n\t\n\t<tr " . CellRollOver() . ">\n\t<td align='right' class=legend>IMAP SSL:</stong></td>\n\t<td width=1%>" . Field_checkbox("service_imapssl_enabed", 1, $cyrus->main_array["CYRUS"]["service_imapssl_enabed"]) . "</td>\n\t<td>" . Field_text("service_imapssl_listen", $cyrus->main_array["CYRUS"]["service_imapssl_listen"], 'width:150px') . "</td>\n\t<td>" . Field_text("service_imapssl_maxchild", $cyrus->main_array["CYRUS"]["service_imapssl_maxchild"], 'width:80px') . "</td>\n\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t</tr>\n\t\n\t<tr " . CellRollOver() . ">\n\t<td align='right' class=legend>POP3:</stong></td>\n\t<td width=1%>" . Field_checkbox("service_pop3_enabed", 1, $cyrus->main_array["CYRUS"]["service_pop3_enabed"]) . "</td>\n\t<td>" . Field_text("service_pop3_listen", $cyrus->main_array["CYRUS"]["service_pop3_listen"], 'width:150px') . "</td>\n\t<td>" . Field_text("service_pop3_maxchild", $cyrus->main_array["CYRUS"]["service_pop3_maxchild"], 'width:80px') . "</td>\n\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t</tr>\n\n\t\n\t<tr " . CellRollOver() . ">\n\t<td align='right' class=legend>POP3 SSL:</stong></td>\n\t<td width=1%>" . Field_checkbox("service_pop3ssl_enabed", 1, $cyrus->main_array["CYRUS"]["service_pop3ssl_enabed"]) . "</td>\n\t<td>" . Field_text("service_pop3ssl_listen", $cyrus->main_array["CYRUS"]["service_pop3ssl_listen"], 'width:150px') . "</td>\n\t<td>" . Field_text("service_pop3ssl_maxchild", $cyrus->main_array["CYRUS"]["service_pop3ssl_maxchild"], 'width:80px') . "</td>\n\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t</tr>\t\n\n\t<tr " . CellRollOver() . ">\n\t<td align='right' class=legend>NNTP:</stong></td>\n\t<td width=1%>" . Field_checkbox("service_nntpd_enabed", 1, $cyrus->main_array["CYRUS"]["service_nntpd_enabed"]) . "</td>\n\t<td>" . Field_text("service_nntpd_listen", $cyrus->main_array["CYRUS"]["service_nntpd_listen"], 'width:150px') . "</td>\n\t<td>&nbsp;</td>\n\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t</tr>\t\n\t\n\t<tr " . CellRollOver() . ">\n\t<td align='right' class=legend>NNTP SSL:</stong></td>\n\t<td width=1%>" . Field_checkbox("service_nntpds_enabed", 1, $cyrus->main_array["CYRUS"]["service_nntpds_enabed"]) . "</td>\n\t<td>" . Field_text("service_nntpds_listen", $cyrus->main_array["CYRUS"]["service_nntpds_listen"], 'width:150px') . "</td>\n\t<td>&nbsp;</td>\n\t<td width=1%>" . help_icon('{howto_cyrus_service}') . "</td>\n\t</tr>\t\n\t<tr " . CellRollOver() . ">\n\t<td align='right' class=legend>{defaultdomain}:</stong></td>\n\t<td width=1%></td>\n\t<td>{$defaultsDomain}</td>\n\t<td>&nbsp;</td>\n\t<td width=1%>" . help_icon('{defaultdomain_text}') . "</td>\n\t</tr>\t\n\t\n\t<tr>\n\t\t<td colspan=5 align='right'>\n\t\t<hr>\n\t\t " . button("{apply}", "CyrusMasterSaveConfig()") . "\n\t\t</td>\n\t</tr>\n\t</table>\n\t</form>\n\t</div>\n\t</td>\n\t</tr>\n\t</table>\n\t{$impad_form}\n\t\n\t\n\t</div>\n\t</div>\n\t<script>\n\t\nvar x_CyrusMasterSaveConfig= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>0){alert(results);}\n\tRefreshTab('main_config_cyrus');\n}\n\n\nfunction CyrusMasterSaveConfig(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('allowallsubscribe').checked){XHR.appendData('allowallsubscribe',1);}else{XHR.appendData('allowallsubscribe',0);}\n\tif(document.getElementById('allowanonymouslogin').checked){XHR.appendData('allowanonymouslogin',1);}else{XHR.appendData('allowanonymouslogin',0);}\n\tif(document.getElementById('createonpost').checked){XHR.appendData('createonpost',1);}else{XHR.appendData('createonpost',0);}\n\tif(document.getElementById('duplicatesuppression').checked){XHR.appendData('duplicatesuppression',1);}else{XHR.appendData('duplicatesuppression',0);}\n\t\n\tif(document.getElementById('service_imapssl_enabed').checked){XHR.appendData('service_imapssl_enabed',1);}else{XHR.appendData('service_imapssl_enabed',0);}\n\tif(document.getElementById('service_pop3_enabed').checked){XHR.appendData('service_pop3_enabed',1);}else{XHR.appendData('service_pop3_enabed',0);}\n\tif(document.getElementById('service_pop3ssl_enabed').checked){XHR.appendData('service_pop3ssl_enabed',1);}else{XHR.appendData('service_pop3ssl_enabed',0);}\n\tif(document.getElementById('service_nntpd_enabed').checked){XHR.appendData('service_nntpd_enabed',1);}else{XHR.appendData('service_nntpd_enabed',0);}\n\tif(document.getElementById('service_nntpds_enabed').checked){XHR.appendData('service_nntpds_enabed',1);}else{XHR.appendData('service_nntpds_enabed',0);}\n\t\n\tXHR.appendData('autocreateinboxfolders',document.getElementById('autocreateinboxfolders').value);\n\tXHR.appendData('autocreatequota',document.getElementById('autocreatequota').value);\n\tXHR.appendData('maxmessagesize',document.getElementById('maxmessagesize').value);\n\tXHR.appendData('popminpoll',document.getElementById('popminpoll').value);\n\tXHR.appendData('quotawarn',document.getElementById('quotawarn').value);\n\tXHR.appendData('service_imap_maxchild',document.getElementById('service_imap_maxchild').value);\n\tXHR.appendData('service_imapssl_listen',document.getElementById('service_imapssl_listen').value);\n\tXHR.appendData('service_imapssl_maxchild',document.getElementById('service_imapssl_maxchild').value);\n\tXHR.appendData('service_pop3_listen',document.getElementById('service_pop3_listen').value);\n\tXHR.appendData('service_pop3_maxchild',document.getElementById('service_pop3_maxchild').value);\n\tXHR.appendData('service_pop3ssl_listen',document.getElementById('service_pop3ssl_listen').value);\n\tXHR.appendData('service_pop3ssl_maxchild',document.getElementById('service_pop3ssl_maxchild').value);\n\tXHR.appendData('service_nntpd_listen',document.getElementById('service_nntpd_listen').value);\n\tXHR.appendData('service_nntpds_listen',document.getElementById('service_nntpds_listen').value);\n\tdocument.getElementById('cyrusconf').innerHTML='<center style=\"margin:20px;padding:20px\"><img src=\"img/wait_verybig.gif\"></center>';\n\t\n\t\n\tXHR.sendAndLoad('{$page}', 'GET',x_CyrusMasterSaveConfig);\n\t\n\t}\t\n\t\n\t</script>\n\t";
    return $tpl->_ENGINE_parse_body($html);
}