adm_add.php 6.12 KB
Newer Older
1 2 3 4 5
<?php
/*
 $Id: adm_add.php,v 1.9 2006/01/24 05:03:30 joe Exp $
 ----------------------------------------------------------------------
 AlternC - Web Hosting System
alban's avatar
alban committed
6
 Copyright (C) 2006 Le r�seau Koumbit Inc.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
 http://koumbit.org/
 Copyright (C) 2002 by the AlternC Development Team.
 http://alternc.org/
 ----------------------------------------------------------------------
 Based on:
 Valentin Lacambre's web hosting softwares: http://altern.org/
 ----------------------------------------------------------------------
 LICENSE

 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License (GPL)
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 To read the license please visit http://www.gnu.org/copyleft/gpl.html
 ----------------------------------------------------------------------
 Original Author of file: Benjamin Sonntag
 Purpose of file: Member managment
 ----------------------------------------------------------------------
*/
require_once("../class/config.php");
33
include_once("head.php");
34 35 36 37 38 39

if (!$admin->enabled) {
	__("This page is restricted to authorized staff");
	exit();
}

40
$fields = array (
Alan Garcia's avatar
Alan Garcia committed
41 42 43
	"canpass"    => array ("request", "integer", 1),
	"login"      => array ("request", "string", null),
	"pass"       => array ("request", "string", null),
44
	"passconf"   => array ("request", "string", null),
Alan Garcia's avatar
Alan Garcia committed
45 46 47 48 49
	"notes"      => array ("request", "string", null),
	"nom"        => array ("request", "string", null),
	"prenom"     => array ("request", "string", null),
	"nmail"      => array ("request", "string", null),
	"create_dom" => array ("request", "integer", 0),
50 51
);
getFields($fields);
52 53

?>
Chantal Bernard-Putz's avatar
Chantal Bernard-Putz committed
54
<h3><?php __("New AlternC account"); ?></h3>
55 56
<hr id="topbar"/>
<br />
57
<?php
58
if (isset($error) && $error) {
alban's avatar
alban committed
59
	echo "<p class=\"alert alert-danger\">$error</p>";
60 61
}
?>
Chantal Bernard-Putz's avatar
Chantal Bernard-Putz committed
62 63
<form method="post" action="adm_doadd.php" id="main" name="main">
<table class="tedit">
64
<tr><th><label for="login"><?php __("Username"); ?></label></th><td>
65
	<input type="text" class="int" name="login" id="login" value="<?php ehe($login); ?>" size="20" maxlength="16" />
66 67 68
</td></tr>
<tr>
	<th><label for="pass"><?php __("Initial password"); ?></label></th>
Alan Garcia's avatar
Alan Garcia committed
69
	<td><input type="password" id="pass" name="pass" class="int" value="<?php ehe($pass); ?>" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td>
70 71 72
</tr>
<tr>
	<th><label for="passconf"><?php __("Confirm password"); ?></label></th>
73
	<td><input type="password" id="passconf" name="passconf" class="int" value="<?php ehe($passconf); ?>" size="20" maxlength="64" /></td>
74 75
</tr>
<tr>
76
	<th><label><?php __("Can he change its password"); ?></label></th>
Chantal Bernard-Putz's avatar
Chantal Bernard-Putz committed
77
	<td>
78 79
        <input type="radio" class="inc" id="canpass0" name="canpass" value="0"<?php cbox($canpass==0); ?>/><label for="canpass0"><?php __("No"); ?></label><br />
	<input type="radio" class="inc" id="canpass1" name="canpass" value="1"<?php cbox($canpass==1); ?>/><label for="canpass1"><?php __("Yes"); ?></label><br />	
80 81
	</td>
</tr>
Antoine Beaupré's avatar
Antoine Beaupré committed
82
<tr>
83
       <th><label for="notes"><?php __("Notes"); ?></label></th>
84
       <td><textarea name="notes" id="notes" class="int" cols="32" rows="5"><?php  ehe($notes); ?></textarea></td>
Antoine Beaupré's avatar
Antoine Beaupré committed
85
</tr>
86
<tr>
87
        	<th><label for="nom"><?php echo _("Surname")."</label> / <label for=\"prenom\">"._("First Name"); ?></label></th>
88
	<td><input class="int" type="text" id="nom" name="nom" value="<?php ehe($nom); ?>" size="16" maxlength="128" />&nbsp;/&nbsp;<input type="text" name="prenom" id="prenom" value="<?php ehe($prenom); ?>" class="int" size="16" maxlength="128" /></td>
89 90 91
</tr>
<tr>
	<th><label for="nmail"><?php __("Email address"); ?></label></th>
92
	<td><input type="text" name="nmail" id="nmail" class="int" value="<?php ehe($nmail); ?>" size="30" maxlength="128" /></td>
93 94 95
</tr>
<tr>
	<th><label for="type"><?php __("Account type"); ?></label></th>
96
	<td><select name="type" id="type" class="inl">
97
	<?php
Alan Garcia's avatar
Alan Garcia committed
98
	eoption($quota->listtype(), 'default', true);
99
?></select>
100
</td>
101
</tr>
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
<tr>
    <th>
        <?php 
          __("Wich database server for this user ?");
          echo "<br/>";
          echo "<i>"._("Warning: you can't change it after the creation of the user.")."</i>";
        ?>
     </th>
     <td><?php
          echo "<select name='db_server_id' id='db_server_id' >";
          foreach ($mysql->list_db_servers() as $ldb ) {
            echo "<option value='".$ldb['id']."'>".$ldb['name']."</option>";
          }
          echo "</select>";
        ?>
    </td>
</tr>

120
<?php if (variable_get('hosting_tld') || $dom->enum_domains()) { ?>
121
<tr>
122
    <th colspan="2">
123
        <input type="checkbox" name="create_dom" value="1" class="inc" id="create_dom" <?php cbox($create_dom==1); ?>/>
Chantal Bernard-Putz's avatar
Chantal Bernard-Putz committed
124 125
        <label for="create_dom"><?php printf(_("Install the domain"),""); ?></label>
        <span class="int" id="create_dom_list_pfx">login.</span><select name="create_dom_list" class="int" id="create_dom_list">
126
            <?php if (variable_get('hosting_tld')) { ?>
127 128
             <option value="<?php echo variable_get('hosting_tld'); ?>" selected="selected"><?php echo variable_get('hosting_tld'); ?></option>
          <?php } 
129 130 131 132
            /* Enumeration des domaines : */
            $domain=$dom->enum_domains();
            reset($domain);
            while (list($key,$val)=each($domain)) { ?>
133
               <option value="<?php echo $val; ?>" > <?php echo $val?> </option>
134 135 136 137
            <?php } ?>
        </select>
    </th>
</tr>
138
 <?php } ?>
Chantal Bernard-Putz's avatar
Chantal Bernard-Putz committed
139
<tr class="trbtn"><td colspan="2">
140 141
  <input type="submit" class="inb ok" name="submit" value="<?php __("Create this AlternC account"); ?>" />
  <input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='adm_list.php'" />
Chantal Bernard-Putz's avatar
Chantal Bernard-Putz committed
142
</td></tr>
143 144
</table>
</form>
Chantal Bernard-Putz's avatar
Chantal Bernard-Putz committed
145 146 147 148
<script type="text/javascript">
 document.forms['main'].login.focus();
 document.forms['main'].setAttribute('autocomplete', 'off');
</script>
149

150
<?php include_once("foot.php"); ?>