| 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 | ); |
|---|
| 50 | getFields($fields); |
|---|
| 51 | |
|---|
| 52 | ?> |
|---|
| 53 | <h3><?php __("New AlternC account"); ?></h3> |
|---|
| 54 | <hr id="topbar"/> |
|---|
| 55 | <br /> |
|---|
| 56 | <?php |
|---|
| 57 | if (isset($error) && $error) { |
|---|
| 58 | echo "<p class=\"error\">$error</p>"; |
|---|
| 59 | } |
|---|
| 60 | ?> |
|---|
| 61 | <form method="post" action="adm_doadd.php" id="main" name="main"> |
|---|
| 62 | <table class="tedit"> |
|---|
| 63 | <tr><th><label for="login"><?php __("Username"); ?></label></th><td> |
|---|
| 64 | <input type="text" class="int" name="login" id="login" value="<?php ehe($login); ?>" size="20" maxlength="16" /> |
|---|
| 65 | </td></tr> |
|---|
| 66 | <tr> |
|---|
| 67 | <th><label for="pass"><?php __("Initial password"); ?></label></th> |
|---|
| 68 | <td><input type="password" id="pass" name="pass" class="int" value="<?php ehe($pass); ?>" size="20" maxlength="64" /></td> |
|---|
| 69 | </tr> |
|---|
| 70 | <tr> |
|---|
| 71 | <th><label for="passconf"><?php __("Confirm password"); ?></label></th> |
|---|
| 72 | <td><input type="password" id="passconf" name="passconf" class="int" value="<?php ehe($passconf); ?>" size="20" maxlength="64" /></td> |
|---|
| 73 | </tr> |
|---|
| 74 | <tr> |
|---|
| 75 | <th><label for="canpass"><?php __("Can he change its password"); ?></label></th> |
|---|
| 76 | <td> |
|---|
| 77 | <input type="radio" class="inc" id="canpass0" name="canpass" value="0"<?php cbox($canpass==0); ?>><label for="canpass0"><?php __("No"); ?></label><br /> |
|---|
| 78 | <input type="radio" class="inc" id="canpass1" name="canpass" value="1"<?php cbox($canpass==1); ?>><label for="canpass1"><?php __("Yes"); ?></label><br /> |
|---|
| 79 | </td> |
|---|
| 80 | </tr> |
|---|
| 81 | <tr> |
|---|
| 82 | <th><label for="notes"><?php __("Notes"); ?></label></th> |
|---|
| 83 | <td><textarea name="notes" id="notes" class="int" cols="32" rows="5"><?php ehe($notes); ?></textarea></td> |
|---|
| 84 | </tr> |
|---|
| 85 | <tr> |
|---|
| 86 | <th><label for="nom"><?php echo _("Surname")."</label> / <label for=\"prenom\">"._("First Name"); ?></label></th> |
|---|
| 87 | <td><input class="int" type="text" id="nom" name="nom" value="<?php ehe($nom); ?>" size="20" maxlength="128" /> / <input type="text" name="prenom" id="prenom" value="<?php ehe($prenom); ?>" class="int" size="20" maxlength="128" /></td> |
|---|
| 88 | </tr> |
|---|
| 89 | <tr> |
|---|
| 90 | <th><label for="nmail"><?php __("Email address"); ?></label></th> |
|---|
| 91 | <td><input type="text" name="nmail" id="nmail" class="int" value="<?php ehe($nmail); ?>" size="30" maxlength="128" /></td> |
|---|
| 92 | </tr> |
|---|
| 93 | <tr> |
|---|
| 94 | <th><label for="type"><?php __("Account type"); ?></label></th> |
|---|
| 95 | <td><select name="type" id="type" class="inl"> |
|---|
| 96 | <?php |
|---|
| 97 | $db->query("SELECT distinct(type) FROM defquotas ORDER by type"); |
|---|
| 98 | while($db->next_record()) { |
|---|
| 99 | $type = $db->f("type"); |
|---|
| 100 | echo "<option value=\"$type\""; |
|---|
| 101 | if($type == 'default') |
|---|
| 102 | echo " selected=\"selected\""; |
|---|
| 103 | echo ">$type</option>"; |
|---|
| 104 | } |
|---|
| 105 | ?></select> |
|---|
| 106 | </td> |
|---|
| 107 | </tr> |
|---|
| 108 | <?php if (variable_get('hosting_tld') || $dom->enum_domains()) { ?> |
|---|
| 109 | <tr> |
|---|
| 110 | <th colspan="2"> |
|---|
| 111 | <input type="checkbox" name="create_dom" value="1" class="inc" id="create_dom" <?php cbox($create_dom==1); ?>/> |
|---|
| 112 | <label for="create_dom"><?php printf(_("Install the domain"),""); ?></label> |
|---|
| 113 | <span class="int" id="create_dom_list_pfx">login.</span><select name="create_dom_list" class="int" id="create_dom_list"> |
|---|
| 114 | <?php if (variable_get('hosting_tld')) { ?> |
|---|
| 115 | <option value="<?php echo variable_get('hosting_tld'); ?>" selected="selected"><?php echo variable_get('hosting_tld'); ?></option> |
|---|
| 116 | <?php } |
|---|
| 117 | /* Enumeration des domaines : */ |
|---|
| 118 | $domain=$dom->enum_domains(); |
|---|
| 119 | reset($domain); |
|---|
| 120 | while (list($key,$val)=each($domain)) { ?> |
|---|
| 121 | <option value="<?php echo $val; ?>" > <?php echo $val?> </option> |
|---|
| 122 | <?php } ?> |
|---|
| 123 | </select> |
|---|
| 124 | </th> |
|---|
| 125 | </tr> |
|---|
| 126 | <?php } ?> |
|---|
| 127 | <tr class="trbtn"><td colspan="2"> |
|---|
| 128 | <input type="submit" class="inb" name="submit" value="<?php __("Create this AlternC account"); ?>" /> |
|---|
| 129 | <input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='adm_list.php'" /> |
|---|
| 130 | </td></tr> |
|---|
| 131 | </table> |
|---|
| 132 | </form> |
|---|
| 133 | <script type="text/javascript"> |
|---|
| 134 | document.forms['main'].login.focus(); |
|---|
| 135 | document.forms['main'].setAttribute('autocomplete', 'off'); |
|---|
| 136 | </script> |
|---|
| 137 | |
|---|
| 138 | <?php include_once("foot.php"); ?> |
|---|