Qques modifs pour améliorer l'interface
This commit is contained in:
parent
bb83fe83e4
commit
fb0fd61b1f
|
@ -57,6 +57,9 @@ include_once("head.php");
|
||||||
<th><?php __("Target");?></th>
|
<th><?php __("Target");?></th>
|
||||||
<th><?php __("Entry");?></th>
|
<th><?php __("Entry");?></th>
|
||||||
<th><?php __("Compatibility");?></th>
|
<th><?php __("Compatibility");?></th>
|
||||||
|
<th><?php __("Enabled ?");?></th>
|
||||||
|
<th><?php __("Only DNS ?");?></th>
|
||||||
|
<th><?php __("Need to be DNS ?");?></th>
|
||||||
<th><?php __("Edit");?></th>
|
<th><?php __("Edit");?></th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
|
@ -70,6 +73,9 @@ foreach($dom->domains_type_lst() as $d) {
|
||||||
<td><?php echo $d['target'];?></td>
|
<td><?php echo $d['target'];?></td>
|
||||||
<td><?php echo $d['entry'];?></td>
|
<td><?php echo $d['entry'];?></td>
|
||||||
<td><?php echo $d['compatibility'];?></td>
|
<td><?php echo $d['compatibility'];?></td>
|
||||||
|
<td><?php echo $d['enable']?__("Yes"):__("No");?></td>
|
||||||
|
<td><?php echo $d['only_dns']?__("Yes"):__("No");?></td>
|
||||||
|
<td><?php echo $d['need_dns']?__("Yes"):__("No");?></td>
|
||||||
<td><div class="ina"><a href="adm_domstypeedit.php?name=<?php echo urlencode($d['name']); ?>"><img style="padding-bottom: 5px" src="images/edit.png" alt="<?php __("Edit"); ?>" /><?php __("Edit"); ?></a></div></td>
|
<td><div class="ina"><a href="adm_domstypeedit.php?name=<?php echo urlencode($d['name']); ?>"><img style="padding-bottom: 5px" src="images/edit.png" alt="<?php __("Edit"); ?>" /><?php __("Edit"); ?></a></div></td>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ if (!$admin->enabled) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( ! $dom->domains_type_update($name, $description, $target, $entry, $compatibility) ) {
|
if ( ! $dom->domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns) ) {
|
||||||
die($err->errstr());
|
die($err->errstr());
|
||||||
} else {
|
} else {
|
||||||
include("adm_domstype.php");
|
include("adm_domstype.php");
|
||||||
|
|
|
@ -41,6 +41,9 @@ $fields = array (
|
||||||
"target" => array ("request", "string", ""),
|
"target" => array ("request", "string", ""),
|
||||||
"entry" => array ("request", "string", ""),
|
"entry" => array ("request", "string", ""),
|
||||||
"compatibility" => array ("request", "string", ""),
|
"compatibility" => array ("request", "string", ""),
|
||||||
|
"enable" => array ("request", "boolean", ""),
|
||||||
|
"only_dns" => array ("request", "boolean", ""),
|
||||||
|
"need_dns" => array ("request", "boolean", ""),
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
|
@ -85,7 +88,18 @@ if ($error_edit) {
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php __("Compatibility");?></th>
|
<th><?php __("Compatibility");?></th>
|
||||||
<td><input name="compatibility" type=text size="15" value="<?php echo $d['compatibility']; ?>" /></td>
|
<td><input name="compatibility" type=text size="15" value="<?php echo $d['compatibility']; ?>" /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?php __("Enable");?></th>
|
||||||
|
<td><input name="enable" type=checkbox value="1" <?php cbox($d['enable']); ?> /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?php __("Do only a DNS entry");?></th>
|
||||||
|
<td><input name="only_dns" type=checkbox value="1" <?php cbox($d['only_dns']); ?> /></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?php __("Need to be the DNS");?></th>
|
||||||
|
<td><input name="need_dns" type=checkbox value="1" <?php cbox($d['need_dns']); ?> /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="trbtn">
|
<tr class="trbtn">
|
||||||
<td colspan="2">
|
<td colspan="2">
|
||||||
|
|
|
@ -58,7 +58,7 @@ $dom->unlock();
|
||||||
<input type="text" class="int" name="t_<?php echo $dt['name']?>" id="t_<?php echo $dt['name']?>" value="<?php ehe($targval); ?>" size="28" />
|
<input type="text" class="int" name="t_<?php echo $dt['name']?>" id="t_<?php echo $dt['name']?>" value="<?php ehe($targval); ?>" size="28" />
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<!--
|
<!--
|
||||||
document.write(" <input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.type_val_<?php echo $dt['name'];?>');\" value=\" <?php __("Choose a folder..."); ?> \" class=\"bff\">");
|
document.write(" <input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.t_<?php echo $dt['name'];?>');\" value=\" <?php __("Choose a folder..."); ?> \" class=\"bff\">");
|
||||||
// -->
|
// -->
|
||||||
</script><?php
|
</script><?php
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -75,7 +75,7 @@ function dnsoff() {
|
||||||
gestion des sous-domaines
|
gestion des sous-domaines
|
||||||
-->
|
-->
|
||||||
<table class="tlist">
|
<table class="tlist">
|
||||||
<tr><th colspan="2"><?php __("Actions"); ?></th><th><?php __("Subdomain"); ?></th><th><?php __("Place"); ?></th></tr>
|
<tr><th colspan="2"><?php __("Actions"); ?></th><th><?php __("Subdomain"); ?></th><th><?php __("Type");?></th><th><?php __("Place"); ?></th></tr>
|
||||||
<?php
|
<?php
|
||||||
$col=1;
|
$col=1;
|
||||||
for($i=0;$i<$r["nsub"];$i++) {
|
for($i=0;$i<$r["nsub"];$i++) {
|
||||||
|
@ -89,7 +89,8 @@ for($i=0;$i<$r["nsub"];$i++) {
|
||||||
<div class="ina"><a href="dom_subdel.php?domain=<?php echo urlencode($r["name"]) ?>&sub=<?php echo urlencode($r["sub"][$i]["name"]) ?>&type=<?php echo urlencode($r["sub"][$i]["type"]) ?>&value=<?php echo urlencode($r["sub"][$i]['dest'])?>"><img src="images/delete.png" alt="<?php __("Delete"); ?>" /><?php __("Delete"); ?></a></div>
|
<div class="ina"><a href="dom_subdel.php?domain=<?php echo urlencode($r["name"]) ?>&sub=<?php echo urlencode($r["sub"][$i]["name"]) ?>&type=<?php echo urlencode($r["sub"][$i]["type"]) ?>&value=<?php echo urlencode($r["sub"][$i]['dest'])?>"><img src="images/delete.png" alt="<?php __("Delete"); ?>" /><?php __("Delete"); ?></a></div>
|
||||||
</td>
|
</td>
|
||||||
<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><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 echo $r["sub"][$i]['type'] === '0' ? '<a href="bro_main.php?R='.urlencode($r["sub"][$i]["dest"]).'">'.htmlspecialchars($r["sub"][$i]["dest"]).'</a>' : htmlspecialchars($r["sub"][$i]["dest"]); ?> </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"]); ?> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -159,7 +159,7 @@ class m_dom {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function domains_type_update($name, $description, $target, $entry, $compatibility) {
|
function domains_type_update($name, $description, $target, $entry, $compatibility, $enable, $only_dns, $need_dns) {
|
||||||
global $err,$cuid,$db;
|
global $err,$cuid,$db;
|
||||||
$id=intval($id);
|
$id=intval($id);
|
||||||
$name=mysql_real_escape_string($name);
|
$name=mysql_real_escape_string($name);
|
||||||
|
@ -167,7 +167,10 @@ class m_dom {
|
||||||
$target=mysql_real_escape_string($target);
|
$target=mysql_real_escape_string($target);
|
||||||
$entry=mysql_real_escape_string($entry);
|
$entry=mysql_real_escape_string($entry);
|
||||||
$compatibility=mysql_real_escape_string($compatibility);
|
$compatibility=mysql_real_escape_string($compatibility);
|
||||||
$db->query("UPDATE domaines_type SET description='$description', target='$target', entry='$entry', compatibility='$compatibility' where name='$name';");
|
$enable=intval($enable);
|
||||||
|
$only_dns=intval($only_dns);
|
||||||
|
$need_dns=intval($need_dns);
|
||||||
|
$db->query("UPDATE domaines_type SET description='$description', target='$target', entry='$entry', compatibility='$compatibility', enable=$enable, need_dns=$need_dns, only_dns=$only_dns where name='$name';");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,7 +632,7 @@ 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 * from sub_domaines where compte='$cuid' and domaine='$dom'");
|
$db->query("select sd.*, dt.description as type_desc from sub_domaines sd, domaines_type dt where compte='$cuid' and domaine='$dom' and upper(dt.name)=upper(sd.type)");
|
||||||
// Pas de webmail, on le cochera si on le trouve.
|
// Pas de webmail, on le cochera si on le trouve.
|
||||||
$this->webmail=0;
|
$this->webmail=0;
|
||||||
for($i=0;$i<$r["nsub"];$i++) {
|
for($i=0;$i<$r["nsub"];$i++) {
|
||||||
|
@ -638,6 +641,7 @@ class m_dom {
|
||||||
$r["sub"][$i]["name"]=$db->Record["sub"];
|
$r["sub"][$i]["name"]=$db->Record["sub"];
|
||||||
$r["sub"][$i]["dest"]=$db->Record["valeur"];
|
$r["sub"][$i]["dest"]=$db->Record["valeur"];
|
||||||
$r["sub"][$i]["type"]=$db->Record["type"];
|
$r["sub"][$i]["type"]=$db->Record["type"];
|
||||||
|
$r["sub"][$i]["type_desc"]=$db->Record["type_desc"];
|
||||||
/*
|
/*
|
||||||
if ($db->Record["type"]==3) { // Webmail
|
if ($db->Record["type"]==3) { // Webmail
|
||||||
$this->webmail=1;
|
$this->webmail=1;
|
||||||
|
@ -685,7 +689,7 @@ class m_dom {
|
||||||
$type = " and type=\"".mysql_real_escape_string($type)."\"";
|
$type = " and type=\"".mysql_real_escape_string($type)."\"";
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
$db->query("select * from sub_domaines where compte='$cuid' and domaine='$dom' and sub='$sub' and ( length('$type')=0 or type='$type') and (length('$value')=0 or '$value'=valeur);");
|
$db->query("select sd.*, dt.description as type_desc from sub_domaines sd, domaines_type dt where compte='$cuid' and domaine='$dom' and sub='$sub' and ( length('$type')=0 or type='$type') and (length('$value')=0 or '$value'=valeur) and upper(dt.name)=upper(sd.type);");
|
||||||
if ($db->num_rows()==0) {
|
if ($db->num_rows()==0) {
|
||||||
$err->raise("dom",14);
|
$err->raise("dom",14);
|
||||||
return false;
|
return false;
|
||||||
|
@ -695,6 +699,7 @@ class m_dom {
|
||||||
$r["name"]=$db->Record["sub"];
|
$r["name"]=$db->Record["sub"];
|
||||||
$r["dest"]=$db->Record["valeur"];
|
$r["dest"]=$db->Record["valeur"];
|
||||||
$r["type"]=$db->Record["type"];
|
$r["type"]=$db->Record["type"];
|
||||||
|
$r["type_desc"]=$db->Record["type_desc"];
|
||||||
$db->free();
|
$db->free();
|
||||||
return $r;
|
return $r;
|
||||||
} // get_sub_domain_all
|
} // get_sub_domain_all
|
||||||
|
|
Loading…
Reference in New Issue