Changeset 2247

Show
Ignore:
Timestamp:
05/22/08 16:40:18 (6 months ago)
Author:
azerttyu
Message:

Création d'un nouveau compte avec son sous domaine

Permettre à un (sous) administrateur d'affecter au choix le domaine entre ceux déclarés pour son compte ou celui générique du serveur (défini par l'admin général).

close #1087

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • alternc/trunk/bureau/admin/adm_add.php

    r1653 r2247  
    9292          echo "<option value=\"$type\""; 
    9393          if($type == 'default') 
    94             echo " selected"; 
     94            echo " selected=\"selected\""; 
    9595          echo ">$type</option>"; 
    9696        } 
    9797?></select> 
     98        </td> 
    9899</tr> 
    99 <? if (variable_get('hosting_tld')) { ?> 
     100 
    100101<tr> 
    101         <th colspan="2"><label><input type="checkbox" name="create_dom" value="1" /> 
    102         <?php printf(_("Create the domain <b>username.%s</b>"),variable_get('hosting_tld')); ?></label></th> 
    103         </tr> 
     102    <th colspan="2"> 
     103        <input type="checkbox" name="create_dom" value="1" /> 
     104        <label><?php printf(_("Create the domain <b>username.%s</b>"),""); ?></label> 
     105        <select name="create_dom_list"> 
     106            <?php if (variable_get('hosting_tld')) { ?> 
     107                <option value="<?php echo variable_get('hosting_tld'); ?>" selected="selected"><?php echo variable_get('hosting_tld'); ?></option> 
     108            <?php }  
     109            /* Enumeration des domaines : */ 
     110            $domain=$dom->enum_domains(); 
     111            reset($domain); 
     112            while (list($key,$val)=each($domain)) { ?> 
     113                <option value="<?php echo $val; ?>" > <?php echo $val?> </option> 
     114            <?php } ?> 
     115        </select> 
     116    </th> 
     117</tr> 
    104118<tr> 
    105 <? } ?> 
    106119        <td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create a new member"); ?>" /></td> 
    107120</tr> 
  • alternc/trunk/bureau/admin/adm_doadd.php

    r1872 r2247  
    6060   * 1 = force = ne tient pas compte du whois ou des droits de tld 
    6161   */ 
    62   if ($create_dom) { 
    63     if (variable_get("hosting_tld")) { 
     62 
     63  if (($create_dom == 1)  && !is_null($create_dom_list)) { 
    6464      # make sure we don't have multiple dots there 
    6565      $dom->lock(); 
    66       $dom->add_domain($login.".".preg_replace("/^\.\.*/", "", variable_get("hosting_tld")),1,1,1); 
     66      $dom->add_domain($login.".".preg_replace("/^\.\.*/", "", $create_dom_list),1,1,1); 
    6767      $dom->unlock(); 
    68     } else { 
    69       $err->log("no 'hosting_tld' variable defined in `variables` table, not creating domain"); 
    70     } 
    7168  } 
     69 
    7270  $ftp->add_ftp($login,"",$pass,"/"); 
    7371  $mem->unsu();