Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
adm_edit.php
Go to the documentation of this file.
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 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  "uid" => array ("request", "integer", 0),
42 );
44 
45 $subadmin=variable_get("subadmin_restriction");
46 
47 if ($subadmin==0 && !$admin->checkcreator($uid)) {
48  __("This page is restricted to authorized staff");
49  exit();
50 }
51 
52 if (!$r=$admin->get($uid)) {
53  $error=$err->errstr();
54 }
55 
56 ?>
57 <h3><?php __("Member Edition"); ?></h3>
58 <hr id="topbar"/>
59 <br />
60 <?php
61  if (isset($error) && $error) {
62  echo "<p class=\"alert alert-danger\">$error</p>";
63  }
64 ?>
65 <form method="post" action="adm_doedit.php" name="main" id="main">
66 <table class="tedit">
67 <tr>
68  <th><input type="hidden" name="uid" value="<?php echo $uid ?>" />
69 <?php __("Username"); ?></th>
70  <td><?php echo $r["login"]; ?></td>
71 </tr>
72 <tr>
73  <th><label><?php __("Account Enabled?"); ?></label></th>
74  <td>
75  <?php if ($r["uid"]==$mem->user["uid"]) { ?>
76  <?php __("You cannot disable your own account."); ?>
77  <?php } else { ?>
78  <input type="radio" class="inc" id="enabled0" name="enabled" value="0"<?php cbox($r["enabled"]==0); ?> /><label for="enabled0"><?php __("No"); ?></label><br />
79  <input type="radio" class="inc" id="enabled1" name="enabled" value="1"<?php cbox($r["enabled"]==1); ?> /><label for="enabled1"><?php __("Yes"); ?></label><br />
80  <?php } ?>
81  </td>
82 </tr>
83 
84 <tr>
85  <th><label for="pass"><?php __("Password"); ?></label></th>
86  <td><input type="password" class="int" id="pass" name="pass" value="" size="20" maxlength="64" /><?php display_div_generate_password(DEFAULT_PASS_SIZE,"#pass","#passconf"); ?></td>
87 </tr>
88 <tr>
89  <th><label for="passconf"><?php __("Confirm password"); ?></label></th>
90  <td><input type="password" class="int" id="passconf" name="passconf" value="" size="20" maxlength="64" /></td>
91 </tr>
92 <tr>
93  <th><label><?php __("Password change allowed?"); ?></label></th>
94  <td>
95  <input type="radio" class="inc" id="canpass0" name="canpass" value="0"<?php cbox($r["canpass"]==0); ?>/><label for="canpass0"><?php __("No"); ?></label><br />
96  <input type="radio" class="inc" id="canpass1" name="canpass" value="1"<?php cbox($r["canpass"]==1); ?>/><label for="canpass1"><?php __("Yes"); ?></label><br />
97  </td>
98 </tr>
99  <tr>
100  <th><label for="notes"><?php __("Notes"); ?></label></th>
101  <td><textarea name="notes" id="notes" class="int" cols="32" rows="5"><?php ehe($r['notes']); ?></textarea></td>
102 </tr>
103 <tr>
104  <th><label for="nom"><?php echo _("Surname")."</label> / <label for=\"prenom\">"._("First Name"); ?></label></th>
105  <td><input type="text" class="int" name="nom" id="nom" value="<?php ehe($r["nom"]); ?>" size="20" maxlength="128" />&nbsp;/&nbsp;<input type="text" class="int" name="prenom" id="prenom" value="<?php ehe($r["prenom"]); ?>" size="20" maxlength="128" /></td>
106 </tr>
107 <tr>
108  <th><label for="nmail"><?php __("Email address"); ?></label></th>
109  <td><input type="text" class="int" name="nmail" id="nmail" value="<?php ehe($r["mail"]); ?>" size="30" maxlength="128" /></td>
110 </tr>
111 <tr>
112  <th><label for="type"><?php __("Account type"); ?></label></th>
113  <td><select name="type" id="type" class="inl">
114  <?php
115  eoption($quota->listtype(), $r['type'], true);
116 ?></select>&nbsp; <input type="checkbox" name="reset_quotas" id="reset_quotas" class="inc" /><label for="reset_quotas"><?php __("Reset quotas to default?") ?></label></td>
117 </tr>
118 <tr>
119  <th><label for="duration"><?php __("Period"); ?></label></th>
120  <td><?php echo duration_list('duration', $r['duration']) ?></td>
121 </tr>
122 <tr class="trbtn"><td colspan="2">
123  <input type="submit" class="inb" name="submit" value="<?php __("Edit this account"); ?>" />
124  <input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='adm_list.php'" />
125 </td>
126 </tr>
127 </table>
128 </form>
129 
130 <br/>
131 
132 <?php if($r['duration']) { ?>
133 <form method="post" action="adm_dorenew.php">
134 <input type="hidden" name="uid" value="<?php echo $uid ?>" />
135 <table border="1" cellspacing="0" cellpadding="4" class="tedit">
136 <tr>
137  <th><label for="periods"><?php __("Renew for") ?></label></th>
138  <td><input name="periods" id="periods" type="text" size="2" value="1"/><?php echo ' ' . _('period(s)') ?></td>
139 </tr>
140 <tr>
141  <td colspan="2" align="center"><input type="submit" class="inb" name="submit" value="<?php __("Renew"); ?>" />
142 </td>
143 </tr>
144 </table>
145 </form>
146 <?php } /* Renouvellement */ ?>
147 
148 <p>
149 <?php
150 if ($mem->user["uid"]==2000 && $r["uid"]!=2000) { // Only ADMIN (2000) can change the admin status of accounts
151 if ($r["su"]) {
152 ?>
153 <b><?php __("This account is a super-admin account"); ?></b>
154 <br/>
155 <br/>
156 <?php if ($admin->onesu()) {
157  __("There is only one administrator account, you cannot turn this account back to normal");
158 } else {
159 ?>
160 <span class="ina"><a href="adm_donosu.php?uid=<?php echo $r["uid"]; ?>"><?php __("Turn this account back to normal"); ?></a></span>
161 <?php }
162 } else { ?>
163 <span class="ina"><a href="adm_dosu.php?uid=<?php echo $r["uid"]; ?>"><?php __("Make this account a super admin one"); ?></a></span>
164 <?php } ?>
165 </p>
166 
167 <p><?php
168  }
169 if ($c=$admin->get($r["creator"])) {
170  printf(_("Account created by %s"),$c["login"]);
171  }
172 ?>
173 </p>
174 <script type="text/javascript">
175  document.forms['main'].pass.focus();
176  document.forms['main'].setAttribute('autocomplete', 'off');
177 </script>
178 <?php include_once("foot.php"); ?>