Gére quand un domaines type n'existe pas (plus ?) pour un sous domaine
This commit is contained in:
parent
b758a5c083
commit
5b10a1d1b7
|
@ -151,12 +151,16 @@ for($i=0;$i<$r["nsub"];$i++) {
|
||||||
$disabled_class=in_array(strtoupper($r['sub'][$i]['enable']),array('DISABLED','DISABLE') )?'sub-disabled':'';
|
$disabled_class=in_array(strtoupper($r['sub'][$i]['enable']),array('DISABLED','DISABLE') )?'sub-disabled':'';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<tr class="lst">
|
<tr class="lst" data-fqdn="<?php echo $r["sub"][$i]["fqdn"]; ?>">
|
||||||
<?php if ( $r['sub'][$i]['web_action'] =='DELETE') { echo "<td colspan='2' />"; } else { ?>
|
<?php if ( $r['sub'][$i]['web_action'] =='DELETE') { echo "<td colspan='2' />"; } else { ?>
|
||||||
<td class="center">
|
<td class="center">
|
||||||
<?php if (!(!$isinvited && $dt[strtolower($r["sub"][$i]["type"])]["enable"] != "ALL" )) { ?>
|
<?php if (!(!$isinvited && $dt[strtolower($r["sub"][$i]["type"])]["enable"] != "ALL" )) { ?>
|
||||||
<div class="ina edit"><a href="dom_subedit.php?sub_domain_id=<?php echo urlencode($r["sub"][$i]["id"]) ?>"><?php __("Edit"); ?></a></div>
|
<?php if ( isset($problems[$r["sub"][$i]["fqdn"]])) { // if this subdomain have problem, can't modify it, only delete it
|
||||||
<?php } ?>
|
__("Forbidden");
|
||||||
|
} else { ?>
|
||||||
|
<div class="ina edit"><a href="dom_subedit.php?sub_domain_id=<?php echo urlencode($r["sub"][$i]["id"]) ?>"><?php __("Edit"); ?></a></div><?php
|
||||||
|
} // isset problems
|
||||||
|
} ?>
|
||||||
|
|
||||||
|
|
||||||
</td><td class="center">
|
</td><td class="center">
|
||||||
|
@ -215,6 +219,12 @@ $disabled_class=in_array(strtoupper($r['sub'][$i]['enable']),array('DISABLED','D
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</table>
|
</table>
|
||||||
|
<?php
|
||||||
|
// Add a class on the sub_domains who have a problem
|
||||||
|
foreach ($problems as $pr => $lm) { // $problems can be empty but can't be null/false
|
||||||
|
echo "<script type='text/javascript'>$(\"tr[data-fqdn='".$pr."']\").addClass('alert-danger-tr');</script>\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -344,6 +344,10 @@ img {
|
||||||
.alert-danger a{
|
.alert-danger a{
|
||||||
color: #6F2B2A;
|
color: #6F2B2A;
|
||||||
}
|
}
|
||||||
|
.alert-danger-tr {
|
||||||
|
background-color: #F2DEDE !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Alert icons */
|
/* Alert icons */
|
||||||
#content .alert {
|
#content .alert {
|
||||||
|
|
|
@ -1105,7 +1105,8 @@ class m_dom {
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
$r["nsub"]=$db->Record["cnt"];
|
$r["nsub"]=$db->Record["cnt"];
|
||||||
$db->free();
|
$db->free();
|
||||||
$db->query("SELECT sd.*, dt.description AS type_desc, dt.only_dns FROM sub_domaines sd, domaines_type dt WHERE compte='$cuid' AND domaine='$dom' AND UPPER(dt.name)=UPPER(sd.type) ORDER BY sd.sub,sd.type");
|
#$db->query("SELECT sd.*, dt.description AS type_desc, dt.only_dns FROM sub_domaines sd, domaines_type dt WHERE compte='$cuid' AND domaine='$dom' AND UPPER(dt.name)=UPPER(sd.type) ORDER BY sd.sub,sd.type");
|
||||||
|
$db->query("SELECT sd.*, dt.description AS type_desc, dt.only_dns FROM sub_domaines sd LEFT JOIN domaines_type dt on UPPER(dt.name)=UPPER(sd.type) WHERE compte='$cuid' AND domaine='$dom' ORDER BY sd.sub,sd.type ;");
|
||||||
// Pas de webmail, on le cochera si on le trouve.
|
// Pas de webmail, on le cochera si on le trouve.
|
||||||
$r["sub"]=array();
|
$r["sub"]=array();
|
||||||
for($i=0;$i<$r["nsub"];$i++) {
|
for($i=0;$i<$r["nsub"];$i++) {
|
||||||
|
@ -2075,6 +2076,15 @@ function generate_apacheconf($p = null) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if we know each type of subdomain
|
||||||
|
// Example: we may not know WEBMAIL if we upgrade from a previous setup
|
||||||
|
foreach ( $da['sub'] as $sub ) {
|
||||||
|
if (is_null($sub['type_desc'])) {
|
||||||
|
$errors[$sub['fqdn']]=sprintf(_("Problem on %s: we do not know domain's type <b>%s</b>."),$sub['fqdn'], $sub['type']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: add a full compatibility check.
|
// TODO: add a full compatibility check.
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
|
|
Loading…
Reference in New Issue