function wizard_certificate_1()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $hostname = $sock->GET_INFO("myhostname");
    $t = time();
    $ENC[1024] = 1024;
    $ENC[2048] = 2048;
    $ENC[4096] = 4096;
    if ($hostname == null) {
        $hostname = $sock->getFrameWork("system.php?hostname-g=yes");
        $sock->SET_INFO($hostname, "myhostname");
    }
    $title = $tpl->_ENGINE_parse_body("{new_certificate}");
    $html[] = "<div class=text-info style='font-size:18px'>{wizard_certificate_1}<br><i>{CSR_MULTIPLE_EXPLAIN}</i></div>";
    $html[] = "<div style='width:98%' class=form>";
    $html[] = "<table style='width:100%'>";
    $html[] = Field_text_table("wizard-certificate-commonname", "{CommonName}", $hostname, 22, null, 400);
    $html[] = Field_list_table("wizard-certificate-levelenc", "{level_encryption}", 2048, 22, $ENC);
    $html[] = Field_password_table("wizard-certificate-password", "{password}", "secret", 22, null, 300);
    $html[] = Field_button_table_autonome("{add}", "Submit{$t}", 30);
    $html[] = "</table>";
    $html[] = "</div>\n<script>\nvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\t\$('#flexRT{$_GET["t"]}').flexReload();\n\tYahooWin6Hide();\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('wizard-certificate-commonname',encodeURIComponent(document.getElementById('wizard-certificate-commonname').value));\n\tXHR.appendData('wizard-certificate-levelenc',document.getElementById('wizard-certificate-levelenc').value);\n\tXHR.appendData('wizard-certificate-password',encodeURIComponent(document.getElementById('wizard-certificate-password').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n}\n</script>\n\t\t\n\t";
    echo $tpl->_ENGINE_parse_body(@implode("\n", $html));
}
Ejemplo n.º 2
0
function login()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $failed = $tpl->javascript_parse_text("{failed}");
    $t = time();
    $html = "<div style='width:98%' class=form>\n\t<table style='width:100%'>\n\t" . Field_text_table("username-{$t}", "{username}", null, 26, "script:SaveCheck{$t}(event)", 400) . Field_password_table("password-{$t}", "{password}", null, 26, "script:SaveCheck{$t}(event)", 400) . Field_button_table_autonome("{submit}", "Save{$t}", 32) . "\n\t\t\t\n\t\t\t\n\t</div>\n<script>\nvar xSave{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length==0){alert('FATAL ERROR');return;};\n\tif(results=='FALSE'){\n\t\talert('{$failed}');\n\t\treturn;\n\t}\n\tAjaxTopMenu('template-top-menus','admin.top.menus.php');\n\tYahooWinBrowseHide();\n}\n\nfunction SaveCheck{$t}(e){\n\tif(!checkEnter(e)){return;}\n\tSave{$t}();\n}\n\nfunction Save{$t}(){\n\tvar XHR = new XHRConnection();\n\tvar pp=encodeURIComponent(document.getElementById('password-{$t}').value);\n\tXHR.appendData('artica_password',pp);\n\tXHR.appendData('artica_username',document.getElementById('username-{$t}').value);\n\tXHR.appendData('VIA_API','1');\n\tXHR.sendAndLoad('logon.php', 'POST',xSave{$t});\n}\n</script>\n";
    echo $tpl->_ENGINE_parse_body($html);
}
function wizard_certificate_1()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $hostname = $sock->GET_INFO("myhostname");
    $t = time();
    $ENC[1024] = 1024;
    $ENC[2048] = 2048;
    $ENC[4096] = 4096;
    if ($hostname == null) {
        $hostname = $sock->getFrameWork("system.php?hostname-g=yes");
        $sock->SET_INFO($hostname, "myhostname");
    }
    $title = $tpl->_ENGINE_parse_body("{new_certificate}");
    $html[] = "<div class=explain style='font-size:18px'>{wizard_certificate_1}<br><i>{CSR_MULTIPLE_EXPLAIN}</i></div>";
    $html[] = "<div style='width:98%' class=form>";
    $html[] = "<table style='width:100%'>";
    $html[] = Field_text_table("wizard-certificate-commonname", "{CommonName}", $hostname, 22, null, 400);
    $html[] = Field_checkbox_table("AsSquidCertificate", "{proxy_certificate}", 0, 22, "{proxy_gen_certificate_explain}");
    $html[] = Field_list_table("wizard-certificate-levelenc", "{level_encryption}", 2048, 22, $ENC);
    $html[] = Field_password_table("wizard-certificate-password", "{password}", "secret", 22, null, 300);
    $html[] = Field_button_table_autonome("{add}", "Submit{$t}", 30);
    $html[] = "</table>";
    $html[] = "</div>\n<script>\nvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\t\n\tif(document.getElementById('squid_ports_popup_certificates')){\n\t\tif(document.getElementById('squid_ports_popup_certificates_num')){\n\t\t\tvar id=document.getElementById('squid_ports_popup_certificates_num').value;\n\t\t\tvar Common=document.getElementById('wizard-certificate-commonname').value;\n\t\t\tLoadAjaxSilent('squid_ports_popup_certificates','squid.ports.php?certificate-refresh=yes&default='+Common+'&t='+id);\n\t\t}\n\t}\t\n\t\n\t\n\t\$('#TABLE_CERTIFICATE_CENTER_MAIN').flexReload();\n\t\n\tvar commonName=document.getElementById('wizard-certificate-commonname').value;\n\tLoadjs('openssl.CSR.progress.php?generate-csr='+commonName);\n\tYahooWin6Hide();\n\t\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('wizard-certificate-commonname',encodeURIComponent(document.getElementById('wizard-certificate-commonname').value));\n\tXHR.appendData('wizard-certificate-levelenc',document.getElementById('wizard-certificate-levelenc').value);\n\tXHR.appendData('wizard-certificate-password',encodeURIComponent(document.getElementById('wizard-certificate-password').value));\n\tif(document.getElementById('AsSquidCertificate').checked){\n\t\tXHR.appendData('wizard-certificate-proxy',1);\n\t}else{\n\t\tXHR.appendData('wizard-certificate-proxy',0);\n\t}\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n}\n</script>\n\t\t\n\t";
    echo $tpl->_ENGINE_parse_body(@implode("\n", $html));
}
Ejemplo n.º 4
0
function csr_gen()
{
    $tpl = new templates();
    $users = new usersMenus();
    $page = CurrentPageName();
    $sock = new sockets();
    $ligne = unserialize($sock->GET_INFO("CertificateCenterCSR"));
    $t = time();
    if ($ligne["CountryName"] == null) {
        $ligne["CountryName"] = "US";
    }
    if ($ligne["stateOrProvinceName"] == null) {
        $ligne["stateOrProvinceName"] = "New York";
    }
    if ($ligne["localityName"] == null) {
        $ligne["localityName"] = "Brooklyn";
    }
    if ($ligne["emailAddress"] == null) {
        $ligne["emailAddress"] = "*****@*****.**";
    }
    if ($ligne["OrganizationName"] == null) {
        $ligne["OrganizationName"] = "MyCompany Ltd";
    }
    if ($ligne["OrganizationalUnit"] == null) {
        $ligne["OrganizationalUnit"] = "IT service";
    }
    if (!is_numeric($ligne["CertificateMaxDays"])) {
        $ligne["CertificateMaxDays"] = 730;
    }
    if (!is_numeric($ligne["levelenc"])) {
        $ligne["levelenc"] = 1024;
    }
    $button_save = $tpl->_ENGINE_parse_body(button("{edit}", "Save{$t}()", 30));
    if ($ligne["password"] == null) {
        $ligne["password"] = "******";
    }
    $sock->getFrameWork("openssl.php?copy-csr=yes");
    $data = @file_get_contents("/usr/share/artica-postfix/ressources/logs/web/Myprivkey.csr");
    @unlink("/usr/share/artica-postfix/ressources/logs/web/Myprivkey.csr");
    $html[] = "<div style='width:98%' class=form>";
    $html[] = "<table style='width:100%'>";
    $html[] = Field_text_table("CommonName-{$t}", "{CommonName}", $ligne["CommonName"], 22, null, 400);
    $html[] = Field_text_table("CountryName-{$t}", "{countryName}", $ligne["CountryName"], 22, null, 110);
    $html[] = Field_text_table("stateOrProvinceName-{$t}", "{stateOrProvinceName}", $ligne["stateOrProvinceName"], 22, null, 400);
    $html[] = Field_text_table("localityName-{$t}", "{localityName}", $ligne["localityName"], 22, null, 400);
    $html[] = Field_text_table("OrganizationName-{$t}", "{organizationName}", $ligne["OrganizationName"], 22, null, 400);
    $html[] = Field_text_table("OrganizationalUnit-{$t}", "{organizationalUnitName}", $ligne["OrganizationalUnit"], 22, null, 400);
    $html[] = Field_text_table("emailAddress-{$t}", "{emailAddress}", $ligne["emailAddress"], 22, null, 400);
    $html[] = Field_password_table("password-{$t}", "{password}", $ligne["password"], 22, null, 300);
    $html[] = Field_button_table_autonome("{generate_csr}", "Submit{$t}", 30);
    $html[] = "</table>";
    $html[] = "<hr>\n\t<textarea\n\tstyle='margin-top:5px;font-family:Courier New;\n\tfont-weight:bold;width:100%;height:520px;border:5px solid #8E8E8E;\n\toverflow:auto;font-size:16px !important;width:99%;height:390px' id='csr-{$t}'>{$data}</textarea>\n\t";
    $html[] = "</div>\n<script>\nvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);}\n\tRefreshTab('main_certificates_center_tabs');\n\tif(document.getElementById('squid_ports_popup_certificates')){\n\t\tvar id=document.getElementById('squid_ports_popup_certificates_num').value;\n\t\tvar Common=document.getElementById('CommonName-{$t}').value;\n\t\tLoadAjaxSilent('squid_ports_popup_certificates','squid.ports.php?certificate-refresh=yes&default='+Common+'&t='+id);\n\t}\n\t\n\t\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('GEN-CSR','yes');\n\tXHR.appendData('CommonName',encodeURIComponent(document.getElementById('CommonName-{$t}').value));\n\tXHR.appendData('CountryName',encodeURIComponent(document.getElementById('CountryName-{$t}').value));\n\tXHR.appendData('stateOrProvinceName',encodeURIComponent(document.getElementById('stateOrProvinceName-{$t}').value));\n\tXHR.appendData('localityName',encodeURIComponent(document.getElementById('localityName-{$t}').value));\n\tXHR.appendData('OrganizationName',encodeURIComponent(document.getElementById('OrganizationName-{$t}').value));\n\tXHR.appendData('OrganizationalUnit',encodeURIComponent(document.getElementById('OrganizationalUnit-{$t}').value));\n\tXHR.appendData('emailAddress',encodeURIComponent(document.getElementById('emailAddress-{$t}').value));\n\tXHR.appendData('password',encodeURIComponent(document.getElementById('password-{$t}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t}\n\t\n</script>\n";
    echo $tpl->_ENGINE_parse_body(@implode("\n", $html));
}
Ejemplo n.º 5
0
function certificate_edit_settings()
{
    $commonName = $_GET["CommonName"];
    $commonNameADD = null;
    $q = new mysql();
    $db = file_get_contents(dirname(__FILE__) . '/ressources/databases/ISO-3166-Codes-Countries.txt');
    $tbl = explode("\n", $db);
    while (list($num, $ligne) = each($tbl)) {
        if (preg_match('#(.+?);\\s+([A-Z]{1,2})#', $ligne, $regs)) {
            $regs[2] = trim($regs[2]);
            $regs[1] = trim($regs[1]);
            $array_country_codes["{$regs[1]}_{$regs[2]}"] = $regs[1];
        }
    }
    $ENC[1024] = 1024;
    $ENC[2048] = 2048;
    $ENC[4096] = 4096;
    if (!$q->FIELD_EXISTS("sslcertificates", "UsePrivKeyCrt", "artica_backup")) {
        $sql = "ALTER TABLE `sslcertificates` ADD `UsePrivKeyCrt` smallint(1) DEFAULT 0";
        $q->QUERY_SQL($sql, 'artica_backup');
    }
    $tpl = new templates();
    $choose_UsePrivKeyCrt = $tpl->javascript_parse_text("{choose_UsePrivKeyCrt}");
    $sql = "SELECT * FROM sslcertificates WHERE CommonName='{$commonName}'";
    $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
    if ($ligne["UseGodaddy"] == 1) {
        $ligne["UsePrivKeyCrt"] = 1;
        $commonNameADD = " (Godaddy)";
    }
    if ($ligne["UsePrivKeyCrt"] == 0) {
        if ($ligne["CountryName"] == null) {
            $ligne["CountryName"] = "UNITED STATES_US";
        }
        if ($ligne["stateOrProvinceName"] == null) {
            $ligne["stateOrProvinceName"] = "New York";
        }
        if ($ligne["localityName"] == null) {
            $ligne["localityName"] = "Brooklyn";
        }
        if ($ligne["emailAddress"] == null) {
            $ligne["emailAddress"] = "*****@*****.**";
        }
        if ($ligne["OrganizationName"] == null) {
            $ligne["OrganizationName"] = "MyCompany Ltd";
        }
        if ($ligne["OrganizationalUnit"] == null) {
            $ligne["OrganizationalUnit"] = "IT service";
        }
        if (!is_numeric($ligne["CertificateMaxDays"])) {
            $ligne["CertificateMaxDays"] = 730;
        }
        if (!is_numeric($ligne["levelenc"])) {
            $ligne["levelenc"] = 1024;
        }
    }
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $hostname = $sock->GET_INFO("myhostname");
    $choose_UsePrivKeyCrt = $tpl->javascript_parse_text("{choose_UsePrivKeyCrt}");
    $t = time();
    $ENC[1024] = 1024;
    $ENC[2048] = 2048;
    $ENC[4096] = 4096;
    $commonNameEnc = urlencode($commonName);
    $bt_name = "{apply}";
    if (strlen($ligne["pkcs12"]) > 50) {
        $cleint_certificate = "<div style='float:right;width:30%;text-align:right;margin:5px'>\n\t\t\t<center>\n\t\t\t<a href=\"{$page}?pkcs12=yes&CommonName=" . urlencode($_GET["CommonName"]) . "\">\n\t\t\t\t<img src='img/certificate-128.png'>\n\t\t\t</a><br>\n\t\t\t<span style='font-size:18px'>PKCS12 {client_certificate}</span> \n\t\t\t</center>\n\t\t\t</div>";
    }
    if ($ligne["UsePrivKeyCrt"] == 0) {
        $bt_name = "{generate_x509}";
    }
    $html[] = "<div style='font-size:42px;margin-bottom:15px'>{$commonName}{$commonNameADD}</div>";
    $html[] = "<div style='width:98%' class=form>";
    $html[] = "<table style='width:100%'>";
    if ($ligne["UsePrivKeyCrt"] == 0) {
        $html[] = "<tr><td colspan=2>{$cleint_certificate}" . Paragraphe_switch_img("{UsePrivKeyCrt}", "{UsePrivKeyCrt_text}", "UsePrivKeyCrt", $ligne["UsePrivKeyCrt"], null, 820) . "</td></tr>";
        $html[] = Field_list_table("CountryName-{$t}", "{countryName}", $ligne["CountryName"], 22, $array_country_codes);
        $html[] = Field_text_table("stateOrProvinceName", "{stateOrProvinceName}", $ligne["stateOrProvinceName"], 22, null, 400);
        $html[] = Field_text_table("localityName", "{localityName}", $ligne["localityName"], 22, null, 400);
        $html[] = Field_text_table("OrganizationName", "{organizationName}", $ligne["OrganizationName"], 22, null, 400);
        $html[] = Field_text_table("OrganizationalUnit", "{organizationalUnitName}", $ligne["OrganizationalUnit"], 22, null, 400);
        $html[] = Field_text_table("emailAddress", "{emailAddress}", $ligne["emailAddress"], 22, null, 400);
        $html[] = Field_text_table("CertificateMaxDays", "{CertificateMaxDays} ({days})", $ligne["CertificateMaxDays"], 22, null, 150);
        $html[] = Field_list_table("levelenc", "{level_encryption}", $ligne["levelenc"], 22, $ENC);
        $html[] = Field_password_table("password-{$t}", "{password}", $ligne["password"], 22, null, 300);
        $html[] = Field_button_table_autonome($bt_name, "Submit{$t}", 30);
    } else {
        $html[] = "<tr>\n\t\t<td class=legend style='font-size:22px'>{countryName}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["CountryName"]}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{stateOrProvinceName}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["stateOrProvinceName"]}</td>\n\t\t</tr>\t\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{localityName}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["localityName"]}</td>\n\t\t</tr>\t\t\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{organizationName}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["OrganizationName"]}</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{organizationalUnitName}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["OrganizationalUnit"]}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{emailAddress}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["emailAddress"]}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td class=legend style='font-size:22px'>{level_encryption}:</td>\n\t\t<td style='font-size:22px;font-weight:bold'>{$ligne["levelenc"]}</td>\n\t\t</tr>\t\t";
    }
    $html[] = "</table>";
    $html[] = "</div>\n\t<script>\n\t\tvar xSubmit{$t}= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>3){alert(results);return;}\n\t\t\$('#TABLE_CERTIFICATE_CENTER_MAIN').flexReload();\n\t\tvar UsePrivKeyCrt=document.getElementById('UsePrivKeyCrt').value;\n\t\tif(UsePrivKeyCrt==1){\n\t\t\tLoadjs('openssl.x509.progress.php?generate-x509={$commonNameEnc}');\n\t\t}else{\n\t\t\tLoadjs('openssl.CSR.progress.php?generate-csr={$commonNameEnc}');\n\t\t}\n\t\tYahooWin6Hide();\n\t}\n\t\n\t\n\tfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\t\n\tXHR.appendData('CommonName',encodeURIComponent('{$_GET["CommonName"]}'));\n\tXHR.appendData('UsePrivKeyCrt',document.getElementById('UsePrivKeyCrt').value);\n\tXHR.appendData('CountryName',document.getElementById('CountryName-{$t}').value);\n\t\n\tXHR.appendData('CertificateMaxDays',document.getElementById('CertificateMaxDays').value);\n\tXHR.appendData('stateOrProvinceName',document.getElementById('stateOrProvinceName').value);\n\tXHR.appendData('localityName',document.getElementById('localityName').value);\n\tXHR.appendData('OrganizationName',document.getElementById('OrganizationName').value);\n\tXHR.appendData('OrganizationalUnit',document.getElementById('OrganizationalUnit').value);\n\tXHR.appendData('emailAddress',document.getElementById('emailAddress').value);\n\tXHR.appendData('levelenc',document.getElementById('levelenc').value);\n\tXHR.appendData('password',encodeURIComponent(document.getElementById('password-{$t}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n\t}\n\n\n\t</script>\n\t\n\t";
    echo $tpl->_ENGINE_parse_body(@implode("\n", $html));
}
function page()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $sock = new sockets();
    $tpl = new templates();
    $db = file_get_contents(dirname(__FILE__) . '/ressources/databases/ISO-3166-Codes-Countries.txt');
    $tbl = explode("\n", $db);
    while (list($num, $ligne) = each($tbl)) {
        if (preg_match('#(.+?);\\s+([A-Z]{1,2})#', $ligne, $regs)) {
            $regs[2] = trim($regs[2]);
            $regs[1] = trim($regs[1]);
            $array_country_codes["{$regs[1]}_{$regs[2]}"] = $regs[1];
        }
    }
    $ENC[1024] = 1024;
    $ENC[2048] = 2048;
    $ENC[4096] = 4096;
    $ligne = unserialize($sock->GET_INFO("OpenVPNCertificateSettings"));
    if ($ligne["CountryName"] == null) {
        $ligne["CountryName"] = "UNITED STATES_US";
    }
    if ($ligne["stateOrProvinceName"] == null) {
        $ligne["stateOrProvinceName"] = "New York";
    }
    if ($ligne["localityName"] == null) {
        $ligne["localityName"] = "Brooklyn";
    }
    if ($ligne["emailAddress"] == null) {
        $ligne["emailAddress"] = "*****@*****.**";
    }
    if ($ligne["OrganizationName"] == null) {
        $ligne["OrganizationName"] = "MyCompany Ltd";
    }
    if ($ligne["OrganizationalUnit"] == null) {
        $ligne["OrganizationalUnit"] = "IT service";
    }
    if (!is_numeric($ligne["CertificateMaxDays"])) {
        $ligne["CertificateMaxDays"] = 730;
    }
    if (!is_numeric($ligne["levelenc"])) {
        $ligne["levelenc"] = 2048;
    }
    $hostname = $sock->GET_INFO("myhostname");
    $t = time();
    $ENC[1024] = 1024;
    $ENC[2048] = 2048;
    $ENC[4096] = 4096;
    $bt_name = "{apply}";
    $html[] = "<div style='font-size:42px;margin-bottom:15px'>{$hostname}</div>";
    $html[] = "<div style='width:98%' class=form>";
    $html[] = "<table style='width:100%'>";
    $html[] = Field_list_table("CountryName-{$t}", "{countryName}", $ligne["CountryName"], 22, $array_country_codes);
    $html[] = Field_text_table("stateOrProvinceName", "{stateOrProvinceName}", $ligne["stateOrProvinceName"], 22, null, 400);
    $html[] = Field_text_table("localityName", "{localityName}", $ligne["localityName"], 22, null, 400);
    $html[] = Field_text_table("OrganizationName", "{organizationName}", $ligne["OrganizationName"], 22, null, 400);
    $html[] = Field_text_table("OrganizationalUnit", "{organizationalUnitName}", $ligne["OrganizationalUnit"], 22, null, 400);
    $html[] = Field_text_table("emailAddress", "{emailAddress}", $ligne["emailAddress"], 22, null, 400);
    $html[] = Field_text_table("CertificateMaxDays", "{CertificateMaxDays} ({days})", $ligne["CertificateMaxDays"], 22, null, 150);
    $html[] = Field_list_table("levelenc", "{level_encryption}", $ligne["levelenc"], 22, $ENC);
    $html[] = Field_password_table("password-{$t}", "{password}", $ligne["password"], 22, null, 300);
    $html[] = Field_button_table_autonome($bt_name, "Submit{$t}", 30);
    $html[] = "</table>";
    $html[] = "</div>\n<script>\nvar xSubmit{$t}= function (obj) {\n\tvar results=obj.responseText;\n\tif(results.length>3){alert(results);return;}\n\tLoadjs('index.openvpn.client.progress.php?uid=OpenVPN-MASTER');\n}\n\t\n\t\nfunction Submit{$t}(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('CommonName',encodeURIComponent('{$hostname}'));\n\tXHR.appendData('CountryName',document.getElementById('CountryName-{$t}').value);\n\tXHR.appendData('CertificateMaxDays',document.getElementById('CertificateMaxDays').value);\n\tXHR.appendData('stateOrProvinceName',document.getElementById('stateOrProvinceName').value);\n\tXHR.appendData('localityName',document.getElementById('localityName').value);\n\tXHR.appendData('OrganizationName',document.getElementById('OrganizationName').value);\n\tXHR.appendData('OrganizationalUnit',document.getElementById('OrganizationalUnit').value);\n\tXHR.appendData('emailAddress',document.getElementById('emailAddress').value);\n\tXHR.appendData('levelenc',document.getElementById('levelenc').value);\n\tXHR.appendData('password',encodeURIComponent(document.getElementById('password-{$t}').value));\n\tXHR.sendAndLoad('{$page}', 'POST',xSubmit{$t});\n}\n</script>\n";
    echo $tpl->_ENGINE_parse_body(@implode("\n", $html));
}