function popup_dns_save() { $resolv = new resolv_conf(); $resolv->MainArray["DNS1"] = $_POST["DNS1"]; $resolv->MainArray["DNS2"] = $_POST["DNS2"]; $resolv->save(); $sock = new sockets(); $sock->SET_INFO("myhostname", $_POST["hostname"]); $sock->getFrameWork("cmd.php?ChangeHostName={$_POST["hostname"]}"); $sock->getFrameWork("services.php?resolvConf=yes"); }
function DNS_SERVERS_SAVE(){ $resolv=new resolv_conf(); while (list ($num, $val) = each ($_POST) ){ $resolv->MainArray[$num]=$val; } $resolv->save(); $sock=new sockets(); $sock->getFrameWork("services.php?resolvConf=yes"); }
function checkParams() { progress_logs(5, "{apply_settings}", "Checks settings.."); $sock = new sockets(); $array = unserialize(base64_decode($sock->GET_INFO("KerbAuthInfos"))); if ($array["WINDOWS_DNS_SUFFIX"] == null) { progress_logs(20, "{apply_settings}", "Auth Winbindd, misconfiguration failed WINDOWS_DNS_SUFFIX = NULL"); return false; } if ($array["WINDOWS_SERVER_NETBIOSNAME"] == null) { progress_logs(20, "{apply_settings}", "Auth Winbindd, misconfiguration failed WINDOWS_SERVER_NETBIOSNAME = NULL"); return false; } if ($array["WINDOWS_SERVER_TYPE"] == null) { progress_logs(20, "{apply_settings}", "Auth Winbindd, misconfiguration failed WINDOWS_SERVER_TYPE = NULL"); return false; } if ($array["WINDOWS_SERVER_ADMIN"] == null) { progress_logs(20, "{apply_settings}", "Auth Winbindd, misconfiguration failed WINDOWS_SERVER_ADMIN = NULL"); return false; } if ($array["WINDOWS_SERVER_PASS"] == null) { progress_logs(20, "{apply_settings}", "Auth Winbindd, misconfiguration failed WINDOWS_SERVER_PASS = NULL"); return false; } $ADNETIPADDR = $array["ADNETIPADDR"]; $UseADAsNameServer = $sock->GET_INFO("UseADAsNameServer"); if (!$UseADAsNameServer) { $UseADAsNameServer = 0; } if ($UseADAsNameServer == 1) { $resolve = new resolv_conf(); progress_logs(20, "{apply_settings}", "Auth Winbindd, SET {$ADNETIPADDR} as 1st DNS in line " . __LINE__); $resolve->MainArray["DNS1"] = $ADNETIPADDR; progress_logs(20, "{apply_settings}", "Auth Winbindd, Building configuration " . __LINE__); $REX = $resolve->build(); progress_logs(20, "{apply_settings}", "Auth Winbindd, saving /etc/resolv.conf " . __LINE__); @file_put_contents("/etc/resolv.conf", $resolve->build()); progress_logs(20, "{apply_settings}", "Auth Winbindd, saving new configuration " . __LINE__); $resolve->save(); } $hostname = strtolower(trim($array["WINDOWS_SERVER_NETBIOSNAME"])) . "." . strtolower(trim($array["WINDOWS_DNS_SUFFIX"])); progress_logs(20, "{apply_settings}", "Trying to resolve host {$hostname} ...." . __LINE__); $ip = gethostbyname($hostname); progress_logs(20, "{apply_settings}", "host {$hostname} = {$ip}...." . __LINE__); if ($ip == $hostname) { progress_logs(7, "{apply_settings}", "!!!!! {$ip} gethostbyname({$hostname}) failed !!!!!"); return false; } progress_logs(7, "{apply_settings}", "Checks settings success.."); return true; }
function settingsSave() { include_once dirname(__FILE__) . "/ressources/externals/Net_DNS2/DNS2.php"; include_once dirname(__FILE__) . "/ressources/class.resolv.conf.inc"; $ipClass = new IP(); $sock = new sockets(); $users = new usersMenus(); $tpl = new templates(); include_once dirname(__FILE__) . "/ressources/class.html.tools.inc"; $_POST["WINDOWS_SERVER_PASS"] = url_decode_special_tool($_POST["WINDOWS_SERVER_PASS"]); if (strpos($_POST["WINDOWS_SERVER_ADMIN"], "@") > 0) { $trx = explode("@", $_POST["WINDOWS_SERVER_ADMIN"]); $_POST["WINDOWS_SERVER_ADMIN"] = $trx[0]; } unset($_SESSION["EnableKerbAuth"]); $EnableWebProxyStatsAppliance = $sock->GET_INFO("EnableWebProxyStatsAppliance"); $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance"); if (!is_numeric($EnableWebProxyStatsAppliance)) { $EnableWebProxyStatsAppliance = 0; } if ($users->WEBSTATS_APPLIANCE) { $EnableWebProxyStatsAppliance = 1; } $_POST["WINDOWS_DNS_SUFFIX"] = trim(strtolower($_POST["WINDOWS_DNS_SUFFIX"])); if ($_POST["WINDOWS_DNS_SUFFIX"] == null) { echo "Please set the DNS domain of your Active Directory server"; return; } $Myhostname = $sock->getFrameWork("cmd.php?full-hostname=yes"); $MyhostnameTR = explode(".", $Myhostname); $MyNetbiosName = $MyhostnameTR[0]; unset($MyhostnameTR[0]); $MyDomain = strtolower(@implode(".", $MyhostnameTR)); if ($MyDomain != $_POST["WINDOWS_DNS_SUFFIX"]) { $nic = new system_nic(); $nic->set_hostname("{$MyNetbiosName}.{$_POST["WINDOWS_DNS_SUFFIX"]}"); } $adhost = "{$_POST["WINDOWS_SERVER_NETBIOSNAME"]}.{$_POST["WINDOWS_DNS_SUFFIX"]}"; if (strtolower($adhost) == strtolower($Myhostname)) { echo "Active Directory: {$adhost} as the same name of this server:{$Myhostname}\n"; return; } if ($_POST["ADNETIPADDR"] != null) { $ipaddrZ = explode(".", $_POST["ADNETIPADDR"]); while (list($num, $a) = each($ipaddrZ)) { $ipaddrZ[$num] = intval($a); } $_POST["ADNETIPADDR"] = @implode(".", $ipaddrZ); } $resolved = gethostbyname($adhost); if (!$ipClass->isValid($resolved)) { if ($ipClass->isValid($_POST["ADNETIPADDR"])) { $resolved = CheckDNS($adhost, $_POST["ADNETIPADDR"]); if ($ipClass->isValid($resolved)) { $_POST["UseADAsNameServer"] = 1; } } } $sock->SET_INFO("SambaBindInterface", $_POST["SambaBindInterface"]); $sock->SET_INFO("KerbAuthDisableNormalizeName", $_POST["KerbAuthDisableNormalizeName"]); $sock->SET_INFO("WindowsActiveDirectoryKerberos", $_POST["WindowsActiveDirectoryKerberos"]); $sock->SET_INFO("KerbAuthDisableGroupListing", $_POST["KerbAuthDisableGroupListing"]); $sock->SET_INFO("KerbAuthTrusted", $_POST["KerbAuthTrusted"]); $sock->SET_INFO("KerbAuthMapUntrustedDomain", $_POST["KerbAuthMapUntrustedDomain"]); $sock->SET_INFO("NtpdateAD", $_POST["NtpdateAD"]); $sock->SET_INFO("KerbAuthMethod", $_POST["KerbAuthMethod"]); $sock->SET_INFO("SquidNTLMKeepAlive", $_POST["SquidNTLMKeepAlive"]); $sock->SET_INFO("UseADAsNameServer", $_POST["UseADAsNameServer"]); $sock->SET_INFO("NET_RPC_INFOS", base64_encode(serialize(array()))); $ArrayKerbAuthInfos = unserialize(base64_decode($sock->GET_INFO("KerbAuthInfos"))); while (list($num, $ligne) = each($_POST)) { $ArrayKerbAuthInfos[$num] = $ligne; } $sock->SaveConfigFile(base64_encode(serialize($ArrayKerbAuthInfos)), "KerbAuthInfos"); if ($_POST["UseADAsNameServer"] == 1) { $resolve = new resolv_conf(); $resolve->MainArray["DNS1"] = $_POST["ADNETIPADDR"]; $resolve->save(); $resolved = CheckDNS($adhost, $_POST["ADNETIPADDR"]); if (!$ipClass->isValid($resolved)) { echo $tpl->javascript_parse_text("{error}: {unable_to_resolve} Active Directory: {$adhost} {with} {$_POST["ADNETIPADDR"]}", 1); return; } } else { $resolved = gethostbyname($adhost); if (!$ipClass->isValid($resolved)) { $tpl = new templates(); if ($EnableWebProxyStatsAppliance == 0) { $sock->SET_INFO("EnableKerbAuth", 0); } $sock->SaveConfigFile(base64_encode(serialize($_POST)), "KerbAuthInfos"); echo $tpl->javascript_parse_text("{error}: {unable_to_resolve} Active Directory: {$adhost}", 1); return; } if ($resolved == "127.0.0.1") { echo $tpl->javascript_parse_text("{error}: {$adhost} lookup to 127.0.0.1 !\n"); return; } } if (strpos($_POST["ADNETBIOSDOMAIN"], ".") > 0) { echo "The netbios domain \"{$_POST["ADNETBIOSDOMAIN"]}\" is invalid.\n"; $sock->SET_INFO("EnableKerbAuth", 0); return; } $sock->SET_INFO("EnableKerbAuth", $_POST["EnableKerbAuth"]); }
function BUILD_NETWORK() { $SUBNIC = null; $unix = new unix(); $sock = new sockets(); $nohup = $unix->find_program("nohup"); $php5 = $unix->LOCATE_PHP5_BIN(); $savedsettings = unserialize(base64_decode(file_get_contents("/etc/artica-postfix/settings/Daemons/WizardSavedSettings"))); $KEEPNET = $savedsettings["KEEPNET"]; if ($KEEPNET == 1) { return; } $netbiosname = $savedsettings["netbiosname"]; if (strlen($netbiosname) > 15) { $netbiosname = substr(0, 15, $netbiosname); } if (isset($savedsettings["domain"])) { $domainname = $savedsettings["domain"]; $SEARCH_DOMAIN = $domainname; } $EnableKerbAuth = intval($sock->GET_INFO("EnableKerbAuth")); if ($EnableKerbAuth == 1) { $array = unserialize(base64_decode($sock->GET_INFO("KerbAuthInfos"))); if (isset($array["WINDOWS_DNS_SUFFIX"])) { $SEARCH_DOMAIN = $array["WINDOWS_DNS_SUFFIX"]; $domainname = $SEARCH_DOMAIN; } } $Encoded = base64_encode(serialize($savedsettings)); @file_put_contents("/etc/artica-postfix/settings/Daemons/WizardSavedSettings", $Encoded); if (!isset($savedsettings["NIC"])) { $savedsettings["NIC"] = "eth0"; } $NIC = $savedsettings["NIC"]; if (preg_match("#(.+?):([0-9]+)#", $savedsettings["NIC"], $re)) { $NIC = trim($re[1]); $SUBNIC = $re[2]; } writeprogress(60, "{building_networks}"); $nics = new system_nic($NIC); $nics->CheckMySQLFields(); $dhclient = $unix->find_program("dhclient"); if (is_file($dhclient)) { $pid = $unix->PIDOF($dhclient); if ($unix->process_exists($pid)) { $unix->KILL_PROCESS($pid, 9); } } $nics->eth = $NIC; if ($SUBNIC != null) { $nics->IPADDR = "127.0.0.2"; $nics->NETMASK = "255.255.255.255"; $nics->GATEWAY = "0.0.0.0"; $nics->BROADCAST = "0.0.0.0"; $nics->DNS1 = $savedsettings["DNS1"]; $nics->DNS2 = $savedsettings["DNS2"]; $nics->dhcp = 0; $nics->metric = $savedsettings["metric"]; $nics->enabled = 1; $nics->defaultroute = 1; } else { $nics->IPADDR = $savedsettings["IPADDR"]; $nics->NETMASK = $savedsettings["NETMASK"]; $nics->GATEWAY = $savedsettings["GATEWAY"]; $nics->BROADCAST = $savedsettings["BROADCAST"]; $nics->DNS1 = $savedsettings["DNS1"]; $nics->DNS2 = $savedsettings["DNS2"]; $nics->dhcp = 0; $nics->metric = $savedsettings["metric"]; $nics->enabled = 1; $nics->defaultroute = 1; } writeprogress(60, "{saving_network}"); $nics->SaveNic(); if ($SUBNIC != null) { $q = new mysql(); $sql = "INSERT INTO nics_virtuals (ID,nic,org,ipaddr,netmask,cdir,gateway,ForceGateway,failover,metric)\n\t\tVALUES('{$SUBNIC}','{$NIC}','','{$savedsettings["IPADDR"]}','{$savedsettings["NETMASK"]}',\n\t\t'','{$savedsettings["GATEWAY"]}',0,0,1);"; $q->QUERY_SQL($sql, "artica_backup"); $sql = "UPDATE nics_virtuals SET nic='{$NIC}',\n\t\torg='',\n\t\tipaddr='{$savedsettings["IPADDR"]}',\n\t\tnetmask='{$savedsettings["NETMASK"]}',\n\t\tcdir='',\n\t\t\t\tgateway='{$savedsettings["GATEWAY"]}',\n\t\t\t\tForceGateway='0',\n\t\t\t\tfailover='0',\n\t\t\t\tmetric='1'\n\t\t\t\tWHERE ID={$SUBNIC}"; $q->QUERY_SQL($sql, "artica_backup"); } writeprogress(60, "Loading resolv library"); $resolv = new resolv_conf(); $arrayNameServers[0] = $savedsettings["DNS1"]; $arrayNameServers[1] = $savedsettings["DNS2"]; $resolv->MainArray["DNS1"] = $arrayNameServers[0]; $resolv->MainArray["DNS2"] = $arrayNameServers[1]; $resolv->MainArray["DOMAINS1"] = $SEARCH_DOMAIN; writeprogress(60, "Saving DNS settings"); $resolv->save(); $nic = new system_nic(); writeprogress(60, "{set_new_hostname} {$netbiosname}.{$domainname}"); $nic->set_hostname("{$netbiosname}.{$domainname}"); $php = $unix->LOCATE_PHP5_BIN(); $nohup = $unix->find_program("nohup"); writeprogress(60, "{building_resolv_configuration}"); shell_exec(trim("{$nohup} " . $unix->LOCATE_PHP5_BIN() . " /usr/share/artica-postfix/exec.virtuals-ip.php --resolvconf >/dev/null 2>&1")); writeprogress(60, "{building_networks_scripts}"); shell_exec("{$php5} /usr/share/artica-postfix/exec.virtuals-ip.php >/dev/null 2>&1"); }
function ACTION_DNS() { $unix = new unix(); $clear = $unix->find_program("clear"); if (is_file($clear)) { system("{$clear}"); } echo "This wizard will help to configure DNS.\n"; echo "Press q letter to exit or any key to continue:"; $answer = trim(strtolower(fgets(STDIN))); if ($answer == "q") { return; } if (is_file($clear)) { system("{$clear}"); } $tcp = new IP(); $GLOBALS["PROGRESS"] = true; $f = explode("\n", @file_get_contents("/etc/resolv.conf")); while (list($gpid, $val) = each($f)) { if (preg_match("#^domain\\s+(.+)#", $val, $re)) { $domain = $re[1]; break; } } $DN1 = ASK_DNS1(); $DN2 = ASK_DNS2(); echo "Set the search domain suffix: [{$domain}]\n"; $domain2 = trim(strtolower(fgets(STDIN))); if ($domain2 != null) { $domain = $domain2; } echo "DNS server 1........: \"{$DN1}\"\n"; echo "DNS server 2........: \"{$DN2}\"\n"; echo "Search domain suffix: \"{$domain}\"\n"; echo "\n"; //ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null); echo "If your are agree with these settings\n"; echo "Press any key to apply settings or press \"q\" to return to menu.\n"; $answer = trim(strtolower(fgets(STDIN))); if ($answer == "q") { return; } echo "Loading DNS library...\n"; $GLOBALS["PROGRESS"] = true; $resolv = new resolv_conf(); $resolv->MainArray["DNS1"] = $DN1; $resolv->MainArray["DNS2"] = $DN2; $resolv->MainArray["DOMAINS1"] = $domain; echo "Saving DNS items ( please wait )...\n"; $resolv->save(); if ($domain != null) { $f[] = "domain {$domain}"; $f[] = "search {$domain}"; } $f[] = "options attempts:5 timeout:5"; $f[] = "nameserver {$DN1}"; $f[] = "nameserver {$DN2}\n"; @file_put_contents("/etc/resolv.conf", @implode("\n", $f)); echo "Saving DNS items done...\n"; echo "Press any key to return to menu."; $answer = trim(strtolower(fgets(STDIN))); MAIN_MENU(); }
function setup_3() { $GLOBALS["DEBUG_TEMPLATE"] = true; include_once dirname(__FILE__) . "/ressources/class.langages.inc"; $langAutodetect = new articaLang(); $DetectedLanguage = $langAutodetect->get_languages(); $GLOBALS["FIXED_LANGUAGE"] = $DetectedLanguage; $tpl = new templates(); $page = CurrentPageName(); $users = new usersMenus(); $sock = new sockets(); $savedsettings = unserialize(base64_decode($_GET["savedsettings"])); $users = new usersMenus(); $sock = new sockets(); $EnableUfdbGuard = $sock->GET_INFO("EnableUfdbGuard"); if ($EnableUfdbGuard != $savedsettings["EnableWebFiltering"]) { $savedsettings["EnableWebFiltering"] = $EnableUfdbGuard; } $please_fill_all_form_values = $tpl->javascript_parse_text("{please_fill_all_form_values}"); $organization = $savedsettings["organization"]; $employees = $savedsettings["employees"]; $company_name = $savedsettings["company_name"]; $country = $savedsettings["country"]; $city = $savedsettings["city"]; $mail = $savedsettings["mail"]; $telephone = $savedsettings["telephone"]; $UseServerV = $savedsettings["UseServer"]; $smtp_domainname = $savedsettings["smtp_domainname"]; $company_www = $savedsettings["company_www"]; $GoldKey = $savedsettings["GoldKey"]; $KEEPNET = $savedsettings["KEEPNET"]; if (!is_numeric($KEEPNET)) { $KEEPNET = 0; } $t = time(); $MBX = false; $Postfix = false; $Samba = false; $squid_installed = false; $nginx_installed = false; $UseServer[null] = "{select}"; if ($users->POSTFIX_INSTALLED) { $Postfix = true; } if ($users->ZARAFA_INSTALLED) { $MBX = true; } if ($users->cyrus_imapd_installed) { $MBX = true; } if ($MBX) { $UseServer["ASMAIL"] = "{mail_server}"; } if ($users->SAMBA_INSTALLED) { $Samba = true; } if ($users->SQUID_INSTALLED) { $squid_installed = true; } if ($users->NGINX_INSTALLED) { $nginx_installed = true; } if ($Postfix) { $UseServer["ASRELAY"] = "{relay_server}"; } if ($Samba) { $UseServer["ASFILE"] = "{file_server}"; } if ($squid_installed) { $UseServer["ASPROXY"] = "{proxy_server}"; } if ($nginx_installed) { $UseServer["ASREVERSEPROXY"] = "{reverse_proxy_server}"; } $UseServer["AS_WORDPRESS"] = "Wordpress appliance"; $netbiosname = $savedsettings["netbiosname"]; $domainname = $savedsettings["domain"]; $arrayNameServers[0] = $savedsettings["DNS1"]; $arrayNameServers[1] = $savedsettings["DNS2"]; $page = CurrentPageName(); $tpl = new templates(); if ($KEEPNET == 0) { $resolv = new resolv_conf(); $resolv->MainArray["DNS1"] = $arrayNameServers[0]; $resolv->MainArray["DNS2"] = $arrayNameServers[1]; $resolv->save(); } if ($KEEPNET == 0) { if ($_POST["IPADDR"] != null) { $nics = new system_nic("eth0"); $nics->eth = "ethO"; $nics->IPADDR = $arrayNameServers["IPADDR"]; $nics->NETMASK = $arrayNameServers["NETMASK"]; $nics->GATEWAY = $arrayNameServers["GATEWAY"]; $nics->BROADCAST = $arrayNameServers["BROADCAST"]; $nics->DNS1 = $arrayNameServers[0]; $nics->DNS2 = $arrayNameServers[1]; $nics->dhcp = 0; $nics->metric = $savedsettings["metric"]; $nics->enabled = 1; $nics->NoReboot = true; $nics->SaveNic(); } } $UseServerF = Field_array_Hash($UseServer, "UseServer", $UseServerV, "style:font-size:25px"); $UseServerFF = "\t\n\t</tr>\n\t\t<td class=legend style='font-size:25px'>{you_using_this_server_for}:</td>\n\t\t<td>{$UseServerF}</td>\n\t</tr>"; if ($users->WORDPRESS_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Wordpress Appliance'>"; } if ($users->SMTP_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='SMTP Relay Appliance'>"; } if ($users->KASPERSKY_WEB_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Kaspersky Web Appliance'>"; } if ($users->LOAD_BALANCE_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Load balance Appliance'>"; } if ($users->ZARAFA_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Zarafa Appliance'>"; } if ($users->SAMBA_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='File Sharing Appliance'>"; } if ($users->WEBSTATS_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Web statistics Appliance'>"; } if ($users->STATS_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Statistics Appliance'>"; } if ($users->KASPERSKY_SMTP_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Kaspersky SMTP Appliance'>"; } if ($users->APACHE_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Apache Appliance'>"; } if ($users->SQUID_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Proxy Appliance'>"; } if ($users->HAPRROXY_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Load balance Appliance'>"; } if ($users->FULL_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Artica Full Appliance'>"; } if ($users->MYCOSI_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='MyCOSI Appliance'>"; } if ($users->CYRUS_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='IMAP-POP3 OpenSource Appliance'>"; } if ($users->PROXYTINY_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Tiny Proxy Appliance'>"; } if ($users->SQUID_REVERSE_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Reverse Proxy Appliance' >"; } if ($users->GATEWAY_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Gateway Appliance' >"; } if ($users->WORDPRESS_APPLIANCE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Wordpress Appliance' >"; } if ($users->WEBSECURIZE) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='WebSecurize Appliance' >"; } if ($users->BAMSIGHT) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='BamSight' >"; } if ($users->LANWANSAT) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='LANWANSAT Appliance' >"; } //toujours à la fin... if ($UseServerFF == null) { if ($users->FROM_SETUP) { $UseServerFF = "<input type='hidden' id='UseServer' name='UseServer' value='Installed from Setup'>"; } } $noticeregisterform = "<div style='font-size:11px;text-align:right'>{noticeregisterform}</div>"; if ($users->WEBSECURIZE) { $noticeregisterform = null; } if ($users->LANWANSAT) { $noticeregisterform = null; } if ($users->BAMSIGHT) { $noticeregisterform = null; } $company_name_txtjs = $tpl->javascript_parse_text("{company_name}"); $FORM = "\n\t<div style='width:98%' class=form>\n\t<table style='width:100%' id='{$t}'>\n\t\n\t<tr>\n\t\t<td colspan=2 style='font-size:50px;font-weight:bolder'>{YourRealCompany}</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:25px'>{gold_license}:</td>\n\t\t<td>" . Field_text("GoldKey", $GoldKey, "font-size:25px;width:440px") . "</td>\n\t</tr>\n\t\t<tr><td colspan=2 align='right'><i>{gold_license_explain}</i></td></tr>\t\n\t<tr>\n\t\t<td class=legend style='font-size:25px'>{company_name}:</td>\n\t\t<td>" . Field_text("company_name", $company_name, "font-size:25px;width:440px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:25px'>{company_website}:</td>\n\t\t<td>" . Field_text("company_www", $company_www, "font-size:25px;width:440px") . "</td>\n\t</tr>\t\t\t\t\n\t</tr>\n\t\t<td class=legend style='font-size:25px'>{country}:</td>\n\t\t<td>" . Field_text("country", $country, "font-size:25px;width:440px") . "</td>\n\t</tr>\n\t</tr>\n\t\t<td class=legend style='font-size:25px'>{city}:</td>\n\t\t<td>" . Field_text("city", $city, "font-size:25px;width:440px") . "</td>\n\t</tr>\n\t\t\t\t\t\n\t</tr>\n\t\t<td class=legend style='font-size:25px'>{your_email_address}:</td>\n\t\t<td>" . Field_text("mail", $mail, "font-size:25px;width:440px") . "</td>\n\t</tr>\t\n\t</tr>\n\t\t<td class=legend style='font-size:25px'>{phone_title}:</td>\n\t\t<td>" . Field_text("telephone", $telephone, "font-size:25px;width:440px") . "</td>\n\t</tr>\n\t</tr>\n\t\t<td class=legend style='font-size:25px'>{nb_employees}</td>\n\t\t<td>" . Field_text("employees", $employees, "font-size:25px;width:440px") . "</td>\n\t</tr>\n\n\t{$UseServerFF}\n\t\n\t<tr>\n\t\t<td colspan=2 style='font-size:25px;font-weight:bolder'> </td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 style='font-size:50px;font-weight:bolder'>{virtual_company}</div></td>\n\t</tr>\t\n\t</tr>\n\t\t<td class=legend style='font-size:25px'>{organization}:</td>\n\t\t<td>" . Field_text("organization", $organization, "font-size:25px;width:440px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:25px'>{domain}:</td>\n\t\t<td>" . Field_text("smtp_domainname", $smtp_domainname, "font-size:25px;width:440px", null, null, null, false, "CheckMyForm{$t}(event)") . "</td>\n\t</tr>\t\n\t\t<tr>\n\t\t<td colspan=2 style='font-size:25px;font-weight:bolder'> </td>\n\t</tr>\n\t<tr>\n\t\t<td style='font-size:16px;font-weight:bolder'><div style='text-align:left'>" . button("{back}", "LoadAjax('setup-content','{$page}?setup-2=yes&savedsettings={$_GET["savedsettings"]}')", "30px") . "</div></td>\n\t\t<td style='font-size:16px;font-weight:bolder'><div style='text-align:right'>" . button("{next}", "ChangeCompanySettings()", "30px") . "</div></td>\n\t</tr>\n\t</table>\n\t{$noticeregisterform}\n\t\n\t<script>\n\t\tvar X_ChangeCompanySettings= function (obj) {\n\t\t\tUnlockPage();\n\t\t\tvar results=obj.responseText;\n\t\t\tvar KEEPNET={$KEEPNET};\n\t\t\tif(KEEPNET==0){\n\t\t\t\tLoadAjax('setup-content','{$page}?setup-4=yes&savedsettings='+results);\n\t\t\t}else{\n\t\t\t\tLoadAjax('setup-content','{$page}?setup-5=yes&savedsettings='+results);\n\t\t\t}\n\t\t\n\t\t\t}\n\t\t\n\t\t\t\n\t\tfunction CheckMyForm{$t}(e){\n\t\t\tif(!checkEnter(e)){return;}\n\t\t}\n\t\t\n\t\tfunction ChangeCompanySettings(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tvar testval=document.getElementById('company_name').value;\n\t\t\tif(testval.length==0){alert('{$please_fill_all_form_values}: {$company_name_txtjs}');return;}\n\t\t\tvar testval=document.getElementById('country').value;\n\t\t\tif(testval.length==0){alert('{$please_fill_all_form_values}');return;}\n\t\t\tvar testval=document.getElementById('city').value;\n\t\t\tif(testval.length==0){alert('{$please_fill_all_form_values}');return;}\t\t\t\t\t\t\n\t\t\tvar testval=document.getElementById('mail').value;\n\t\t\tif(testval.length==0){alert('{$please_fill_all_form_values} - mail');return;}\n\t\t\tvar testval=document.getElementById('employees').value;\n\t\t\tif(testval.length==0){alert('{$please_fill_all_form_values}');return;}\n\t\t\tvar testval=document.getElementById('organization').value;\n\t\t\tif(testval.length==0){alert('{$please_fill_all_form_values}');return;}\n\t\t\tvar testval=document.getElementById('smtp_domainname').value;\n\t\t\tif(testval.length==0){alert('{$please_fill_all_form_values}');return;}\t\t\t\n\t\t\t\n\t\t\tXHR.appendData('company_name',encodeURIComponent(document.getElementById('company_name').value));\n\t\t\tXHR.appendData('city',encodeURIComponent(document.getElementById('city').value));\n\t\t\tXHR.appendData('organization',encodeURIComponent(document.getElementById('organization').value));\n\t\t\tXHR.appendData('country',encodeURIComponent(document.getElementById('country').value));\n\t\t\tXHR.appendData('smtp_domainname',document.getElementById('smtp_domainname').value);\n\t\t\tXHR.appendData('organization',document.getElementById('organization').value);\n\t\t\tXHR.appendData('mail',document.getElementById('mail').value);\n\t\t\tXHR.appendData('telephone',document.getElementById('telephone').value);\n\t\t\tXHR.appendData('employees',document.getElementById('employees').value);\n\t\t\tXHR.appendData('company_www',document.getElementById('company_www').value);\n\t\t\tXHR.appendData('EnableWebFiltering','{$savedsettings["EnableWebFiltering"]}');\n\t\t\tXHR.appendData('GoldKey',document.getElementById('GoldKey').value);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tXHR.appendData('savedsettings','{$_GET["savedsettings"]}');\n\t\t\tLockPage();\n\t\t\tXHR.sendAndLoad('{$page}', 'POST',X_ChangeCompanySettings);\n\t\t\t\n\t\t}\n\tdocument.getElementById('content').style.height='930px';\n\t</script>\n\t\n\t"; $html = "\n\t\n\t<div style='font-size:32px;font-weight:bolder;margin-bottom:50px'>{ContactAndOrganization}</div>{$FORM}\n\t\n\t\n\t"; echo $tpl->_ENGINE_parse_body($html); }