diff --git a/bureau/admin/dom_edit.inc.php b/bureau/admin/dom_edit.inc.php
index 4f73abf1..5c53e7ec 100644
--- a/bureau/admin/dom_edit.inc.php
+++ b/bureau/admin/dom_edit.inc.php
@@ -40,6 +40,7 @@ $dom->unlock();
domains_type_lst() as $dt) {
if (! $dt['enable']) continue;
if ( (! $r['dns'] ) and ($dt['need_dns']) ) continue;
+ //if ( strtoupper($type)!=strtoupper($dt['name']) ) continue;
$targval=(strtoupper($type)==strtoupper($dt['name']))?$sd['dest']:'';
?>
diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php
index 9a4743a4..20088457 100644
--- a/bureau/class/m_dom.php
+++ b/bureau/class/m_dom.php
@@ -792,7 +792,7 @@ class m_dom {
$compatibility_lst = explode(",",$db->f('compatibility'));
# Get the list of type of subdomains already here who have the same name
- $db->query("select * from sub_domaines where sub='$sub' and domaine='$dom' and not (type='$type' and valeur='$value_old')");
+ $db->query("select * from sub_domaines where sub='$sub' and domaine='$dom' and not (type='$type' and valeur='$value_old') and web_action != 'DELETE'");
#$db->query("select * from sub_domaines where sub='$sub' and domaine='$dom';");
while ($db->next_record()) {
# And if there is a domain with a incompatible type, return false
@@ -860,7 +860,7 @@ class m_dom {
}
if (! is_null($type_old )) { // It's not a creation, it's an edit. Delete the old one
- $db->query("delete from sub_domaines where domaine='$dom' and sub='$sub' and upper(type)=upper('$type_old') and valeur='$value_old';");
+ $db->query("update sub_domaines set web_action='DELETE' where domaine='$dom' and sub='$sub' and upper(type)=upper('$type_old') and valeur='$value_old';");
}
// Re-create the one we want
diff --git a/install/upgrades/1.0.sql b/install/upgrades/1.0.sql
index e35fd70f..a7b7bbce 100644
--- a/install/upgrades/1.0.sql
+++ b/install/upgrades/1.0.sql
@@ -35,7 +35,7 @@ INSERT IGNORE INTO `domaines_type` (name, description, target, entry, compatibil
alter table domaines add column dns_action enum ('OK','UPDATE','DELETE') NOT NULL default 'UPDATE';
alter table domaines add column dns_result varchar(255) not null default '';
alter table sub_domaines add column web_action enum ('OK','UPDATE','DELETE') NOT NULL default 'UPDATE';
-alter table sub_domaines add column dns_result varchar(255) not null default '';
+alter table sub_domaines add column web_result varchar(255) not null default '';
alter table sub_domaines add column enable enum ('ENABLED', 'ENABLE', 'DISABLED', 'DISABLE') NOT NULL DEFAULT 'ENABLED';
drop table sub_domaines_standby;
drop table domaines_standby;