function EditRelayhost() { $main = new main_cf(); $main->main_array["relayhost"] = $_GET["EditRelayhost"]; $main->save_conf(); $tpl = new templates(); echo $tpl->_ENGINE_parse_body('{success}'); }
function PostFixVerifyDatabaseSaveParseOthers() { $main = new main_cf(); unset($_GET["address_verify_map"]); while (list($num, $ligne) = each($_GET)) { $main->main_array[$num] = $ligne; } $main->save_conf(); }
function SaveForm() { $main = new main_cf(); while (list($num, $ligne) = each($_GET)) { $main->main_array[$num] = $ligne; } $main->save_conf(); $tpl = new templates(); echo $tpl->_ENGINE_parse_body('{success}'); }
function SaveForm() { $main = new main_cf(); while (list($num, $val) = each($_GET)) { writelogs("{$num}=\"{$val}\"", __FUNCTION__, __FILE__); $main->main_array[$num] = $val; } $main->save_conf(); $tpl = new templates(); echo $tpl->_ENGINE_parse_body('{success}'); }
function smtpd_sasl_auth_enable() { $main = new main_cf(); $clientRestriction = new smtpd_restrictions(); //smtpd_recipient_restrictions if ($_GET["smtpd_sasl_auth_enable"] == "no") { $clientRestriction->DeleteKey("permit_sasl_authenticated", "smtpd_recipient_restrictions"); } if ($_GET["smtpd_sasl_auth_enable"] == "yes") { $clientRestriction->AddKey("permit_sasl_authenticated", 'smtpd_recipient_restrictions'); $clientRestriction->AddKey("reject_unauth_destination", 'smtpd_recipient_restrictions'); } $main->main_array["smtp_sender_dependent_authentication"] = $_GET["smtp_sender_dependent_authentication"]; $main->main_array["smtpd_sasl_auth_enable"] = $_GET["smtpd_sasl_auth_enable"]; $main->main_array["smtpd_sasl_authenticated_header"] = $_GET["smtpd_sasl_authenticated_header"]; $main->save_conf(); $tpl = new templates(); echo $tpl->_ENGINE_parse_body('{success}'); }
function Delete_Intet_Interface() { $main = new main_cf(); unset($main->array_inet_interfaces[$_GET["Delete_Intet_Interface"]]); $main->save_conf(); echo MyInet_interfaces(); }
function apply_popup2() { $amavis = new amavis(); $amavis->Save(); $amavis->SaveToServer(); $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); }
function PostFixSaveServerCacheSettings() { $main = new main_cf(); while (list($key, $datas) = each($_GET)) { $main->main_array[$key] = $datas; } $main->save_conf(); $tpl = new templates(); echo $tpl->_ENGINE_parse_body('{success}'); }
function BuildRobots($list, $domain) { $array[] = "admin"; $array[] = "bounces"; $array[] = "confirm"; $array[] = "join"; $array[] = "leave"; $array[] = "owner"; $array[] = "request"; $array[] = "subscribe"; $array[] = "unsubscribe"; $tpl = new templates(); $ldap = new clladp(); $dn = "cn={$list}@{$domain},cn=robots,cn=mailman,cn=artica,{$ldap->suffix}"; if (!$ldap->ExistsDN($dn)) { $upd["objectClass"][] = 'top'; $upd["objectClass"][] = 'ArticaMailManRobots'; $upd["MailManAliasPath"][] = "\"|/var/lib/mailman/mail/mailman post {$list}\""; $upd["TransportMailmanMaps"][] = 'mailman:'; $upd["cn"][] = "{$list}@{$domain}"; if (!$ldap->ldap_add($dn, $upd)) { echo $ldap->ldap_last_error; exit; } echo $tpl->_ENGINE_parse_body("{success}:{$list}\n"); } else { unset($upd); echo $tpl->_ENGINE_parse_body("{success}:{$list}\n"); } while (list($num, $ligne) = each($array)) { $dn = "cn={$list}-{$ligne}@{$domain},cn=robots,cn=mailman,cn=artica,{$ldap->suffix}"; if (!$ldap->ExistsDN($dn)) { $upd["objectClass"][] = 'top'; $upd["objectClass"][] = 'ArticaMailManRobots'; $upd["MailManAliasPath"][] = "\"|/var/lib/mailman/mail/mailman {$ligne} {$list}\""; $upd["cn"][] = "{$list}-{$ligne}@{$domain}"; $upd["TransportMailmanMaps"][] = 'mailman:'; if (!$ldap->ldap_add($dn, $upd)) { echo $ldap->ldap_last_error; exit; } echo $tpl->_ENGINE_parse_body("{success}:{$list}-{$ligne}\n"); unset($upd); } else { echo $tpl->_ENGINE_parse_body("{success}:{$list}-{$ligne}\n"); unset($upd); } } $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); }
function main_fetchmail_build(){ include_once('ressources/class.user.inc'); include_once('ressources/class.main_cf.inc'); include_once('ressources/class.fetchmail.inc'); $failed=false; $isp_address_mail=$_GET["isp_address_mail"]; $isp_pop3_server=$_GET["isp_pop3_server"]; $isp_smtp_server=$_GET["isp_smtp_server"]; $isp_account=$_GET["isp_account"]; $isp_password=$_GET["isp_password"]; $local_email=$_GET["local_email"]; $local_password=$_GET["local_password"]; $isp_smtp_account=$_GET["isp_smtp_account"]; $isp_smtp_password=$_GET["isp_smtp_password"]; $relay_server=$_GET["relay_server"]; if($local_email==null){ echo main_fetchmail_build_results(true,'local mail (False)'); exit; } $ldap=new clladp(); writelogs("i try to found if user exists",__FUNCTION__,__FILE__); $uid=$ldap->uid_from_email($local_email); if($uid<>null){ $user=new user($local_email); $ou=$user->ou; }else{ writelogs("no user found, create it",__FUNCTION__,__FILE__); $tb=explode("@",$local_email); $local_domain=$tb[1]; $user=new user($tb[0]); $ou=$ldap->ou_by_smtp_domain($local_domain); if($ou==null){ $ou=$local_domain; writelogs("Adding new organization $ou",__FUNCTION__,__FILE__); $ldap->AddOrganization($ou); } } writelogs("Creating user",__FUNCTION__,__FILE__); $user=new user($local_email); $user->mail=$local_email; $user->password=$local_password; $user->ou=$ou; $user->SenderCanonical=$isp_address_mail; if(!$user->add_user()){ echo main_fetchmail_build_results(true,$user->ldap_error); exit; } if($isp_smtp_account<>null){ writelogs("Creating SMTP authentification for $isp_smtp_server width $isp_smtp_account",__FUNCTION__,__FILE__); $sasl=new smtp_sasl_password_maps(); $sasl->add($isp_address_mail,$isp_smtp_account,$isp_password); $main=new main_cf(); writelogs("Enable sasl engine in postfix",__FUNCTION__,__FILE__); $main->smtp_sasl_password_maps_enable_2(); } writelogs("Creating sender_dependent_relayhost_maps -> $isp_smtp_server",__FUNCTION__,__FILE__); $sender=new sender_dependent_relayhost_maps(); if(!$sender->Add($isp_address_mail,$isp_smtp_server)){ echo main_fetchmail_build_results(true,"sender_dependent_relayhost_maps:$sender->ldap_error"); exit; } $fetchmail=new Fetchmail_settings(); $array["poll"]=$isp_pop3_server; $array["proto"]="auto"; $array["keep"]="yes"; $array["user"]=$isp_account; $array["pass"]=$isp_password; $array["is"]=$local_email; $array["fetchall"]="yes"; $line=$fetchmail->compile($array); if(!$user->fetchmail_add_rule($line)){ echo main_fetchmail_build_results(true,"fetchmail rule:$user->ldap_error"); exit; } $relay=new Routing($ou); if($relay_server<>null){ if(!$relay->create_relay_server($local_domain,$relay_server,$ou)){ echo main_fetchmail_build_results(true,"relay:$relay->ldap_error"); } }else{ if(!$relay->create_localdomain($ou,$local_domain)){ echo main_fetchmail_build_results(true,"local domain:$relay->ldap_error"); } } $fetchmail=new fetchmail(); $fetchmail->Save(); $main=new main_cf(); $main->save_conf(); $main->save_conf_to_server(); $info="<table style='width:100%'> <tr> <td width=1%><img src='img/fw_bold.gif'></td> <td nowrap align='right'><strong>{organization}</strong>:</td> <td nowrap><strong>$ou</strong></td> </tr> <tr> <td width=1%><img src='img/fw_bold.gif'></td> <td nowrap align='right'><strong>{local_mail}</strong>:</td> <td nowrap><strong>$local_email</strong></td> </tr> <tr> <td width=1%><img src='img/fw_bold.gif'></td> <td nowrap align='right'><strong>{isp_address_mail}</strong>:</td> <td nowrap><strong>$isp_address_mail</strong></td> </tr> </table> "; echo main_fetchmail_build_results(false,$info); }
<?php if(posix_getuid()<>0){die("Cannot be used in web server mode\n\n");} include_once(dirname(__FILE__).'/ressources/class.templates.inc'); include_once(dirname(__FILE__).'/ressources/class.ini.inc'); include_once(dirname(__FILE__).'/ressources/class.main_cf.inc'); include_once(dirname(__FILE__).'/ressources/class.amavis.inc'); include_once(dirname(__FILE__).'/ressources/class.samba.inc'); include_once(dirname(__FILE__).'/ressources/class.squid.inc'); $main=new main_cf(); $main->save_conf(); $main->save_conf_to_server(1); $amavis=new amavis(); $amavis->Save(); $amavis->SaveToServer(); $samba=new samba(); $samba->SaveToLdap(); $squid=new squidbee(); $squid->SaveToLdap(); $squid->SaveToServer(); system('/etc/init.d/artica-postfix restart postfix'); system('/etc/init.d/artica-postfix restart squid'); system('/etc/init.d/artica-postfix restart samba'); system('/usr/share/artica-postfix/bin/artica-install --cyrus-checkconfig'); system('/etc/init.d/artica-postfix restart imap'); system('/etc/init.d/artica-postfix restart saslauthd');
function mysql_action_enable_change() { $enable = $_GET["changemysqlenable"]; $artica = new artica_general(); $artica->EnableMysqlFeatures = $enable; if ($enable == 0) { $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); } $artica->SaveMysqlSettings(); $sock = new sockets(); $datas = $sock->getfile('restartmysql'); $datas = htmlentities($datas); $tbl = explode("\n", $datas); $datas = ''; while (list($num, $val) = each($tbl)) { $datas = $datas . "<div>{$val}</div>"; } echo "<div style='width:100%;height:500px;overflow:auto'>{$datas}</div>"; }
function ApplyConfigPostfix() { $users = new usersMenus(); $users->LoadModulesEnabled(); $tpl = new templates(); if ($users->AsPostfixAdministrator == true) { //Apply amavis settings if installed if ($users->AMAVIS_INSTALLED == 1) { if ($users->EnableAmavisDaemon == 1) { include_once "ressources/class.amavis.inc"; $amavis = new amavis(); $amavis->Save(); $amavis->SaveToServer(); } } //------------------------------------ $main = new main_cf(); $main->save_conf(); if (!$main->save_conf_to_server()) { $result = InfosError('postfix_main_settings', '{error}'); echo $tpl->_ENGINE_parse_body($result); return null; } $filters = new main_header_check(); $filters->SaveToDaemon(); if ($users->KAV_MILTER_INSTALLED) { if ($users->KAVMILTER_ENABLED == 1) { include_once "ressources/class.kavmilterd.inc"; $kavmilterd = new kavmilterd(); $kavmilterd->ReBuildAllRules(); $kavmilterd->SaveToLdap(0, 1); $tpl = new templates(); echo $tpl->_ENGINE_parse_body(Success("aveserver_main_settings")); } } if ($users->AMAVIS_INSTALLED) { if ($users->EnableAmavisDaemon == 1) { include_once "ressources/class.amavis.inc"; $amavis = new amavis(); $amavis->Save(); } } if ($users->kas_installed) { if ($users->KasxFilterEnabled == 1) { include_once "ressources/class.kas-filter.inc"; $kas = new kas_single(); $kas->Save(); } } $result = Success("postfix_main_settings"); } else { $result = NotAllowed("postfix_main_settings"); } echo $tpl->_ENGINE_parse_body($result); }
function relayhost_save(){ $main=new main_cf(); $tpl=new templates(); $stunnel=new stunnel4(); $continue=true; $main->smtp_sasl_password_maps_enable_2(); $localport=$stunnel->main_array["postfix_relayhost"]["accept"]; writelogs("Saving [127.0.0.1]:$localport -> {$_GET["username"]}",__FUNCTION__,__FILE__,__LINE__); $main->main_array["relayhost"]="[127.0.0.1]:$localport"; $main->save_conf(); $sock=new sockets(); $sock->SET_INFO("PostfixRelayHost","[127.0.0.1]:$localport"); $sock->getFrameWork("cmd.php?postfix-relayhost=yes"); if($_GET["username"]==null){$continue=false;} if($_GET["password"]==null){$continue=false;} $saslpswd=new smtp_sasl_password_maps(); if($continue){ writelogs("UPDATE [127.0.0.1]:$localport",__FUNCTION__,__FILE__,__LINE__); if(!$saslpswd->add("[127.0.0.1]:$localport",$_GET["username"],$_GET["password"])){ echo $tpl->javascript_parse_text("{err_sasl_saveldap}<br>$saslpswd->ldap_infos"); return; } $sock->SET_INFO("smtp_sender_dependent_authentication",1); $sock->getFrameWork("cmd.php?postfix-hash-senderdependent=yes"); $sock->getFrameWork("cmd.php?postfix-smtp-sasl=yes"); }else{ writelogs("Delete [127.0.0.1]:$localport",__FUNCTION__,__FILE__,__LINE__); $saslpswd->delete("[127.0.0.1]:$localport"); } }
function save_step_sasl() { $tpl = new templates(); $continue = true; $main = new main_cf(); $main->main_array["smtp_sender_dependent_authentication"] = $_POST["smtp_sender_dependent_authentication"]; $main->save_conf(); if ($_POST["username"] == null) { $continue = false; } if ($_POST["password"] == null) { $continue = false; } if ($continue) { $saslpswd = new smtp_sasl_password_maps(); if (!$saslpswd->add("localhost", $_POST["username"], $_POST["password"])) { return $tpl->_ENGINE_parse_body(save_step_infos(false, "{err_sasl_saveldap}<br>{$saslpswd->ldap_infos}")); } else { return $tpl->_ENGINE_parse_body(save_step_infos(true, '{ok_sasl_saveldap}')); } } return $tpl->_ENGINE_parse_body(save_step_infos(true, '{ok_sasl_saveldap}')); }
function ChangeHostName() { $tpl = new templates(); if ($_GET["ChangeHostName"] == 'null') { echo $tpl->_ENGINE_parse_body('{cancel}'); return null; } $sock = new sockets(); $sock->getFrameWork("cmd.php?ChangeHostName={$_GET["ChangeHostName"]}"); $users = new usersMenus(); if ($users->POSTFIX_INSTALLED) { include_once 'ressources/class.main_cf.inc'; $main = new main_cf(); $main->main_array["myhostname"] = $_GET["ChangeHostName"]; $main->save_conf(); $main->save_conf_to_server(); } }
function RelayHostDelete() { $main = new main_cf(); unset($main->main_array["relayhost"]); $sock = new sockets(); $sock->SET_INFO('PostfixRelayHost', null); $main->save_conf(); }
function backup_save() { $MailArchiverEnabled = $_GET["MailArchiverEnabled"]; writelogs("MailArchiverEnabled={$MailArchiverEnabled}", __FUNCTION__, __FILE__); $sock = new sockets(); $sock->SET_INFO('MailArchiverEnabled', $MailArchiverEnabled); $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); $sock = new sockets(); $sock->getFrameWork("cmd.php?SaveMaincf=yes"); }
function bundle_save() { $sock = new sockets(); $name = $_GET["bundle_save"]; $enable = $_GET["bundle_enable"]; if ($name == "kasper") { if ($enable == "no") { writelogs("DISABLE KASPERSKY", __FUNCTION__, __FILE__); $artica = new artica_general(); $artica->KasxFilterEnabled = 0; $artica->kavmilterEnable = 0; $artica->Save(); $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); } else { $artica = new artica_general(); $artica->KasxFilterEnabled = 1; $artica->kavmilterEnable = 1; $artica->Save(); $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); } $tpl = new templates(); echo $tpl->_ENGINE_parse_body("{enable}:{$enable} ->{success}\n"); return null; } if ($name == "amavis") { if ($enable == "no") { writelogs("DISABLE AMAVIS", __FUNCTION__, __FILE__); $sock->SET_INFO("EnableAmavisDaemon", "0"); $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); } else { $sock = new sockets(); $sock->SET_INFO("EnableAmavisDaemon", "1"); $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); } $tpl = new templates(); echo $tpl->_ENGINE_parse_body("{enable}:{$enable} ->{success}\n"); return null; } if ($name == "addons") { if ($enable == "no") { writelogs("DISABLE ADDONS", __FUNCTION__, __FILE__); $artica = new artica_general(); $artica->MilterGreyListEnabled = 0; $artica->Save(); $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); } else { $artica = new artica_general(); $artica->MilterGreyListEnabled = 1; $artica->Save(); $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); } $tpl = new templates(); echo $tpl->_ENGINE_parse_body("{enable}:{$enable} ->{success}\n"); return null; } if ($name == "opensource") { $sock = new sockets(); if ($enable == "no") { writelogs("DISABLE opensource", __FUNCTION__, __FILE__); $artica = new artica_general(); $artica->SpamAssMilterEnabled = 0; $artica->ClamavMilterEnabled = 0; $artica->Save(); $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); } else { $artica = new artica_general(); $sock->SET_INFO("EnableAmavisDaemon", 0); $artica->SpamAssMilterEnabled = 1; $artica->ClamavMilterEnabled = 1; $artica->Save(); $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); } $tpl = new templates(); echo $tpl->_ENGINE_parse_body("{enable}:{$enable} ->{success}\n"); return null; } }
function compile_postfix_save() { $tpl = new templates(); $tpl = new templates(); $main = new main_cf(); $main->save_conf(); echo $tpl->_ENGINE_parse_body("<br><strong>{APP_POSTFIX}:</strong>{postfix_main_settings} {success}"); }
function RelayHostDelete(){ $main=new main_cf(); unset($main->main_array["relayhost"]); $sock=new sockets(); $sock->SET_INFO('PostfixRelayHost',null); $main->save_conf(); $sock->getFrameWork("cmd.php?postfix-relayhost=yes"); }
function sasl_save() { if ($_GET["PostfixEnableSubmission"] == 1) { $_GET["save_auth"] = 1; } $main = new main_cf(); $socks = new sockets(); $socks->SET_INFO('PostfixEnableSubmission', $_GET["PostfixEnableSubmission"]); if ($_GET["save_auth"] == 1) { $main->main_array["smtpd_sasl_auth_enable"] = "yes"; $main->main_array["smtpd_use_tls"] = "yes"; $main->main_array["smtpd_sasl_path"] = "smtpd"; $main->main_array["smtpd_tls_session_cache_database"] = "btree:\$queue_directory/smtpd_tls_cache "; if ($main->main_array["smtpd_tls_key_file"] == null) { $main->main_array["smtpd_tls_key_file"] = "/etc/ssl/certs/postfix/ca.key"; } if ($main->main_array["smtpd_tls_cert_file"] == null) { $main->main_array["smtpd_tls_cert_file"] = "/etc/ssl/certs/postfix/ca.crt"; } if ($main->main_array["smtpd_tls_CAfile"] == null) { $main->main_array["smtpd_tls_CAfile"] = "/etc/ssl/certs/postfix/ca.csr"; } if ($main->main_array["smtpd_tls_session_cache_timeout"] == null) { $main->main_array["smtpd_tls_session_cache_timeout"] = "3600s"; } $socks->SET_INFO('PostFixSmtpSaslEnable', '1'); $mainr = new smtpd_restrictions(); $mainr->AddKey("permit_mynetworks", "smtpd_recipient_restrictions"); $mainr->AddKey("permit_sasl_authenticated", "smtpd_recipient_restrictions"); $mainr->AddKey("reject_unauth_destination", "smtpd_recipient_restrictions"); } else { $main->main_array["smtpd_sasl_auth_enable"] = "no"; $main->main_array["smtpd_use_tls"] = "no"; $main->main_array["smtpd_tls_auth_only"] = "no"; $mainr = new smtpd_restrictions(); $socks->SET_INFO('PostFixSmtpSaslEnable', '0'); $mainr->DeleteKey("permit_sasl_authenticated", "smtpd_recipient_restrictions"); } $main->save_conf(); $main->save_conf_to_server(); }
function SmtpdHeloRequiredSave() { $main = new main_cf(); $main->main_array["smtpd_helo_required"] = $_GET["save_smtpd_helo_required"]; $main->save_conf(); $tpl = new templates(); echo $tpl->_ENGINE_parse_body('{success}'); }
function PostfixAddFallBackServerMove() { $main = new main_cf(); $hash = explode(',', $main->main_array["smtp_fallback_relay"]); $newarray = array_move_element($hash, $hash[$_GET["PostfixAddFallBackServerMove"]], $_GET["move"]); $main->main_array["smtp_fallback_relay"] = implode(",", $newarray); $main->save_conf(); }
function SaveSettings() { echo "<div><code>"; $ldap = new clladp(); $usersMenus = new usersMenus(); $ldap->AddOrganization($_COOKIE["company"]); echo "</div></code>"; echo "<div><code>"; if (!$usersMenus->cyrus_imapd_installed) { $ldap->AddRelayDomain($_COOKIE["company"], $_COOKIE["smtp_domain"], $_COOKIE["smtp_relay"], 25); } else { $ldap->AddDomainEntity($_COOKIE["company"], $_COOKIE["smtp_domain"]); } echo "</div></code>"; echo "<div><code>"; $users = new user($_COOKIE["username"]); $users->mail = "{$_COOKIE["username"]}@{$_COOKIE["smtp_domain"]}"; $users->password = $_COOKIE["password"]; $users->ou = $_COOKIE["company"]; $users->add_user(); $users->add_alias("root"); $users->add_alias("mailflt3"); $users->add_alias("*****@*****.**"); $users->add_alias("root@{$usersMenus->fqdn}"); $users->add_alias("postmaster@{$usersMenus->fqdn}"); $users->add_alias("*****@*****.**"); $users->add_alias("postmaster"); echo "</div></code>"; $sock = new sockets(); $sock->SET_INFO("PostmasterAdress", $users->mail); $sock->SET_INFO("MasterSMTPDomainName", $_COOKIE["smtp_domain"]); $sock->SET_INFO("SmtpWizardFinish", 1); if ($usersMenus->AMAVIS_INSTALLED) { echo "<div><code>"; include_once "ressources/class.amavis.inc"; $amavis = new amavis(); $amavis->Save(); $sock->SET_INFO("EnableAmavisDaemon", "1"); $sock->getFrameWork("cmd.php?artica-filter-reload=yes"); $amavis->SaveToServer(); echo "</div></code>"; } if ($usersMenus->BIND9_INSTALLED) { include_once "ressources/class.bind9.inc"; include_once "ressources/class.system.network.inc"; $net = new networking(); if (is_array($net->arrayNameServers)) { $dns = implode("\n", $net->arrayNameServers); $sock->SaveConfigFile($dns, "PostfixBind9DNSList"); $sock->SET_INFO('PostfixEnabledInBind9', 1); } } echo "<div><code>"; $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); echo "</div></code>"; }
function ActiveTLSMsgbox_SavePostfix() { $main = new main_cf(); $main->save_conf(); $main->save_conf_to_server(); $html = "<table style='width:100%'>\n\t<tr>\n\t<td width=1% valign='top'><img src='img/ok24.png'></td>\n\t<td><strong>{restarting_postfix}</strong><p class=caption>{you_can_close}</p></td>\n\t</tr>\n\t</table>\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function SaveDNSSettings(){ $main=new main_cf(); $main->main_array["ignore_mx_lookup_error"]=$_GET["ignore_mx_lookup_error"]; $main->main_array["disable_dns_lookups"]=$_GET["disable_dns_lookups"]; $main->main_array["myhostname"]=$_GET["myhostname"]; $main->save_conf(); $sock=new sockets(); $sock->SET_INFO("myhostname",$_GET["myhostname"]); $sock->getFrameWork("cmd.php?postfix-others-values=yes"); }
function CreateDomainIP() { $ldap = new clladp(); $tpl = new templates(); $ou = $_GET["ou"]; $dn = "cn=relay_domains,ou={$ou},dc=organizations,{$ldap->suffix}"; if (!$ldap->ExistsDN($dn)) { $upd['cn'][0] = "relay_domains"; $upd['objectClass'][0] = 'PostFixStructuralClass'; $upd['objectClass'][1] = 'top'; $ldap->ldap_add($dn, $upd); unset($upd); } $domain_name = trim($_GET["domain"]); $relayIP = $_GET["domain_ip"]; $relayPort = 25; $mx = "yes"; $dn = "cn={$domain_name},cn=relay_domains,ou={$ou},dc=organizations,{$ldap->suffix}"; $upd['cn'][0] = "{$domain_name}"; $upd['objectClass'][0] = 'PostFixRelayDomains'; $upd['objectClass'][1] = 'top'; $ldap->ldap_add($dn, $upd); $dn = "cn=relay_recipient_maps,ou={$ou},dc=organizations,{$ldap->suffix}"; if (!$ldap->ExistsDN($dn)) { $upd['cn'][0] = "relay_recipient_maps"; $upd['objectClass'][0] = 'PostFixStructuralClass'; $upd['objectClass'][1] = 'top'; $ldap->ldap_add($dn, $upd); unset($upd); } $dn = "cn=@{$domain_name},cn=relay_recipient_maps,ou={$ou},dc=organizations,{$ldap->suffix}"; $upd['cn'][0] = "@{$domain_name}"; $upd['objectClass'][0] = 'PostfixRelayRecipientMaps'; $upd['objectClass'][1] = 'top'; $ldap->ldap_add($dn, $upd); $dn = "cn=transport_map,ou={$ou},dc=organizations,{$ldap->suffix}"; if (!$ldap->ExistsDN($dn)) { $upd['cn'][0] = "transport_map"; $upd['objectClass'][0] = 'PostFixStructuralClass'; $upd['objectClass'][1] = 'top'; $ldap->ldap_add($dn, $upd); unset($upd); } if ($relayIP != null) { if ($mx == "no") { $relayIP = "[{$relayIP}]"; } $dn = "cn={$domain_name},cn=transport_map,ou={$ou},dc=organizations,{$ldap->suffix}"; $upd['cn'][0] = "{$domain_name}"; $upd['objectClass'][0] = 'transportTable'; $upd['objectClass'][1] = 'top'; $upd["transport"][] = "relay:{$relayIP}:{$relayPort}"; if (!$ldap->ldap_add($dn, $upd)) { echo $ldap->ldap_last_error; } else { echo $tpl->_ENGINE_parse_body($domain . ' {added}'); } } $main = new main_cf(); $main->main_array["myorigin"] = $domain; $main->save_conf(); }