Fix d'un bug alacon qui faisait que tout les domaines étaient listé comme hébergeant des mails
Fix #308
This commit is contained in:
parent
14632cec3c
commit
9936146ec1
|
@ -386,7 +386,8 @@ class m_dom {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($noerase) $noerase="1"; else $noerase="0";
|
if ($noerase) $noerase="1"; else $noerase="0";
|
||||||
$db->query("INSERT INTO domaines (compte,domaine,gesdns,gesmx,noerase,dns_action) VALUES ('$cuid','$domain','$dns','1','$noerase','UPDATE');");
|
if ($dns) $gesmx="1"; else $gesmx="0"; // do not host mx by default if not hosting the DNS
|
||||||
|
$db->query("INSERT INTO domaines (compte,domaine,gesdns,gesmx,noerase,dns_action) VALUES ('$cuid','$domain','$dns','$gesmx','$noerase','UPDATE');");
|
||||||
if (!($id=$db->lastid())) {
|
if (!($id=$db->lastid())) {
|
||||||
$err->raise("dom",_("An unexpected error occured when creating the domain"));
|
$err->raise("dom",_("An unexpected error occured when creating the domain"));
|
||||||
return false;
|
return false;
|
||||||
|
@ -409,13 +410,13 @@ class m_dom {
|
||||||
|
|
||||||
// TODO: Old hooks, FIXME: when unused remove them
|
// TODO: Old hooks, FIXME: when unused remove them
|
||||||
$hooks->invoke("alternc_add_domain",array($domain));
|
$hooks->invoke("alternc_add_domain",array($domain));
|
||||||
$hooks->invoke("alternc_add_mx_domain",array($domain));
|
if ($gesmx) $hooks->invoke("alternc_add_mx_domain",array($domain));
|
||||||
if ($isslave) {
|
if ($isslave) {
|
||||||
$hooks->invoke("alternc_add_slave_domain",array($domain));
|
$hooks->invoke("alternc_add_slave_domain",array($domain));
|
||||||
}
|
}
|
||||||
// New Hooks:
|
// New Hooks:
|
||||||
$hooks->invoke("hook_dom_add_domain",array($id));
|
$hooks->invoke("hook_dom_add_domain",array($id));
|
||||||
$hooks->invoke("hook_dom_add_mx_domain",array($id));
|
if ($gesmx) $hooks->invoke("hook_dom_add_mx_domain",array($id));
|
||||||
if ($isslave) {
|
if ($isslave) {
|
||||||
$hooks->invoke("hook_dom_add_slave_domain",array($id, $slavedom));
|
$hooks->invoke("hook_dom_add_slave_domain",array($id, $slavedom));
|
||||||
}
|
}
|
||||||
|
@ -1116,16 +1117,10 @@ class m_dom {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($gesmx && !$r["mail"]) {
|
if ($gesmx && !$r["mail"]) {
|
||||||
// TODO: old hooks, FIXME: remove when unused
|
|
||||||
$hooks->invoke("alternc_add_mx_domain",array($domain));
|
|
||||||
// New Hooks:
|
|
||||||
$hooks->invoke("hook_dom_add_mx_domain",array($r["id"]));
|
$hooks->invoke("hook_dom_add_mx_domain",array($r["id"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$gesmx && $r["mail"]) { // on a dissocié le MX : on détruit donc l'entree dans LDAP
|
if (!$gesmx && $r["mail"]) { // on a dissocié le MX : on détruit donc l'entree dans LDAP
|
||||||
// TODO: old hooks, FIXME: remove when unused
|
|
||||||
$hooks->invoke("alternc_del_mx_domain",array($domain));
|
|
||||||
// New Hooks:
|
|
||||||
$hooks->invoke("hook_dom_del_mx_domain",array($r["id"]));
|
$hooks->invoke("hook_dom_del_mx_domain",array($r["id"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,6 +209,7 @@ FROM
|
||||||
domaines d LEFT JOIN address a ON (d.id=a.domain_id AND a.type='')
|
domaines d LEFT JOIN address a ON (d.id=a.domain_id AND a.type='')
|
||||||
WHERE
|
WHERE
|
||||||
d.compte = $uid
|
d.compte = $uid
|
||||||
|
and d.gesmx = 1
|
||||||
GROUP BY
|
GROUP BY
|
||||||
d.id
|
d.id
|
||||||
ORDER BY
|
ORDER BY
|
||||||
|
|
Loading…
Reference in New Issue