Ignore:
Timestamp:
04/29/10 10:31:15 (3 years ago)
Author:
benjamin
Message:

dans l'edition des domaines, on a maintenant des formulaires PROPRES ... et l'adresse IP n'est pas preremplie desormais (ca me pourrissait la vie ce truc de xxx.xxx.xxx.xxx)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • alternc/trunk/bureau/admin/dom_edit.php

    r2676 r2677  
    3333$fields = array ( 
    3434        "domain"    => array ("request", "string", ""), 
     35        "sub"       => array ("request", "string", ""), 
     36        "type"      => array ("request", "integer", $dom->type_local), 
     37        "sub_local" => array ("request", "string",  "/"), 
     38        "sub_url"   => array ("request", "string", "http://"),  
     39        "sub_ip"    => array ("request", "string", ""), 
    3540); 
    3641getFields($fields); 
     
    4651function dnson() { 
    4752        // Active les composants DNS : 
    48         if (document.forms["dns"].mx.disabled!=null) 
    49                 document.forms["dns"].mx.disabled=false; 
    50         if (document.forms["dns"].mail.disabled!=null) 
    51                 document.forms["dns"].mail.disabled=true; 
     53        if (document.forms["fdns"].mx.disabled!=null) 
     54                document.forms["fdns"].mx.disabled=false; 
     55        if (document.forms["fdns"].emailon.disabled!=null) 
     56                document.forms["fdns"].emailon.disabled=true; 
     57        if (document.forms["fdns"].emailoff.disabled!=null) 
     58                document.forms["fdns"].emailoff.disabled=true; 
    5259} 
    5360function dnsoff() { 
    5461        // Active les composants DNS : 
    55         if (document.forms["dns"].mx.disabled!=null) 
    56                 document.forms["dns"].mx.disabled=true; 
    57         if (document.forms["dns"].mail.disabled!=null) 
    58                 document.forms["dns"].mail.disabled=false; 
     62        if (document.forms["fdns"].mx.disabled!=null) 
     63                document.forms["fdns"].mx.disabled=true; 
     64        if (document.forms["fdns"].emailon.disabled!=null) 
     65                document.forms["fdns"].emailon.disabled=false; 
     66        if (document.forms["fdns"].emailoff.disabled!=null) 
     67                document.forms["fdns"].emailoff.disabled=false; 
    5968} 
    6069</script> 
     
    95104        <table border="0"> 
    96105                <tr> 
    97                         <td colspan="2"> 
    98                         <input type="hidden" name="domain" value="<?php echo $r["name"]; ?>" /> 
     106                        <td> 
     107                        <input type="hidden" name="domain" value="<?php ehe($r["name"]); ?>" /> 
    99108                        <input type="hidden" name="action" value="add" /> 
    100 <?php __("Create a subdomain:"); ?> 
    101 <input type="text" class="int" name="sub" style="text-align:right" value="" size="22" id="sub" /><span class="int" id="newsubname">.<?php echo $domain; ?></span></td> 
     109  <?php __("Create a subdomain:"); ?></td><td> 
     110<input type="text" class="int" name="sub" style="text-align:right" value="<?php ehe($sub); ?>" size="22" id="sub" /><span class="int" id="newsubname">.<?php echo $domain; ?></span></td> 
    102111                </tr> 
    103112                <tr> 
    104                         <td><input type="radio" id="local" class="inc" name="type" value="<?php echo $dom->type_local; ?>" checked="checked" onclick="document.main.sub_local.focus();" /> 
     113<td><input type="radio" id="local" class="inc" name="type" value="<?php echo $dom->type_local; ?>" <?php cbox($type==$dom->type_local); ?> onclick="document.main.sub_local.focus();" /> 
    105114                                <label for="local"><?php __("Locally managed"); ?></label></td> 
    106                         <td><input type="text" class="int" name="sub_local" id="sub_local" value="/" size="28" /> 
     115                        <td><input type="text" class="int" name="sub_local" id="sub_local" value="<?php ehe($sub_local); ?>" size="28" /> 
    107116<script type="text/javascript"> 
    108117<!-- 
     
    113122                </tr> 
    114123                <tr> 
    115                         <td><input type="radio" id="url" class="inc" name="type" value="<?php echo $dom->type_url; ?>" onclick="document.main.sub_url.focus();" /> 
     124                        <td><input type="radio" id="url" class="inc" name="type" value="<?php echo $dom->type_url; ?>" <?php cbox($type==$dom->type_url); ?> onclick="document.main.sub_url.focus();" /> 
    116125                                <label for="url" ><?php __("URL redirection"); ?></label></td> 
    117                         <td><input type="text" class="int" name="sub_url" id="sub_url" value="http://" size="50" /></td> 
     126                        <td><input type="text" class="int" name="sub_url" id="sub_url" value="<?php ehe($sub_url); ?>" size="50" /></td> 
    118127                </tr> 
    119128                <?php if ($r["dns"]) { // show only if dns is enabled ?> 
    120129                <tr> 
    121                         <td><input type="radio" id="ip" class="inc" name="type" value="<?php echo $dom->type_ip; ?>" onclick="document.main.sub_ip.focus();" /> 
     130                        <td><input type="radio" id="ip" class="inc" name="type" value="<?php echo $dom->type_ip; ?>" <?php cbox($type==$dom->type_ip); ?> onclick="document.main.sub_ip.focus();" /> 
    122131                                <label for="ip"><?php __("IP redirection"); ?></label></td> 
    123                         <td><input type="text" class="int" name="sub_ip" id="sub_ip" value="xxx.xxx.xxx.xxx" size="16" /></td> 
     132                <td><input type="text" class="int" name="sub_ip" id="sub_ip" value="<?php ehe($sub_ip); ?>" size="16" /> <small><?php __("(enter an IPv4 address, for example 192.168.1.2)"); ?></small></td> 
    124133                </tr> 
    125                  <? } ?> 
     134                <? } ?> 
    126135                <tr> 
    127                         <td><input type="radio" id="webmail" class="inc" name="type" value="<?php echo $dom->type_webmail; ?>" /> 
     136                <td><input type="radio" id="webmail" class="inc" name="type" value="<?php echo $dom->type_webmail; ?>" <?php cbox($type==$dom->type_webmail); ?>/> 
    128137                                <label for="webmail"><?php __("Webmail access"); ?></label></td> 
    129138                        <td>&nbsp;</td> 
     
    146155<hr /> 
    147156<h3><?php __("DNS parameters"); ?></h3> 
    148 <form action="dom_editdns.php?domain=<?php echo urlencode($r["name"]) ?>" method="post" id="dns"> 
     157<form action="dom_editdns.php?domain=<?php echo urlencode($r["name"]) ?>" method="post" id="fdns" name="fdns"> 
    149158<table border="1" cellpadding="6" cellspacing="0"> 
    150159<tr><td colspan="2"><?php __("Manage the DNS on the server ?"); ?></td></tr> 
    151160<tr> 
    152         <td align="center" width="65%"><label for="yesdns"><?php __("Yes"); ?></label><input type="radio" id="yesdns" class="inc" name="dns" value="1"<?php if ($r["dns"]) echo " checked=\"checked\"" ?> onclick="dnson();" /></td> 
    153         <td align="center" width="35%"><label for="nodns"><?php __("No"); ?></label><input type="radio" id="nodns" class="inc" name="dns" value="0"<?php if (!$r["dns"]) echo " checked=\"checked\"" ?> onclick="dnsoff();" /></td> 
     161                                                                      <td align="center" width="65%"><input type="radio" id="yesdns" class="inc" name="dns" value="1"<?php cbox($r["dns"]); ?> onclick="dnson();" />&nbsp;<label for="yesdns"><?php __("Yes"); ?></label></td> 
     162   <td align="center" width="35%"><input type="radio" id="nodns" class="inc" name="dns" value="0"<?php cbox(!$r["dns"]); ?> onclick="dnsoff();" />&nbsp;<label for="nodns"><?php __("No"); ?></label></td> 
    154163</tr> 
    155164<tr> 
     
    163172        <p> 
    164173        <?php __("help_dns_mail"); ?></p> 
    165         <select class="inl" id="email" name="email" <?php if ($r["dns"]) echo "disabled=\"disabled\""; ?>><option value="1"<?php if ($r["mail"]) echo " selected=\"selected\"";?>><?php __("Yes"); ?></option><option value="0"<?php if (!$r["mail"]) echo " selected=\"selected\"";?>><?php __("No"); ?></option></select> 
     174         <input type="radio" id="emailon" class="inc" name="email" id="emailon" value="1"<?php cbox($r["mail"]); ?> <?php if ($r["dns"]) echo "disabled=\"disabled\""; ?>/><label for="emailon"><?php __("Yes"); ?></label> 
     175<br /> 
     176         <input type="radio" id="emailoff" class="inc" name="email" id="emailoff" value="0"<?php cbox(!$r["mail"]); ?> <?php if ($r["dns"]) echo "disabled=\"disabled\""; ?>/><label for="emailoff"><?php __("No"); ?></label> 
    166177        </td> 
    167178</tr> 
Note: See TracChangeset for help on using the changeset viewer.