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
This commit is contained in:
parent
7bc627a203
commit
6a0aa72bf8
|
@ -91,18 +91,31 @@ if ($error) {
|
||||||
$type = $db->f("type");
|
$type = $db->f("type");
|
||||||
echo "<option value=\"$type\"";
|
echo "<option value=\"$type\"";
|
||||||
if($type == 'default')
|
if($type == 'default')
|
||||||
echo " selected";
|
echo " selected=\"selected\"";
|
||||||
echo ">$type</option>";
|
echo ">$type</option>";
|
||||||
}
|
}
|
||||||
?></select>
|
?></select>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? if (variable_get('hosting_tld')) { ?>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2"><label><input type="checkbox" name="create_dom" value="1" />
|
<th colspan="2">
|
||||||
<?php printf(_("Create the domain <b>username.%s</b>"),variable_get('hosting_tld')); ?></label></th>
|
<input type="checkbox" name="create_dom" value="1" />
|
||||||
</tr>
|
<label><?php printf(_("Create the domain <b>username.%s</b>"),""); ?></label>
|
||||||
|
<select name="create_dom_list">
|
||||||
|
<?php if (variable_get('hosting_tld')) { ?>
|
||||||
|
<option value="<?php echo variable_get('hosting_tld'); ?>" selected="selected"><?php echo variable_get('hosting_tld'); ?></option>
|
||||||
|
<?php }
|
||||||
|
/* Enumeration des domaines : */
|
||||||
|
$domain=$dom->enum_domains();
|
||||||
|
reset($domain);
|
||||||
|
while (list($key,$val)=each($domain)) { ?>
|
||||||
|
<option value="<?php echo $val; ?>" > <?php echo $val?> </option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<? } ?>
|
|
||||||
<td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create a new member"); ?>" /></td>
|
<td colspan="2"><input type="submit" class="inb" name="submit" value="<?php __("Create a new member"); ?>" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -59,16 +59,14 @@ if (!($u=$admin->add_mem($login, $pass, $nom, $prenom, $nmail, $canpass, $type))
|
||||||
*
|
*
|
||||||
* 1 = force = ne tient pas compte du whois ou des droits de tld
|
* 1 = force = ne tient pas compte du whois ou des droits de tld
|
||||||
*/
|
*/
|
||||||
if ($create_dom) {
|
|
||||||
if (variable_get("hosting_tld")) {
|
if (($create_dom == 1) && !is_null($create_dom_list)) {
|
||||||
# make sure we don't have multiple dots there
|
# make sure we don't have multiple dots there
|
||||||
$dom->lock();
|
$dom->lock();
|
||||||
$dom->add_domain($login.".".preg_replace("/^\.\.*/", "", variable_get("hosting_tld")),1,1,1);
|
$dom->add_domain($login.".".preg_replace("/^\.\.*/", "", $create_dom_list),1,1,1);
|
||||||
$dom->unlock();
|
$dom->unlock();
|
||||||
} else {
|
|
||||||
$err->log("no 'hosting_tld' variable defined in `variables` table, not creating domain");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$ftp->add_ftp($login,"",$pass,"/");
|
$ftp->add_ftp($login,"",$pass,"/");
|
||||||
$mem->unsu();
|
$mem->unsu();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue