Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
adm_add.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: adm_add.php,v 1.9 2006/01/24 05:03:30 joe Exp $
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2006 Le r�seau Koumbit Inc.
7  http://koumbit.org/
8  Copyright (C) 2002 by the AlternC Development Team.
9  http://alternc.org/
10  ----------------------------------------------------------------------
11  Based on:
12  Valentin Lacambre's web hosting softwares: http://altern.org/
13  ----------------------------------------------------------------------
14  LICENSE
15 
16  This program is free software; you can redistribute it and/or
17  modify it under the terms of the GNU General Public License (GPL)
18  as published by the Free Software Foundation; either version 2
19  of the License, or (at your option) any later version.
20 
21  This program is distributed in the hope that it will be useful,
22  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  GNU General Public License for more details.
25 
26  To read the license please visit http://www.gnu.org/copyleft/gpl.html
27  ----------------------------------------------------------------------
28  Original Author of file: Benjamin Sonntag
29  Purpose of file: Member managment
30  ----------------------------------------------------------------------
31 */
32 require_once("../class/config.php");
33 include_once("head.php");
34 
35 if (!$admin->enabled) {
36  __("This page is restricted to authorized staff");
37  exit();
38 }
39 
40 $fields = array (
41  "canpass" => array ("request", "integer", 1),
42  "login" => array ("request", "string", null),
43  "pass" => array ("request", "string", null),
44  "passconf" => array ("request", "string", null),
45  "notes" => array ("request", "string", null),
46  "nom" => array ("request", "string", null),
47  "prenom" => array ("request", "string", null),
48  "nmail" => array ("request", "string", null),
49  "create_dom" => array ("request", "integer", 0),
50 );
52 
53 ?>
54 <h3><?php __("New AlternC account"); ?></h3>
55 <hr id="topbar"/>
56 <br />
57 <?php
58 if (isset($error) && $error) {
59  echo "<p class=\"alert alert-danger\">$error</p>";
60 }
61 ?>
62 <form method="post" action="adm_doadd.php" id="main" name="main">
63 <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 </td></tr>
67 <tr>
68  <th><label for="pass"><?php __("Initial password"); ?></label></th>
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 </tr>
71 <tr>
72  <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 </tr>
75 <tr>
76  <th><label><?php __("Can he change its password"); ?></label></th>
77  <td>
78  <input type="radio" class="inc" id="canpass0" name="canpass" value="0"<?php cbox($canpass==0); ?>/><label for="canpass0"><?php __("No"); ?></label><br />
79  <input type="radio" class="inc" id="canpass1" name="canpass" value="1"<?php cbox($canpass==1); ?>/><label for="canpass1"><?php __("Yes"); ?></label><br />
80  </td>
81 </tr>
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>
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 </tr>
90 <tr>
91  <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 </tr>
94 <tr>
95  <th><label for="type"><?php __("Account type"); ?></label></th>
96  <td><select name="type" id="type" class="inl">
97  <?php
98  eoption($quota->listtype(), 'default', true);
99 ?></select>
100 </td>
101 </tr>
102 <tr>
103  <th>
104  <?php
105  __("Wich database server for this user ?");
106  echo "<br/>";
107  echo "<i>"._("Warning: you can't change it after the creation of the user.")."</i>";
108  ?>
109  </th>
110  <td><?php
111  echo "<select name='db_server_id' id='db_server_id' >";
112  foreach ($mysql->list_db_servers() as $ldb ) {
113  echo "<option value='".$ldb['id']."'>".$ldb['name']."</option>";
114  }
115  echo "</select>";
116  ?>
117  </td>
118 </tr>
119 
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); ?>/>
124  <label for="create_dom"><?php printf(_("Install the domain"),""); ?></label>
125  <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  <option value="<?php echo variable_get('hosting_tld'); ?>" selected="selected"><?php echo variable_get('hosting_tld'); ?></option>
128  <?php }
129  /* Enumeration des domaines : */
130  $domain=$dom->enum_domains();
131  reset($domain);
132  while (list($key,$val)=each($domain)) { ?>
133  <option value="<?php echo $val; ?>" > <?php echo $val?> </option>
134  <?php } ?>
135  </select>
136  </th>
137 </tr>
138  <?php } ?>
139 <tr class="trbtn"><td colspan="2">
140  <input type="submit" class="inb ok" name="submit" value="<?php __("Create this AlternC account"); ?>" />
141  <input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='adm_list.php'" />
142 </td></tr>
143 </table>
144 </form>
145 <script type="text/javascript">
146  document.forms['main'].login.focus();
147  document.forms['main'].setAttribute('autocomplete', 'off');
148 </script>
149 
150 <?php include_once("foot.php"); ?>