| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | $Id: adm_edit.php,v 1.13 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: Show a form to edit a member |
|---|
| 30 | ---------------------------------------------------------------------- |
|---|
| 31 | */ |
|---|
| 32 | require_once("../class/config.php"); |
|---|
| 33 | |
|---|
| 34 | if (!$admin->enabled) { |
|---|
| 35 | __("This page is restricted to authorized staff"); |
|---|
| 36 | exit(); |
|---|
| 37 | } |
|---|
| 38 | if (!$admin->checkcreator($uid)) { |
|---|
| 39 | __("This page is restricted to authorized staff"); |
|---|
| 40 | exit(); |
|---|
| 41 | } |
|---|
| 42 | |
|---|
| 43 | if (!$r=$admin->get($uid)) { |
|---|
| 44 | $error=$err->errstr(); |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | include("head.php"); |
|---|
| 48 | ?> |
|---|
| 49 | </head> |
|---|
| 50 | <body> |
|---|
| 51 | <h3><?php __("Member Edition"); ?></h3> |
|---|
| 52 | <?php |
|---|
| 53 | if ($error) { |
|---|
| 54 | echo "<p class=\"error\">$error</p>"; |
|---|
| 55 | } |
|---|
| 56 | ?> |
|---|
| 57 | <form method="post" action="adm_doedit.php"> |
|---|
| 58 | <table border="1" cellspacing="0" cellpadding="4"> |
|---|
| 59 | <tr> |
|---|
| 60 | <th><input type="hidden" name="uid" value="<?php echo $uid ?>" /> |
|---|
| 61 | <?php __("Username"); ?></th> |
|---|
| 62 | <td><?php echo $r["login"]; ?></td> |
|---|
| 63 | </tr> |
|---|
| 64 | <tr> |
|---|
| 65 | <th><label for="enabled"><?php __("Account Enabled ?"); ?></label></th> |
|---|
| 66 | <td><select class="inl" name="enabled" id="enabled"> |
|---|
| 67 | <?php |
|---|
| 68 | echo "<option"; |
|---|
| 69 | if ($r["enabled"]=="0") echo " selected=\"selected\""; |
|---|
| 70 | echo " value=\"0\">"._("No")."</option>"; |
|---|
| 71 | echo "<option"; |
|---|
| 72 | if ($r["enabled"]=="1") echo " selected=\"selected\""; |
|---|
| 73 | echo " value=\"1\">"._("Yes")."</option>"; |
|---|
| 74 | ?></select></td> |
|---|
| 75 | </tr> |
|---|
| 76 | |
|---|
| 77 | <tr> |
|---|
| 78 | <th><label for="pass"><?php __("Password"); ?></label></th> |
|---|
| 79 | <td><input type="password" class="int" id="pass" name="pass" value="" size="20" maxlength="64" /></td> |
|---|
| 80 | </tr> |
|---|
| 81 | <tr> |
|---|
| 82 | <th><label for="passconf"><?php __("Confirm password"); ?></label></th> |
|---|
| 83 | <td><input type="password" class="int" id="passconf" name="passconf" value="" size="20" maxlength="64" /></td> |
|---|
| 84 | </tr> |
|---|
| 85 | <tr> |
|---|
| 86 | <th><label for="canpass"><?php __("Can he change its password"); ?></label></th> |
|---|
| 87 | <td><select class="inl" name="canpass" id="canpass"> |
|---|
| 88 | <?php |
|---|
| 89 | for($i=0;$i<count($bro->l_icons);$i++) { |
|---|
| 90 | echo "<option"; |
|---|
| 91 | if ($r["canpass"]==$i) echo " selected=\"selected\""; |
|---|
| 92 | echo " value=\"$i\">"._($bro->l_icons[$i])."</option>"; |
|---|
| 93 | } |
|---|
| 94 | ?></select> |
|---|
| 95 | </td> |
|---|
| 96 | </tr> |
|---|
| 97 | <tr> |
|---|
| 98 | <th><label for="nom"><?php echo _("Surname")."</label> / <label for=\"prenom\">"._("First Name"); ?></label></th> |
|---|
| 99 | <td><input type="text" class="int" name="nom" id="nom" value="<?php echo $r["nom"]; ?>" size="20" maxlength="128" /> / <input type="text" class="int" name="prenom" id="prenom" value="<?php echo $r["prenom"]; ?>" size="20" maxlength="128" /></td> |
|---|
| 100 | </tr> |
|---|
| 101 | <tr> |
|---|
| 102 | <th><label for="nmail"><?php __("Email address"); ?></label></th> |
|---|
| 103 | <td><input type="text" class="int" name="nmail" id="nmail" value="<?php echo $r["mail"]; ?>" size="30" maxlength="128" /></td> |
|---|
| 104 | </tr> |
|---|
| 105 | <tr> |
|---|
| 106 | <th><label for="type"><?php __("Account type"); ?></label></th> |
|---|
| 107 | <td><select name="type" id="type"> |
|---|
| 108 | <?php |
|---|
| 109 | $db->query("SELECT distinct(type) FROM defquotas ORDER by type"); |
|---|
| 110 | while($db->next_record()) { |
|---|
| 111 | $type = $db->f("type"); |
|---|
| 112 | echo "<option value=\"$type\""; |
|---|
| 113 | if($type == $r['type']) |
|---|
| 114 | echo " selected"; |
|---|
| 115 | echo ">$type</option>"; |
|---|
| 116 | } |
|---|
| 117 | ?></select><label for="reset_quotas"><?php __("Reset quotas to default ?") ?></label><input type="checkbox" name="reset_quotas" id="reset_quotas"></td> |
|---|
| 118 | </tr> |
|---|
| 119 | <tr> |
|---|
| 120 | <td colspan="2" align="center"><input type="submit" class="inb" name="submit" value="<?php __("Edit this account"); ?>" /> |
|---|
| 121 | </td> |
|---|
| 122 | </tr> |
|---|
| 123 | </table> |
|---|
| 124 | </form> |
|---|
| 125 | |
|---|
| 126 | <p> |
|---|
| 127 | <?php |
|---|
| 128 | if ($mem->user[uid]==2000) { // PATCHBEN only root can change su/nosu :) |
|---|
| 129 | if ($r["su"]) { |
|---|
| 130 | ?> |
|---|
| 131 | <b><?php __("This account is a super-admin account"); ?></b><br /> |
|---|
| 132 | <?php if ($admin->onesu()) { |
|---|
| 133 | __("There is only one administrator account, you cannot turn this account back to normal"); |
|---|
| 134 | } else { |
|---|
| 135 | ?> |
|---|
| 136 | <a href="adm_donosu.php?uid=<?php echo $r["uid"]; ?>"><?php __("Turn this account back to normal"); ?></a> |
|---|
| 137 | <?php } |
|---|
| 138 | } else { ?> |
|---|
| 139 | <a href="adm_dosu.php?uid=<?php echo $r["uid"]; ?>"><?php __("Make this account a super admin one"); ?></a> |
|---|
| 140 | <?php } ?> |
|---|
| 141 | </p> |
|---|
| 142 | |
|---|
| 143 | |
|---|
| 144 | <p><?php |
|---|
| 145 | } |
|---|
| 146 | $c=$admin->get($r["creator"]); |
|---|
| 147 | printf(_("Account created by %s"),$c["login"]); |
|---|
| 148 | ?> |
|---|
| 149 | </p> |
|---|
| 150 | <p><a href="adm_list.php"><?php __("Back to the account list"); ?></a></p> |
|---|
| 151 | </body> |
|---|
| 152 | </html> |
|---|