This commit is contained in:
Alan Garcia 2011-02-01 18:03:29 +00:00
parent 46510d79e5
commit 3cbccf5bce
3 changed files with 33 additions and 25 deletions

View File

@ -101,16 +101,19 @@ for($i=0;$i<$r["nsub"];$i++) {
$col=3-$col;
?>
<tr class="lst<?php echo $col; ?>">
<?php if ( $r['sub'][$i]['web_action'] =='DELETE') { echo "<td colspan=2 />"; } else { ?>
<td class="center">
<div class="ina"><a href="dom_subedit.php?domain=<?php echo urlencode($r["name"]) ?>&amp;sub=<?php echo urlencode($r["sub"][$i]["name"]) ?>&amp;type=<?php echo urlencode($r["sub"][$i]["type"]) ?>&amp;value=<?php echo urlencode($r["sub"][$i]['dest'])?>"><img src="images/edit.png" alt="<?php __("Edit"); ?>" /><?php __("Edit"); ?></a></div>
</td><td class="center">
<div class="ina"><a href="dom_subdel.php?domain=<?php echo urlencode($r["name"]) ?>&amp;sub=<?php echo urlencode($r["sub"][$i]["name"]) ?>&amp;type=<?php echo urlencode($r["sub"][$i]["type"]) ?>&amp;value=<?php echo urlencode($r["sub"][$i]['dest'])?>"><img src="images/delete.png" alt="<?php __("Delete"); ?>" /><?php __("Delete"); ?></a></div>
</td>
<?php } // end IF ==DELETE ?>
<td><a href="http://<?php ecif($r["sub"][$i]["name"],$r["sub"][$i]["name"]."."); echo $r["name"] ?>" target="_blank"><?php ecif($r["sub"][$i]["name"],$r["sub"][$i]["name"]."."); echo $r["name"] ?></a></td>
<td><?php __($r['sub'][$i]['type_desc']);?></td>
<td><?php echo $r["sub"][$i]['type'] === 'LOCAL' ? '<a href="bro_main.php?R='.urlencode($r["sub"][$i]["dest"]).'">'.htmlspecialchars($r["sub"][$i]["dest"]).'</a>' : htmlspecialchars($r["sub"][$i]["dest"]); ?>&nbsp;</td>
<td><?php
if ( $r['sub'][$i]['web_action'] !='DELETE') {
switch ($r['sub'][$i]['enable']) {
case 'ENABLED':
__("Enabled");
@ -126,6 +129,7 @@ for($i=0;$i<$r["nsub"];$i++) {
case 'DISABLE':
__("Desactivation pending");
break;
}
}?></td>
<td><?php
switch ($r['sub'][$i]['web_action']) {

View File

@ -864,7 +864,11 @@ class m_dom {
}
// Re-create the one we want
$db->query("insert into sub_domaines (compte,domaine,sub,valeur,type,web_action) values ('$cuid','$dom','$sub','$dest','$type','UPDATE');");
if (! $db->query("insert into sub_domaines (compte,domaine,sub,valeur,type,web_action) values ('$cuid','$dom','$sub','$dest','$type','UPDATE');") ) {
echo "query failed: ".$db->Error;
return false;
}
// Tell to update the DNS file
$db->query("update domaines set dns_action='UPDATE' where domaine='$dom';");