Edition de sous-domaines

This commit is contained in:
Alan Garcia 2011-02-01 13:06:40 +00:00
parent cee931e448
commit b9d8daab9b
3 changed files with 4 additions and 3 deletions

View File

@ -40,6 +40,7 @@ $dom->unlock();
<?php foreach($dom->domains_type_lst() as $dt) { <?php foreach($dom->domains_type_lst() as $dt) {
if (! $dt['enable']) continue; if (! $dt['enable']) continue;
if ( (! $r['dns'] ) and ($dt['need_dns']) ) continue; if ( (! $r['dns'] ) and ($dt['need_dns']) ) continue;
//if ( strtoupper($type)!=strtoupper($dt['name']) ) continue;
$targval=(strtoupper($type)==strtoupper($dt['name']))?$sd['dest']:''; $targval=(strtoupper($type)==strtoupper($dt['name']))?$sd['dest']:'';
?> ?>
<tr> <tr>

View File

@ -792,7 +792,7 @@ class m_dom {
$compatibility_lst = explode(",",$db->f('compatibility')); $compatibility_lst = explode(",",$db->f('compatibility'));
# Get the list of type of subdomains already here who have the same name # 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';"); #$db->query("select * from sub_domaines where sub='$sub' and domaine='$dom';");
while ($db->next_record()) { while ($db->next_record()) {
# And if there is a domain with a incompatible type, return false # 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 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 // Re-create the one we want

View File

@ -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_action enum ('OK','UPDATE','DELETE') NOT NULL default 'UPDATE';
alter table domaines add column dns_result varchar(255) not null default ''; 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 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'; alter table sub_domaines add column enable enum ('ENABLED', 'ENABLE', 'DISABLED', 'DISABLE') NOT NULL DEFAULT 'ENABLED';
drop table sub_domaines_standby; drop table sub_domaines_standby;
drop table domaines_standby; drop table domaines_standby;