Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
adm_quotaedit.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: adm_quotaedit.php,v 1.4 2004/10/24 20:09:21 anonymous Exp $
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2002 by the AlternC Development Team.
7  http://alternc.org/
8  ----------------------------------------------------------------------
9  Based on:
10  Valentin Lacambre's web hosting softwares: http://altern.org/
11  ----------------------------------------------------------------------
12  LICENSE
13 
14  This program is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License (GPL)
16  as published by the Free Software Foundation; either version 2
17  of the License, or (at your option) any later version.
18 
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  To read the license please visit http://www.gnu.org/copyleft/gpl.html
25  ----------------------------------------------------------------------
26  Original Author of file: Benjamin Sonntag
27  Purpose of file: Show the form to edit the user's quota
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 include_once("head.php");
32 
33 if (!$admin->enabled) {
34  __("This page is restricted to authorized staff");
35  include_once("foot.php");
36  exit();
37 }
38 
39 $fields = array (
40  "uid" => array ("request", "integer", 0),
41 );
43 
44 if (!$us=$admin->get($uid)) {
45  $error=$err->errstr();
46 }
47 
48 $mem->su($uid);
49 if (!$r=$quota->getquota()) {
50  $error=$err->errstr();
51 }
52 $mem->unsu();
53 
54 ?>
55 <h3><?php __("Editing the quotas of a member"); ?></h3>
56 <hr id="topbar"/>
57 <br />
58 <?php
59  if (isset($error) && $error) {
60  echo "<p class=\"alert alert-danger\">$error</p>";
61  include_once("foot.php");
62  exit();
63  }
64 ?>
65 <form method="post" action="adm_quotadoedit.php">
66 <table class="tedit">
67 <tr><th><input type="hidden" name="uid" value="<?php echo $uid ?>" />
68 <?php __("Username"); ?></th><td colspan="3"><code><big><?php echo $us["login"]; ?></big></code>&nbsp;</td></tr>
69 <tr><th><?php __("Quota"); ?></th><th style="text-align: right"><?php __("Total"); ?></th><th><?php __("Used"); ?></th></tr>
70 <?php
71 $ql=$quota->qlist();
72 reset($ql);
73 while (list($key,$val)=each($ql)) {
74  if (!isset($r[$key])) continue;
75  echo "<tr>";
76  echo "<td>";
77  if ($r[$key]["t"]==$r[$key]["u"] && $r[$key]["u"]) echo "<span style=\"color: red;\">";
78  echo "<label for=\"q_$key\">" . $val . "</label>";
79  if ($r[$key]["t"]==$r[$key]["u"] && $r[$key]["u"]) echo "</span>";
80  echo "</td>";
81  echo "<td align=\"center\"><input type=\"text\" class=\"int\" style=\"text-align: right\" size=\"10\" maxlength=\"20\" value=\"".$r[$key]["t"]."\" name=\"q_".$key."\" id=\"q_".$key."\" /></td>";
82  echo "<td align=\"right\"><code><label for=\"q_$key\">".$r[$key]["u"]."</label></code>&nbsp;</td>";
83  echo "</tr>";
84 }
85 ?>
86 <tr class="trbtn"><td colspan="3">
87  <input class="inb ok" type="submit" name="submit" value="<?php __("Edit the quotas"); ?>" />
88  <input type="button" class="inb cancel" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='adm_list.php'" />
89 
90 </td></tr>
91 </table>
92 </form>
93 <?php include_once("foot.php"); ?>