| 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 | ); |
|---|
| 42 | getFields($fields); |
|---|
| 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 | <?php |
|---|
| 57 | if ($error) { |
|---|
| 58 | echo "<p class=\"error\">$error</p>"; |
|---|
| 59 | include_once("foot.php"); |
|---|
| 60 | exit(); |
|---|
| 61 | } |
|---|
| 62 | ?> |
|---|
| 63 | <form method="post" action="adm_quotadoedit.php"> |
|---|
| 64 | <table class="tedit"> |
|---|
| 65 | <tr><th><input type="hidden" name="uid" value="<?php echo $uid ?>" /> |
|---|
| 66 | <?php __("Username"); ?></th><td colspan="3"><code><big><?php echo $us["login"]; ?></big></code> </td></tr> |
|---|
| 67 | <tr><th><?php __("Quota"); ?></th><th style="text-align: right"><?php __("Total"); ?></th><th><?php __("Used"); ?></th></tr> |
|---|
| 68 | <?php |
|---|
| 69 | $ql=$quota->qlist(); |
|---|
| 70 | reset($ql); |
|---|
| 71 | while (list($key,$val)=each($ql)) { |
|---|
| 72 | echo "<tr>"; |
|---|
| 73 | echo "<td>"; |
|---|
| 74 | if ($r[$key]["t"]==$r[$key]["u"] && $r[$key]["u"]) echo "<span style=\"color: red;\">"; |
|---|
| 75 | echo "<label for=\"q_$key\">" . _("quota_".$key) . "</label>"; |
|---|
| 76 | if ($r[$key]["t"]==$r[$key]["u"] && $r[$key]["u"]) echo "</span>"; |
|---|
| 77 | echo "</td>"; |
|---|
| 78 | echo "<td align=\"center\"><input type=\"text\" class=\"int\" style=\"text-align: right\" size=\"10\" maxlength=\"10\" value=\"".$r[$key]["t"]."\" name=\"q_".$key."\" id=\"q_".$key."\" /></td>"; |
|---|
| 79 | echo "<td align=\"right\"><code><label for=\"q_$key\">".$r[$key]["u"]."</label></code> </td>"; |
|---|
| 80 | echo "</tr>"; |
|---|
| 81 | } |
|---|
| 82 | ?> |
|---|
| 83 | <tr class="trbtn"><td colspan="3"> |
|---|
| 84 | <input class="inb" type="submit" name="submit" value="<?php __("Edit the quotas"); ?>" /> |
|---|
| 85 | <input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='adm_list.php'" /> |
|---|
| 86 | |
|---|
| 87 | </td></tr> |
|---|
| 88 | </table> |
|---|
| 89 | </form> |
|---|
| 90 | <?php include_once("foot.php"); ?> |
|---|