From 886f8b9d9b3c9a3a4e41f60de727002394ef9bfe Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Mon, 28 Mar 2011 12:28:37 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20sur=20la=20g=C3=A9n=C3=A9ration=20des=20M?= =?UTF-8?q?X?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bureau/class/m_dom.php | 48 +++++++++++-------- debian/alternc.postinst | 3 ++ debian/po/fr.po | 2 +- .../templates/bind/templates/zone.template | 1 - 4 files changed, 33 insertions(+), 21 deletions(-) diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index e86a2af7..2dd3d1db 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -73,6 +73,8 @@ class m_dom { var $type_ipv6 = "IPV6"; var $type_cname = "CNAME"; var $type_txt = "TXT"; + var $type_mx = "MX"; + var $type_mx2 = "MX2"; var $action_insert = "0"; var $action_update= "1"; @@ -347,16 +349,16 @@ class m_dom { if (!$force) { $v=checkhostallow($domain,$this->dns); if ($v==-1) { - $err->raise("dom",7); // TLD interdit - return false; + $err->raise("dom",7); // TLD interdit + return false; } if ($dns && $v==-2) { - $err->raise("dom",12); // Domaine non trouvé dans le whois - return false; + $err->raise("dom",12); // Domaine non trouvé dans le whois + return false; } if ($dns && $v==-3) { - $err->raise("dom",23); // Domaine non trouvé dans le whois - return false; + $err->raise("dom",23); // Domaine non trouvé dans le whois + return false; } if ($dns) $dns="1"; else $dns="0"; @@ -365,11 +367,11 @@ class m_dom { if ($tld[$v]==5) $dns=0; // It must be a real domain (no subdomain) if (!$dns) { - $v=checkhostallow_nodns($domain); - if ($v) { - $err->raise("dom",22); - return false; - } + $v=checkhostallow_nodns($domain); + if ($v) { + $err->raise("dom",22); + return false; + } } } // Check the quota : @@ -385,8 +387,8 @@ class m_dom { $db->query("SELECT domaine FROM domaines WHERE compte='$cuid' AND domaine='$slavedom';"); $db->next_record(); if (!$db->Record["domaine"]) { - $err->raise("dom",1,$slavedom); - $isslave=false; + $err->raise("dom",1,$slavedom); + $isslave=false; } // Point to the master domain : $this->set_sub_domain($domain, '', $this->type_url, 'http://www.'.$slavedom); @@ -399,7 +401,7 @@ class m_dom { $domshort=str_replace("-","",str_replace(".","",$domain)); if (! is_dir($dest_root . "/". $domshort)) { - mkdir($dest_root . "/". $domshort); + mkdir($dest_root . "/". $domshort); } // Creation des 3 sous-domaines par défaut : Vide, www et mail @@ -407,24 +409,32 @@ class m_dom { $this->set_sub_domain($domain, 'www', $this->type_local, '/'. $domshort); $this->set_sub_domain($domain, 'mail', $this->type_webmail, ''); } + + if ($mx) { + $this->set_sub_domain($domain, '', $this->type_mx, $GLOBALS['L_DEFAULT_MX']); + if (! empty($GLOBALS['L_DEFAULT_SECONDARY_MX'])) { + $this->set_sub_domain($domain, '', $this->type_mx2, $GLOBALS['L_DEFAULT_SECONDARY_MX']); + } + } + // DEPENDANCE : // Lancement de add_dom sur les classes domain_sensitive : // Declenchons les autres classes. foreach($classes as $c) { if (method_exists($GLOBALS[$c],"alternc_add_domain")) { - $GLOBALS[$c]->alternc_add_domain($domain); + $GLOBALS[$c]->alternc_add_domain($domain); } } foreach($classes as $c) { if (method_exists($GLOBALS[$c],"alternc_add_mx_domain")) { - $GLOBALS[$c]->alternc_add_mx_domain($domain); + $GLOBALS[$c]->alternc_add_mx_domain($domain); } } if ($isslave) { foreach($classes as $c) { - if (method_exists($GLOBALS[$c],"alternc_add_slave_domain")) { - $GLOBALS[$c]->alternc_add_slave_domain($domain,$slavedom); - } + if (method_exists($GLOBALS[$c],"alternc_add_slave_domain")) { + $GLOBALS[$c]->alternc_add_slave_domain($domain,$slavedom); + } } } return true; diff --git a/debian/alternc.postinst b/debian/alternc.postinst index 4a85fbe9..c62a4c41 100644 --- a/debian/alternc.postinst +++ b/debian/alternc.postinst @@ -81,6 +81,9 @@ NS2_HOSTNAME="" # Mail server hostname DEFAULT_MX="" +# Secondary mail server hostname +DEFAULT_SECONDARY_MX="" + # Note: MySQL username/password configuration now stored in /etc/alternc/my.cnf # quels clients mysql sont permis (%, localhost, etc) diff --git a/debian/po/fr.po b/debian/po/fr.po index 4475bca5..d5afe5d5 100644 --- a/debian/po/fr.po +++ b/debian/po/fr.po @@ -19,10 +19,10 @@ msgstr "" "PO-Revision-Date: 2006-04-26 11:16+0200\n" "Last-Translator: Benjamin Sonntag \n" "Language-Team: Team AlternC \n" -"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" +"Language: \n" #. Type: boolean #. Description diff --git a/etc/alternc/templates/bind/templates/zone.template b/etc/alternc/templates/bind/templates/zone.template index 2b96a9ce..0af009f6 100644 --- a/etc/alternc/templates/bind/templates/zone.template +++ b/etc/alternc/templates/bind/templates/zone.template @@ -16,4 +16,3 @@ $TTL 1D IN NS %%ns1%%. IN NS %%ns2%%. - IN MX 5 %%mx%%.